HOME | DD

roboprez — Random Land Gen - Fractal

Published: 2009-07-16 09:39:19 +0000 UTC; Views: 3757; Favourites: 19; Downloads: 30
Redirect to original
Description Instructions...
Click to double grid, space to reset. If flash brings up a slow script warning, click no to keep on going or click yes to keep what you've done

This is land generation using the fractal method. I learnt the method from ChevyRay's blog post

[link]
Now in case you are confused ill explain what it does. First it creates an 8x8 grid and fills it randomly with blue/green tiles. Now when you click it's going to double the grid (16x16) and double what was already there (GBBG becomes GGBBBBGG). Now for each tile it checks the nine tiles around it. Now depending on what's around it it has different chances of being G/B. Then you keep on clicking until you get to 512x512

I originally did this in AS2 but it was very slow (Flash would bring a slow script message on 206x206). Because of this a decided to read up on AS3 and convert it. this took 6 frustrating hours! Tell me when on your computer it brings the first slow script message (15 second time-out I recall).

Okay well I'm going to update this more with some funky features later!
Related content
Comments: 18

theCheeseGrater [2010-06-26 17:55:02 +0000 UTC]

awesome you should make a zooming effect or something so it gives the illusion of infinite detail

👍: 0 ⏩: 1

roboprez In reply to theCheeseGrater [2010-06-27 08:05:22 +0000 UTC]

Yeah I've been meaning to do that for quite some time now but i've just never gotten round to it

👍: 0 ⏩: 1

theCheeseGrater In reply to roboprez [2010-06-28 12:48:29 +0000 UTC]

Haha ok... it reminds me a lot of some of the winamp visualizers that do that

👍: 0 ⏩: 0

erickthesonicfan [2009-12-31 01:39:19 +0000 UTC]

This looks pretty nice, it's useful for making maps for RPGs.

👍: 0 ⏩: 1

roboprez In reply to erickthesonicfan [2009-12-31 04:51:49 +0000 UTC]

Yeah, I was going to make a game using it but i've got too many things to do at the moment

👍: 0 ⏩: 1

erickthesonicfan In reply to roboprez [2009-12-31 04:55:38 +0000 UTC]

at first sight, it reminded me of Golden Sun.

👍: 0 ⏩: 0

HiddenSpartan [2009-12-28 19:13:37 +0000 UTC]

How did you calculate the probability for the change of a square?

👍: 0 ⏩: 1

roboprez In reply to HiddenSpartan [2009-12-30 05:31:41 +0000 UTC]

Each square looks at the squares around it. If 3 squares are green, it has 3 in 9 chance of being green. At the very start they are purely just random

👍: 0 ⏩: 1

HiddenSpartan In reply to roboprez [2009-12-30 09:12:48 +0000 UTC]

Ok, so I did basically the same thing as you ([link] ).

👍: 0 ⏩: 0

Sirence [2009-12-25 09:49:54 +0000 UTC]

It already started lagging at 1024x1024 :/

👍: 0 ⏩: 1

roboprez In reply to Sirence [2009-12-26 00:20:45 +0000 UTC]

Remember that's double the size of the box.

👍: 0 ⏩: 0

Schweinskopfsuelze [2009-12-25 09:16:47 +0000 UTC]

imo it eats too many ressources

👍: 0 ⏩: 0

GarGar [2009-08-09 09:52:21 +0000 UTC]

Wow, this is really cool. Actionscript really is quite beyond me, especially AS3, that's an ENTIRELY new level, there.

👍: 0 ⏩: 1

roboprez In reply to GarGar [2009-08-10 06:58:03 +0000 UTC]

Hey AS3 isn't that different two AS2, it just takes some time to relearn what you've already learnt

👍: 0 ⏩: 0

scottapotamas [2009-07-17 12:29:34 +0000 UTC]

4096 is as far as it can get... i think its because of a flaw or restriction in the file, as trying to go further didn't crash, it just thought for a second, and nothing changed... Other than that, great, a long way out they look like continents on a 2d map

👍: 0 ⏩: 1

roboprez In reply to scottapotamas [2009-07-18 01:11:21 +0000 UTC]

oh yeah i don't think flash allows you to go past a certain bitmap res for fear of eating to much ram. Ill find a way around it.

👍: 0 ⏩: 0

BatmanWithBunnyEars [2009-07-16 09:43:41 +0000 UTC]

That's pretty neat, but it would be more fun if you could somehow control land generation. Then you could make a game out of it...

👍: 0 ⏩: 1

roboprez In reply to BatmanWithBunnyEars [2009-07-16 10:10:39 +0000 UTC]

Yes next version i'm going to add customization than some viewing options. I'm also working on a tile based engine for this that could be used for a game.

👍: 0 ⏩: 0