Save system

This commit is contained in:
2025-12-01 11:41:47 +01:00
parent 8abe153c99
commit 9a2404fe0e
4 changed files with 22 additions and 40 deletions

View File

@@ -13,44 +13,15 @@
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "Welcome.md", "file": "Lore/The World.md",
"mode": "source", "mode": "source",
"source": false "source": false
}, },
"icon": "lucide-file", "icon": "lucide-file",
"title": "Welcome" "title": "The World"
}
},
{
"id": "40801921a07146e2",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Lore/Liora.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Liora"
}
},
{
"id": "518281623a6393f8",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Game Design/Focus System.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Focus System"
} }
} }
], ]
"currentTab": 2
} }
], ],
"direction": "vertical" "direction": "vertical"
@@ -219,18 +190,20 @@
"obsidian-git:Open Git source control": false "obsidian-git:Open Git source control": false
} }
}, },
"active": "642469d5b256e7da", "active": "768d071a2d742b85",
"lastOpenFiles": [ "lastOpenFiles": [
"WELCOME.md", "Assets/world_map.pdf",
"Game Design/Focus System.md", "Lore/The World.md",
"Timeline.canvas", "Assets/world_map.svg",
"Lore/Liora.md", "Lore/Liora.md",
"Lore/Sacred Forest.md", "Lore/Sacred Forest.md",
"Lore/Kestrel.md", "Lore/Kestrel.md",
"Lore/Grand Forest.md",
"Lore/Grand Lake.md", "Lore/Grand Lake.md",
"Lore/The World.md", "Lore/Grand Forest.md",
"Assets/world_map.pdf", "Game Design/SaveGame.md",
"Game Design/Focus System.md",
"WELCOME.md",
"Timeline.canvas",
"Assets/liora_front_back.jpg", "Assets/liora_front_back.jpg",
"Assets", "Assets",
"Lore/Liora/liora_front_back.jpg", "Lore/Liora/liora_front_back.jpg",

Binary file not shown.

9
Game Design/SaveGame.md Normal file
View File

@@ -0,0 +1,9 @@
The save system has to keep track of persistent variables for certain important entities, world flags and the location of dynamic objects in the world.
## Implementation
We create a class `SaveGame` that calls the `Save()` and `Load()` functions of all singleton systems in the game that implement them. Then the saving and loading is deferred to each component. The resulting dictionary data for each component is bundled in another dictionary that groups them under the component name.
It is unnatural to let this system actually define the variables used by all those various systems, and it is not a bother to implement this functionality either. For the player we will have to create a component that stores the persistent data.
World flags are managed by the world system, and they are saved to and from a dictionary as well.

View File

@@ -1,3 +1,3 @@
![[world_map.pdf]] ![[world_map.svg]]
The world is split up into five distinct regions. The world is split up into five distinct regions.