Event-Driven Architecture: Wisper Expansion & Legacy Sunset #171

Open
opened 2026-03-15 23:08:42 +00:00 by freemo · 0 comments
Owner

Background and Context

Aethyr's Publisher base class includes Wisper pub/sub, but only 3 events are currently published in the entire codebase: :player_input, :object_added, and :pre_look. The specification defines 30+ domain events that should be published from game systems, and a reactive event-subscription architecture where the UI, NPC reactions, logging, and other cross-cutting concerns subscribe to events rather than being called directly.

The current codebase has four legacy direct-call patterns that predate Wisper:

  • player.output(message) — 111+ call sites sending text directly to player connections
  • room.out_event(event_hash) — 23 call sites distributing event hashes through room inventories
  • room.output(message) — 5 call sites broadcasting text through Container iteration
  • .alert(event) — 5 call sites dispatching Event objects via direct method calls

Additionally, the reflection-based EventHandler (Module.const_get(event.type).send(event.action, ...)) is retained only for combat delayed events and NPC reaction sequences, and is scheduled for removal.

Articulated End State

Every significant state change in the game publishes a Wisper domain event. All four legacy direct-call patterns are eliminated. The EventHandler is removed. Game logic has zero awareness of its observers. Cross-cutting concerns subscribe to the events they care about. The codebase follows past-tense event naming per the Wisper guidelines in CONTRIBUTING.md.

Child Epics

Epic Outcome
Core Domain Event Definitions All 30+ spec domain events implemented and published
Sunset Legacy out_event() Pattern 23 call sites replaced; Container#out_event deleted
Sunset Legacy room.output() Pattern 5 call sites replaced; Container#output deleted
Sunset Legacy player.output() Pattern 111+ call sites replaced via gradual bridge migration
Sunset Legacy .alert() Pattern 5 call sites replaced; old Event dispatch eliminated
EventHandler Deprecation Reflection-based handler removed; combat uses CombatService
## Background and Context Aethyr's `Publisher` base class includes Wisper pub/sub, but only 3 events are currently published in the entire codebase: `:player_input`, `:object_added`, and `:pre_look`. The specification defines 30+ domain events that should be published from game systems, and a reactive event-subscription architecture where the UI, NPC reactions, logging, and other cross-cutting concerns subscribe to events rather than being called directly. The current codebase has four legacy direct-call patterns that predate Wisper: - `player.output(message)` — 111+ call sites sending text directly to player connections - `room.out_event(event_hash)` — 23 call sites distributing event hashes through room inventories - `room.output(message)` — 5 call sites broadcasting text through Container iteration - `.alert(event)` — 5 call sites dispatching `Event` objects via direct method calls Additionally, the reflection-based `EventHandler` (`Module.const_get(event.type).send(event.action, ...)`) is retained only for combat delayed events and NPC reaction sequences, and is scheduled for removal. ## Articulated End State Every significant state change in the game publishes a Wisper domain event. All four legacy direct-call patterns are eliminated. The `EventHandler` is removed. Game logic has zero awareness of its observers. Cross-cutting concerns subscribe to the events they care about. The codebase follows past-tense event naming per the Wisper guidelines in CONTRIBUTING.md. ## Child Epics | Epic | Outcome | |------|---------| | Core Domain Event Definitions | All 30+ spec domain events implemented and published | | Sunset Legacy `out_event()` Pattern | 23 call sites replaced; Container#out_event deleted | | Sunset Legacy `room.output()` Pattern | 5 call sites replaced; Container#output deleted | | Sunset Legacy `player.output()` Pattern | 111+ call sites replaced via gradual bridge migration | | Sunset Legacy `.alert()` Pattern | 5 call sites replaced; old Event dispatch eliminated | | EventHandler Deprecation | Reflection-based handler removed; combat uses CombatService |
freemo self-assigned this 2026-03-16 01:26:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: aethyr/Aethyr#171
No description provided.