Expand description
Resolve authoritative game states to gfx sprite mode_ids.
Structs§
- NpcPresentation
Input - Inputs for NPC wildlife presentation (keeps this crate free of sim types).
- Placed
NpcPresentation Input - Town / building NPCs — schedule + conversation.
- Player
Presentation Config - Player
Presentation Doc - Player
Presentation Input - Inputs for player presentation (keeps this crate free of sim types).
- Player
Sprite Presentation Input - Inputs for player sprite resolution.
- Sprite
Catalog - Index of all sprite sheets and their mode ids.
- Sprite
Sheet Modes - Mode ids for one sprite sheet.
- Wildlife
NpcPresentation Input - Inputs for wildlife / combat-driven NPCs (keeps this crate free of sim types).
Constants§
- NPC_
LEGACY_ BEHAVIOR_ ALIASES - Legacy behavior FSM ids still accepted in
sprite_modeswhen no canonical key matches. - NPC_
PRESENTATION_ STATES - Standard presentation keys shown in content-admin and used on the wire.
- PLAYER_
DIRECTIONAL_ BASE_ MODES - Movement modes that may have per-direction variants on a sprite sheet.
- PLAYER_
PRESENTATION_ STATES - Standard presentation keys shown in content-admin and used on the wire.
- RESOURCE_
PRESENTATION_ KEYS - Stable presentation keys for harvestable resource nodes (designer-facing).
- RESOURCE_
PRESENTATION_ KEY_ COOLDOWN_ LEGACY - Legacy key still accepted in item
sprite_modesYAML.
Functions§
- base_
sprite_ mode - Strip a directional suffix so stale server modes like
walk_northstill face correctly. Longer suffixes (_northeast) are matched before shorter ones (_north). - cardinal_
facing_ label - 8-way facing labels (N/NE/E/SE/S/SW/W/NW) for paperdoll and directional sheets.
- default_
player_ presentation_ path - default_
sprites_ dir - Resolve sprites directory from env, synced install cache, or repo checkout.
- eight_
way_ facing_ label - Bin continuous yaw into one of eight compass labels.
- expand_
directional_ draw_ mode - Expand a base gfx mode with client facing when the sheet has directional variants. Prefers 8-way labels, then falls back to 4-way for older PNG sheets.
- four_
way_ facing_ label - Legacy 4-way bin (N/E/S/W) — fallback when a sheet lacks 8-way cells.
- load_
player_ presentation - load_
player_ presentation_ default - load_
sprite_ catalog - Load sprite mode index from
dir(expectsmanifest.yaml+ sheet YAML files). - mode_
exists_ on_ sheet - True when
modeis on the sheet, or directional variants likewalk_northexist for basewalk. - npc_
presentation_ key - npc_
sheet_ alias - Canonical presentation key → first matching sheet mode id (shared with runtime resolve).
- placed_
npc_ presentation_ input - Build presentation input for placed (town/building) NPCs.
- player_
presentation_ input - presentation_
sheet_ mode_ ids - Mode ids used to validate presentation → sprite mode resolution.
- presentation_
validation_ mode_ ids - Mode ids used to validate an entity’s
sprite_modes(PNG sheet and/or baked paperdoll). - resolve_
farm_ growth_ sprite_ mode - Farm crop growth bands from sim (
grow_10…grow_100). Picks the requested stage when present on the sheet, otherwise the nearest lower stage, then common resource modes. - resolve_
npc_ sprite_ mode - Resolve gfx mode for an NPC view.
- resolve_
placed_ npc_ presentation_ key - resolve_
player_ presentation_ key - resolve_
player_ sprite_ mode - Resolve gfx mode for a player entity view.
- resolve_
resource_ sprite_ mode - Resolve gfx mode for a resource node view.
- resolve_
wildlife_ presentation_ key - resource_
presentation_ key - sheet_
has_ mode - True when
sheet_modescontainsmodeor a directional variant ({mode}_north, …). - validate_
sprite_ mode_ maps - Validate that every value in
sprite_modesexists on the sheet fortile_id. - validate_
sprite_ modes_ for_ presentation - Validate
sprite_modesvalues against PNG and/or paperdoll bake mode lists. - wildlife_
npc_ presentation_ input - Build presentation input for wildlife from sim context.
Type Aliases§
- Sprite
Mode Map - Presentation key → sprite sheet mode id (from item/NPC YAML
sprite_modes).