Open theludovyc opened 1 week ago
Nice idea @theludovyc , but you don't need to make file name format like YYMMDDhhmmss,
you can just use FileAccess.get_modified_time()
for this.
Second it should be just .json
as those are easy to hack, they should be .save
and a Resource.
And they sould be saved using for example FileAccess.open_encrypted_with_pass()
@Jeremi360 Why do you want to handle it as a Resource instead of a Json format ?
Why do you want to encrypt the save file ? If the player want to corrupt it, that is his problem, do not you think ?
@theludovyc
Why do you want to handle it as a Resource instead of a Json format ?
Becouse Resouces can be write to binary format.
Why do you want to encrypt the save file ? If the player want to corrupt it, that is his problem, do not you think ?
I didn't look at it that way, I just thogut that devs don't want player to corrupt save files.
But if you feel that this binary/encrypted way is not so obvious, then we should give developers a choice for example a setting in ProjectSettings.
@Jeremi360
Becouse Resouces can be write to binary format.
So it is rely to the fact of file encryption.
I didn't look at it that way, I just thogut that devs don't want player to corrupt save files.
In my opinion, you want to encrypt the file when you make online multiplayer games or cash things (dlc, microtransactions, ...). For the other scenario, if the player modify is save file, it will broke his game and that is all.
okay if you say so after all RTG is more your project then mine.
We can take inspiration from renpy https://www.renpy.org/doc/html/_images/slot_save.jpg and cyberpunk 2077 https://www.gry-online.pl/Galeria/html/pliki/551069390.jpg
Handle saves in JSON format
Save a screenshot and timestamp
The name of the file can be YYMMDDhhmmss.json
We can use the user:// folder to save the file in like
user://saves/YYMMDDhhmmss.json
The func to save should be generic like
save(data:JSON)
orsave(data:Dictionary)
, so users can save their own data