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

Save files should only contain object IDs and user selections #94

Open
ghost opened this issue Aug 17, 2017 · 2 comments
Open

Save files should only contain object IDs and user selections #94

ghost opened this issue Aug 17, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 17, 2017

So a lot of people have created issues related to JSON pharsing errors, i have also run into this problem twice now.

The first time i ran into this error it coincided perfectly with a complete failure of my operating system which could only be resolved by formatting and reinstalling the OS, i did though have enough time to read about this issue.

I read that one possibility that could cause this to happen were that saving and loading the character ended up padding the JSON save file with so much redundant data that the JSON parser would run out of memory, so this second time i did not reload my character once until i was completely done with it.

Even with this precaution i ran into exactly the same parsing error including the error message that is visible in the save/load screen, an other thing i noticed was that when using the PDF button it seemed like i had so many implants that in ruined the formatting.

So in the end i think that one possibility is simply that it's possible to create a character which when converted to JSON is to big for standard allowed memory size to handle.

@ghost
Copy link
Author

ghost commented Aug 18, 2017

seems like the version i used was a year out of date

@ghost ghost closed this as completed Aug 18, 2017
@EmperorArthur
Copy link
Collaborator

I'm glad to hear your issue was resolved.

In general, I do need to re-work the save and load system. Right now everything is serialized and stored as JSON. Even things like the description text.

This was done for a good reason. In the program things like Implants are standalone objects that don't know anything about the database. Internally every single option is constructed as soon as you load the webpage. The save/load code is built in to each object. This means loading is just constructing an object from saved data without ever having to touch the database.

Importantly, only objects added to a character are saved. The more Implants, the larger the save file. So, the thing isn't massive.

There are some negatives though:

  • Any changes to an item in the database won't be reflected if you load a save with that item. You would have to remove it, then save again, then load that new save.
  • The saves are way too big compared to what they should be. There's no reason to save things like descriptions or calculated values.

@EmperorArthur EmperorArthur reopened this Aug 19, 2017
@EmperorArthur EmperorArthur changed the title Maybe possible to create character which JSON save becomes to big to load Remove descriptions from JSON save code Aug 19, 2017
@EmperorArthur EmperorArthur changed the title Remove descriptions from JSON save code Save files should only contain object IDs and user selections Aug 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant