30 October 2017
There's a lot to think about with a question like this, and there's a reason that I say in the FAQ that PicaVoxel is not built for large worlds; it involves a lot of work and will be different for every game.
I wrote a thread about large volumes here, so read that first so you can get an idea about the kind of data sizes you'll be dealing with: http://forum.picavoxel.com/chat/max-volume-size-stress-test
So with a large world, the first thing you'll need to think of is scale. On one end you've got Minecraft, where each block is roughly a metre or so, so a player can stand entirely inside a voxel. Minecraft works by streaming in chunks from disk and rendering them as you move around the world. This only really works because of the large scale - you have to run quite far before you get to the next chunk.
On the other end, you've got a game like mine, Jarheads, which works on a very tiny scale with an RTS-like camera: https://youtu.be/XAqf9kn3MUo?list=PLr6rfxGHqwWP1CNSKbMQEzEAPDFpt4rIC&t=1050
The map at that timestamp in the video is one of the largest sized maps in the game, and it only takes 10-15 seconds to walk across in a straight line. In Jarheads, I load the entire map into memory at once because of the scale involved. You can simply see too much of the map and move around it too fast for on-the-fly loading and meshing to work. A map that size, by the way, uses around 2GB of RAM.
The Jarheads map code is all-custom; it doesn't use PicaVoxel (it was actually made before PicaVoxel)
The other thing you have to think about is content: how are you going to design the map. If you're going to work with PicaVoxel only, then you have two options: procedural generation, or drawing in an external editor and importing.
For Jarheads, I created my own editor to suit the purpose: https://www.youtube.com/watch?v=jXDpEfWPRmk It has terrain painting and then the ability to place objects that are made with Magica. Again, all custom, not based on PicaVoxel.
So this has been a bit of a stream of consciousness to get to the point I'm trying to make: it's up to you. You'll need to experiment and do the work. PicaVoxel is a very generic tool that gets you up and running with voxel stuff pretty quickly, but it can't be everything to everyone.
Lastly, some actual practical advice to answer your question. If you're going to try and do this with PicaVoxel, then you have two options:
- Have the world be one large volume
- Split the terrain up into a grid of volumes
If you use number 1, then you'll need to alter the way that PicaVoxel works because you're going to have to figure out a way of rendering in PicaVoxel chunks on the fly according to character position. You will also have the entire world's data in memory at once (the voxel array stored in Frame.Voxels). This will be quite convenient in some ways, but it'll likely use a lot of RAM.
With option 2, you'll have an easier time of getting on-the-fly loading working. You can have one volume for each "grid" tile of your world, and you can use the built-in PicaVoxel functions Frame.ToCompressedByteArray and Frame.FromCompressedByteArray to store and load volumes. You could even make use of the Magica/Qubicle importer code to load volumes from those formats, which will give you the option of using those tools to create your map.