Open herobank110 opened 3 years ago
I'm interested in trying to do this and if everything goes well, also in opening a PR during Hacktoberfest. :)
Hi, thanks for your interest!
Let me elaborate in the issue. It is for a data saving and loading mechanism for games, such as the last checkpoint, player name, high score, etc.
I was thinking of 2 new functions: saving function - input: dictionary to save, slot name, output: whether the save was successful loading function - input: slot name, output: dictionary of saved values, or None if the slot couldn't be loaded If you have other suggestions please let me know.
A good place for this would be as static methods of GameplayUtilities, under factorygame/utils/gameplay.py
My initial idea was to have a SaveGame class to add fields to in a derived class, so you could have autocomplete on the loaded save game object, but this should be a separate issue.
I was thinking about the same approach of two new functions to save and load. I really want to work on this challenge, I found your project very interesting =)
Thanks. I assigned you to the issue!
hello, sorry for the lack of news. this week I start working on this problem :)
can i use any library?
what library were you thinking of using?
some library like Pickle
Certainly, anything in the standard library is fine. Other libraries might be difficult to link as the package doesn't currently have a setup.py. If you do use pickle please consider Protocol version 3 which is compatible with python 3.2, the oldest version of python currently supported by this project.
Do you think about supporting python 3.7+ in this application?
This is what I'm doing:
In the save / create method, I check if the folder containing the savegame exists, if it does not exist, it is created. In order not to have problems with overwriting files, I think of using a standard name like "savegame_nowtimestamp.dat". In the load method, I think about checking if the file you want exists, and if it exists, I load the data. In both cases, a message will be sent to the user if the action was successful or not.
If you are dissatisfied with any of the steps above, tell me and I will do it the way you think is ideal. :smile:
I'm having a little trouble finding where to collect the data to be saved on the savegame.
Great work! Sounds like you have a lot of functionality.
I have a few ideas for you:
The data that should be saved you have two options:
I definitely want to support python 3.7+. Someday I will drop 3.2 support and make 3.6 the oldest supported.
Sorry! I had some issues with my OS and I ended up losing progress before I could commit. I'll start over.
SaveGame objects with serialisable properties that can be saved and loaded into save slots