/mud-learning

Simple project to get familiar with MUD internals

Primary LanguageTypeScriptMIT LicenseMIT

Tables

  • Player { brainId: ResourceId, x: uint256, y: uint256}: player data, brainId points to the Brain system that "controls" the player
  • PlayerIndex { index: uint256, brainId: ResourceId }: index => player
  • PlayerCount: uint256: tracks the number of players
  • Tick { systemId: ResourceId, updatedAt: uint256 }: keeps track of the last time the tick function was called in each registered system

Systems

  • PlayerSystem: spawns new players and allows brains to run actions on their respective players.
  • TickSystem: allows registering systems and then batch calling multiple systems through their tick functions.
  • BrainRandom: moves its player randomly.

Limitations

  • Brain ticks are open, they should be only called by the Tick system.
  • For now, players just move around.
  • The Tick system is simple, only allows calling each tick once per block.