Times, trials, and turbulence.
Sprites for one and all.
The voxel renderer now has three quality settings, low, medium and high, which essentially skip vertical rows of rendering and roughly interpolate the results. Going from high to medium doesn’t result in much of a quality hit, but the speed boost is quite noticeable. The ‘low’ setting doesn’t look that attractive, but gives users running on low-end computers a good chance. I’m estimating that computers as low as 1.0ghz will be able to run the game at 30+ frames per second. I’ll have to find some folks with old computers to help me out with some benchmarking. 😉
So, with the voxel engine now rendering at an acceptable speed, it was time to move onto the next stage of the engine: sprites. Terrain is fine and dandy, but we’re going to need foes to vanquish and particles to spruce up the scenes. Two obvious problems came to mind when deciding the best way to implement sprites: a) How will I decide where to draw them on the screen based on their world coordinates, and b) how do I ensure that the sprites appear behind/in-front of the terrain properly?
The first issue wasn’t too bad. It was a matter of reusing the transformations I was using in my last renderer attempt (the one with the nice quadtree screenshots), where were really just simplified regular 4×4 transformation matrices (since there is no Y axis rotation), and then scaling based on how much the point from the world had to be scaled to be projected onto the viewing plane. Lots of jargon for those of you not inclined toward 3D graphics. 😉 On a more simple topic, the layering of the sprite was done by creating a ‘depth buffer’, which stored the distance from the camera every pixel is while the terrain is rendered. Using this data, sprites that are drawn can gauge which pixels it can overwrite given its own distance value.
(..Which are actually the powerup sprites from Magma Duel, a previous game :P)
With sprites now working properly, the final step before starting the actual game will be implementing a map editor of somesort so that I can create maps for missions/tracks/whatever. Still no final decision about what exactly the game will be.
More news as development continues!