Jump to content

Fractal terrain generator (I think...)


lokster
 Share

Recommended Posts

This is just proof of concept...

I was trying to generate fractal terrain (like in that old game called Artilery...)

Here is a screenshot:

Posted Image

And the script itself:terrain.au3

Update 05-FEB-2007: terrain.au3

- now you can drop bombs on the terrain... :)

It uses the algorhithm that is called Midpoint Displacement in one dimension.

All its logic is located in the DisplaceMidpoints function.

Edited by lokster
Link to comment
Share on other sites

Must say this really fascinated me. I just had to look up how that algorithm work and do something similar.

I stared thinking about how one would make the terrain fall down when undermined. Looping through all pixels checking for missing ones

can't be very fast. Anyone have any other ideas?

Oh and here's my script if anyone is interested. It's really does the same as the ops but without fancy colors and with a few more options in the GUI instead.

MidpointDisplacement.au3

post-18344-1170480677_thumb.png

Edited by Lej
Link to comment
Share on other sites

@Lej check the updated version of the script in the first post. Now you can drop bombs on the terrain. The logic is very simple.

Yes that was nice and interesting. Only problem I see with this method is the flashing when redrawing the entire graphic control.

Could perhaps be fixed by drawing the terrain after the bomb in a different graphic control and then placing it on top.

Oh, and you might want to add some kind of check to the bomb as it will crash if the radius of the bomb reaches outside the screen.

(Tries to write to $w[<0] or $w[>512])

Link to comment
Share on other sites

Wow! It's great!

Yippi! Now just to create bomb falling animation :whistle: and some cannons running on land :) it will be great autoit game :lol:.

I can't wait next version! (if will be it?)

i542

(P.S. Maybe I should create Fractal Terrain Generator #1 Fan in usersigs.com?)

I can do signature me.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...