GeomAdd texture replacement issue

Creating new content for Trespasser!

Moderators: TresCom Support Team, TresCom Board Managers, TresCom Developers

User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4353
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

GeomAdd texture replacement issue

Post by TheIdiot »

Quick question that's been bugging me a lot recently. When I go to import a mesh in GeomAdd for my level and I tell it to replace existing textures, it works out all fine and dandy, but it ends up ADDING a new texture instead of replacing a previous one, increasing the SWP size and occasionally causing crash issues. It almost always breaks the game when I try to replace terrain textures (the level loads up and, just as it starts, the game CTDs). This even happens if I use the same palette as before. Is there a way to get around this? I'm trying to keep my SWP and PID as small as possible but an additional set of 10 or 11 textures isn't really good for it. I'd run a full SWP update but for some reason it simply won't work - I get an instant crash on loading. :sick:

If there's anyone willing to perhaps look into this, I'd gladly send them the level file to see if they can to an SWP update for me or export the files into a new level. :)
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GeomAdd texture replacement issue

Post by machf »

Well... you have to rebuild the SWP. There's an option for that in GeomAdd. But you need to export all the textures from the level into a folder first. Otherwise, GeomAdd only keeps adding the textures by appending them to the end of the current .SWP file and changing the pointers correspondingly.
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4353
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: GeomAdd texture replacement issue

Post by TheIdiot »

machf wrote:Well... you have to rebuild the SWP. There's an option for that in GeomAdd. But you need to export all the textures from the level into a folder first. Otherwise, GeomAdd only keeps adding the textures by appending them to the end of the current .SWP file and changing the pointers correspondingly.
Hmm. Could you perhaps walk me through the procedure? What I'm doing is going into TresEd, making all object types visible, selecting all objects (including TrnObjs afterward), exporting them to a TPM in a dump folder, then going into Shell Generator and creating ONLY an SWP and PID file (called islanublar.swp, same as the level name), which I then put in the data folder alongside the rest of the level files (.grf, .scn and .wtd). After that, I open up GeomAdd and hit "Update SWP", and select the folder I dumped my textures to. It gives me the warnings for 24-bit textures where necessary, and I allow it to update the files. Once that's done, I open up the level in TresEd and check to see if the textures are fixed - the only errors I seem to have is that the Aviary texture lacks transparency and the edges of a terrain texture appear somewhat blue. Trying to run the level in Tres causes a CTD on the loading screen. Any suggestions?
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GeomAdd texture replacement issue

Post by machf »

Talk to Rebel, he's the expert on that. I just tend to avoid replacing textures whenever possible...
Oh, and there's a "select all objects" option in TresEd... no need to make them all visible and manually selecting them one by one or anything.
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6137
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: GeomAdd texture replacement issue

Post by Rebel »

TheIdiot wrote:
machf wrote:Well... you have to rebuild the SWP. There's an option for that in GeomAdd. But you need to export all the textures from the level into a folder first. Otherwise, GeomAdd only keeps adding the textures by appending them to the end of the current .SWP file and changing the pointers correspondingly.
Hmm. Could you perhaps walk me through the procedure? What I'm doing is going into TresEd, making all object types visible, selecting all objects (including TrnObjs afterward), exporting them to a TPM in a dump folder, then going into Shell Generator and creating ONLY an SWP and PID file (called islanublar.swp, same as the level name), which I then put in the data folder alongside the rest of the level files (.grf, .scn and .wtd). After that, I open up GeomAdd and hit "Update SWP", and select the folder I dumped my textures to. It gives me the warnings for 24-bit textures where necessary, and I allow it to update the files. Once that's done, I open up the level in TresEd and check to see if the textures are fixed - the only errors I seem to have is that the Aviary texture lacks transparency and the edges of a terrain texture appear somewhat blue. Trying to run the level in Tres causes a CTD on the loading screen. Any suggestions?
You're missing the opacity maps for your ground textures, and it sound like tresed is only exporting the colormaps of your 24bit textures, but not the mask maps. The best way to build your level is to create a folder and with all models or texture used, place a copy of those textures inside that folder so the swap updates don't cause you headaches (ie. Missing textures). My guess is, some of your models don't have an opacity map assigned to them, so TresEd is grabbing the wrong model and exporting only the color map, or during the update Geomadd is updating a model without the opacity map first, therefore your textures are being added without the mask.

1st, verify that the opacity maps are being exported during export all (check texture folder).
2nd, go thru each model assigned those textures, being certain that all models sharing those textures have the correct color map/opacity map listing.
3rd, if not, do not import the problem textures, remove them from the folder. Do the swap update.
Lastly, create a plane, I call these texture strips, you'll find these in both retail and tc levels, and assign your problem textures to these strips and import those separately.

Now, if you can't find your opacity maps, meaning tresed isn't exporting them at all, export an individual object with the missing textures listed in the texture dialog box. You may be able to find them using swap_viewer too, but you'd have to save the missing textures one a time. Hope my rambling helps -

Ps: exported 24bit textures have several pixel errors at the bottom left of the texture, you have too fix these manually (ice., mspaint) before you import them.
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4353
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: GeomAdd texture replacement issue

Post by TheIdiot »

Rebel
Hmm, I scanned through everything, still the same issue. I've checked all the objects I know have transparency, fixed the Aviary mesh (it didn't have the opacity map), and had to bring in a texture strip for the flashing lights, but it still won't work. I even went and fixed all the false errors GeomAdd was giving me and those weren't even related to the textures. :( I'm still digging away at the game to see if anything will work, but no luck.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GeomAdd texture replacement issue

Post by machf »

Rebel wrote: Ps: exported 24bit textures have several pixel errors at the bottom left of the texture, you have too fix these manually (ice., mspaint) before you import them.
No, it is because of the way GeomAdd imports them into the levels, it's an error that wasn't fixed. If you export an original 24-bit texture from one of the retail levels (from the muzzle flashes, for example), the texture will be OK, but 24-bit textures imported by GeomAdd into a level aren't placed correctly inside the .SWP file and you get an extra 16 or 32 bytes (can't remember) which effectively shift the image by several pixels... and then, if you export it, you'll notice it (in-game you also notice it, particularly if the texture was meant to be aligned to some feature of the object it's applied to).

A "fix" for this, since I think 24-bit textures don't get any mipmaps, is to manually overwrite the texture data in the .SWP file with the proper one from the original image using a hex editor...

Thats' why I keep asking anyone who may contact Andres to ask him for the source code to fix that bug...
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6137
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: GeomAdd texture replacement issue

Post by Rebel »

Ah, import bug, not export. I thought Paul was in touch with Andres?

TheIdiot: Are you certain your terrain placement object and/or the sky model have the correct mipmap values?
madppiper
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 2109
Joined: Mon Jul 22, 2002 11:17 am
Location: Germany
Contact:

Re: GeomAdd texture replacement issue

Post by madppiper »

@Rebel: Sure am - I can drop him a line if you want :)
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GeomAdd texture replacement issue

Post by machf »

I think Andres hasn't access to his old source files ATM, though?
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4353
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: GeomAdd texture replacement issue

Post by TheIdiot »

Well, I've done all I can, absolutely no difference. Crashes at the same spot every time. I think I'm just going to put this aside for now and focus on the million other things to do with my level for now. Thanks anyway, guys. :)
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GeomAdd texture replacement issue

Post by machf »

You may be over the limit... how many textures are there? And how much space do they take?
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4353
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: GeomAdd texture replacement issue

Post by TheIdiot »

machf wrote:You may be over the limit... how many textures are there? And how much space do they take?
GeomAdd tells me I've used 46 out of 98 palettes used and 4.7MB of 20.1MB of primary texture space. Not sure about the number though, how do I find that? I plan on reducing the SWP size in the future to 12MB if I get the update to work though.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GeomAdd texture replacement issue

Post by machf »

Well, if GeomAdd is reporting that, you're still way under the limit, so that isn't the problem...
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4353
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: GeomAdd texture replacement issue

Post by TheIdiot »

Huh. No clue left as to what it could be. I kind of feel like starting a whole new level just to incorporate all the new textures I made since this one seems to be extremely delicate.
Post Reply