Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving and loading game takes too long #42

Open
DavidFidge opened this issue Apr 3, 2023 · 2 comments
Open

Saving and loading game takes too long #42

DavidFidge opened this issue Apr 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@DavidFidge
Copy link
Owner

DavidFidge commented Apr 3, 2023

#41 fixed load game prompt speed. However actually performing a save game and load game is slow.

Most of the current problems are in the Monsters where it must serialize a large list of seen tiles. This means it will get worse as more levels are added to the game.

Writing a custom serializer for serializing map-related data such as map tile information, monster seen tiles etc should help:
https://www.newtonsoft.com/json/help/html/Performance.htm

Another thing to try would be to use BSON which would mean ints etc won't have to be converted to strings, though I doubt this is where the performance problems are:
https://www.newtonsoft.com/json/help/html/SerializeToBson.htm

@DavidFidge DavidFidge added the enhancement New feature or request label Apr 3, 2023
@DavidFidge
Copy link
Owner Author

DavidFidge commented Apr 3, 2023

Tried BSON as it was a very quick change to do and test. The performance isn't much better. Plus it does not support unsigned 64 bit ints.

Will need to try custom serialisation.

@DavidFidge
Copy link
Owner Author

DavidFidge commented Apr 3, 2023

code for BSON is on branch 'saveload' in DavidFidge/FrigidRogue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant