Voxel Engine

I’ve been getting back into game development in my spare time, working on a Voxel engine as a learning experience. Eventually I’d like to build it into a game, but for now I’m focusing on the base system.

Current state of play: different voxel types with unique textures, a movable player cube (the voxel on its own at the front), an expandable size map (loaded from file), a voxel selection system and the beginnings of collision detection.

I originally investigated this idea just over a year ago, but put it on hold until about a month ago. Recently I’ve implemented the voxel and chunk (cube of voxels) system, texturing, naive meshing, and basic camera, player and game-play mechanics. I am using an Entity-Component-System library for the implementation, and building the rest on top of this. I am hoping to learn about the rendering pipeline (and how awesome shaders can be), engine architecture, algorithms and data structures and improving my coding skills (C++). So far perhaps the most interesting system I’ve created is my voxel picking mechanism:

An initial rendering pass encodes each voxel with a 4-byte code (using RGBA colour) for map interaction detection.

This system creates an initial rendering pass, rendering each voxel with a unique colour code that can be read from the buffer. On a mouse click, the code is decoded to locate the voxel in map coordinates. Currently this is used to cycle through voxel types to change the map appearance. This approach will be improved in the future as it is not very efficient, but was a useful and quick implementation to use.

Hope to post more in the future as development continues.

Leave a Reply

Your email address will not be published. Required fields are marked *