Register

Trying to make a first game using the renderer

Dawoodoz
4 months ago
An important part of testing the usability and showing that it's not just a toy project is to actually create a game using the library. One will also find more bugs when starting on a new project because most of the code in big projects end up working with abstractions that rarely touch the library directly.

By not having to store this in the git repository, I can add things that would take way too much space for someone just wanting the library for basic 2D applications. The version control system can be kept locally and expand with old history as much as it needs to.

The isometric sprite engine was updated with the ability to erase background sprites and models from the oc-tree structures. This allow changing the floor's height using a tool in real-time and have the surrounding 3x3 tiles updated by creating new tiles based on pattern matching, invalidating affected background blocks and repainting the background to the screen.

The first roadblock that appeared was the design tools. I could just add some vertex weights and animate characters like in modern games using real-time triangle rasterization, but that would be slower for large crowds and less detailed. Having images of every pose and direction stored in the game's folder would take too much storage space. I might split characters into multiple parts and then just pre-render the frames on first use to be stored for later. Once a character is no longer visible, new characters can then overwrite the buffers with more current animation frames.

I would like to avoid adding sound to the library, because sound and graphics are completely unrelated things that doesn't benefit from being in the same library. The game will probably use an external sound engine, which can be replaced easily with another engine when the game ages.

Physics could be added because it doesn't have any external dependency, but general physics engines cannot do specific optimizations to improve quality and performance. I usually merge collision blocks for tiles as compressed voxel sets to reduce wasted memory, but this is difficult for a general physics shape being imported from a model with a floating-point transform and rounding errors. Custom physics will also result in much smoother walking physics, better continuous intersections for projectiles, cheaper particle effects by not affecting a general broad-phase, and prevent items from falling through the floor when knowing the minimum ground height for each location on the map.
Log in to comment