Hey guys,
I've been trying to figure out an interesting way to model the growth of a fungus-like corruption for this game I'm making and I ended up implementing dragon curves:
Code is here: https://gist.github.com/clofresh/5691856
I'm not sure if I'll end up using it because it looks too regular and I'd like to the growth to look more organic. Do you guys have any suggestions for a cool growth algorithm?
Drawing dragon curve fractals
Drawing dragon curve fractals
----------------------------------------
Sluicer Games
Sluicer Games
Re: Drawing dragon curve fractals
Maybe you can get more irregular shapes if you add random perturbations. If I get it correctly, then the algorithm for the dragon curve replaces each line segment by a more complex shape (two line segments) each iteration. You could either perturb the points coordinates randomly or you could make up more than one substitution rule and then in each iteration for each line segment select on rule randomly.
Check out my blog on gamedev
Re: Drawing dragon curve fractals
Very cool demo. Maybe you can get a more 'organic' effect using cellular automata and a pinch of math.random(). Here is something I hacked together last night:
- Attachments
-
- grow.love
- (980 Bytes) Downloaded 120 times
Re: Drawing dragon curve fractals
That's really cool! Yeah I was also considering cellular automata but I didn't like the rules of Game of Life, though I guess I can just make up my own rules like you did.
----------------------------------------
Sluicer Games
Sluicer Games
Re: Drawing dragon curve fractals
You can also use an accretion simulation by random walk.
The time and memory usage can be big : I use about 250 walkers in my simulation, and 100 walk steps for each per seconds.
(Sorry vrld, I reuse some of your code)
EDIT: I correct a stupid bug that make the accretion not symetrical
The time and memory usage can be big : I use about 250 walkers in my simulation, and 100 walk steps for each per seconds.
(Sorry vrld, I reuse some of your code)
EDIT: I correct a stupid bug that make the accretion not symetrical
Who is online
Users browsing this forum: Ahrefs [Bot] and 86 guests