PDA

Click to See Complete Forum and Search --> : Fractal Based Terrain - how would you attempt it?



Ian424
07-24-2002, 01:17 AM
http://www.gameprogrammer.com/fractal.html

down near the middle of the page, it discusses how you would create such terrain..

how would you set it up in flash?

just set how many divisions of the ground to make, then put a lot of numbers into arrays?

lets say you started with a multidimensional array called terrain, the 1st dimension stores a list of arrays, which contain the Y coordinated you use to buildthe land.. would this be an ideal way to set it up?

the page suggests putting random numers into the 1st array, then finding the midpoint between each point, etc etc.. my idea would be to put each new set of midpoints + the previous midpoints + the original, into the new arrays, so say terrain[0][0] contained 3 points, the next would contain 5 (2 midpoints + originals), the next would have 9, etc.

my Array manipulating skills arent so great .. so do you think you guys could help me with a function to get the midpoints into a new array? or am i thinking about this in an overly complicated way?

ericlin
07-29-2002, 09:35 AM
I read that link a little. I can not understand all of them. Anyway, I know he pick 4 cornors and a peak. Then diagonal and then edge.....etc.

If we want 16x16 terrain, we set random values for 4 corners and a central peak. Then we pick the points that row%8==0 and col%8==0; The next pass will be pick points that row%8==4 and col%8=4; (the module equals half of the width); Repeat this procedures but now row%4==0 and the next step row%4==2;(again, module equals half of the width);

The next problem is what values should be sum-ed and averaged ? It is different between edge point and diagonal points. But, if you see that box for hours, you will smell a fish and got the rules.

I would create a whole 16x16 array. And pick data and calculate them. To modify the dimension of array seems complicated.

I just make it work but slow. Maybe you can improve the speed.

http://dr_ericlin.tripod.com/forum/terrainF5.html
http://dr_ericlin.tripod.com/forum/terrainF5.zip

bit-101
08-08-2002, 08:16 PM
this thread inspired me.
http://www.bit-101.com/content/020808.swf
http://www.bit-101.com/flafiles/020808.fla

just 2d though...