Page 1 of 1

Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Mon Oct 24, 2011 10:28 pm
by Cube_
So basically, I am intending to implement randomly generated maps for my game, but I can't find a single terrain generator that can do this, nor have I found info on how to make one...


So basically What I need is:
A dynamic terrain generator that utilizes a voxel system.
It has to generate terrain in Real time, probably by using a seed and some kind of algorithm
It has to work with Irrlicht, and preferably bullet.
It has to create fairly detailed terrain.
It has to allow users (the player/players) to deform the terrain. (thus allowing tunneling for example)
It has to be in C++

Think minecraft and you are going in the right direction...

An already made (open source) or enough information for making one is what I need :D
Either will work!

thanks in advance! //aaammmsterdddam

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Mon Oct 24, 2011 11:02 pm
by Grumpy
You sure want alot for your first post.

If you check past posts, you will find a palifera of such requests and some good answers. Start your search there.

Grumpy.

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Mon Oct 24, 2011 11:43 pm
by Alpha Omega
Well I have a good idea to store the information in data format. You can use a 2D array to hold the bits each bit is a relative distance from the previous point. You will need to twine two bit streams into one stream. Now, generating good looking terrain from a stream of bits is only as good as the algorithm to generate the bits. Lets say you figure out how to generate the bits. Now to build the mesh, each 2 bits is a point on the mesh, you just have to connect the points to get the mesh back. Start from a corner in the grid. I will choose the top left corner to start. The data in binary would look like this, 0 means the value has not changed, 00 means it goes negative, and 1 means it is one value higher or lower than the previous value. You will need to count the negatives since it is only written once. You will also need to start at zero, or some other value that you will always start at. The bit stream...

Code: Select all

 
X: axis
011001111
 
Y:axis
011001111
 
2D Array:
 
001111000011111111
 
Broken down:
 
00,11,11,00,00,11,11,11,11
 
Table Format:
 
0,1,2,2,1,0,-1,-2
1,2,3,3,2,1,0,-1
2,3,4,4,3,2,1,0
2,3,4,4,3,2,1,0
1,2,3,3,2,1,0,-1
0,1,2,2,1,0,-1,-2
-1,0,1,1,0,-1,-2,-3
-2,-1,0,0,-1,-2,-3,-4
 
 
Which looks like...

Image

Now, you should notice that this will only produce a linear surface, if you need sharp contours you will need to add extra bits. Use 000 as a scaling bit. Its up to you to decide whats best for your scaling parameters and how the bit stream evolves into incorporating things like that. However the idea is shown. You can implement it.

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Tue Oct 25, 2011 6:54 am
by Cube_
now there we have some info!
Now all I need is the algorithm.. oh well I can do some fiddling around with that.... I think I know(-ish) someone that could help me on that...

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Tue Oct 25, 2011 8:44 pm
by PolyVox
You should check out the PolyVox open source voxel terrain system. It's in the process of transitioning between websites, but you can find some information on the new website here. You can also red a bit about Irrlicht integration on the old website here and here.

I should point out that it doesn't actually generate the terrain though - it's just for managing the voxels and creating the mesh.

I'm not a regular on these Irrlicht forums, so post on my forums if I forget to check these ones for any responses.

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Wed Oct 26, 2011 8:05 am
by Virror
Ohh, that terrain system looks very interesting : )
Need to check it out

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Wed Oct 26, 2011 9:08 am
by Cube_
this is indeed very interesting...

I might find this extremely usefull!

Thanks Polyvox!

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Wed Oct 26, 2011 5:47 pm
by PolyVox
I'm glad you like it :-) It's been around for about five years, but I'll start promoting it more heavily once the new website is finished.

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Wed Oct 26, 2011 10:34 pm
by JTippetts
Following on from PolyVox, I wrote a couple articles in my blog about generating Minecraft-ish levels (and I used PolyVox to build the illustrations). I also have made available for download and early version of the chainable-module noise library I used for the posts, in case you are interested.

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Thu Oct 27, 2011 7:42 am
by Virror
Very good articles! I have played around with noise generated terrain my self a bit for my game generating hightmaps. But using PolyVox gives a lot more possibilities : D

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Tue Nov 01, 2011 10:28 pm
by Cube_
very interesting indeed.....

@PolyVox, a quick question, how detailed terrain could one make using Polyvox?
@JTippetts those are some interesting articles.... will look into them later :D (Buried 10 feet deep in code at the moment :D)

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Wed Nov 02, 2011 9:54 am
by Virror
The terrain detail is all up yo you i guess. The large volume supports nearly endless size, so if you have some good render techniques you could probably go very detailed.
Working on a test terrain based on PolyVox but have some issues with picking the correct voxels from the mesh-selection and also i know nothing of shaders so texturing is a problem ; )
But have kind of destroyable terrain ingame working now.

Re: Dynamic Voxel System For 3D maps, Does It Exist?

Posted: Wed Nov 02, 2011 1:09 pm
by Cube_
nice :D

I will keep messing with polyvox, since I can't do anything else at the moment, tho a voxel system is not at the very top of my todo list....