Jump to content


Photo

Modding Commandos 1: a few questions


  • Please log in to reply
31 replies to this topic

#1 Maurice1976

Maurice1976
  • Members
  • 75 posts

Posted 06 September 2017 - 07:51 PM

Ever since the game was first released, I've been playing it on and off through the years. I was disheartened when Pyro gave up on the title after Commandos 3, especially since there didn't seem to be any easy way to create new levels. Fast forward to recent times, I bought the GOG versions not too long ago (mostly to avoid Windows compatibility issues), applied the awesome resolution fix and played through it once more. That's when I actually learned of the various modding tools - and this forum, too.

 

I've extracted many of the game files and started exploring them, both from BEL and BCoD, trying to make sense of how they "made it work". It has been enlightening as well as entertaining. After playing through Lexx's awesome mission pack, I decided to give it a try myself. Inadvertently, however, I found that information is sometimes sketchy at best, or perhaps I'm simply not looking in the proper places, but leaving me with questions anyway. Hopefully, they can get answered here. In no particular order:

 

- The MIS files are pretty large, especially for the bigger missions. While I am not averse to getting my hands dirty, I wonder if there are any tools out there to take away part of that burden (like the map editor, but then to add soldiers, patrols, vehicles and the like and set various attributes for them, as well as patrol routes)? And/or any detailed information about the entries in that file? A number of them are pretty straightforward, but for instance the section that takes care of the trains or the vehicles that enter and leave the map again, with or without a driver exiting it at some point, look rather complex. Is there some information about it anywhere? Or will I have to figure out most of how that "works" by trial and error by myself?

 

- The MIS files contain a specific entry initially which is basically a pointer to mission-specific stuff. It obviously handles objective states (as detailed by the various mission results texts in the MAPAxxxx.STR files) and as I read elsewhere also additional stuff like the electric fence (mission 3 in BEL) or the surf wave (mission 1 in BCoD). Is there a detailed overview of what each of these hard pointers does? Or is that still mostly unknown?

 

- In the same section, the MIS files also contain an entry "EXITPOINTS". What do these represent? I've sometimes seen units wander off the map (patrols that had lost all of their soldiers except for the Sergeant, without means to regenerate it), do they use the closest of these exitpoints for that purpose?

 

- The game features two VOL files: a MAPAxxxx.VOL and a matching CHOQxxxx.VOL file. What's the purpose of having two files? As far as I can see, the only difference seems to be the EXTRAINFO section (present in MAPA, missing in CHOQ), which handles the explosion bits if you blow up the polygon ingame. Or is there something else that I am missing here?

 

- Likewise, the game has a .TIP file, as well as a .POL file, which basically seem to do the same. The only difference is that the TIP file specifies a box in which it will show the refered tooltip ingame, while the POL file specifies a polygon shape (noting that a box is essentially a 4-point polygon with connecting lines at square angles from one another). It seems redundant to have two files that basically do the same thing.

 

- I'm trying to wrap my head around the difference between sectors on one hand and the points as listed in the VOL file on the other hand. Sectors already define passability and visibility through the sector in question, so what does the game do with the object points? Especially since you can also define a height for the points; the map editor tutorial has you create a box around the tent this way, but it doesn't say why the game needs that. I'm missing something as to why these are needed; do they have to do something with view cones, or with units passing behind these areas defined by those points?

 

I might have more questions as my mapmaking proceeds, but I'll leave it at this for now ;).


Edited by Maurice1976, 06 September 2017 - 07:54 PM.


#2 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 07 September 2017 - 07:44 PM

Hi, I'm trying to answer your questions to the best of my knowledge and belief :)
I'd like to point out that English isn't my first language, so please excuse any grammatical errors.
 

- The MIS files are pretty large, especially for the bigger missions. While I am not averse to getting my hands dirty, I wonder if there are any tools out there to take away part of that burden (like the map editor, but then to add soldiers, patrols, vehicles and the like and set various attributes for them, as well as patrol routes)? And/or any detailed information about the entries in that file? A number of them are pretty straightforward, but for instance the section that takes care of the trains or the vehicles that enter and leave the map again, with or without a driver exiting it at some point, look rather complex. Is there some information about it anywhere? Or will I have to figure out most of how that "works" by trial and error by myself?

Some information about the MIS entries can be found here: http://commandosmodd...os_Modding_Wiki
Unfortunately there's no info about the more complex sections (trains, scripted vehicles). Yeah, at some point it's really more like a trial and error thing.

Some time ago I wrote a script for Cheat Engine. It allows me to log the position of the mouse pointer and create the mission script for new soldiers with a few key strokes. Would you be interested in that script?
 

- The MIS files contain a specific entry initially which is basically a pointer to mission-specific stuff. It obviously handles objective states (as detailed by the various mission results texts in the MAPAxxxx.STR files) and as I read elsewhere also additional stuff like the electric fence (mission 3 in BEL) or the surf wave (mission 1 in BCoD). Is there a detailed overview of what each of these hard pointers does? Or is that still mostly unknown?

This hasn't been documented anywhere yet. I think all special animations (water from the dam, sparks, the lights on the radio station in mission 1, the conveyor belt in mission 19) and escape vehicles that pick your men up, are hard-coded. But there's an easy way to find out what is defined in the MIS and what mission-specific code is loaded from the EXE, just remove the INTENDENCIA line and restart the mission, this should deactivate all special behavior.
 

In the same section, the MIS files also contain an entry "EXITPOINTS". What do these represent? I've sometimes seen units wander off the map (patrols that had lost all of their soldiers except for the Sergeant, without means to regenerate it), do they use the closest of these exitpoints for that purpose?

Exactly!
 

The game features two VOL files: a MAPAxxxx.VOL and a matching CHOQxxxx.VOL file. What's the purpose of having two files? As far as I can see, the only difference seems to be the EXTRAINFO section (present in MAPA, missing in CHOQ), which handles the explosion bits if you blow up the polygon ingame. Or is there something else that I am missing here?

The CHOQxxxx.VOL define obstacles (like tree trunks), all other obstacles - the navigation mesh - are defined in the SEC file.
When I create new maps, I also define those small obstacles in the SEC. I guess the developers introduced the CHOQ files so that the map designers have more freedom in moving the trees around on the map, any (last minute) changes wouldn't require to recalculate the SEC files.
 

Likewise, the game has a .TIP file, as well as a .POL file, which basically seem to do the same. The only difference is that the TIP file specifies a box in which it will show the refered tooltip ingame, while the POL file specifies a polygon shape (noting that a box is essentially a 4-point polygon with connecting lines at square angles from one another). It seems redundant to have two files that basically do the same thing.

Yes, it is redundant. I have no clue why they use two files. Maybe they only had .TIP files first and later they realized that a simple box isn't enough? I don't know.
 

I'm trying to wrap my head around the difference between sectors on one hand and the points as listed in the VOL file on the other hand. Sectors already define passability and visibility through the sector in question, so what does the game do with the object points? Especially since you can also define a height for the points; the map editor tutorial has you create a box around the tent this way, but it doesn't say why the game needs that. I'm missing something as to why these are needed; do they have to do something with view cones, or with units passing behind these areas defined by those points?

SEC is purely for navigation and the line of sight (view cone).
The definitions in the VOL file give the 2D sprites a 3D shape, so that the game knows in which order it has to draw the sprites.
If the 3D polygon doesn't represent what the player sees on the 2D image, things like this could happen:
vol.jpg

 

Alright, that would be all for the moment, I hope I could help you with my answers.



#3 Maurice1976

Maurice1976
  • Members
  • 75 posts

Posted 07 September 2017 - 10:36 PM

Hey Herbert,

 

Thanks for your detailed answers. Don't worry about your English, it's not my primary language either :p.

 

I've already found the modding Wiki (and as I already understood, you initially set that one up ;) ), but I noticed that it indeed lacked the more complex sections. Hence the question ;).

 

Just this evening I ran the comandos.exe through IDA 5.0 to disassemble it. I did find a section referencing the INTENDENCIA parts, but can't make heads or tails of it yet. Some of them, for instance the mission to blow up the dam, has a somewhat larger data section, while most of them are pretty bland. I suspect the section actually details a number of variables (the dam mission has explicit references to TRP1, TRP2 and TRP3, which are the TRIPLINES ID's as listed in the MIS file of that mission - but note that within the exe file, the reference tag is reversed for some reason, i.e. "1PRT2PRT3PRT". I suspect this is an issue with representing it in Little Endian vs. Big Endian format) . After that, the code seems to follow a series of subroutines, the address of which is located at each of the intendencia entries there (the address is stated as 7CDD6F; reversing that just like the tags yields an address of 0x6FDD7Ch. Since at runtime the game shifts everything by 0x400000h, the actual address within the exe is actually 0x2FDD7Ch. That address is the start of a very short subroutine, which in turn calls another subroutine ... etc, that's where I lose track of what the game does). Strange enough, I have yet to find any of the string variables that are listed in the MAPAxxxx.STR files, so those might actually be referenced based on linenumber instead of reference code.

 

But I digress. With regards to the CHOQxxxx.VOL file, your explanation actually makes sense. Still, after creating the VOL files with the currently available toolset, any adjustments afterwards need to be done manually, right? At least, I don't recall an option in the map editor to actually load an existing VOL file into it.

 

Thanks for your explanation on the sectors and points. My thoughts started to drift in that direction already, thanks for confirming those suspicions :). I see Tiny on the roof of that building in your image, but I understand that he's actually behind the building rather than standing on the roof.

 

As for the script, that might be useful, but I don't really know what the CheatEngine program is. I was figuring to load up the (empty) map in the game and then use the debug option to get cursor positions, writing them down on a piece of paper, then going back into the MIS file and using those to get the various waypoints for patrols and the like. A program/script to generate these would probably be better than writing them down, before manually putting them into a MIS or VOL file.

 

At the moment I am still going over the original game's MIS files. While I intend to make some mission in BCoD, I figured I would first get the basics down with the BEL files, before figuring out the extras that came with BCoD. I've been pouring the MIS files into Excel and cross-referencing everything in it, trying to find all the various parameters and variables, commenting on what each of those does - of course augmented with all the information that's already available on your wiki :).

 

Just two more quick questions, to see if those things could work in the missions I am planning:

1) Is it possible to have more than 1 train on a given map? I mean a moving one, of course ;). Either on a separate track (like having 2 tracks, 1 in each direction), or various different train setups on 1 track, at various times apart.

2) I am guessing the sniper rifle range is hard-coded? I had an idea of having the player putting the sniper into a belltower at some point, increasing the weapon range ... but I suspect this one is impossible.



#4 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 08 September 2017 - 01:08 AM

1) Yes, having 2 (or more trains) should be no problem.

2) I'm afraid that's hard coded. But maybe you can figure out where the values are stored in the EXE.

These are the ranges in pixels: colt and grenade: 300, sniper rifle: 1000, harpoon: 100, sub-machine gun and static machine gun: 400

(I think that the range of the harpoon was changed with a patch, so it's possible that the harpoon in the gog.com version has a different range)

 

Oh yeah, the "writing down the positions on a piece of paper"-method. The approved way for modding the MIS files since 1998 :D

Here's the Cheat Engine script (but it only works with the bundled Debug exe): Attached File  CheatEngineScript.zip   1MB   23 downloads

I wrote some info about the usage at the top of the script.

 

Although you can't load a VOL into MapEditor, you can save your work with F5, quit the program and load the map later with F6. Every time you exit MapEditor, it will create the file MapEditor_backup.cme which can also be loaded with F6.

 

And feel free to update the Wiki if you have some valuable information :) Future modders will be thankful!



#5 Maurice1976

Maurice1976
  • Members
  • 75 posts

Posted 08 September 2017 - 08:22 AM

Nice to know! In one of the missions I plan to make a somewhat busy traffic junction, with several trains heading both directions. I don't plan to give the player actual access to the railroad, it's mostly intended as scenery.

 

I'll see what I can do, but IDA 5 is a bit ... crude. It's like disecting a car engine to figure out how it works mechanically, with having just a sledgehammer and chainsaw as tools available :p. Still, I've disassembled two games before, the exploration of the inner mechanics was entertaining and insightful - especially when discovering bugs :p. In this case, I explored a bit more yesterday evening but instead of following the bread crumb trail, I decided to take a different approach. Mission 3, the destruction of the dam, features an automated escape vehicle, since the Driver is missing from that mission. The vehicle has two tags in the MIS file, being CAMA and HCAM. Inverting those to AMAC and MACH, I did find those two close together within the exe, so that has to be the subroutine that handles the triggers surrounding the escape in that mission. While browsing through some of the other subroutines around that section, I also noticed one particular case in which the game pushed a certain tag to the stack, essentially triggering the events that are attached to that trigger in the MIS file. Will continue that exploration this weekend, I guess ;).

 

Thanks for the script, I am sure it will prove useful once I get around to actually creating maps. I plan my first map to be relatively small / short, with Fins and Spooky having to destroy 1 object before making it out of there. It will be the first mission of what will hopefully turn out to be a 6-mission mini campaign. For now, though, I am still aggregating all the MIS file information. When I have something conclusive to add to the Wiki, I will certainly do :).



#6 Salvadorc17

Salvadorc17

    title available

  • Members
  • 490 posts
  • Location:Colombia
  • Projects:https://github.com/salvadorc17/CommandosMaker

Posted 15 September 2017 - 08:21 PM

There is not already a editor for that MIS files, the file provided by malik cjm, or does is only for Behind enemy lines?



#7 Maurice1976

Maurice1976
  • Members
  • 75 posts

Posted 15 September 2017 - 10:23 PM



There is not already a editor for that MIS files, the file provided by malik cjm, or does is only for Behind enemy lines?

 

Thanks! I checked out your reference on that name and indeed found the relevant posts here. However, it doesn't seem Malik has updated his editor to work with the BCoD version from GOG (which is the one I currently use). Although ... I also have the original disks somewhere, I could check out and see which version that is. Edit: It's a small exe and when I try to run it, it says it isn't supported by Windows NT. Might be a compatibility issue, but given how old it is, I doubt it's the 1.0.6 version that Malik mentioned in his description. Unless someone has that version of the exe, I doubt I will be able to use his editor.

 

I intend my missions for BCoD, in any case.


Edited by Maurice1976, 15 September 2017 - 10:43 PM.


#8 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 16 September 2017 - 04:55 PM

Here's a BCD .exe that works with Malik's hack: Attached File  coman_mp.zip   1.24MB   52 downloads



#9 Maurice1976

Maurice1976
  • Members
  • 75 posts

Posted 16 September 2017 - 05:58 PM

Here's a BCD .exe that works with Malik's hack: attachicon.gifcoman_mp.zip

 

Thanks once again! :thumbsuphappy:

 

I haven't much time in the next few weeks, unfortunately, but I've been able to get a list of all shadows across BEL and BCoD. Now I can go over the VOL files of either game and check to see to which main graphic they're attached - and make the link explicit in some Excel sheet (including offsets). That should help to eventually automate the process of adding shadows to objects, saving you the hassle of having to do it yourself.



#10 Jeroen

Jeroen
  • Members
  • 177 posts
  • Location:Noord-Brabant
  • Projects:Commandos BEL är bara smörja.

Posted 16 September 2017 - 06:27 PM

Who is Malik? What is his hack?

I do have a BCD version of the Polish program called Komandos Edytor, from www.komandos.zone.zg.pl, if anyone wants to try that. (Their BEL editor is also available in German, but not the BCD editor AFAIK)



#11 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 16 September 2017 - 06:44 PM

Who is Malik? What is his hack?

https://malik-cjm.blogspot.co.at/



#12 Salvadorc17

Salvadorc17

    title available

  • Members
  • 490 posts
  • Location:Colombia
  • Projects:https://github.com/salvadorc17/CommandosMaker

Posted 16 September 2017 - 08:22 PM

Who is Malik? What is his hack?

I do have a BCD version of the Polish program called Komandos Edytor, from www.komandos.zone.zg.pl, if anyone wants to try that. (Their BEL editor is also available in German, but not the BCD editor AFAIK)

 

Sure, share that, i cant get links, seems all broken.



#13 Jeroen

Jeroen
  • Members
  • 177 posts
  • Location:Noord-Brabant
  • Projects:Commandos BEL är bara smörja.

Posted 16 September 2017 - 09:43 PM

Here it is. I hope it works on your octa-core, 32 gigabyte RAM, windows 10 machines.

Attached Files


Edited by Imp, 16 September 2017 - 09:44 PM.


#14 Maurice1976

Maurice1976
  • Members
  • 75 posts

Posted 17 September 2017 - 07:38 PM

While examining the VOL files, I found a reference to a file called "-EXPLO00.RLE" with regards to exploding objects. As far as I can tell, they're used to display a fire blast to display the explosion, but I can't find where they actually stored this file. I've extracted all WAD files as far as I can tell, but I'm not seeing any file with this particular name. As it is, the explosion effect rather seems to be a sequence of images instead of a static one. Any idea how this one functions?



#15 Jeroen

Jeroen
  • Members
  • 177 posts
  • Location:Noord-Brabant
  • Projects:Commandos BEL är bara smörja.

Posted 17 September 2017 - 07:45 PM

See attachment. They must have had a macro generator as well and an "element generator. I will look for those.

 

Attached Files


Edited by Imp, 17 September 2017 - 07:46 PM.


#16 Lexx2k

Lexx2k
  • Members
  • 128 posts
  • Location:Berlin
  • Projects:BTCOD Mission Pack

Posted 18 September 2017 - 05:15 AM

 

Who is Malik? What is his hack?

https://malik-cjm.blogspot.co.at/

 

 

Reminds me of how cool it would have been to get the flamethrower and other stuff to work. I even started working on some animation tests back then, but eh, if the mechanics don't work...



#17 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 18 September 2017 - 07:51 AM

While examining the VOL files, I found a reference to a file called "-EXPLO00.RLE" with regards to exploding objects. As far as I can tell, they're used to display a fire blast to display the explosion, but I can't find where they actually stored this file. I've extracted all WAD files as far as I can tell, but I'm not seeing any file with this particular name. As it is, the explosion effect rather seems to be a sequence of images instead of a static one. Any idea how this one functions?

I guess -EXPLO00.RLE relates to the sprites of EXPLCASA.WAD (although, as you already mentioned, the sprites inside the WAD have a different filename). The name -EXPLO0?.RLE is probably recognized as some kind of macro by the EXE. You'll also notice that -EXPLO00.RLE through -EXPLO03.RLE show a slightly different animation.



#18 Maurice1976

Maurice1976
  • Members
  • 75 posts

Posted 18 September 2017 - 08:57 AM

 

While examining the VOL files, I found a reference to a file called "-EXPLO00.RLE" with regards to exploding objects. As far as I can tell, they're used to display a fire blast to display the explosion, but I can't find where they actually stored this file. I've extracted all WAD files as far as I can tell, but I'm not seeing any file with this particular name. As it is, the explosion effect rather seems to be a sequence of images instead of a static one. Any idea how this one functions?

I guess -EXPLO00.RLE relates to the sprites of EXPLCASA.WAD (although, as you already mentioned, the sprites inside the WAD have a different filename). The name -EXPLO0?.RLE is probably recognized as some kind of macro by the EXE. You'll also notice that -EXPLO00.RLE through -EXPLO03.RLE show a slightly different animation.

 

 

I suspect it's something hard-coded then. As it is, it displays a sequence of images that represents an evolving fireblast that eventually dissipates again, rather than a single static image. I've noticed that the tags behind the filename is "..L" in a lot of cases (though not always). I know "X.." means it's mirrored in the X direction and ".Y." likewise in the Y-direction ("XY." obviously for both), but I couldn't find what "..L" stands for, either. I've seen it's also used for the pulsating light at the switches they use in some missions. Any ideas?



#19 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 18 September 2017 - 09:08 AM

About the "..L" tag, well, I don't know the correct term but in Gimp I get the same result if I set the blend mode to "Addition":

explosion.png

(left=Normal, right=Addition)



#20 Maurice1976

Maurice1976
  • Members
  • 75 posts

Posted 18 September 2017 - 10:11 AM

It's probably an indication that it should be an overlay then (i.e. black is considered transparent). Something similar happens with the blinking red light, after all. Curious, because I have seen some EXPL references that don't have it ... which should show rather clearly then. Will check some of that tonight.

 

Edit: I've made a few trials (and errors :p). The presence - or lack thereof - of the L tag doesn't seem to affect the explosion in any way. It will still display the explosion as it should do, with whatever is exploding visible underneath it. Changing the name of the explosion graphic for something else has a profound impact, as it will no longer show the explosion at all - in fact, it will not show anything anymore. I have to admit that that does look weird, though; you just suddenly see the ruined graphics appear and debris flies everywhere, there's just no inferno.

 

Also tried a few other things with regards to patrols: changing their velocity and changing the route type to "JUMP" instead of "LOOP" or "PINGPONG" or similar. The good news: JUMP is a valid command, even for soldiers on patrol (whether they are individual soldiers or compound patrol groups). The bad news: for a compound patrol group, only the leader jumps to the new coordinate. The soldiers following him will travel to the jump coordinate by conventional means, i.e. on foot. In BEL, the soldiers following the leader also don't pick up on the velocity of the leader, so when you set their velocity real high, they will lag behind. At least BCoD seems to have fixed that particular issue. Another piece of bad news: it doesn't seem to be possible to change the velocity of a patrol during the patrol itself; it seems to be set only once.


Edited by Maurice1976, 18 September 2017 - 06:50 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users