2.6 KiB
2.6 KiB
Dungeon Tile System Overhaul (Plan)
Goal: Unify live dungeon editor, Builder, and TileMaps around a shared tile metadata model that supports decoration overlays and animation behavior.
Tile Types
- Floor: base walkable tile.
- Wall: base blocking tile.
- Decoration: overlay tile that does not modify underlying base tile properties.
Tile Properties (Base)
type: floor | wall | decorationisStatic: bool (static vs animated)blocksLos: boolblocksProjectiles: boolinteractable: bool
Tile Properties (Animation)
Only if isStatic = false:
frames: ordered list of frame indices (from the same sheet)frameRate: float (fps) orframeDurationMs(pick one)trigger:tick|interactionendBehavior:reset|loop|stopreset: return to frame 0 and stoploop: continuously loopstop: stop on last frame
finalFrameOverrides(optional):- Properties that change when animation ends, e.g.
blocksLos,blocksProjectiles,walkable,interactable
- Properties that change when animation ends, e.g.
Apply Scope
scope = tile_instance(this placement only)scope = tile_type(all tiles with this sprite definition)
Data Model (Draft)
Shared metadata should be stored once and used by:
- Live editor (runtime overrides)
- Builder (authoring time)
- TileMaps (definition time)
Proposed entities:
TileDefinition(global): sheetId + frameIndex + base properties + animation settingsTileInstanceOverride(per placement): overrides for base/animation propsDecorationLayer(per placement): optional overlay(s) with own definition and properties
UI Flow (Live Editor)
- Mode toggle: View | Edit
- Tile Picker enabled only in Edit
- Select Sheet ? Select Tile(s)
- Show "Tile Properties" panel
- Choose Apply Scope: This Tile Only / All Tiles of This Type
- For Animated:
- select frames
- trigger (interaction/tick)
- endBehavior (reset/loop/stop)
- optional final frame overrides
Builder + TileMaps
- Should surface the same Tile Properties UI and write to the same tables/JSON
- Decoration tiles must be placeable on top of base tiles without changing base
DungeonSimulation Impact
- Must resolve base tile + decoration layers into:
- walkability
- LOS blocking
- projectile blocking
- interactability
- Animated tiles with end behavior + final overrides must update tile state at runtime
- e.g. door animation ends ? walkable = true, blocksLos = false
Open Questions
- Should
frameRatebe global per definition or per instance? - Should decoration tiles participate in collisions (default: no)?
- Do we allow multiple decorations per tile? If yes, define max layers.