Skip to content

Chapter 5 — The Event System

Part II — Engine Architecture

Events are the bloodstream of AI RPG Engine.

  • Event structure — domain, object, verb, payload
  • Event vocabulary — naming conventions and patterns
  • Event routing — specific listeners, domain wildcards, catch-all
  • Event presentation channels — how events reach the player
combat.contact.hit
combat.entity.defeated
status.applied
dialogue.node.entered
world.zone.entered
audio.cue.requested
environment.noise.changed
progression.node.unlocked

Modules receive an EventRegistry during initialization. They subscribe to specific event types, domain wildcards (combat.*), or the catch-all (*) to respond to simulation changes.

Events are processed synchronously in subscription order, ensuring deterministic behavior across replays.