Sign in to follow this  
Followers 0
lokster

Fractal terrain generator (I think...)

8 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



Beautifull :)

Can't wait to see this with prospeeds possibilities combined :D

Cannon Wars :D

Greetz,

FaNtA

Share this post


Link to post
Share on other sites

Beautifull :)

Can't wait to see this with prospeeds possibilities combined :D

Cannon Wars :D

Greetz,

FaNtA

Yes, I have the same thing in mind. And as it seems it will not be very difficult. Will try...

Share this post


Link to post
Share on other sites

Wow! It's great!


I can do signature me.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
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])

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0