WC1 mission objectives

ZOmegaZ

Rear Admiral
In my on-again off-again quest to fully document and duplicate the WC1/2 game engine, I've run into an interesting gap. From HCl's work, I've gained an understanding of how the graphics and data files are typically encoded. HCl fully documented the graphics, and the missions format can be mostly understood from his editor code.

I've decoded most of the briefings, except for the details of some of the branching rules. And I've decoded two of the three blocks of data in the campaign files. This includes who's sitting at the bar, victory points for the series, victory points for the individual objectives of each mission, medal availability, and so on. The one thing I seem to be missing, though, is very important: what are the actual objectives for each mission? What do you have to actually do to get those victory points, or to get a Halcyon victory?

As best I can tell, the only remaining decoded data in camp.000 is four bytes per mission slot. Since there are four slots per series, unoccupied mission slots are labeled with -1 0 0 0. However, some extant missions have the same label. Oddly, series 1-7 match perfectly between Vega and SM1, while series 8 in SM1 is a duplicate of series 2.

There are two possibilities. Either these four bytes represent the objectives in some way that is totally unclear to me. Or the mission objectives are stored elsewhere, quite possibly in the executable itself. The latter would raise the question of what those four bytes represent. The first byte is always 0-10 in the first two campaigns, but goes as high as 27 in SM2. The other bytes are almost always divisible by 5, usually by 10 as well.

Does anyone have any information or insight on this matter?
 
I think you should start off by looking at the WC1 mission guide (the online one, that lists all the points you can get in a given mission), to see if you can find any connection between what's there, and what's in camp.000. However, I doubt that this file has anything to do with objectives.

That's a pretty cool quest you're on, though. Hope to see more of your results! :)
 
Yeah, this as been baking my noodle for some time too.
Admittedly the WC1 campaign editor has been put on the backburner until other things are out of the way, but I never found where this data was held.
How do you set (what I call) significant ships?
For instance, in the ralari mission, how do I make the ralari significant so the game then reports its destruction, so the debriefing can branch accordingly?
Being able to do this is vital to making any campaign editor viable.
I'm tempted to ask whoever has that archived copy of the WC1 source code (LOAF I imagine), if he could have a peek for us. I'd not ask to look at the code, just be pointed in the right direction.

One thing to note ZomegaZ; Some of the data I uncovered when deconstructing the module.000 file, seemed to be using 3 byte integers, rather than the standard 1, 2 or 4 (the ship co-ordinates being the most common ones). I believed this was to save space in memory and on disk. Looking at the files you sent me ages ago (which even in their incomplegte state were still extremely helpful) it didn't look like you had encountered this. Is it possible that the data for 'significant' ships is a single byte integer which you have unwittingly amalgamated into a four byte integer?

If you want a fresh set of eyes to go over what you've found, post up the txt files and I'll be happy to have a look.
 
Well having looked at all three files (camp.000, module.000 and briefings.000), for each mission to work within a campaign there is data in all three of those files which works together I would imagine that to change data in just the module.000 file, you would create problems within a campaign though not the individual mission.
For example, I can change the assigned wingman in the module.000 and that mission will work fine, but if that is not changed in the briefings and camp files, you'll have issues with story flow and conditional branching. If I were to do this for mission 1 and change your wingman to Hunter, but only in the module.000 file, I suspect that if Hunter were killed, the game would either crash on debriefing or you would get Spirits funeral scene instead of Hunters and the chalkboard would also show Tanaka dead.

Now I have looked at a lot of the module.000 file and I'm confident I could poke about enough to construct a new mission (new navs, new debris, new enemies, new positions) yet there is a lot of data that I have not worked out yet. So my guess would be that this file is where the objective data is stored.
It appears that the method used for construction of a campagin would be to plot all of the missions in the module file, then make briefings for them (briefing.000 file) then tie them all together in the camp.000 file.
Built like that, from the bottom up, you could include all the data for significant ships and victory points in the module.000 file, then the [de]briefings and campaign files could reference this data with its own in order to make the game work.
 
Interestingly, looking at the very end of module.000, it lists all of the squadron names and all of the system names. This includes 2 unused names 'Kirov' and Cambria. Looking at the WC universe map, 'Cambria' is even further back than Hells Kitchen, while I can't find Kirov.
 
Ok, so I have been looking at module.000 again today. There's an interesting section of data near the beginning of the file.
Looking at the file using a hex editor, reading as decimal, the table begins at byte 22 and goes on to byte 1561.
There are 56 sets of single byte data. Each set has 24 single bytes of data in it.
The number of sets seems significant because though not always used, there are 4 mission slots available for each system you fight in and as I found out today, there are 2 system names that seem to be for extra systems that were dropped at some point in development. There are 13 systems in WC1. (13+2)*4=56.
This is also held up by the fact you can see that for most entries, 3 slots are used and one is empty. The only deviation from this is the first section, where 2 slots are empty and the last two where no slots are free. With Enyo only having 2 missions and both Hells Kitchen and Venice having 4, this again seems to fit.

Where things get interesting is when you look at the data in the used slots. Below is the data for the Enyo system (one mission slot per line)

0 0 0 0 0 0 1 0 2 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255
0 0 0 0 0 0 1 0 2 0 6 0 255 255 255 255 255 255 255 255 255 255 255 255
0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255

It seems that bytes 5-10 are only used if the mission slot is filled. So what is the 6 0 for?
I looked for a pattern, to see if it was specific to escort missions. At first it seemed to be, but then things changed later on.
Then, on a hunch, I looked at my dusty and unfinished WC1 editor. It now seems clear that these are refences to ship slots. Looking at the 2nd Enyo mission, the drayman occupies slot 7, which is slot 6 when counting from 0 rather than 1. It also makes sense that in used mission slots you need to turn on the Tigers claw, your ship and your wingman (0 0 for the claw, 1 0 - you, 2 0 - wingman) which accounts for the standard 0 0 1 0 2 0 data in all used mission slots.

When we look at the Kurasawa Ralari mission the data looks like this...

0 0 0 0 0 0 1 0 2 0 10 0 11 0 255 255 255 255 255 255 255 255 255 255

So here we have ship slots 10 and 11 referenced. This is the Ralari and the Rapier which is escorting it.
What seems to be happening in this whole block of data is that friendly ships are being declared. This isn't strictly needed as each ship declares its IFF later on in the file. So this would seem to be a big part of what we are both looking for.
However I'm not certain it is the full answer, as there is no consequence I know of of you saving the Ralari but not the escorting Rapier. I'm also not clear on how this works with the debriefings conditional branching (the briefing file is not something I have looked at in great detail yet). I imagine at debriefing the conditions ask if ship x has been destroyed then it branches the text accordingly. I'm not clear on how to get the branching to look at a certain ship. If I were to build my own mission, how do I get the thing to look at the slot I want and react accordingly?
Also, this doesn't answer how the branching works for Kilrathi ships. The Colonel still knows if you took out enemy cap ships or not.

There is a mass of data after that (but before the nav data) which I have organised into blocks but have yet to realy delve into as it is not yet obvious what it is for.

Sorry for the massive post, hope it is helpful.
 
From what I have, the first block in module.00x is the ships that autopilot with you. But I haven't experimented deeply with it.

I contacted HCl, and just he pointed out that the answer was right in front of me the whole time. The nav map IS the mission objectives. From my limited understanding, the briefings branch on whether a particular objective was achieved or not. Now, that doesn't necessarily explain everything, I'm not in a position to dive into the individual missions and check things at the moment. For example, I'd be curious how SM2 series 1 mission 2 works, when you get no points for attacking the enemy fleet, but the briefing branches anyway.

And I'm still left wondering what the first block of camp.00x is. :-)
 
Interesting.
If you could send me your breakdown of the beirfing/debrifing branching that you worked out, I have a fair bit of understanding of how the mission set-ups work in the module.000 file, so may find it easier to find the answer to this.
 
Well here's a bump to an old thread.

This all assumes nobody has come up with an answer to this in my time away (if they have then cool)

Okay so I haven't come here in a while (the CIC editing forums). I mostly came back after looking through old hard disks and coming across my incomplete WC1 editor.
That editor ceased development because I could not work out how 'Significant ships', as I called them, were declared. Without knowing how to tag them as objectives and then have debriefings react to success or failure, made a mission editor pointless.

So a couple of day ago I decided to look at the data with fresh eyes. I found some new stuff but not the data I was after.
I then found the WCToolbox, created by @UnnamedCharacter and ran the three files (Module.000, Briefing.000, Camp.000) through that.

Some amazing stuff came from that. I'd never seen such a comprehensive mapping of these files before. So I looked.
In all of the ship tables and all of that, I still could not find anything significant. I nearly gave up.
Instead I decided to look at the debriefings and see if I could map the conditionals in those. Not only because that was not something I had seen done (though probably has) and in them, the objectives had some relevance.

And oh I think I've found gold.

In the branching there are conditional statements depending on objective outcomes. The success tag is [11] (followed by 2 numbers) and the failure tag is [12] (also followed by 2 numbers). My breakthrough was when looking at Kurasawa 1 and the 3 Cat Transports. The first number after the conditional tag [11] or [12] correlates exactly with where that ship is listed in the objectives in the FLIGHT PLAN section!

I have only just worked this out and written up a preliminary document about it (see attached) so have not fully tested it either against all missions (it tracks to the following 2 Kurasawa missions, Ralari and Exeter escort) nor have I tested out in game with altered data (I don't currently have a KS WC install on any of my machines) but after years and years of chasing this elusive quarry, I'm almost certain that I have solved it.

I mean maybe someone has already solved this in the years I've been away. Even so, I'm quite chuffed to have done it myself, as it removes the blocker that stopped my full WC1 campaign editor. So if I can find some regular time, this might restart.
Any way, anyone interested, have a look at the file attached.

Lastly, this would absolutely NOT have been possible without the efforts of a whole bunch of other people on here. I think the phrase is that I'm standing on the shoulders of giants.

EDIT: also attached is my very incomplete breakdown of debriefing branching.
 

Attachments

Back
Top