Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: T-Man on October 06, 2010, 05:57:18 pm

Title: What causes the mod change pilot problems?
Post by: T-Man on October 06, 2010, 05:57:18 pm
Hey, this isn't a bug report or anything, just wanted to ask really; Does anyone actually know what causes the problems that mean people need to have a pilot for each mod?

The big reason for me being interested is essentially a guilty admission; against all advice, for the vast majority of the time i've used FSOpen i've run a single pilot file for all my campaigns; WiH was the only campaign where i use a different pilot :nervous:. I do this because I've actually never suffered any problems with it; i even change from one mod to another and back again and been able to continue the campaigns from where i left off, which i like as i don't have to constantly swap pilots to change campaigns. Only once a few years ago did i ever have an error that i think was down to this practice (i think in that case the "total ship skills by player" list in the pilot stats, which put in "-"s for ships that arn't in the currently running mod, went over the ship limit and so started crashing).

So yeah just curious really
Thanks
Tom

(For the record, yes i do apologise for going against advice by doing this, and the day i do jinx it, and my pilot file crashes FSOpen then melts my desktop i'll be sure to let you all know so you can laugh at the irony :lol:).
Title: Re: What causes the mod change pilot problems?
Post by: General Battuta on October 06, 2010, 05:59:28 pm
Whatever the issue is, it's gonna be fixed soon.
Title: Re: What causes the mod change pilot problems?
Post by: The E on October 06, 2010, 06:03:58 pm
The problem is that the pilot file is, shall we say, badly designed. It holds a plethora of information without adequate safeguards to prevent overflows in places, meaning that one piece of malformed data can have second- or third order effects on the game, in places that, on the surface, don't seem to be connected to the pilot file.

Then there's the fact that the pilot file is opened, written to, read from and closed again rather often, with each write operation being potentially dangerous.
The rewrite that will come in the next version of FSO will address and fix these issues.
Title: Re: What causes the mod change pilot problems?
Post by: Goober5000 on October 06, 2010, 11:50:09 pm
I haven't run into those issues much; in my experience they're rather rare.  The more frequent and usual problems comes from switching mods when in the middle of campaigns.  This is primarily because the pilot file uses indexes to keep track of things, so it will say that your loadout requires the fifth weapon in weapons.tbl, or that you are authorized to fly the 19th ship in ships.tbl.  It becomes immediately obvious when one mod's 19th ship is different from another mod's 19th ship, and it really becomes a problem if the different ships happen to have different subsystems or are of different classes.
Title: Re: What causes the mod change pilot problems?
Post by: Mongoose on October 07, 2010, 01:10:40 am
Just like T-Law, I've used mostly the same pilot myself for a long time now, and I've never run into corruption issues with it; as Goober noted, though, I don't make a habit of switching campaigns/mods before finishing my current one.  I did make a few clones for FSPort and BP purposes, just to be on the safe side, but I feel like I probably would have been safe regardless.  It'll be nice to see the new pilot code finally hit the builds, as that standing advice to start new pilots has kind of neutered the whole campaign file system.