Editing Wing Commander III & IV

HCl

WC EXE archaeologist
Nice :) I had forgotten about the Confed Frigate, by the way. Place a few of them in a nav point, and they fill the area with missiles in no time!

I think you'll be able to at least get screenshots of the Ekapshi by hex-editing my WC3 editor a bit. All you need to do is change one of the ship names used internally by the game to replace one of the ships in the editor by the Ekapshi.

Regarding WC4 ship screenshots, you could either use my old WC4 mission editor (Arena), or do a similar ship name replacement to Thomas' editor. My WC4 mission editor is more flexible, but far less user friendly, so i'd probably recommend the latter approach (i imagine you'll want the most straight-forward approach).

Regardless of the approach, you'll need a list of WC4 objects and the names used by the game. Fortunately i have one on one of my old notebooks, which i will be posting when i get finished for the day. :)

(Regarding WC4 Arrows: if memory serves, there are 3 Arrow variants in WC4: pirate, confed, and cloak-capable, all with different textures.)
 

BrynS

Mr Kat says...
Some neat finds there. :D

I wonder why some of these textures and "fully functional" models weren't used in WC3? Time/testing constraints perhaps?

-Bryn
 

Quarto

Unknown Enemy
Ok, stats are looking promising. Here's a few Dralthi bits that I found so far. For now, I'll bore you with raw extracts... once I've got this stuff more or less figured out, I'll simply start compiling these into text files.

BTW, Mario, can you provide me with any information at all about which files are used by which ships? I assume your mission editor must refer to the different ships somehow. Right now, all I can do is search all those wonderful nameless, numbered IFF files looking at their INFO chunk, and given that INFO names as informative as DRALTHI are in the minority, this might take a while... :p

First up, dynamics - steering and speed.

Code:
        FORM "DYNM"
        {
          CHUNK "FGTR"
          {
            long 65
            long 55
            long 55
            long 430
            long 1100
            long 22
            long 800
          }
        }

It seems that YPR are stored internally in a slightly different order, as PYR (or PRY)... either that, or it could be that the Dralthi does in fact have different YPR values than in the manual. We'll see once I bite into some of the other ships.

After YPR, we've got max speed and max AB speed. No surprises here, either.

Next are... well, that's where things get interesting. What exactly does that 22 and 800 mean? Hopefully, once I've had a look at more ships, a comparison between ships will help explain this.

Then there's a FORM that I don't understand at all. It's called DAMG, but I don't think it's related to damage or anything like that, because there's another FORM for that later on:

Code:
        FORM "DAMG"
        {
          CHUNK "FGTR"
          {
            long 8
            long 2
            long 40
          }
        }

No idea what these three values mean. What I do know is that capital ships have only one value (inside a CPTL chunk rather than a FGTR chunk), which is usually much higher. The Kilrathi carrier (or at least, the most likely candidate for a Kilrathi carrier at this point), for example, has 15000.


The next interesting bit for us are the weapons:

Code:
        FORM "WEAP"
        {
          FORM "FGTR"
          {
            CHUNK "GUNS"
            {
              long 76800
              long 76800
              long $00012C00
              cstring "OGUN"
              long -679927
              float 0.0
              long -81920
              long $FFFEC000
              cstring "OGUN"
              long $FFFEC000
              long $FFFEC000
              long -81920
              long $FFFEC000
              cstring "TGUN"
              long 688133
              float 0.0
              long 0
            }
            CHUNK "MISL"
            {
              long 76
              cstring "IRKMISS"
              long 1035
              long 2560
              long 2560
              long 0
            }
            CHUNK "DECY"
            {
              long 6
              cstring "KDECOY"
            }
          }
        }

Decoys are easiest to understand, I guess :p. Missiles and guns are probably gonna be worse. It's easy enough to understand what kind of missile the Dralthi carries - a Kilrathi IR missile. But how many? Does it only carry one, or do those four longs mean it carries four (like in the manual?)? And guns - it's more or less safe to assume that OGUN and TGUN are the names of gun types, in which case OGUN would be (judging from the manual) the Meson Gun, while TGUN would be a Particle cannon. However, if each of these entries does indeed represent a separate weapon, this would lead me to believe that, given the general similarity between the missile and gun chunks, the Dralthi does in fact carry only one IR missile.

The final bit of interest that I found so far is the shield and armour:
Code:
        FORM "SHLD"
        {
          CHUNK "DATA"
          {
            cstring "SHLDFX"
          }
          CHUNK "FGTR"
          {
            long 12
            long 120
            long 120
            long 120
            long 120
            long 80
            long 60
            long 80
            long 60
          }
        }
      }

Except for that first 12, things are fairly plain here. Values 2-5 are shields, while values 6-9 are armour. Judging from the armour values, it seems that most likely the order in which these are stored is front, side 1, rear, side 2. Needless to say, unless there is an assymetrically-armoured ship in there, we'll never find out which side is which, but it's not something we actually need to know. All that remains is that first 12. Based on how things work in WCP, I would guess that this is the core value - i.e., how much damage the ship can take once you peel down both the shields and the armour. It does seem rather small, though.

Edit: after looking at a few other files, I've noticed that the first value is always 1/10th of the shield values. It occurs to me that this could also mean the shield recharge rate.

The above FORMs are, as far as I can figure out, the only places that contain the stats. There does not appear to be anything about the ship's mass anywhere, but that could be what one of the unknown values in the DYNM FORM would mean... presumably, the other would then be acceleration.

Other things that could be in there somewhere (but not necessarily - they weren't in WC1 & 2) are afterburner fuel and gun energy.
 

HCl

WC EXE archaeologist
Ok, here is the list of object names used by WC4 that i had on my notes. If you can get Thomas' editor to read these names, the game should load them with no problems. Otherwise, you'll have to use my older WC4 editor.

Incidentally, Jakub, this is more or less what you were looking for, these are the names used by my editor and by the game mission files. All you need is know is how to associate these names to the file numbers returned by treman... I'll try to look that on my notes soon, although the INFO tag should give you a hint for now (and, unfortunately, these names don't provide that much extra information anyway).

One thing to keep in mind is that there are a lot of variants. The Vindicator, for example, has quite a few of them, but most of those are mission specific modifications, for MIP missions, Pliers' cloak, and such situations. Unless you want to document them all, you should just search the main file, in this case "vindicat", and get those stats. Often there is a "low" variant, for example "hellow" in the case of the Hellcat, "excalow" for the Excalibur. These are often the variants flown by enemy AI ships, so it could be useful to look into both variants and see if (how?) they have been crippled.

All in all, there's a lot of work to do here, if the purpose is to truly document everything. :)

Here's the name list:

Code:
dragon
bcarrier (unused Black Lance carrier)
blbase (Axius)
bltrans
arpir8
arcloak
razor
tboltpr8
pfrigate
bannew
bannewj
banlow
banclok
aveng
avenclok
avengj
avencle2
avenge2
avengl3
vindicat
vindimip
vindica3
vindclok
vinclmip
intrepid
intclss1 
intlow
uoutpost (unused, broken, but model could be complete)
arconfed ("green" arrow)
hellcat
hellow
tbolt
longbow2
excalibr
excalow
bearcat
hermes
lexingtn
lex42    (under construction)
lex48    (under construction) 
lexlow   
cstarbse (Ella)
ctrans
ctranfls (flashpacked)
cdestroy
cdestlow
cfrigate
cfriglow
bpdepot
n4vesuv
veshang (broken)
vesuvius
vesnosup
sthelens
ccruiser
radpost
jammer
wepdepot
radarry
spacelab
ufrigate
ufriglow
udestroy
udestlow
ucruiser
utrans
utranfls
ktrans  (broken)
dralthi
kbase
kshuttle
bldspec
climbld
turplat
turmisl
utank
ctank
ctankmis
turpod
inpod   (MIP)
capmiss
shut
trshut
cshut
drydock
iris (hatch)
 

Bandit LOAF

Long Live the Confederation!
I'm having some trouble with WCEdit -- the game crashes when I try to create a new mission. I can switch the player ship, but it dies on me when I try to change the f irst mission into something of my design.
 

Will_Styles

Spaceman
I was playing with wcedit and noticed all the fighters are flyable except the arrows, but when you are in them and pull the trigger a hellcat is off in the distance firing out into nowhere.
 

Mincemeat

Doomsday's Neighbour
In regards to the WC4 editor by Thomas,

I could never get the custom mission feature to work myself.

I would just hex-edit the gameflow file manually... should be fairly easy to find the appropriate strings to alter.

Which leads to another point - it seems like a lot of WC4 shiptypes (eg arrows) cause strange behaviour or outright crashes if you try to fly them. It seems to have something to do with what guns are active by default?

And one more thing, your missile loadouts will be partially overridden by your custom loadout so you'll get strange missile counts :(
 

Will_Styles

Spaceman
I also noticed that if you change your ship to the dragon, when you have your last chance to defect, and flashpack the intrepid, fighters appear almost instantly, and the lexington goes down in seconds.
 

Mincemeat

Doomsday's Neighbour
Will_Styles said:
I also noticed that if you change your ship to the dragon, when you have your last chance to defect, and flashpack the intrepid, fighters appear almost instantly, and the lexington goes down in seconds.

That's just part of the usual mission scripting - you don't need a Dragon to do this although it will certainly make it easier. The Lexington will be neutralised one way or another ;)
 

Quarto

Unknown Enemy
HCl said:
Incidentally, Jakub, this is more or less what you were looking for, these are the names used by my editor and by the game mission files. All you need is know is how to associate these names to the file numbers returned by treman... I'll try to look that on my notes soon, although the INFO tag should give you a hint for now (and, unfortunately, these names don't provide that much extra information anyway).
Yep, that does seem to be what I'm looking for - if you have this kind of info for WC3, it woudl be much appreciated.

The trouble with the INFO tag is that I have found at least one occasion where two differently-numbered files had the same INFO tag.

What I'm really curious about, though, is what kind of info your editor uses internally to tell the game what ships we want to use. What I'd basically like to know is whether you choose these ships from some kind of internal game list (like WCP's ship.iff), or do you point directly to filenames? If it's the latter, would it be possible to configure the editor to point to other WC3 ship files? For example, I found an odd Kilrathi capship called KIL-930. Judging from its stats, it seems like it could be a Kilrathi transport... it's unarmed, though, and it doesn't have any cargo attachments, so if it is a transport, it's some kind of different variety (or an unfinished version). So, being able to connect ships up to the game would be mighty useful for me. Additionally, is there any way I can make sure that the game reads my modified files instead of the originals from the TRE? Without the ability to replace ships for experimentation, I won't be able to figure out any of the remaining unknowns.

Also, a little update about what I've been able to figure out from the stats so far. The last value in the DAMG form is almost certainly the ship's core strength. In the case of capships, there is only one value at all, and it appears to match core strength values. The other two DAMG values in a fighter are still unknown. Could be shield recharge rates or something.
 

AD

Finder of things, Doer of stuff
Bandit LOAF said:
I'm having some trouble with WCEdit -- the game crashes when I try to create a new mission. I can switch the player ship, but it dies on me when I try to change the f irst mission into something of my design.


I had the same trouble. The editor doesnt seem to be actually writting the mission file. (even the spot where you put in a name is greyed out)
 

Bandit LOAF

Long Live the Confederation!
No luck getting the editor to work... but I did figure out that to fly any fighter all you need to do is replace the name in the ".wce" file with one of the names from HCl's list above. This works for fighters and shuttles, but I have had absolutely no luck with capital ships -- if anyone can figure out how to grab pictures of the Jammer, please let me know (the others should be fairly easy in-game).

Here's the Arrows!

wc4arrow1.png

wc4arrow2.png

wc4arrow3.png


I'll work on the other fighters today.
 
Last edited by a moderator:

HCl

WC EXE archaeologist
Hmm now that i think of it, i don't remember ever being able to use Thomas' WCEdit properly, but i remember people were using it without any problems back then, so i simply assumed i was doing something wrong and was never too motivated to figure out what. In any case, LOAF, looks like you'll have to either use my WC4 mission editor or swap capships manually. I'll try to give you some information on this tonight.

Jakub, both my WC4 editor and the WC4 mission files refer to the ship file names directly. There is nothing similar to WCP's ship.iff in WC3 or WC4. You'd just have to enter the file name and the game would happily use it (that's how my WC4 editor used ships converted from WC3 and even Armada). Without being pessimist tho, i wouldn't be too excited about the KIL-930 file: it probably is the ktrans file, which looks nothing like a Kilrathi transport, if i recall correctly.

I do have a similar file list for WC3, as well as means to read external files. File identification is done by the game through a filename hash value. I made once a program that would make it possible to identify filenames easily, but i couldn't find it last night. In any case, you'll be able to force reading external files by hex-editing the TRE, and if you do this before you supply the external file, you will get the original file name from the game's error message. Fortunately, the INFO tag will give you very good clues as to which file you're looking at.

I'll try to post the relevant data for this when i finish work for the day.
 

Bandit LOAF

Long Live the Confederation!
Great -- thanks a lot! No rush, though... I'm off to Texas for a few days, so I won't be around until Monday at least.

Screenshots of all the fighters and shuttles are finished! They're in /ships2/images/4views, if anyone wants to poke around.

The one thing I couldn't find was the Border Worlds assault shuttle -- the one Dekker flies. It shouldn't be too hard to get in its natural setting, though. The one surprise was that there are three Confed-style shuttles -- the one I wasn't expecting was one with the Border Worlds logo (the other two are the Confed version and the camoflaged Marine shuttle).
 

HCl

WC EXE archaeologist
Here are the file names for WC3:

Code:
darket
dralthi
vaktoth
paktahn
ktanker
kdread
victory
ktrn
ttrans    (no cargo)
ttransc   (with cargo)
ttranscs  (another cargo variant)
tcruiser
tdest
kcorv
astrftr
sorthak
strakha
tbase
tfrig
arrow
hellcat
tbolt
impera (longbow)
excal
kasbase
kcruiser
kdestl
kdest
kcarrier
bloodfng
kliace
dralace
khvace
kbomace
strakace
ekapshi
behemoth
capmiss
skipmiss
jubuoy
tranbomb
ktank
depot 


player ship variants:

arrowp
hellcatp
tboltp
imperap (longbow)
excalp

To remove an entry from a WC3/4 TRE based on the extraction number from treman, do the following:

- Calculate offset = x*8+24, with x being the number given to file by treman
- In your hex editor go to this offset and enter FFFFFFFF.
- The game should now attempt to read this file externally. However, the game prefixes the string ..\..\ to the file name, which is why you need to have the game installed somewhere with at least 2 directory levels (ie, c:\something\wc4).

The one thing I couldn't find was the Border Worlds assault shuttle -- the one Dekker flies.

That's the Hermes entry... though i don't know if Tom's editor will be able to use it, i think that one is coded internally as a capship.
 
I'm not sure why...

But this is my favorite thread ever! It's just cool watching/listening to people break it down!

Sorry, just had to say...I'm increasingly addicted to this thread!
 

Bandit LOAF

Long Live the Confederation!
I'm back!

I grabbed five-view shots of all the Armada fighters... and then left them on my computer in Texas. D'oh. Anyone have any idea how to grab five-view pictures of the Armada capital ships? The world needs to see those transports...
 

Quarto

Unknown Enemy
Well, that depends if you're dead-set on getting shots of them in-game. If you're not, it's a relatively simple matter, since all four Armada capships have been extracted from the game and converted to WCP (see Killerwave's page). What this means is that they can be viewed in either WCP, or in 3D Exploration, using Thomas' plugin.

If I have time tomorrow evening, I can get you five-view shots of all four of them. If not... well, then I won't have time until the weekend at the earliest - but if you still need help getting them by then, I'll certainly find time to get those shots at some point soon.
 

HCl

WC EXE archaeologist
Managed to go through my notes during the weekend, so here's some more information :)

WC3: I uploaded a hex-edited version of my WC3 editor here which replaces the Bloodfang with the Ekapshi. This should make it easy taking screenshots from it. Just hex-edit the string at offset 250212 (3d164 hex) to any of the names on the WC3 list i provided before and it should work (due to scripting issues, try changing IFF code to Kilrathi if you encounter problems with any ship). Don't forget to terminate the string with a 00 hex.

WC4: In the package linked above, there is also a WC4 mission file. Try renaming it to whatever file name Tom's editor uses (newmiss.iff or something similar) and place it on c:\data\missions . With some luck, the game will load it and it will work without any problems. Otherwise, you'll have to install my WC4 mission editor (tried with that and it works). Keep this IFF file handy, in any case. In this mission, you will find a Razor and a Hermes transport at Nav 1. This transport can be changed to anything on the WC4 list i posted before, which should make it easy to take screenshots of the Jammer or other exotic objects (uoutpost comes to mind) with only a small tweak. You'll have to hex-edit the string at offset 7247 (1c4f hex).

Armada: I only have the floppy version of Armada, so i'm posting the information i have based on this version. The offsets may or may not be different on the CD version of the game.

Assuming you want to take screenshots of the transports from the game itself (opposed to the solution Q proposed), there's a quick way to acheive that.

- Hex edit data.tre at offset 7995583 (7a00bf hex) and
7995601 (7a00d1 hex): enter 01 on both locations.

- Hex edit data.tre at offset 7995567 (7a00af hex) and enter one of the numbers from the following list:

Code:
0 - Arrow
1 - Phantom
2 - Wraith
3 - Gladius
4 - Banshee
5 - Dralthi
6 - Shoklar
7 - Jrathek
8 - Korlarh
9 - Goran
10 - Lexington
11 - Confed Transport
12 - Kilrathi Transport
13 - Confed Carrier (same as lexington, different targetting name)
14 - Kilrathi Carrier

This will change confed gauntlet mission 1. The first two changes (to value 01) should make both ships at the first nav point friendly, so you can move around easily, while the last one changes one of the Dralthi to whatever ship you choose; in this case, you'll want 11 (b hex) and 12(c hex).
 
Top