← everything

PrimortalGame DevelopmentGame Engine

Scripted entity behaviors! Here’s an example of the player remotely controlling another entity by pressing buttons. Once the NPC steps on one of the end-spots, the NPC walks itself back to the start.

Since my XenoLog posts a week ago, I’ve been busy re-writing my entire entity control system for the over world game state. It’s taken 5,000+ lines of code over 100+ files, but it’s been worth it! Entities no longer implement a single interface, and they no longer interact directly with the dozen or so sub-systems that make up the over-world state.

The entity system was revamped, and now maintains 5 independent components for each entity:

On top of that, all changes to entities and other game state components go through a new Event & Effect dispatcher, decoupling triggers and side effects. This allowed me to implement a Plan system with which I can queue up combinations of serial and parallel effects in whatever sequence I want. At the moment, the system supports:

This all culminates to parameterized, generic entity creation. I can register bespoke (or reusable) entity constructors and event handlers and reference them within Tiled (my map editor) when creating entities. These can be used to create flexible NPC interactions, dialogue sequences, teleportation, basically anything you need to do to control a game entity.

I feel like at this point, I’m close to completing the “build the game engine” milestone and I can start focusing on actually working on the “true game”.

A lot of this stuff I’ve built is already available in something like Unity or Godot - but part of this project has been about proving to myself I could program a game without. It’s been a lifelong dream to build a game from scratch - seriously, since middle school when I first played with HTML. So I’m super proud of this specific update.