Discovering Mission Table Workings: My Plan

General Mech2 related Developments go here. Discussions welcome!

Moderator: Skyfaller

Forum rules
If you are writing a guide please do not post it here! Post in the Dev FAQ section please.
User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Discovering Mission Table Workings: My Plan

Post by Col.Kell » Wed Jan 28, 2009 3:52 pm

Because mission tables are a very complex and important role in the mechwarrior 2 games, I have decided to dedicate a thread to them here.

What I am in the process of doing right now is "decoding" the mission objectives in the SCN1 files by reverse-engineering; I am using a program made by allmhuran, Endymion (Edward Wong), and two others called MW2 Mission Editor 3D, compiling several near-identical missions with minor changes as to recognize what bytes serve what porpouse.

In doing this, I am not only hoping to understand just how they work, but also back-track and look at mission tables from pre-existing MW2 levels. And remembering how the objectives and gamepieces play out and behave in certain levels, I can then recognize the newly known info, and figure out how the declarations and objectives are pieced together in what order, and discover how info is arranged to make the AI or objectives behave in specific ways.

After putting those puzzles together, we can then rearange data to make scenario modding/making easier and simpler to understand!

This is my plan and hopes on discovering the mission table inner workings.
Last edited by Col.Kell on Thu Jan 29, 2009 9:17 pm, edited 2 times in total.
MechWarrior 2: 31stCC
Image

User avatar
Skyfaller
Clan 2nd MechWarrior
Clan 2nd MechWarrior
Posts: 991
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: Discovering Mission Table Workings: My Plan

Post by Skyfaller » Wed Jan 28, 2009 10:52 pm

Good luck.

I can see why this interests you. If you see it through to the end, you may obtain knowledge on MW2 that no had since the game was programmed. Please post everything you find here, and document the involved BWD tags carefully, it's interesting for me too.

Call for help if you need to, like I did with the MW2 textures. If we get stuck, as a last measure, one of the game programmers has an account here. We can contact him on this, but first let's see how far you/we get on our own.

This may also help.
Download MechVM

If you have problems with MechVM, please attach the files MechVM.cfg and install-report.txt from the folder where MechVM installed your game.

User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: Discovering Mission Table Workings: My Plan

Post by Col.Kell » Thu Jan 29, 2009 7:45 am

You mean Ed Wong and "Hammer" both have an account on here. I haven't noticed any activity from them in the last couple of months... I could use their help right about now, this is hard... :(

And yes, I am recording what I come across on the mission tables, I don't want valuble knowlege to slip away back into the void of time. So far I have figured out the bytes that control priority (primary, secondary...), requirment, shown/hidden, and what star "owns" the objective.
MechWarrior 2: 31stCC
Image

User avatar
Skyfaller
Clan 2nd MechWarrior
Clan 2nd MechWarrior
Posts: 991
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: Discovering Mission Table Workings: My Plan

Post by Skyfaller » Thu Jan 29, 2009 9:13 am

Col.Kell wrote:So far I have figured out the bytes that control priority (primary, secondary...), requirment, shown/hidden, and what star "owns" the objective.
Did you report that in another thread already? Otherwise, please give more detail. Post the resonsible BWD tags, and where you found the data (offset, data type). That way, I won't have to duplicate your work.
Download MechVM

If you have problems with MechVM, please attach the files MechVM.cfg and install-report.txt from the folder where MechVM installed your game.

User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: Discovering Mission Table Workings: My Plan

Post by Col.Kell » Thu Jan 29, 2009 12:09 pm

No, it's not in any thread yet. I was simply giving examples of what I know so far, I am recording these down in a text file; byte, type, porpouse, distance/length, options, etc.
But when the text is complete, I will post it on this thread.

...But yes, I wouldn't want to condem anyone to repeat anything like this :lol:
MechWarrior 2: 31stCC
Image

allmhuran
House Steiner Private
House Steiner Private
Posts: 32
Joined: Mon Nov 24, 2008 4:12 pm

Re: Discovering Mission Table Workings: My Plan

Post by allmhuran » Thu Jan 29, 2009 10:01 pm

I thought I remembered Ed making or getting hold of a program which converted the bwds back into plain text, but I know he can't remember or find it. I think it would be easier to build missions as described in the various FAQ's that can be found around here. Start with blank notepad files, or files from the sample mission which are still in plain text form (dem1.mwm), or the uncompiled mission files that come with one of the 3d editor downloads. Of course, it would be nice to be able to extract a prebuilt environment in its entirety and change a few settings around to make a new mission out of it, but then it loses something in terms of orginality. I recommend you start the way I and I think most everyone else did: With a very simple, blank mission. The mwm version of "hello world". A single mountain, a single nav point, a single objective to go to the nav point. Building that will get you familiar with what the various different important plain text files do (xxxWLDx.wld, xxxPLTx.wld, xxxAREx.wld, xxxSCNx.wld, etc), as well as teaching you which ones you can pretty much just copy in unchanged (except for renaming). Then you wasm.exe it up, drop it in your missions dir (for mercnet at least) and you're set. Of course, if youre editing the prj directly... well... abandon all hope :P

Oh btw, I was Axe, not Hammer ;)

User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: Discovering Mission Table Workings: My Plan

Post by Col.Kell » Fri Jan 30, 2009 8:55 am

Thank you for the response, but, do you have a mission table saved or something? I am trying to take different missions with actual working objectives, and compile them into BWD to see what they look like, that way I can be familiar with all the SCN1 bwd stuff in the prj.

Can you do a special favor for me, Don? Could you create 3 different mission tables for the userstar using MW2EDIT3D? All three being Destroy, Recon, Defend; and the target objective is just an xxxxAREx? And the mission terminates when the objective is successful, and post them here? I would be ever so greatfull to you if you could do that, even just one mission table would be great too. Please? :)
allmhuran wrote:Of course, if youre editing the prj directly... well... abandon all hope :P
I HAVE done this, I CAN prove you wrong. I HAVE PROOF. Doing this is completely possible, as long as the new file doesn't exceed the file size of the prj file you are replacing.
Private Message me your email and I can send you pictures of MW2:31cc PRJ experimentations. Or you can look at my build-a-world thread or Col.Kell's Trial of Grievance map packs 1 and 2 here in the Development sections. :)
allmhuran wrote:Oh btw, I was Axe, not Hammer ;)
hehe... sorry Axe, my bad. :roll:
MechWarrior 2: 31stCC
Image

User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1621
Joined: Tue Jan 22, 2008 10:07 am

Re: Discovering Mission Table Workings: My Plan

Post by Sir MMPD Radick » Fri Jan 30, 2009 12:27 pm

As can I .. I have edited the prj with some results as well.. here
James 3:5-10: My Reminder
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.

User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: Discovering Mission Table Workings: My Plan

Post by Col.Kell » Fri Jan 30, 2009 10:52 pm

My notes on human mission tables in .BWD form:
--- What Kell knows so far about mission tables for humans ---
All the experiments were done using Edward Wong, Don "Axe" Halloran, Michael E. Grover and Patrick A. Grover's MW2EDIT3D for Mercenaries.
Data is near identical and coalates very much with that of the mission tables of 31cc and GBL. There may be some differences but I have not yet recognized any while studying the human mission tables.
Also, some of the bytes described may not always be in the same locations as described due to larger table size, but do not panic! For at least you know what the bytes look like, that will help if you do come across that problem :)

IMPORTANT! :
Just so we are all on the same page; when I say... I don't know... when I say a specific byte is... e.g, 70h away from this or that file or tag, I mean the hex distance starts from the first character after the name or tag we start from, and the distance ends when we get to the character we are looking for, which should be 70h, or whatever it is specified.
e.g., when we look at " dem1st01 . . . . . . . . . . . . . . . . . . gene001s . . gene001f . . . . " and we are starting from dem1st01 and want to end at gene001s, the first character we start from would be the first byte after dem1st01.
I don't know all this stuff about "words" or "blocks"... so until I do, you'll just have to downgrade to my mindset for the time being. xD

-------------------------------------------
The 70th hex away from the xxxxSTxx is the time a star has to complete an objective. Infinate time is set as "FF FF FF". Time is in seconds.

74h away from xxxxSTxx are two bytes that tell what priority a mission is, and if it is required or optional.
The first byte seems to tell the sim what priority a mission is, 01 is for primary, 02 for secondary, 00 for tertiary.

The second byte tells the sim if this is an optional or manditory objective, type 4D for required, and 4F for optional.

4Ah away from xxxxSTxx is the byte that tells if the objective is shown or hidden to the player when he presses F12 to view the objectives. Use 56 for shown, and 48 for hidden.

46h away from xxxxSTxx are the pair of bytes that call out whats called the "action" (e.g., destroy, recon, defend, goto, sleep, objfail, return, etc.). Here are all the ACTION commands, typing in the following bytes will give you:

bytes 46h - 48h away from xxxxSTxx:
"00 02 00" is WAIT
"02 00 00" is DESTROY
"04 00 00" is DEFEND
"08 00 00" is RECON
"00 01 00" is GOTO
"20 00 00" is RETURN
"00 20 00" is LEAVE
"00 08 00" is SHUTDOWN
"00 04 00" is SLEEP
"00 10 00" is EXPLODE

bytes 46h - 48h away from xxxxSTxx:
"00 00 01" is MSNSUCCEED
"00 00 02" is MSNFAIL
"00 00 20" is MSNRESET
"00 00 10" is OBJSUCCEED
"00 00 08" is OBJFAIL
"00 00 40" is OBJRESET
"00 00 04" is OBJSHOW


Located 90h away from xxxxSTxx (excluding the FF FF tag,) is the TARGET type. The TARGET can consist of a NAVPOINT (xxxxNAVx), a STAR (xxxxENSx for enemy mech stars, xxxxUSRx for friendly stars, and either USERSTAR or xxxxSTAR for your own), an AREA (xxxxAREx), a star's STARTPOINT (xxxxSTx1), or NONE (NULL).
We use the TARGET definition to tell the sim what this mission objective revolves around, while the data that comes after that tells HOW this objective is to be carried out and what conditions make us win/lose.

This is about all I have discovered in my reverse-engineering study on mission tables using MW2EDIT3D, and so this concludes my first phase of the process. The second phase will be to recognize the hex bytes in the scenario, and figure out what the commands would look like in text.
In other words, I am converting the source text (.WLD) into binary world (.BWD), and then taking .BWD and mentaly converting it back to text so I can understand how it was all organized to make the mission.

After that, I MAY consider looking into the AI mission tables.
(I dread the thought. Unlike the AI tables, the human players who use the human table is free to do his own will; the sim doesn't tell him how he's gonna pilot that mech of his, only he does. However... the AI is a different story, the AI is like a little child who's hand you have to hold every step of the way, it requires all this additional info that enables it to react in certain situations. Basicly, it means AI is a whole lot more complex than human tables...)
Please inform me if there is need for any clarification.
MechWarrior 2: 31stCC
Image

User avatar
Skyfaller
Clan 2nd MechWarrior
Clan 2nd MechWarrior
Posts: 991
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: Discovering Mission Table Workings: My Plan

Post by Skyfaller » Sat Jan 31, 2009 12:21 am

Good work so far!
Download MechVM

If you have problems with MechVM, please attach the files MechVM.cfg and install-report.txt from the folder where MechVM installed your game.

Post Reply