Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: m!m on January 10, 2018, 04:19:52 am

Title: JSON pilot files
Post by: m!m on January 10, 2018, 04:19:52 am
Currently, FSO uses a binary file format for storing the pilot data. While this format is quite space efficient it is absolutely unreadable for someone without a hex editor. A while back I made some changes to the pilot code which made it possible to write the pilot data in the much more readable JSON format. That made it easier to debug issues but the code was not able to read this format when the game was started the next time. That is what these changes implement. The builds below are able to use JSON for loading and storing the pilot data. "Old" binary pilots will be converted when FSO is started for the first time so you will not lose any progress if you use these builds.

Test builds for all platforms: http://swc.fs2downloads.com/builds/test/jsonPilots/
Pull request with changes: https://github.com/scp-fs2open/fs2open.github.com/pull/1267

To test these builds all you have to do is run FSO with them and try some stuff that involves the pilot data like continuing a campaign. I want to make sure that the common operations definitely work before this gets merged into the master branch.
Title: Re: JSON pilot files
Post by: PIe on January 10, 2018, 12:29:50 pm
"Old" binary pilots will be converted when FSO is started for the first time so you will not lose any progress if you use these builds.
Does this mean that any campaign progress made with this build will be lost if I switch back to a regular one, ie I'll be back at the point where I switched builds?
Title: Re: JSON pilot files
Post by: m!m on January 10, 2018, 12:31:10 pm
Yes, any progress made with these builds will not be saved in the old files.
Title: Re: JSON pilot files
Post by: tomimaki on January 11, 2018, 03:42:11 pm
In normal build last played pilot is at the top. In this not.
Minor thing but I got used to it :P

Ok, now this is weird. I did few mission in main campaign on this build then switch back to normal build and I see these missions are done :confused:
Title: Re: JSON pilot files
Post by: m!m on January 11, 2018, 04:31:38 pm
In normal build last played pilot is at the top. In this not.
Minor thing but I got used to it :P
I just checked and for me the last played pilot appears at the top of the list :doubt:
Title: Re: JSON pilot files
Post by: PIe on February 04, 2018, 11:13:01 am
With this build, under one circumstance I need to reselect the campaign each time I launch FSO.
Steps to repro are:
Play a mission that advances you in the campaign; change pilot settings (I changed difficulty); play another mission that advances the campaign; restart FSO.  It will tell you that you need to select a campaign.
Title: Re: JSON pilot files
Post by: m!m on February 05, 2018, 11:47:14 am
I found an issue where the old binary pilots were always being converted to their JSON version even though the JSON version already existed which would explain why changing your settings would not be saved. The builds from the first post contain a fix which should resolve that issue.
Title: Re: JSON pilot files
Post by: Lykurgos88 on November 16, 2019, 01:26:14 pm
Hi!

What's the current status with JSON pilot files? Can we expect them in a Nightly build soon?  :)
Title: Re: JSON pilot files
Post by: m!m on November 16, 2019, 02:06:15 pm
That code is already in the nightlies for some time and should be active by default.
Title: Re: JSON pilot files
Post by: Lykurgos88 on November 16, 2019, 03:24:54 pm
That code is already in the nightlies for some time and should be active by default.

Ok, thx for the info!