Mechwarrior 2 Mercenaries : The Next Wave

Updated July 17, 2001

Recent changes:
Added link to MW2.PRJ file viewer called PRJGET.

This website was created to describe an effort by myself to create what I believe to be the way Mercenaries should have been made.  It is my hope that this page will inspire others to create their own games and maybe even join in on my efforts.  Hopefully I will be able to update this page regularly as to the status of the project.  First lets start with a vision for what I would like to see in a RPG front end for the MW2 Mercenaries simulation engine.

Vision

I envision a complex universe filled with planets, machines, people and the almighty quest for the c-bill.  I envision treasure hunts using Star League data chips that contain maps.  I would like to see clan weapons salvaged from peripheral planets sold to weapons companies who in turn pay royalties and/or instant profits to the seller.  I would like to drive tanks, man turrets, fly aerospace fighters, jumpships and helicopters, drive armored cars, and nuke whole cities all in the pursuit of cash.  I would like to see royal houses put a contract on my head for nuking his favorite vacation spot.  I want to place bets on fights in the Solaris games.  I want to wake up in the morning to the sound of the mech powering up after being kidnapped the previous night by a rich kid who wants to test his skills.  Then when the kid gets killed in the endeavor I want to weave my way through the universe wondering when his family will finally catch up to me.  I want to get kidnapped by the clans and get thrown into the laborer caste until I get a chance to either die or work my way up to being a warrior, scientist or merchant.  This time not for money, but for a way back to the Inner Sphere.  After all, clan or not we just want a piece of Terra.  Some of us would rather just buy it.  I want to buy my own jump ships and hire techs to fix things rather than paying high fees for installing equipment.  I want to purchase a badly damaged clan mech shell and put IS legs on it to repair it.  I want to build mechs that walk 10kph but have 75 tons of armor.  I want to play a game that does not end because there is no more story.  I want people to be able to add plots, subplots, missions, mechs, vehicles and generally take part in this grand adventure.  I want what the original Mechwarrior had but Mechwarrior 2 and since have not delivered.

Technical Plan

In a nutshell: to replace the MW2SHELL.EXE in the DOS version of MW2 Mercenaries
This file is where all the story line of the game is stored and viewed.  I have successfully created a mission launcher that will launch all the internal missions (see below).

Technical Accomplishments

File formats decoded:
  MW2.PRJ - This file is equivalent to what a WAD is to Doom.
  xxxxSTAR.BWD files - These contain mission parameters describing starmates and enemies to the SIM.
  SHP files - These are the buttons and other images used in the shell.

Launching missions:
  I have figured out all of the command line arguments to launch internal, external, and mercnet missions for use in another program such as a launcher (see below).

Retrieving data afters missions:
  I have determined that you can get damage data for your own mech as well as possibly salvage information on enemy mechs.  It seems that if you place the MEK file for your own star's mechs in the MEK directory it places the damage info in the file.  It is possible this will also work with enemies.

Technical Needs

File formats:
  Determining which files contain information about the mission results.  Files that are changed after a mission is completed are: MW2SND.CFG, MW2CAR.CFG and MW2MSN.CFG.  There may be others and if anyone pursuing figuring these guys out would benefit from the use of the launcher (see below).

Weapon info:
  I need weapon numbers for the weapons in the mech.  If someone with hex editor were to use it to determine what is in the mech by methodically changing weapons and recording the "text" and the "hex weapon numbers" in a text file that would save a lot of time.  If someone were to explore and figure out how to put nukes and torpedoes in their mech that would be awesome.

Files for random missions:
  Internally to the MW2.PRJ file are what I have to guess are random mission files.  But in order to extract and run them there needs to be other support files.  I would like help in determining how to do this.  I do have a start on a file extractor for the MW2.PRJ file but it is not done yet.

Ideas (not strictly technical):
  I am going to need ideas to do anything useful.  I have not even started on the RPG side, but am currently developing all my support files to make things easier.  I would like ideas for how to structure worlds, people, governments, goals, plots, etc...  I plan on using an OOP methodology to make adding new objects easier and I plan on making use of scripting for plots and personality descriptions.  However, if anyone has done this before they might be able to point me in the right direction or even show me how to do things, or even help write it.  I plan on releasing this code under the GPL to encourage further development.

Programming Environment

I have chosen to develop this program in DOS for many reasons.  First the DOS sim (MW2.EXE) is accessible to other DOS programs.  It may be accessible to Windows programs, but I really do not want to write a full screen Windows program and deal with the Windows API.  The reason I want full screen is because it is more immerssive.  I have also tryed to develop programs under Windows.  It stinks and is unstable.  I would rather go stick my head in a toilet.  The tools I am using are DJGPP compiler, Allegro (game developer library, very nice), and the Raw Hide IDE (which is very nice as well).  The DJGPP compiler is actually a port of the GNU GCC compiler for protected mode DOS.  It is a very good compiler that I believe I will use in the future at work.   The DJGPP compiler has some other nice features.  If I decide I want to port this to Windows I can just download the appropriate libraries and write code for Windows with it.  Not only is the GCC compiler a industry standard compiler but it can be used to cross compile to Mac, Windows, DOS, Alpha, etc...  Try that using Visual Basic or Visual C++, NOT!

Support Tools

A note about the support tools.  They tend to be big because of the libraries I am using. Most are at least 500k uncompressed.

Launcher (230K) - Status: Ready
This program comes in two parts.  The first is the launcher.exe file and second is the userctrl.exe file.  The reason there are two files is due to the fact that DOS DJGPP compiled programs tend to swallow all the memory so that the MW2.EXE I am trying to spawn does not have any.  So the userctrl.exe program is a Turbo C++ for DOS  16-bit program used to launch both the launcher and the sim (MW2.EXE).  By the way, this is exactly how the programmers at Activision did their code for Mercenaries.  There are three main programs in the mercs directory: mercs.exe, mw2shell.exe, and mw2.exe.  Mercs.exe is the DOS 16-bit program.  Mw2shell.exe and mw2.exe are both protected mode programs.  My programs need to be placed in the mercs directory so that they have access to the MW2.PRJ and the MW2.EXE files.  These programs also work for Mech2 and GBL, but they do not have the features I want in a sim.  Besides they are not as cool as Mercs, right?  I have a problem with the fascist clan society idea.  Being a Merc to me is more American.

SHP file viewer (210K) - Status: Ready
Note: This is just a test utility to test some code to read these files.  The palette is not accurate and some pics mess up.

Okay, this is weird but I made it anyway.  I wanted to be able to use the buttons and graphics that came with Mercs.  However, I could not find any info on this format (I think it is proprietary).  So it became a challenge.  I sat for hours thinking about what all the numbers mean while staring at a hex editor.  The header was the easy part.  It told me there were muliple images, and where they were in the file.  The header of each image told me their size.  Then I tried reading in the data.  Sure I knew that the width * height = real_size meant the data was compressed or encoded.  Then I thought RLE (run length encoding, the simplest of encoding schemes).  If this is a custom format developed by Activision it can't be particularly sophisticated, right?  Well, I tried many variations of PCX style RLE and nothing.  Then I thought, maybe they RLE encoded the textures.  Well, that did not work.  Then still looking at the hex data I thought, what if I tweak some numbers and watch it display in Mercs (duh).  So I did that and after writing down the results and carefully analyzing them I realized the data is divided up into control bytes and data bytes.  If I see a zero, then it means go to the next row.  If I see a one then I skip writing the next n bytes.  If it is even then I repeat the next data orignal number divided by two equals n times.  If I see a odd number then I write the next original number divided by two n bytes.  If this is greek then look at the code.  If that is greek I can't help you.

MW2.PRJ Extractor (230K) - Status: Ready.
This will allow people to extract the data built into the MW2.PRJ files for Mercs, Mech2, and GBL.  It is not intended as a way to rip off data.  It is there to help us develop a new and better Mercs.  Being able to extract files has done quite a bit for my understanding how all the data is structured.  I will pull this kind of code if I think people are just ripping out sounds and bitmaps for lame Windows themes.  Although I cannot control other people I cannot, in good conscience, knowingly support the theft of intellectual property.  (My apologies to those who do not engage in this sort of conduct.)
 

Various Code Files

These will help for people creating their own support programs.

DEFMEK.H - This is the internal definition of the MEK file format, with comments.
 

Contact

demolishun@lycos.com

Do not be afraid to ask questions or to say what you think about this plan.  I am open to suggestions and constructive criticism.