Modularizing Lumote Part 2: Reassembly
So in Modularizing Lumote Part 1 I covered our reasoning as to why we decided to break the world down into smaller pieces. In part 2, I’m going to cover what the breakdown looked like how the world assembly system works.
As was discussed in the previous post, we had a bunch of world and wanted to break it down into single rooms that could be easily snapped together and re-arranged to adjust the pacing and difficulty of the game. The first step was deciding a minimum size that a level could be, all levels will be within a box that is a multiple of the minimum size to help us easily snap them together.
Voxel engines like the one in Lumote generally work by segmenting the environment into smaller pieces called chunks. These chunks allow for local modifications to be less computationally expensive when recalculating rendering and physics information. As it turns out, our levels happened to be almost exactly a multiple of our voxel chunk size which is 32x32x32.
For my sanity and yours, I’m going to present the world as a 2D grid through out this post.
Purple lines are level boundaries, green lines are chunk boundaries
We need to define a box for each level to fit in. Levels aren’t restricted to a 32x32x32 cube, they can be any box but the box dimensions are always a multiple of 32 voxels. Once we’ve properly defined the box for a level, we specify up to 4 evenly spaced connection locations on the vertical faces of the level. Pink for exits, and blue for entrances. This configuration allows us to define modular levels that are can be almost arbitrarily arranged while not restricting the internal design of the levels too much.
Blue entrances, pink exits. Levels can be any dimension of box
Once all the levels have their bounds defined, we use a custom flow charting tool to define the connectivity of the world which is then used to create, rotate and translate the levels that form our world.
Some possible level arrangements based on the 5 levels in this example
Filling in the gaps
As you can see from the above level arrangements, we just have a bunch of floating levels. Lumote is a single world, there are no level load screens, just one big puzzle game all visible to you at once. This means we can’t just have a bunch of weird floating platforms everywhere, we want to make the levels feel grounded and solid. In order to fill in all these missing walls and pillars, we enlist the help of our voxel engine and we simply extrude lowest part of each level downward to infinity.
Extruded final world
And finally, here is an example of a bunch of levels all stitched together using this system, this constitutes about 26 individual puzzles.