Calamity Engine 1.0.0
A cross-platform 2D game engine written in C++ and SDL3.
Loading...
Searching...
No Matches
Calamity Engine

A modular and cross-platform 2D game engine made in SDL3 and C++ built in mind with the Sony PSP.

Index

Platforms Supported

Libraries used

Optimization Sidequest

Due to my engine targeting older/underpowered platforms like the Sony PSP, I designed my engine's architecture with performance in mind from the start.

The physics and render loops are fully decoupled from one another. Physics runs at a fixed 60hz, which avoids both over-simulation and the "spiral of death" where a slow frame causes even slower subsequent frames.

Components and children are stored in std::vectors, so iterating over them in update/render/physicsUpdate is sequential memory access, which matters a lot on platforms with limited cache.

On the physics side, Box2D's substepping is exposed and set to 4 substeps by default. Also, the pixel-to-meter scaling that Box2D requires is baked into the shape at creation time (scaledPolygon, scaledCircle, scaledCapsule) rather than being multiplied in every physics update.

A lot of the end-user API is also function-based rather than property-based specifically to avoid having to diff previous values to detect changes in update loops which I did to optimize cycles for the more underpowered platforms like the PSP.

In the end, I had no issues regarding performance on the PSP! Memory usage also remains < 60mb on desktop platforms. The engine runs efficiently, whilst maintaining a user-friendly API.

Aknowledgements