Author Topic: JSON pilot files  (Read 6783 times)

0 Members and 1 Guest are viewing this topic.

Offline m!m

  • 211
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.

 

Offline PIe

  • 28
  • GTVA POLICE
    • freespace3.com
"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?
[6:23 PM] PIe: why do I have the feeling that I shouldn't be able to give orders to 22nd armored hq
[6:24 PM] Axem: 22nd armored hq, i order you to get me a cup of coffee
[6:24 PM] PIe: and donuts
[6:24 PM] PIe: BECAUSE THIS IS THE GTVA POLICE
[6:25 PM] Axem: :O
[6:25 PM] Axem: am i under arrest
[6:26 PM] [`_`]/: no, just please step out of the myrmidon
[6:26 PM] [`_`]/: you have so much to fred for

[9:50 PM] Sottises: wait did you do vassago's verge?
[9:50 PM] Sottises: .. dirge?
[9:50 PM] Axem: yes
[9:50 PM] Sottises: ohh
[9:50 PM] Sottises: well I have that and JAD too
[9:50 PM] Axem: :)
[9:50 PM] Sottises: what a contrast of themes lmao
[9:50 PM] Axem: isnt it
[9:51 PM] Axem: super grimdark thriller about unknowable alien intelligence and over the top colorful action about friendship
[9:51 PM] PIe: jad is grimdark???
[9:51 PM] Axem: :skull:

 

Offline m!m

  • 211
Yes, any progress made with these builds will not be saved in the old files.

 
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:
« Last Edit: January 11, 2018, 04:10:12 pm by tomimaki »

 

Offline m!m

  • 211
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:

 

Offline PIe

  • 28
  • GTVA POLICE
    • freespace3.com
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.
« Last Edit: February 04, 2018, 12:09:25 pm by PIe »
[6:23 PM] PIe: why do I have the feeling that I shouldn't be able to give orders to 22nd armored hq
[6:24 PM] Axem: 22nd armored hq, i order you to get me a cup of coffee
[6:24 PM] PIe: and donuts
[6:24 PM] PIe: BECAUSE THIS IS THE GTVA POLICE
[6:25 PM] Axem: :O
[6:25 PM] Axem: am i under arrest
[6:26 PM] [`_`]/: no, just please step out of the myrmidon
[6:26 PM] [`_`]/: you have so much to fred for

[9:50 PM] Sottises: wait did you do vassago's verge?
[9:50 PM] Sottises: .. dirge?
[9:50 PM] Axem: yes
[9:50 PM] Sottises: ohh
[9:50 PM] Sottises: well I have that and JAD too
[9:50 PM] Axem: :)
[9:50 PM] Sottises: what a contrast of themes lmao
[9:50 PM] Axem: isnt it
[9:51 PM] Axem: super grimdark thriller about unknowable alien intelligence and over the top colorful action about friendship
[9:51 PM] PIe: jad is grimdark???
[9:51 PM] Axem: :skull:

 

Offline m!m

  • 211
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.

 
Hi!

What's the current status with JSON pilot files? Can we expect them in a Nightly build soon?  :)

 

Offline m!m

  • 211
That code is already in the nightlies for some time and should be active by default.

 
That code is already in the nightlies for some time and should be active by default.

Ok, thx for the info!