zuelong / save-the-spire

A save editor for the game Slay the Spire
16 stars 13 forks source link

Make editor work with current version of the game #29

Open girtonman opened 5 years ago

girtonman commented 5 years ago

After doing some troubleshooting, it looks like the main issue that was causing it to crash was that the seed for the save was too big for a js float, so it was being rounded. For example:

  "seed": 1461819000922140955,

was being rounded to

  "seed": 1461819000922141000,

This would cause the game to crash when the map gen for the rounded seed would conflict with the map position info in the save file.

Adding lossless-json solves this issue pretty easily. I did some very simple testing and the tool seems to be working again with this fix.

girtonman commented 5 years ago

Closes the following issues:

25 #27 #28

zuelong commented 5 years ago

Wow! Thanks so much for digging and looking into this! I'll be sure to get this deployed and maybe add some CI so I can stop doing manual deploys 😅

girtonman commented 5 years ago

I've also been messing around with it and found a couple minor changes that need to be made to handle the new LosslessNumber type.

Throughout a day of testing and using it, I'm feeling even more confident in this fix.

I'm in the process of adding all of the new cards/relics to CardsJSON and RelicsJSON. Would you like me to shoe-horn them into this PR or make a new one for that? There are about 90 cards that need to be added. 😮 I haven't figured out how many relics yet though, but that should hopefully be a shorter list.

girtonman commented 5 years ago

Resolved all feedback and also made a small fix to handle the fact that the value of upgrades can be a number of a LosslessValue depending on its source (file upload or card selector),

girtonman commented 5 years ago

Also moved the changes I was talking about for CardsJSON and RelicsJSON to another branch that I can make a PR for once this one is wrapper up.