Addons
Addons are the layer between YAGE’s engine plugins (@yagejs/core,
@yagejs/renderer, …) and your game: installable, opinionated implementations of
one cohesive gameplay pattern each — dialogue, inventory, combat — designed so
their opinions stay overridable without forking.
They live under the @yagejs-addons npm scope (a separate org from the
engine’s @yagejs scope) and are independently versioned, so an engine
release never forces an addon bump and vice-versa.
How an addon is layered
Section titled “How an addon is layered”Each addon separates concerns so each layer is opinionated at its own level and replaceable independently:
- Model — headless logic + events. No renderer/pixi import, fully unit-testable.
- Component — a
@yagejs/coreComponent the game spawns; bridges model events to entity events. The host owns focus and pause. - Presenters (renderer-backed addons only) — the visual layer, with a
default presenter, reachable through a
/presenterssubpath so the headless path never pulls a renderer. Headless addons (interaction, quests, steering, abilities, synth) ship none.
Available addons
Section titled “Available addons” Dialogue Branching dialogue runner, typewriter box & speech bubbles, inline markup, and swappable themeable presenters.
Virtual Controls Mobile touch overlay — virtual joystick + on-screen buttons that drive the action map, auto-shown on touch devices.
Inventory Slot-based inventory: stacking with per-item caps, item actions, sorting, transfers, and a themeable slot view with swappable icon/row cells.
Abilities Phase-based abilities and a concrete hit contract: combos, holds, cooldowns, hitboxes, projectiles, guards, health, and hit reactions.
Interaction Proximity-based 'walk up, see a prompt, press E' interaction — nearest-in-range focus selection and an interact event, headless and input-optional.
Quests Headless quest log: objectives, prerequisite chains, auto-complete rollup, and save round-trips — bind objectives to any addon's events with a one-line adapter.
Steering Steering (movement AI): seek, flee, arrive, wander, pursue/evade, obstacle avoidance, flocking, path-following, and containment — kinematic or driving a physics body on impulse drive.
Synth Procedural sound effects with no audio files: oscillators, noise, envelopes and filters as plain data, presets for the usual game cues, jingles, per-play variation, and seamless ambient loops.