In our last post I spoke of all the mundane behind the scenes changes I was about to do. Umm, yeah… I only did one. I fixed one minor bug here or there and before I knew it the entire terrain rendering codebase had been overhauled. Here’s a list of changes in no particular order:
- New Tile types: Resources Iron and Carbon, Decorative Rocks
- Tweaked perlin noise generators that created the terrain.
- Introduced terrain height variance. Where previously the whole map fit neatly with right angles, now the terrain shows variations in height and normal values. This creates a much more diverse, interesting, and realistic terrain.
- Implemented a more advanced mesh generating technique that ensures objects with alpha textures are rendered after non-alpha objects. This fixes a glitch where parts of objects (mostly the towers ) would disappear when a rock was nearby.
- Implemented a new mesh culling technique. This technique actually checks data in neighboring chunks to eliminate polygons that aren’t being displayed. Neighbor chunk not loaded yet? No problem. When a chunk is loaded into RAM, it notifies all its neighbor chunks so that they can re-draw their meshes.
- Implemented support for hardware anti-aliasing. By default, it attempts to use 4x AA.
- Changed lighting levels and position to better simulate light from a star.
- Created garbage collection routine for chunks. Each chunk loaded into RAM now stores a time-stamp of when it was last accessed for rendering or modification. If a chunk hasn’t been accessed for 45 seconds, it is queued for removal from RAM and saved to disk. That 45 seconds may change. I believe it is the garbage collection rate used in the CraftBukkit project, so I though it was a good starting point.
Also on the horizon: Since it has been so long, I recorded another video of Angular Velocity in action! It’s over 4 minutes long, 720p, and is uploading to Youtube right now. Sadly for some reason the game skips much more often when I’m recording than not, so the quality could be better. Sorry about that. I’m sure once I optimize the game further it will be eliminated.