Light Racer 3D - Days 5-7 - A Working Scene

Days 5-7 have brought on a dramatic difference to the new game. It went from being a test bed for 3D objects and experimentation to an actual working scene. I laughed out loud when I first finished the merge of the 2D game engine with the new 3D rendering system because the problems were so bad but I was still able to see the racers and control them. It didn't take me much over an hour to fix up the issues and move the camera behind the player for that 3rd person following view. There are no trails, explosions or text yet but this will give you an idea of what the game will look like.

Day 5 - What was done:

Created Red and Yellow racer textures
Created basic item and power emitter meshes
Started implementing better multiple texture loading
Started implementing 2D labels

Day 6 - What was done:

Changed all code to fixed point (importer and renderable objects)
Got basic orthographic heads up display working with dynamic labels
Cleaned up much of the opengl code
Checked FPS - running around 40FPS, am slightly concerned about performance.
Started on trail segment renderer

Day 7 - What was done:

Refactored all rendering code to prepare for the big merge with the 2D game engine
Merged LRE code - deleted all 2D drawing code, commented much functionality out
Rigged up the renderer with the main thread, got basic racer rendering in
Changed camera to follow racer - will put in toggle for overview
Changed controls to left-right turning

What I've discovered (which is not news to most people) is that the emulator can be very different than the target device. I recommend using a device for most or all Android 3D development. The videos for this entry are from the emulator and as such, are running at a slow framerate and have some visible issues.

The code merge was nearly as straightforward as I was hoping it would be. I ended up having to set up a synchronization system between the renderer thread and the main game thread. I wanted to hand snapshots of the world to the renderer but because of the dynamic nature of the trails and segments, I was afraid of memory allocations so I'm just going to try a system like this:

Game Engine Locks World
Game Engine Updates World
Game Engine Unlocks World
Renderer Locks World
Renderer Draws World
Renderer Unlocks World


It seems to work fairly well on the device so far. Its not ideal, as I'd like to be rendering the previous snapshot while ticking the next. I'll see what the final performance numbers are like and go from there.

Here are videos of Day 7 mid-day, and Day 7 end of day. What a difference!