View Issue Details

IDProjectCategoryView StatusLast Update
0002932FSSCPPilot datapublic2014-08-23 03:37
ReporterLorric Assigned Toniffiwan  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionreopened 
Product Version3.7.0 
Target Version3.7.2 
Summary0002932: Pilot file conversion failures
DescriptionCompleted campaign missions are unavailable in the techroom with these pilot files on 3.7.0.

Apologies if you didn't like what I chose for the Severity and Priority fields, I didn't know what to put, especially the Severity field. I haven't done one of these before.
Steps To ReproduceSimply go to the techroom and try to play campaign missions. There is no data.
Additional InformationDeletion of .plr and .csg files has been tried. It worked on 7 of my pilot files, but not these other 15.

I think most of the pilots are from well known mods. They are all named after the campaign they play.

Of course if you have any trouble figuring out what any of them are, just ask.

There are just three that I wouldn’t be surprised if you didn’t know them:

http://www.freespacemods.net/download.php?view.36
http://www.freespacemods.net/download.php?view.37
http://www.hard-light.net/forums/index.php?topic=56156.0
TagsNo tags attached.

Activities

Lorric

2013-10-13 00:10

reporter  

Failed Pilots.rar (141,943 bytes)

kv1at3485

2014-06-07 16:41

reporter  

players.tar.gz (102,654 bytes)

kv1at3485

2014-06-07 16:41

reporter   ~0015815

Last edited: 2014-06-07 16:41

I've added the contents of my /data/players directory as additional data. The pilot data attached works in 3.6.18. Neither 3.7.0 nor 3.7.2 RC2 converts the data correctly.

3.7.0 and 3.7.2 RC2 creates a new player file for "M Lam" but with all stats, medals, and ranks zeroed out. Single player pilot image and squadron logo are preserved.

niffiwan

2014-06-13 04:13

developer   ~0015853

Last edited: 2014-06-13 11:09

Another issue reported on the forums: http://www.hard-light.net/forums/index.php?topic=87443.msg1752361#msg1752361

Issue is the -1 index check for red-alert weapons added in r9630. Avoiding -1 indexes into arrays is good, unfortunately I'm pretty sure that -1 is a valid red-alert weapon denoting "no weapon in this slot". So the check will need to be altered to accept a -1 as valid while avoiding using it as an array index.

edit: this issue fixed in r10801

MageKing17

2014-06-13 14:41

developer   ~0015855

r10801 doesn't actually avoid a -1 array index; should probably have added a "i >= 0" condition to that "else" branch.

niffiwan

2014-06-14 02:40

developer   ~0015856

Thanks - fixed in r10803

Goober5000

2014-06-29 23:08

administrator   ~0015939

This is actually fixed, so marking it as such.

niffiwan

2014-06-30 08:14

developer   ~0015960

Unfortunately I can only confirm one of the many issues reported has been solved. The existing patch may have fixed all the reported issues, but I (or someone else :7) needs to test all the provided test cases to make sure of that.

niffiwan

2014-08-17 12:03

developer  

mantis2932b.patch (771 bytes)   
diff --git a/code/pilotfile/csg_convert.cpp b/code/pilotfile/csg_convert.cpp
index c2de4b4..9369fd2 100644
--- a/code/pilotfile/csg_convert.cpp
+++ b/code/pilotfile/csg_convert.cpp
@@ -443,6 +443,8 @@ void pilotfile_convert::csg_import_red_alert()
 				throw std::runtime_error("Data check failure (RedAlert-weapon)!");
 			} else if (i >= 0) {
 				weapons.index = csg->weapon_list[i].index;
+			} else {
+				weapons.index = -1;
 			}
 
 			weapons.count = cfread_int(cfp);
@@ -461,6 +463,8 @@ void pilotfile_convert::csg_import_red_alert()
 				throw std::runtime_error("Data check failure (RedAlert-weapon)!");
 			} else if (i >= 0) {
 				weapons.index = csg->weapon_list[i].index;
+			} else {
+				weapons.index = -1;
 			}
 
 			weapons.count = cfread_int(cfp);
mantis2932b.patch (771 bytes)   

niffiwan

2014-08-17 12:04

developer   ~0016233

Last edited: 2014-08-20 02:07

another bug found and squashed, but there's still more in there...

edit: and another issue resolved, still checking through the rest of the pilots

niffiwan

2014-08-20 09:57

developer   ~0016241

OK - I've finally gone through most of the supplied pilots. With the two fixes now attached to this ticket, the majority of them convert correctly. In all cases possible I've compared the pilot with 3.6.18 and confirmed that the campaign progress, stats, medals and cutscenes are the same (except where noted)

Details for Lorric's pilots:

Nordera Day.AND.cs2 OK
Nordera Day.pl2 OK

Freespace 1.freespace.cs2 OK
Freespace 1.pl2 OK
CUTSCENE NOK - but missing from original pilot as well

Cardinal Spear.cs.cs2 OK
Cardinal Spear.pl2 OK

Cardinal Spear Vega.csv.cs2 OK
Cardinal Spear Vega.pl2 OK

Vassagos Dirge.pl2 OK
Vassagos Dirge.VassagosDirge.cs2 OK

Derelict.Derelict.cs2 OK
Derelict.pl2 OK
(can't check with 3.6.18 as only have Derelict 3.7.0)
(presume everything else is OK)

Silent Threat Reborn.pl2 OK
Silent Threat Reborn.str.cs2 OK

Blue Planet Aquarius.bp.cs2 OK
Blue Planet Aquarius.pl2 OK
(doesn't convert because mod pack is now different)
(Ship name changed from UEFg Karuna to UEFg Karuna#AOA)
(I'd guess that this will convert if you have the old mod version)

Homesick.Homesick.cs2 OK
Homesick.pl2 OK

Incursion.Incursion.cs2 OK
Incursion.pl2 OK
(stats broken, but were broken in 3.6.18 as well)

Return to Sol.pl2 OK
Return to Sol.Return.cs2 OK

Unification War.pl2 OK
Unification War.Unification War.cs2 OK

What If - AGW.pl2 OK
What If - AGW.WhatIf_AnotherGreatWar.cs2 OK

Wings of Dawn 1.pl2 OK
Wings of Dawn 1.WingsOfDawn.cs2 OK
Invalid ship Ray MkIV was in pilot but not in the mod
Converts OK if pilot is selected in 3.6.18 prior to conversion (which removes the Ray MkIV)

Freespace 2.FreeSpace2.cs2 OK
Freespace 2.pl2 OK
Kills are missing in both 3.6.18 and 3.6.12 and confirmed that kills data is missing from the cs2 completely (not sure how that happened)


=========================================================================================

Details for kv1at3485's pilots:

Unfortunately most of the campaign files here are too old. The conversion process only supports the .cs2 format (2 files), the rest of the campaign saves are .csg and .css. In order to convert them I suggest that you open the pilot with 3.6.18 and the relevant modpack installed and see if that correctly converts the campaign saves to the .cs2 format. If this works, then you should be able to run 3.7.0 with the correct campaign selected in order to convert to the 3.7.0 format (.csg again)

For the 2x .cs2 files:
M Lam.EACampaign4.cs2
I don't know what mod this is from so I can't test it. If you let me know what it is I can give it a go.

M Lam.FreeSpace2.cs2
This one converted OK

niffiwan

2014-08-20 10:00

developer  

mantis2932c.patch (2,222 bytes)   
commit 56b0fb87b2d0c85ff3ca570ea0a5a44fa666d0f9
Author: niffiwan <niffiwan.scp@gmail.com>
Date:   Tue Aug 19 21:33:04 2014 +1000

    Partial fix for mantis 2932
    
    Convert viewed cutscenes

diff --git a/code/pilotfile/csg_convert.cpp b/code/pilotfile/csg_convert.cpp
index 9369fd2..209af62 100644
--- a/code/pilotfile/csg_convert.cpp
+++ b/code/pilotfile/csg_convert.cpp
@@ -12,6 +12,7 @@
 #include "stats/medals.h"
 #include "cfile/cfilesystem.h"
 #include "menuui/techmenu.h"
+#include "cutscene/cutscenes.h"
 
 #include <iostream>
 #include <sstream>
@@ -1102,6 +1103,34 @@ void pilotfile_convert::csg_export_variables()
 	endSection();
 }
 
+void pilotfile_convert::csg_export_cutscenes() {
+	SCP_vector<cutscene_info>::iterator cut;
+
+	startSection(Section::Cutscenes);
+
+	// convert the old int bitfield to the new vector
+	// the 32 is the size-in-bits of the old int on all platforms
+	// supported by FSO prior to 3.7.0
+	size_t size = Cutscenes.size();
+	size_t viewableScenes = 0;
+	for (size_t j=0; j<size && j<32; ++j) {
+		if ( csg->cutscenes & (1<<j) ) {
+			Cutscenes.at(j).viewable = true;
+			viewableScenes++;
+		}
+	}
+
+	// output cutscene data in new format
+	cfwrite_uint(viewableScenes, cfp);
+
+	for(cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut) {
+		if(cut->viewable)
+			cfwrite_string_len(cut->filename, cfp);
+	}
+
+	endSection();
+}
+
 void pilotfile_convert::csg_export()
 {
 	Assert( cfp != NULL );
@@ -1122,7 +1151,7 @@ void pilotfile_convert::csg_export()
 	csg_export_redalert();
 	csg_export_hud();
 	csg_export_variables();
-
+	csg_export_cutscenes();
 
 	// and... we're done! :)
 }
diff --git a/code/pilotfile/pilotfile_convert.h b/code/pilotfile/pilotfile_convert.h
index a18d56e..300f1c7 100644
--- a/code/pilotfile/pilotfile_convert.h
+++ b/code/pilotfile/pilotfile_convert.h
@@ -283,7 +283,8 @@ class pilotfile_convert {
 				Settings		= 0x0010,
 				RedAlert		= 0x0011,
 				Variables		= 0x0012,
-				Missions		= 0x0013
+				Missions		= 0x0013,
+				Cutscenes		= 0x0014,
 			};
 		};
 
@@ -343,5 +344,6 @@ class pilotfile_convert {
 		void csg_export_redalert();
 		void csg_export_hud();
 		void csg_export_variables();
+		void csg_export_cutscenes();
 };
 
mantis2932c.patch (2,222 bytes)   

niffiwan

2014-08-23 03:37

developer   ~0016249

Fix committed to trunk@11019.

niffiwan

2014-08-23 03:37

developer   ~0016250

Fix committed to trunk@11020.

Related Changesets

fs2open: trunk r10801

2014-06-13 06:27

niffiwan


Ported: N/A

Details Diff
Fix pilot conversion issue (followup to r9630)

-1 is a valid weapon index, but avoid indexing the array with it
Affected Issues
0002932
mod - /trunk/fs2_open/code/pilotfile/csg_convert.cpp Diff File

fs2open: trunk r10803

2014-06-13 22:58

niffiwan


Ported: N/A

Details Diff
Fix r10801 (thanks to MageKing17 for noticing this)

Really avoid using -1 as an array index
Affected Issues
0002932
mod - /trunk/fs2_open/code/pilotfile/csg_convert.cpp Diff File

fs2open: trunk r11019

2014-08-23 00:07

niffiwan


Ported: N/A

Details Diff
Partial fix for mantis 2932 (RA wep idx)

Ensure pilot conversion RA weapon indexes are always valid
Affected Issues
0002932
mod - /trunk/fs2_open/code/pilotfile/csg_convert.cpp Diff File

fs2open: trunk r11020

2014-08-23 00:07

niffiwan


Ported: N/A

Details Diff
Partial fix for mantis 2932 (cutscenes)

Convert campaign viewed cutscenes
Affected Issues
0002932
mod - /trunk/fs2_open/code/pilotfile/csg_convert.cpp Diff File
mod - /trunk/fs2_open/code/pilotfile/pilotfile_convert.h Diff File

Issue History

Date Modified Username Field Change
2013-10-13 00:10 Lorric New Issue
2013-10-13 00:10 Lorric File Added: Failed Pilots.rar
2013-10-14 03:07 niffiwan Priority high => normal
2013-10-14 03:07 niffiwan Summary Pilot files do not work with 3.7.0. => Pilot files conversion failures
2013-10-14 03:07 niffiwan Summary Pilot files conversion failures => Pilot file conversion failures
2014-06-07 16:41 kv1at3485 File Added: players.tar.gz
2014-06-07 16:41 kv1at3485 Note Added: 0015815
2014-06-07 16:41 kv1at3485 Note Edited: 0015815
2014-06-13 04:10 niffiwan Assigned To => niffiwan
2014-06-13 04:10 niffiwan Status new => assigned
2014-06-13 04:13 niffiwan Note Added: 0015853
2014-06-13 11:09 niffiwan Note Edited: 0015853
2014-06-13 14:41 MageKing17 Note Added: 0015855
2014-06-14 02:40 niffiwan Note Added: 0015856
2014-06-29 23:03 Goober5000 Changeset attached => fs2open trunk r10803
2014-06-29 23:04 Goober5000 Changeset attached => fs2open trunk r10801
2014-06-29 23:08 Goober5000 Note Added: 0015939
2014-06-29 23:08 Goober5000 Status assigned => resolved
2014-06-29 23:08 Goober5000 Resolution open => fixed
2014-06-29 23:08 Goober5000 Target Version => 3.7.2
2014-06-30 08:14 niffiwan Note Added: 0015960
2014-06-30 08:14 niffiwan Status resolved => feedback
2014-06-30 08:14 niffiwan Resolution fixed => reopened
2014-06-30 08:14 niffiwan Status feedback => assigned
2014-08-17 12:03 niffiwan File Added: mantis2932b.patch
2014-08-17 12:04 niffiwan Note Added: 0016233
2014-08-20 02:06 niffiwan File Added: mantis2932c.patch
2014-08-20 02:07 niffiwan Note Edited: 0016233
2014-08-20 09:57 niffiwan Note Added: 0016241
2014-08-20 09:58 niffiwan File Deleted: mantis2932c.patch
2014-08-20 09:58 niffiwan File Added: mantis2932c.patch
2014-08-20 09:58 niffiwan Status assigned => code review
2014-08-20 10:00 niffiwan File Deleted: mantis2932c.patch
2014-08-20 10:00 niffiwan File Added: mantis2932c.patch
2014-08-23 03:37 niffiwan Changeset attached => fs2open trunk r11019
2014-08-23 03:37 niffiwan Note Added: 0016249
2014-08-23 03:37 niffiwan Status code review => resolved
2014-08-23 03:37 niffiwan Changeset attached => fs2open trunk r11020
2014-08-23 03:37 niffiwan Note Added: 0016250