~keith's Web site

Physics engine, part 0: Engine preparations

This is just a quick update about the internals of my game engine. A few things need to be fixed and implemented before progress on the physics system can actually begin.

What's done

Firstly, and most importantly, the actor/component lifecycle has been properly implemented. This means there are now methods for components to initialize themselves when they're created or resumed, before they enter the main update loop.

Next, I've added a quality-of-life enhancement in the form of the (new!) instantiation macro. This just provides nicer syntax for creating actors, by abstracting away the details of attaching their children and components.

What's not yet done

The one thing remaining before I can begin work on the physics system itself is a way to define the physics system. This is rather simple in Lisp, actually, so it shouldn't take too long.

Also, it'll be useful to make a few tweaks to the rendering system and set up a way to display debug info, so I can observe what the physics system is doing in real-time. I found Lisp bindings for the FreeType font rendering library, which I can use for this.


  • Actors and components are how wh-engine represents the contents of the game world. Actors are objects that exist in the game (such as players, enemies, terrain, and UI elements), and components define aspects of their properties & behaviour.