2.5D Rendering on PlayDate
a year ago
- #game-development
- #raycasting
- #optimization
- Castle Kellmore uses a raycasting rendering system similar to Wolfenstein 3D, optimized for the Playdate's hardware.
- The game is programmed in C++ with a fully integer-based rendering system using 16.16 fixed-point math for performance.
- Raycasting involves casting rays from the player's location to determine wall distances and render vertical spans for walls.
- The game includes floor and ceiling rendering for immersion, drawn with horizontal strips for efficiency.
- Sprites are rendered in vertical spans with constraints to maintain performance, leading to a specific aesthetic.
- Key optimizations include reducing updatable screen area, rendering fractions of the screen per frame, and minimizing pixel overdraw.
- A depth buffer per pixel column is used to manage draw order and occlusion without a full depth buffer.
- Amortized rendering is employed, updating parts of the screen over multiple frames to maintain performance, with different methods for fast and slow motion.