Skip to content

docs: generic interaction system design#130

Merged
lstep merged 2 commits into
mainfrom
docs/interaction-system-design
Jul 17, 2026
Merged

docs: generic interaction system design#130
lstep merged 2 commits into
mainfrom
docs/interaction-system-design

Conversation

@lstep

@lstep lstep commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

Key design decisions

  1. Two-phase RPC with immediate-mode opt-out — press E → query available actions → popup → choose → execute, OR immediate execution (entity's choice via on_interact_action property)
  2. Entity data declares effects, extension code interprets theminteractions JSON property maps action IDs to effect lists (action verb + payload + target IDs)
  3. Fully generic action strings — framework is a pure message router, never assumes a state model
  4. Per-entity effects list — same action string ("toggle") can have different effects per entity; the data decides, not the code
  5. Multi-extension dispatch — each extension handles verbs it knows, skips the rest; adding a new action type = one case in the extension, zero framework changes
  6. Client-side sparks + overlay sprite glow — no server round-trip for cosmetic feedback

Test plan

  • Document renders correctly on GitHub (markdown formatting, code blocks, tables)
  • All referenced file paths and line numbers are accurate
  • Sequence diagrams are readable in monospace rendering

lstep added 2 commits July 16, 2026 03:35
Data-driven interaction model where entity data declares effects
(action verb + payload + target IDs) and extension code interprets
them. Supports popup mode (press E → choose action) and immediate
mode (press E → action fires). Multi-extension dispatch lets
different extensions handle different action verbs from the same
interaction. Includes sequence diagrams, worked examples, and a
6-phase implementation plan.

Refs #129
Update code references in section 2.1 and section 9.2 to match
actual line numbers: GameScene.ts keydown-E (736→810), worldsim.go
applyAction (1141→1180), worldsim.go applyActionReply (1225→1264),
GameScene.ts openDropdown (1532→1737).
@lstep
lstep merged commit f89e9cc into main Jul 17, 2026
4 checks passed
@lstep
lstep deleted the docs/interaction-system-design branch July 17, 2026 17:27
@lstep lstep added the documentation Improvements or additions to documentation label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant