This implements a save/load system. I'm not positive whether I want to stick with this system or not for a few reasons:
It can be a little tedious/cumbersome to setup or confure a new node type. Not bad but could definitely use some improvements.
The save system uses the resource loader. This means the save files are substantially larger than if the system just used a custom JSON setup or something. For instance, the following is an example of the same system where we may only really need the type of node and position:
Add SaveLoadLevelDataComponent to world scene (this sets up the hotkeys, filepath, etc)
Create a new node type resource that describes what to save and what to do with saved data. These are saved within save_load/resources/node_types
Add SaveDataComponent to any entity that has data to save
Add the Node Type resource created in step 3 to the component export variables
## Overview
This implements a save/load system. I'm not positive whether I want to stick with this system or not for a few reasons:
1. It can be a little tedious/cumbersome to setup or confure a new node type. Not bad but could definitely use some improvements.
2. The save system uses the resource loader. This means the save files are substantially larger than if the system just used a custom JSON setup or something. For instance, the following is an example of the same system where we may only really need the type of node and position:
```
[ext_resource type="Script" path="res://save_load/resources/node_types/player_data_resource.gd" id="2_bxsj8"]
[ext_resource type="Script" path="res://save_load/resources/node_types/block_data_resource.gd" id="3_olss2"]
[ext_resource type="Script" path="res://save_load/resources/save_game_data_resource.gd" id="4_l0vj7"]
[sub_resource type="Resource" id="Resource_71kuc"]
script = ExtResource("2_bxsj8")
transform = Transform3D(0.667825, 0, 0.744303, 0, 1, 0, -0.744303, 0, 0.667825, 5.16755, 0.522701, 4.93366)
node_path = NodePath("/root/Root/World/Player")
parent_node_path = NodePath("/root/Root/World")
metadata/_custom_type_script = "uid://dodqpooodtguo"
[sub_resource type="Resource" id="Resource_wd064"]
script = ExtResource("3_olss2")
block_id = "001"
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10, 0, -10)
node_path = NodePath("/root/Root/World/BlocksContainer/Block")
parent_node_path = NodePath("/root/Root/World/BlocksContainer")
metadata/_custom_type_script = "uid://syaia0l6vjt1"
[sub_resource type="Resource" id="Resource_tceqr"]
script = ExtResource("3_olss2")
block_id = "002"
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10, 0, -9)
node_path = NodePath("/root/Root/World/BlocksContainer/@StaticBody3D@2")
parent_node_path = NodePath("/root/Root/World/BlocksContainer")
metadata/_custom_type_script = "uid://syaia0l6vjt1"
```
## How To Use
1. Add `SaveLoadLevelDataComponent` to world scene (this sets up the hotkeys, filepath, etc)
2. Create a new node type resource that describes what to save and what to do with saved data. These are saved within `save_load/resources/node_types`
3. Add `SaveDataComponent` to any entity that has data to save
4. Add the Node Type resource created in step 3 to the component export variables
Loading any time after the first load causes only some blocks to be loaded. Unclear the reason yet.
This should be fixed now
> 1 Outstanding Issue:
> * Loading any time after the first load causes only some blocks to be loaded. Unclear the reason yet.
This should be fixed now
ryanreed
changed title from WIP: Save/Load System to Save/Load System1 month ago
Overview
This implements a save/load system. I'm not positive whether I want to stick with this system or not for a few reasons:
How To Use
SaveLoadLevelDataComponent
to world scene (this sets up the hotkeys, filepath, etc)save_load/resources/node_types
SaveDataComponent
to any entity that has data to save1 Outstanding Issue:
This should be fixed now
WIP: Save/Load Systemto Save/Load System 1 month agoa736243e7b
.