Patching MechCommander's "left arm bug" for fun and profit
mhloppy.comI have forever been confused by 'left' and 'right'. It takes me a few seconds of deliberate thinking to get it right.
So in one of my first piece of software that I wrote for real money I had two functions. One called create_scene_left(), the other called create_scene_rght().
I was very pleased with myself for sneaking in creating_a_scene, but the left and right versions did the opposite of what their names indicated. Users of the software had no problems, but I am sure it would confuse any maintainer.
It even took me an year to even realize that the names were wrong.
Oh man this was my biggest pet peeve with mechcommander as a kid, thanks for fixing it!
I wonder if the board game materials have rules or guidance about where equipment goes? I dunno how close the computer games stick to the board game materials though.
The board game has extensive rules on mech design, but for weapons, it's just wherever they'll fit. Some of the built-in hardware has fixed locations: cockpit, life support, sensors go in the head; engines go in the center torso (with light and xtralight fusion engines spilling out into the side torsos as well), arm and hand actuators go in the arms, and hip, leg, and foot actuators go in the legs. You can see this in the critical slot section in a record sheet: https://i.redd.it/jt3p2f1v14gf1.jpeg
This one definitely deviates from tabletop: pretty much everything except the smallest weapons have an integral tonnage, and the weapons themselves don't line up directly with their tabletop versions.
The newer games tend to be absolutely consistent with the mech design rules in terms of what weapons are available, and their weights and sizes, such that board game designs are legal in the game (and usually the state you get the mechs in before you customize them), and customized mechs are legal board game designs. They tend to limit the customization by doing things like having mechs have predefined hardpoints that limit what types/sizes of guns can go where, because otherwise you just end up with every mech being identical, with maximum armor and the rest of the tonnage being spent on whatever happens to be the most optimal weapon.
This is cool, maybe "target left arm" implies that it's your left, when targetting them and you're facing each other. So, their right arm.
Btw, I recently did my first patches with ghidra. Is there any way to avoid jumping into a code cave by shifting all the instructions up then updating any statements referring to those memory locations? Seems like it should be simple enoigh in theory, but I didn't find an implementation on a cursory search. Could probably code up a plugin pretty easily.
It's basically re-linking the executable. Way too easy to shoot foot - miss one reference and things break in a spectacular, or, worse, subtle fashion. Which means: you definitely need to know where all the references are and what they point to.
References are under no obligation to be presented in a sensible, decompiler-friendly way.
Which is why "jump out into the patch, jump back in" is such a staple of patching. The other way is the hard way, full of pitfalls and potential issues.
How can you be dead certain that all references are known in Ghidra?
Just non-disassembled function or unidentified struct would ruin your plans…
If you need a compact byte -> bit lookup table on x86, consider using the memory form of the bit test (BT) instruction.
I wonder if all those different heavy shenanigans are just to get the hollander's gauss/hunchback autoconnon in the right torso by default.
(original Mechcommander is still the best of the series, even if mission 5 broke my soul for awhile).
Great writeup! Vividly remember this being a thing especially in multiplayer. What was that janky match matching service, MSN something?
Also a really underrated game, the mechanics (line of sight over the horizon stuff) and isometric graphics were pretty cool for the time and it had a well developed story/campaign mode.
Mplayer maybe?
gamespy flash backs for me.
Now let's see this working for Darkest Hours. ;)
(Assuming they didn't fix it themselves, it is a pretty big overhaul to MC1)
99% sure it should work fine for (Exodus and Turncoat), (X-Ray and DSC Raid), and (Xenocide and Bengal Lancers) since those are just custom campaigns.
Lovely stuff. Always a joy to see anything MechWarrior related end up here on HN.
I never played this game! I didn't realize there was a RTS after Crescent Hawk's revenge. I'm looking at the MC2 source code now... it looks like there is a Linux port, meaning could probably get it working for Apple using Fable 5, AI haters, I will challenge you to a batchall.
>probably get it working for Apple
I've gotten older games running just fine with Whisky/game porting toolkit. Sometimes you also need something to fix old DirectX issues like dgvoodoo2.
If you want to make it even easier you could try loading it via Heroic Launcher which supports game porting toolkit.
(Do note: whisky.app is out of development now that the Dev quit to do being pestered by the community so much)
Dear god I loved this game when it came out. It was hard.
I remember it taking me ages to complete the demo missions. And once I had, there being tons of replay value just in the demo missions.
That damned Vulture in the base in the second demo mission was rough. I hit a serious wall in the campaign in Op1M5 when you had to defend the farm. It’s almost a shame that MC2 is so easy in comparison
Op1M5 was scarring the first (dozen) time around! Thank you minelayers
Yeah I had to go back to M3 to salvage the madcat before I was able to finally get past it
I wish they would release MC1 source the way they did with MC2.
It just hit me, in 2026, that MeshCommander [1] (the Intel AMT remote management tool) is probably a homage naming after MechCommander.
Came here excited that MeshCommander is maintained again.
A bit off topic, but a very nice niche YouTubers "SardonicSays" posted a great Retrospective about MechCommander yesterday.
I really need to put some of these techniques to the test with Metal Fatigue.
A rare gem to see someone talking about MF. I used to play lots of it with friends, our games would last for over 48 hours (we wouldn’t sleep). Different time.
My games would last until whoever was hosting had the bug that kills the game due to having too many units, or running out of names for pilots.
And it was somehow still incredibly satisfying, even though there was probably just one bugger who went underground at the start and all the people who over invested in giant robots would have to play whack a mole to find him.