Testing of JSONSerialise is progressing.
I spent a while chasing an issue that turned out to be in the development environment. In some circumstances, pioneer was crashing after a game was saved and then "return to game" clicked (unhandled exception in widget mouse click). I have to execute the release "pioneer.exe" itself (not from Visual Studio "run" command) otherwise I get the crashes. Might work executing the debug "pioneer.exe", I've only tried release. Don't know if this happens on other platforms.
I created a new branch from upstream and found that the crashes happen there too.
To reproduce the crash:
Start at Earth, launch, select 'set speed' thruster control, target Tranquility Base, engage autopilot to land, switch to rear view, wait until 100,000m altitude, save game and click 'return to game'.
Probably don't need to do all that, but that's the recipe I followed to reproduce the crash.
Everything working so far :) The following data has been tested: pilot, ship, navigation, position, speed, autopilot.
Found one bug in SpaceStation::SaveToJson. I've pushed an updated JSONSerialise branch to github: https://github.com/nick-the-ninja/pione ... NSerialise
I'll send a PR when I've done enough testing to cover all aspects of savegame data.
Thanks to the developers! (& suggestion for savegames)
Re: Thanks to the developers! (& suggestion for savegames)
So far so good :)
I've submitted a PR. I've tested a fair bit now, but still need to test some more galaxy persistent stuff.
I've found several issues (not really bugs, they may even be features) that turn out to also occur in Pioneer upstream build.
Apologies for making a mess of the last PR. I'm comfortable with git now :) Although I still haven't learned winmerge (I guess I will when I have to!)
The JSON project could really benefit from testing by more experienced developers and players, who know the features of Pioneer well.
The basic features of the game save and load correctly. One thing I haven't been able to verify yet, is persistent system data (PersistSystemData) which save an array of "dict" items (which I've read as "dictionary"). They are used in the galaxy data, but always contain no data, except one which contains an empty array (explored systems). A visual inspection of a JSON save file will show this. I've spent a while flying around a system trying to get a confirmed "explored system", but no luck so far, so I don't know if it works - it should do though :)
Political data also saves "dict" items, but they are all empty here too. A criminal record is created though (in "crime_record" array) when I shoot at a station :)
Here are the issues I've found:
(1) Sometimes text is wrapped for no apparent reason, and the lower (wrapped) line clashes with the line below.
Also occurs on Pioneer upstream build (but less often?)
For example, press F4 Nav in Proxima Centauri - 'Osborn Town' has 'Town' written below, and clashes with line below.
Also seen it happen in economic screen (but not yet in Pioneer upstream).
(2) Sometimes, after a save and load, the 'Laser Fire Detected' warning occurs. Can't cancel it, so can't accelerate time.
This one is a bug. Also happened once in Pioneer upstream (takes ages to get it to happen, and re-saving/loading clears it I think, so not too nasty).
(3) When hyperspace cloud is targetted, press escape twice, and "Hull Integrity" and "Shield Integrity" appear at the top right of the screen.
Occurs in Pioneer upstream.
(4) Navigation 'systems view' (F2) - sometimes the four buttons (lower left) overlap each other - recovers easily by selecting another system.
Occurs for Pioneer upstream, but not for Pioneer release as download to play - so must be a development environment issue.
I apologise in advance if any of the issues above are actually caused by the JSON code, and affect my running of Pioneer upstream build due to some caching somehow? I don't think so though. I ensure I clean MSVC before exiting and switching to another branch without the JSON code.
I expect it'll be a while before JSONSerialise is pulled into upstream, so I'll keep it up to date with any changes, and I'll learn winmerge if needed :)
To summarise: The JSON code saves exactly the same data as original serialisation, so provided no structural deviations occur, this should just work exactly as before - except that the save file is a JSON text file (easier to work with, and much more robust to changes in save-data).
https://github.com/pioneerspacesim/pioneer/pull/3355
I've submitted a PR. I've tested a fair bit now, but still need to test some more galaxy persistent stuff.
I've found several issues (not really bugs, they may even be features) that turn out to also occur in Pioneer upstream build.
Apologies for making a mess of the last PR. I'm comfortable with git now :) Although I still haven't learned winmerge (I guess I will when I have to!)
The JSON project could really benefit from testing by more experienced developers and players, who know the features of Pioneer well.
The basic features of the game save and load correctly. One thing I haven't been able to verify yet, is persistent system data (PersistSystemData) which save an array of "dict" items (which I've read as "dictionary"). They are used in the galaxy data, but always contain no data, except one which contains an empty array (explored systems). A visual inspection of a JSON save file will show this. I've spent a while flying around a system trying to get a confirmed "explored system", but no luck so far, so I don't know if it works - it should do though :)
Political data also saves "dict" items, but they are all empty here too. A criminal record is created though (in "crime_record" array) when I shoot at a station :)
Here are the issues I've found:
(1) Sometimes text is wrapped for no apparent reason, and the lower (wrapped) line clashes with the line below.
Also occurs on Pioneer upstream build (but less often?)
For example, press F4 Nav in Proxima Centauri - 'Osborn Town' has 'Town' written below, and clashes with line below.
Also seen it happen in economic screen (but not yet in Pioneer upstream).
(2) Sometimes, after a save and load, the 'Laser Fire Detected' warning occurs. Can't cancel it, so can't accelerate time.
This one is a bug. Also happened once in Pioneer upstream (takes ages to get it to happen, and re-saving/loading clears it I think, so not too nasty).
(3) When hyperspace cloud is targetted, press escape twice, and "Hull Integrity" and "Shield Integrity" appear at the top right of the screen.
Occurs in Pioneer upstream.
(4) Navigation 'systems view' (F2) - sometimes the four buttons (lower left) overlap each other - recovers easily by selecting another system.
Occurs for Pioneer upstream, but not for Pioneer release as download to play - so must be a development environment issue.
I apologise in advance if any of the issues above are actually caused by the JSON code, and affect my running of Pioneer upstream build due to some caching somehow? I don't think so though. I ensure I clean MSVC before exiting and switching to another branch without the JSON code.
I expect it'll be a while before JSONSerialise is pulled into upstream, so I'll keep it up to date with any changes, and I'll learn winmerge if needed :)
To summarise: The JSON code saves exactly the same data as original serialisation, so provided no structural deviations occur, this should just work exactly as before - except that the save file is a JSON text file (easier to work with, and much more robust to changes in save-data).
https://github.com/pioneerspacesim/pioneer/pull/3355