moonkey said:
as you saw in my code 256x256x128 is possible, and you can probably go even higher then that, perhaps 300x300x128. Notice also that memory usage is not that crazy, I get around 500MB, same as minecraft which is not bad, you can go up to 1.2 gb before java crashes, it doesn't deal so good with higher memory even if you specify in Xmx1024m...
I'm playing currently with "perlin noise" to fill the empty hills with content ... this is not so easy. Render surefaces (heightmap based) is easy. But in such a sandbox editor the user should remove the sureface box and then he should see the next underground leven and so on ... my last idea was to use a octree to store the internal content of the chunks to save memory, this could be the way.
Hi, tell me how to make removal and addition of ācubesā?
At first, when I have not seen your topic, I tried to make a map consisting of boxes and there I was able to make removal of the cubes, but it was too low fps = ( In your example, as I understand it, uses a polyhedron, and then I do not know how to do it = (
here are two pictures that can help you, they helped me alot when I was trying to understand what I was doing:
http://i.imgur.com/of75u.jpg
http://i.imgur.com/3LMTC.jpg
If you dont understand it, its important to put in on paper and I disected just 1 box on paper and understood how to build it properly my self. When you can build 1 box your self and you understand what you are doing, its easy to scale it up :)
So just look at those drawings if you get confused, or just draw some your self and take time to understand...
You can optimize this by adding chunks, I mean breaking big mesh you got there into smaller chunks, that would speed it up even more and would allow for bigger terrain then you got now. You'd have to figure that part out your self. Best is to do it first on really really small scale. I like to do things on small scale cos my brain can understand it better, and then its easy to scale up... So you could limit the mesh to be 9x9x9and then work on that scale and create chunks that are just 3x3. its much easier to visualse whats going wrong when something goes wrong :)
When you get it right on really small scale you can easiliy scale it up to big numbers :)
You could do physics, but you would need to limit it. If you dont need endless terrain then you dont need chunks, if you have limited area like 100x100x100 you are fine with what I gave you, you can start experimenting with physics and learning that! :)
Sorry to dig this post up from the grave but @moonkey I really wanted to thank you for this - I was about to give up with trying to produce my voxel landscape project and when I saw your pictures hand-drawn I realised and was inspired with new methods and ideas.
This topic was started a while ago but if you have achieved anything with your engine I would love to see it :D
Thanks again
Hi ollie, I dont mind being awakend from a 1000 year sleep
Iā havenāt gotten arround to finish that sucka, but I still have urge and desire to make voxel engine that can scale up and down and which can be used to implement anykind of game. Well problem is that Iāve got a full time job and this stuff does require energy and lots of focus so I put it on ice for a while. I hope to get back to it again soon Meanwhile I wish you best and keep us updated. Glad that my pics helped, you can also look at the code I posted there should be enough there to make you understand some stuff which you need to be able to have large terrains!
Thanks I will be sure to keep you updated - I have re-written it slightly to suit the kind of game I am going to make and I have added in the ability to remove and add blocks. I will need to use picking now to decide which block should be added or removed.
Funny thing is my interest in voxel has awoken yesterday for some reason, just few hours before you posted :d Iām now looking again into it, its like a virus, it gets hold of me and I spend to much time reading forums learning how people all over the net tried to handle the problem, what algorithms they used for optimisation and for lights&shadows, etc. Iāve learned alot but still I miss extensive knowledge of language like java or c++ to be able to fully optimize everything, so if Iām to make real progress Iād need to learn some more language specific things, etc Anyways good luck I know how you feel
Yeah - your engine inspired me a lot. Thank you again so much
I have one question about a small part in your code:
At this line of code:
[java]for (int y = 0; y < (heightmap.getTrueHeightAtPoint(x, z)*0.08f); y++)[/java]
Where you are creating the cells, what is the logic behind multiplying the value by 0.08f? I realise when you remove it you get an ArrayIndexOutOfBounds exception but how did you figure out that number?
well Iām not really sure how I decided on that number, I guess its just experiemented forward, since you have certain number of elements in your array that you canāt go above and you know that bitmap has values from 0-255 if I remember correctly which would give you at most height of 20 units, so when you remove it you are getting probably height of 255 units which is then out of bounds since array maybe goes as much as 128 elements or something like that? So that number is used to scale the height, you want higher height you increase that number
hi, are there any way to use different materials (textures) onto the blocks? the only way iāve found was to create itās own mesh for every block. but the heavy amount of the ānew Geometryā command takes to much performance while creating the whole chunk.
@alrik said:
hi, are there any way to use different materials (textures) onto the blocks? the only way i've found was to create it's own mesh for every block. but the heavy amount of the "new Geometry" command takes to much performance while creating the whole chunk.
You use one texture atlas with all tiles and then set the texture coordinates of the single faces to point at the contained tiles.
@normen said:
You use one texture atlas with all tiles and then set the texture coordinates of the single faces to point at the contained tiles.
Hello, I have been developing a voxel engine recently as well. But I m currently stuck on texturing blocks with different textures. Do you mind to explain more details on "using texture atlas to set the texture coordinates of the single faces to point at contained tiles"? Thx