PlayerPrefs -> File.WriteAllText
Hockey Legends » Devlog
I am now saving the seasons' contents as local file using Unity's JSONUtility and File.WriteAllText, which should be managed by your web browser.
The pros and cons are obvious, and I should've done the switch MUCH earlier! I apologize for all lost seasons' data! It will not happen anymore.
PlayerPrefs
- Takes its toll on the framerate when saving lots of data (in this case, hockey teams with multiple players' bios and stats)
- Gets completely erased whenever a new build version is pushed to itch.io
File.WriteAllText
- Lightning-fast even when dealing with hundreds of player and team files
- Data is kept between build versions, providing proper management is made if there are data structure changes
- Much easier to implement, code-wise
DISCLAIMER: It is possible that changes are not immediately done on local drives after making changes. I have noticed making changes and reloading the page will sometimes discard changes. Make sure you play, or simulate, at least 1 game after some player or teams changes were made. I am sure the solution is simple on the client side; I am investigating.
Hockey Legends
Old time 5-vs-5 hockey with full season simulation and versus play
More posts
- 2D to 3DMay 14, 2023
- Player model, rig and animation WIPMay 10, 2023
- Going 3DApr 28, 2023
- Performance optimisation (accidental)Apr 08, 2023
- 32-Team SeasonsMar 16, 2023
- Hockey Legends player statsJan 24, 2023
- Onward to new things!Sep 29, 2022
- Playoffs + tweaks and improvements!Jul 28, 2022
- PostmortemOct 18, 2021
Leave a comment
Log in with itch.io to leave a comment.