Skip to main content

What Are Subsystems?

Subsystems are optional tools. Use only what your game needs. This is the core platform framing:
  • your game logic stays yours,
  • Crafty subsystems provide multiplayer/platform primitives.

Teams

Methods:
  • create(team_id: String, config: Dictionary) -> void
  • assign(player, team_id: String) -> bool
  • remove_player(player) -> void
  • get_team(player) -> String
  • get_members(team_id: String) -> Array
  • auto_balance() -> void

Score

Methods:
  • add(player, points: int) -> void
  • set_score(player, points: int) -> void
  • get_score(player) -> int
  • get_leaderboard() -> Array
  • add_team(team_id: String, points: int) -> void
  • get_team(team_id: String) -> int

Data

Persistent player data:
Methods:
  • save(player, key: String, value: Variant) -> void
  • load(player, key: String) -> Variant
  • load_all(player) -> Dictionary
  • delete(player, key: String) -> void

Economy

Methods:
  • get_balance(player) -> int
  • award(player, amount: int, reason: String) -> bool
  • spend(player, amount: int, reason: String) -> bool
  • has_balance(player, amount: int) -> bool

UI

Optional helper UI. Creators can still build fully custom UI.

Audio

Input

Crafty.input and per-player player.input provide server-readable control state. Use server-authoritative checks for outcomes.

Signals (Gameplay Events)

Connect game logic to platform gameplay signals:
Available signals:
  • player_killed
  • player_damaged
  • player_respawned
  • timer_expired
  • object_collected
  • npc_killed
  • return_to_hub_requested
  • play_again_requested

Production Notes

  • Connect/disconnect signals in predictable lifecycle points.
  • Keep score/data/economy mutations on server paths.
  • Treat UI/audio helpers as optional convenience, not hard dependencies.