Source Code Project Mantis - FSSCP
View Issue Details
0001929FSSCPFREDpublic2009-05-22 04:212015-03-03 21:56
ReporterFUBAR-BDHR 
Assigned ToMageKing17 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.6.9 
Target VersionFixed in Version 
Summary0001929: Texture replacement more problems
DescriptionMessing around with some nameplates tonight I ran into a couple of quarks. First the texture replacement screen in FRED seems to sort the texture names into alphabetical order. Not a bad feature but if I replace say the fifth texture in the list it actually does replace the fifth texture as it appears in PCS2 not the sorted list.

Now it gets even messier. While trying to figure that out I had 2 of the same ship class in FRED. I started changing one texture on each ship while removing the previous change. Both ships changed but not even the right texture. Seems it decided not to remove one of the replacements or moved it to another texture.

Part 3 (probably what caused part 2) When I finally got the right texture in the sorted list that changed the nameplate and that wrong texture problem happened I looked at it in notepad. It actually stored it with the right name in the .fs2 file. So even though FRED says texture X the FRED file says texture_Y.

Part 4.(haven't double checked this one) Having a texture named Blank in PCS2 doesn't results in the texture not showing up in FRED. I renamed the texture in PCS2 and in the maps directory and it showed up in FRED.
Additional Information3.6.10 RC2. I'll try to add more info tomorrow. Just wanted to get this filed so I didn't forget about it.
TagsNo tags attached.
has duplicate 0003145closed MageKing17 Texture replace dialog entries are offset by one 
has duplicate 0002340resolved Goober5000 Texture replacment with invisible no longer working 
Attached Filesjpg text_replace1.jpg (104,082) 2009-05-25 03:08
http://scp.indiegames.us/mantis/file_download.php?file_id=1275&type=bug
jpg

jpg text_replace2.jpg (147,427) 2009-05-25 03:09
http://scp.indiegames.us/mantis/file_download.php?file_id=1276&type=bug
jpg

jpg texreplace_prob.jpg (182,862) 2009-05-30 00:55
http://scp.indiegames.us/mantis/file_download.php?file_id=1277&type=bug
jpg

patch 1929.patch (2,086) 2015-02-23 21:58
http://scp.indiegames.us/mantis/file_download.php?file_id=2654&type=bug

Notes
(0010918)
FUBAR-BDHR   
2009-05-25 03:17   
Well this one is a little deeper then I though. Couldn't reproduce with retail data. Also couldn't reproduce with some TBP models. B5 and the EA explorer both exhibit the problem so it is reproducible with more then one model. Both models have both shine and glow maps as well as debris textures.

First pic shows the PCS2 texture order as well as where texture rotation6a is.. Second shows what happened when I tried to replace rotation6a with the asteroid texture. The .fs2 file saved it as:

$Texture Replace:
+old: b5rotation1a-shine
+new: asteroid01a

Which is 3 textures in the sorted FRED list above rotation6a. Interestingly enough there are 3 glow textures in the list. All 3 are above rotation6a in the unsorted list.
(0010920)
FUBAR-BDHR   
2009-05-30 00:59   
Just uploaded another screenshot. The first ship with the Patton name plate was previously the only ship in the mission (besides Alpha 1) and had texture replacement that was fixed in notepad. Loaded the mission and added 4 more Novas. Didn't do anything else but you can see they all have missing textures. Saved the mission and checked it in notepad. It was correct and the texture replacement for the Patton did not change. Other 4 had no texture replacement as they should.
(0014500)
Goober5000   
2012-12-17 03:03   
Is this still an issue? I didn't run into any such problems when I was working on 0002340.
(0014503)
FUBAR-BDHR   
2012-12-17 14:40   
Tested 1 part and it still exists. Replaced texture b5rotation6a with asteroid01a just like in the screenshot above. Saved mission. FRED still shows b5rotation6a replaced but in notepad there is this:

$Texture Replace:
+old: b5rotation1a-shine
+new: asteroid01a

I think there are a few factors in reproducing this. First you need a model where the textures aren't in alphabetical order in PCS2. Second you need one that has "missing" maps. By missing I mean things like -glow -shine don't exist for some textures but do for others. So if you have a model with textures a.dds, b.dds, and c.dds where a has -glow, -shine, -normal, b only has -glow, and c only has -glow and -shine you should be able to repo this. I believe there are 2 things happening. First is with the sort order and second is with the routine assuming that all map types (probably all map types used previously on the model) will exist for every map on the model.

I'll see if I can come up with something in retail that can make this happen.
(0014504)
FUBAR-BDHR   
2012-12-17 15:49   
Can't find anything retail but the 3.6.12 mediavp Arcidia can reproduce issues. Just add one to FRED and start replacing textures and looking at the mission in notepad. It seems more random then using b5 so I haven't figured out a single texture that will cause the issue yet.

Also I found another issue where the missing texture warning will pop up for valid textures the second time. I replaced texture cruisertile5 with asteroid01 as a first test. No warning. That didn't trigger the issue so I tried replacing a different texture with asteroid02a which triggered a warning as I assume there is no asteroid02a. I then changed it to asteroid01a and received 2 warnings that asteroid01a doesn't exist which it does.
(0014540)
Goober5000   
2012-12-19 02:21   
Okay, well I just tried the mediaVPs Arcadia and the textures appeared exactly as expected.
(0014543)
FUBAR-BDHR   
2012-12-19 22:18   
Alright here is one with that is reproducible every time. Start FRED, drop in Arcadia, texture replace install01-06 with asteroid01a. Save mission. Delete Arcadia. Add Arcadia. Go to texture replacement and look at install01-06. Save mission. Notice that the texture replacement is in the .fs2 file.
(0014544)
FUBAR-BDHR   
2012-12-19 22:30   
Another one. Place Arcadia. Texture replace instal01-06 and install01-07 with asteroid01a. Save mission. Select Arcadia and texture replace install01-01c with asteroid01a. Save mission. Check the .fs2 file and you should see:

$Texture Replace:
+old: install01-01-glow
+new: asteroid01a
+old: install01-06
+new: asteroid01a
+old: install01-07
+new: asteroid01a
(0014545)
Goober5000   
2012-12-19 22:55   
I wonder if you have the same Arcadia as I do. The mediaVPs one doesn't have the install01-06 and install01-07 textures; instead it has arcadia_01, etc. And the retail one has install01-06a, etc., not install01-06. (Note the a.)

Anyway, I followed your instructions and the only thing I noticed was that the texture replacements for "GTI Arcadia 1" carried over to the next ship called "GTI Arcadia 1" after I deleted and recreated it. That's because the texture replacement is assigned by name in FRED, and the two ships had the same name. But by the same token, since it was the "same" ship, just deleted and recreated, I'm not convinced it's an actual bug.

As for your second example, that one worked just fine for me, and I didn't see the results you reported.
(0014549)
FUBAR-BDHR   
2012-12-19 23:33   
I am testing on the one from the 3.6.12 mediavps. Testing on retail doesn't work as there are no shine, glow, or normal maps.
(0014553)
Goober5000   
2012-12-20 02:18   
Okay, I figured out what my mod problem was. I was able to reproduce both tests.
(0016508)
MageKing17   
2015-02-22 18:17   
I've attached a patch that should fix the remaining issues (since "invisible" support was re-reported as 2340 and fixed by r9444).
(0016512)
Goober5000   
2015-02-23 00:28   
Patch looks reasonable, but I merely did a test merge and skimmed it. What tests did you do to verify that this was fixed?
(0016513)
niffiwan   
2015-02-23 03:33   
On IRC I saw Axem report that this patch fixed the issue in the related ticket (0003145)
(0016514)
MageKing17   
2015-02-23 21:59   
Apparently that particular patch file got made before I'd compiled it, because it was missing a semicolon that is required for it to compile; I must've forgotten to remake the patch file afterwards. Fixed.
(0016522)
Goober5000   
2015-03-02 01:48   
Well I don't think we're going to get any additional opinions. :) If you're satisfied the patch fixes the issues you noticed, then go ahead and commit it.
(0016532)
MageKing17   
2015-03-03 21:56   
Fix committed to trunk@11274.

Issue History
2009-05-22 04:21FUBAR-BDHRNew Issue
2009-05-25 03:08FUBAR-BDHRFile Added: text_replace1.jpg
2009-05-25 03:09FUBAR-BDHRFile Added: text_replace2.jpg
2009-05-25 03:17FUBAR-BDHRNote Added: 0010918
2009-05-30 00:55FUBAR-BDHRFile Added: texreplace_prob.jpg
2009-05-30 00:59FUBAR-BDHRNote Added: 0010920
2012-12-17 03:03Goober5000Note Added: 0014500
2012-12-17 03:03Goober5000Assigned To => Goober5000
2012-12-17 03:03Goober5000Statusnew => feedback
2012-12-17 14:40FUBAR-BDHRNote Added: 0014503
2012-12-17 14:40FUBAR-BDHRStatusfeedback => assigned
2012-12-17 15:49FUBAR-BDHRNote Added: 0014504
2012-12-19 02:21Goober5000Note Added: 0014540
2012-12-19 22:18FUBAR-BDHRNote Added: 0014543
2012-12-19 22:30FUBAR-BDHRNote Added: 0014544
2012-12-19 22:55Goober5000Note Added: 0014545
2012-12-19 23:33FUBAR-BDHRNote Added: 0014549
2012-12-20 02:18Goober5000Note Added: 0014553
2015-02-22 17:29MageKing17Relationship addedhas duplicate 0003145
2015-02-22 18:02MageKing17File Added: 1929.patch
2015-02-22 18:04MageKing17Relationship addedhas duplicate 0002340
2015-02-22 18:17MageKing17Note Added: 0016508
2015-02-22 18:17MageKing17Assigned ToGoober5000 => MageKing17
2015-02-22 18:17MageKing17Statusassigned => code review
2015-02-23 00:28Goober5000Note Added: 0016512
2015-02-23 03:33niffiwanNote Added: 0016513
2015-02-23 21:58MageKing17File Deleted: 1929.patch
2015-02-23 21:58MageKing17File Added: 1929.patch
2015-02-23 21:59MageKing17Note Added: 0016514
2015-03-02 01:48Goober5000Note Added: 0016522
2015-03-03 21:56MageKing17Changeset attached => fs2open trunk r11274
2015-03-03 21:56MageKing17Note Added: 0016532
2015-03-03 21:56MageKing17Statuscode review => resolved
2015-03-03 21:56MageKing17Resolutionopen => fixed