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

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

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

Post 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
"this is not the bottleneck you are looking for"
Grumpy
Posts: 77
Joined: Wed Dec 30, 2009 7:17 pm
Location: Montana, Usa

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

Post 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.
code happens
Alpha Omega
Posts: 288
Joined: Wed Oct 29, 2008 12:07 pm

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

Post 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.
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

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

Post 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...
"this is not the bottleneck you are looking for"
PolyVox
Posts: 5
Joined: Wed Jan 21, 2009 10:29 pm

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

Post 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.
Virror
Posts: 191
Joined: Mon May 02, 2011 3:15 pm

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

Post by Virror »

Ohh, that terrain system looks very interesting : )
Need to check it out
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

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

Post by Cube_ »

this is indeed very interesting...

I might find this extremely usefull!

Thanks Polyvox!
"this is not the bottleneck you are looking for"
PolyVox
Posts: 5
Joined: Wed Jan 21, 2009 10:29 pm

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

Post 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.
JTippetts
Posts: 7
Joined: Wed Oct 19, 2011 12:44 am

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

Post 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.
Virror
Posts: 191
Joined: Mon May 02, 2011 3:15 pm

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

Post 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
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

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

Post 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)
"this is not the bottleneck you are looking for"
Virror
Posts: 191
Joined: Mon May 02, 2011 3:15 pm

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

Post 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.
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

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

Post 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....
"this is not the bottleneck you are looking for"
Post Reply