As you know we made huge progress in understanding the Dark Omen binary file formats in the last months.
In the previous days I found a way to enable multiplayer mode on all maps and also uploaded a video demonstration (Watch the Videos). Because of some bugs in this patch I’ll not release it at the moment.
Today I want to explain how this Multiplayer Patch works:
At first you should download Rob’s BTB-Editor to make understanding things easier.
A BTB-File consists of many different “Chunks”. The first important one the second chunk:
<CHUNK type="2">
<TUP3 type="3"> (26, 0, 0) </TUP3>
<TUP3 type="3"> (1, 86, 4) </TUP3>
<TUP3 type="3"> (3, 1, 0) </TUP3>
<TUP3 type="3"> (4, 1, 0) </TUP3>
<TUP3 type="3"> (7, 64, 256) </TUP3>
<TUP3 type="3"> (10, 128, 0) </TUP3>
</CHUNK>
(3, 1, 0) defines the lose condition (the other “tuples” are unknown). ID 1 is the Unit ID of the regiment which is not allowed to die (in singleplayer mode ID 1 is Bernhardt). Delete (with e.g. a hex editor because Robs viewer can’t delete/add entries) this entry to disable the “Bernhardt Bug” (quite useful for creating “protect regiment” missions btw). You can see the Unique Unit ID by using Wh2Edit (called “Earliest Apperance”) or with the help of a hex editor (byte 5 and 6 in the regiment block). Note: Wh2Edit has a “bug” (because it is 10 years ago nobody had known that the Unit ID is a 16bit variable). This causes a problem when displaying the ID of some enemies (because they often have IDs greater then 255).
Ok, back to topic: The next important Chunk is the last one: It defines among other things which regiments are allowed to by deployed (and where). This is also used to disable Cannon and Mortar in the Drakenhof Castle mission.
Example for such a regiment block:
<SUBRECORD type="503">
<INT type="5"> 16387 </INT>
<INT type="1"> 264 </INT>
<INT type="2"> 271 </INT>
<INT type="6"> 48 </INT>
<INT type="7"> 0 </INT>
<INT type="11"> 0 </INT>
<INT type="12"> 1 </INT>
<INT type="13"> 100 </INT>
</SUBRECORD>
The important ones are the entries with the IDs 1, 2 and 12 (rest is mostly unknown). 1 and 2 are the X and Y coordinates were the regiment is deployed by using the “Auto deploy” button (or setting their Active-Status to “Key Regiment / Auto Deploy”). As long as you don’t want to autodeploy something these IDs are unimportant. Watch Out: When a regiment-coordinate overlaps with something else on the map the game will crash. You can fix this by using high coordinates like 3000/1000, 3000/1100 and so on. I will also use such coordinates in my Trading Post patch.
The entry with ID 12 is the Unit ID (which you can view with Wh2Edit as said above). In multiplayer mode the IDs are autopatched with p1kf and p2kf.arm (change B101mrc and B101nme in the BTB-Header to p1kf and p2kf). So you have to open these 2 arm-files to get the IDs (the IDs are 1-15 and 101-115).
By adding a new entry like…
<SUBRECORD type="503">
<INT type="5"> 16387 </INT>
<INT type="1"> 3000 </INT>
<INT type="2"> 1500 </INT>
<INT type="6"> 48 </INT>
<INT type="7"> 0 </INT>
<INT type="11"> 0 </INT>
<INT type="12"> 105 </INT>
<INT type="13"> 100 </INT>
</SUBRECORD>
…you can enable the 5th regiment of the second player. Add these entries for all regiments and you are done theoretically. For some reasons these changes crash on startup for some unknown reason (I can enable 15 player 1 and 6 player 2 regiments at the moment). As long as I can’t fix this I’ll not release my patch.
Update: I tested it on the black pyramide map and it didn’t crashed. So it must be a problem with the trading post map (end of update).
Note: Don’t forget to change the Integer at the beginning of the chunk to the new number of entries in the junk.
Last but not least it’s also a good idea to change the deployment zones to make a fair fight possible:
There are 2 region chunks available called “mercdeploy” and “enemydeploy”.
Example:
<CHUNK type="4">
<STR type="1006"> Mercdeploy </STR>
<INT type="5"> 259 </INT>
<TUP2 type="10"> (168, 48) </TUP2>
<TUP4 type="502"> (168, 48, 592, 48) </TUP4>
<TUP4 type="502"> (592, 48, 592, 248) </TUP4>
<TUP4 type="502"> (592, 248, 448, 400) </TUP4>
<TUP4 type="502"> (448, 400, 288, 496) </TUP4>
<TUP4 type="502"> (288, 496, 136, 496) </TUP4>
<TUP4 type="502"> (136, 496, 136, 104) </TUP4>
<TUP4 type="502"> (136, 104, 168, 48) </TUP4>
</CHUNK>
The entries with ID 502 define start and end position of the “deployment lines” (x1, y1, x2, y2). This should be quite self explanatory because of this I’ll not take any deeper look on it in this blog entry.
I hope this blog post made understanding the Trading Post Multiplayer Patch a bit easier (for modders
).
More information about BTB files: BTB File Format in the Wiki