Terrain Generator

Previous topic - Next topic

SBlectric

I've been looking into fractal terrain generation lately, as I'm currently working on a Minecraft clone and want to have a good randomized, realistic terrain. Well, I ended up porting an old C++ Perlin Noise routine into GLBasic, then adding a GUI wrapper to control its output.

At the moment, it only draws and exports 2D representations of terrains, but I will soon add in 3D viewing/exporting.




New 1.2 release on 7/29!
Download it here: http://sblectric.com/downloads/TerrainGen-v1.2.zip
C++ and GLBasic code included for the actual algorithm.
Cool stuff and whatever

Slydog

Looking great!

If you're interested, here's a thread discussing voxel style graphics, and algorithms to only add exposed quad faces of a random voxel grouping.  Later perlin noise (simple implementation) is added to make it appear more Minecraft like. 

http://www.glbasic.com/forum/index.php?topic=9499.0

Seems to work fast enough for small worlds (128x128).  Some more optimization would be needed for larger worlds maybe.  It does implement a chunking system, by breaking the world into predetermined size chunks (8x8x8 for example).  This concept speeds up the calculation, plus updating a voxel is much quicker.

Keep us posted on your progress, looks promising. :good:
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

mentalthink

Nice and interesting program, thanks for the code always it's good learning C++ for GLbasic , thanks.

MrPlow

Very nice!
Looking forward to 3D version
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

matchy

#4
Great stuff and just what I was looking for my flat 3D environment and catchup on a bit of inlining. :enc:

SBlectric

It's working really great on my Minecraft clone. Looks good so far! Here's a video of its current status (terrain, physics (still buggy), block placement, walking, etc.)
https://drive.google.com/file/d/0B2Ez6zqWxZAZVWpyMjRKZEhtZWM/edit?usp=sharing
Cool stuff and whatever

matchy

Hey!  =D You know I like that. How about some more distance views?  :whistle:

SBlectric

Here's a good one:
Cool stuff and whatever

Ian Price

I came. I saw. I played.

Slydog

I agree, very nice!

Are you telling me this is running at 936 FPS?
What size world is this? 256x64x256?

What's next?  Add/destroy a block?  Water?  Can't wait.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

SBlectric

#10
It's more like 500-800 now that I added placement, and I achieve this by grouping all the blocks in a chunk into a single object, so instead of ~300 draw calls per chunk like I was getting before, it's now only 1 per chunk.
Here's a video:

Yep, world size is 16x16 chunks, or 256x256x256.
Cool stuff and whatever

Schranz0r

You code this in GLBasic?
Impressive...!

Did you use VBO or Immediate Mode?
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

erico

Indeed, really neat. :good:

mentalthink

 :nw: :nw: :nw: guapísimo, How many polys you can move?¿, really this it's very good, and the Editor, I love the simple UI....

Super!!!

SBlectric

I guess technically it's VBO mode, as I'm loading all of the chunks' vertices and data into memory at startup/chunk update. As for the amount of polygons, it renders two per block face (pretty standard, I don't have poly grouping or anything fancy), and only renders the block faces it calculates to be visible (colliding with an air block).
Cool stuff and whatever