Summary
Persist active combat sessions to YAML so they survive server crashes/restarts. Save on each turn change, restore on server startup.
Phase: Post-MVP Combat Enhancement
Systems: Combat System, Persistence
Prerequisites
Goals
- Save combat state to YAML on each turn transition
- Restore active combat sessions on server startup
- Clean up save files when combat ends normally
- Handle offline players/entities gracefully during restoration
Save Location
plugins/jkvttplugin/CombatSessions/<session_id>.yml
YAML Schema
session_id: "uuid"
dm_id: "uuid"
round_number: 3
current_turn_index: 2
is_setup_phase: false
combatants:
- id: "player-uuid"
type: PLAYER
display_name: "Aragorn"
base_name: "Aragorn"
initiative: 18
initiative_bonus: 3
is_surprised: false
is_hidden: false
is_unconscious: false
is_dead: false
Implementation Notes
- TurnState is NOT persisted (turn restarts fresh after crash)
- Need
Combatant.fromSavedData() factory for lightweight reconstruction without live Player/Entity
- Save triggered in
CombatSession.nextTurn() after advancing
- Delete save file in
CombatSession.endCombat()
- Load all on plugin enable, register in static maps
Related Issues
Summary
Persist active combat sessions to YAML so they survive server crashes/restarts. Save on each turn change, restore on server startup.
Phase: Post-MVP Combat Enhancement
Systems: Combat System, Persistence
Prerequisites
Goals
Save Location
plugins/jkvttplugin/CombatSessions/<session_id>.ymlYAML Schema
Implementation Notes
Combatant.fromSavedData()factory for lightweight reconstruction without live Player/EntityCombatSession.nextTurn()after advancingCombatSession.endCombat()Related Issues