VOGONS

Common searches


First post, by s997863

User metadata
Rank Newbie
Rank
Newbie

Jump-jets recharge-rate in Mechwarrior 2 (& Mercenaries) seems to be affected by high framerates, to the point where they won't recharge at all if you play on DosBox with modern PC with auto/max cycles. The only solution until now was to either cheat with unlimited jump jets, or to keep adjusting dosbox cycles up & down to balance a smooth framerate and re-charge your jump jets when needed.

There was a patch on GitHub a few years back (for Mechwarrior-2 only) that didn't get much attention because it only seemed to work on the exact same CD version that the author was using, and crashed otherwise.

I recently found that CD version, patched mw2.exe as instructed, and played through the patched game with no problems (DosBox cycles set to "auto"). Details are here, along with a link to a modified install (but you will still need your own CD to play the game):
http://www.mech2.org/forum/viewtopic.php?t=6353
The game also ran fine with my own different version CD in the drive (mech2, Dos only), so long as my install folder "mech2" was based off the dos/windows95 1.1 CD version.

The original page for the patch is here, with details on what he changed in the binary mw2.exe file with a hex editor:
https://gist.github.com/anpage/9b5ec3d7220011 … 24b2e696e8b4280
I had also tried the mw2.exe command line FPS limited option mentioned there, and the game's internal 45fps cap felt smoother and more satisfying than any other option I've tried until now, including the patch.
But this option is not viable because you have to load a mission directly, without being able to set any options or choose your mech ... etc.
Unfortunately, that page has been inactive for years. If someone more tech-savvy here knows how to hex edit the mw2.exe to apply a permanent FPS limit to the game (e.g. 45fps), I would really appreciate it. Would it be possible to check the Mechwarrior-2 Mercenaries binaries for a similar solution?

Reply 2 of 9, by LordEnum

User metadata
Rank Newbie
Rank
Newbie

Using the exact version of the exe you have provided and are referencing here, the byte you'd want to change is at AA300.

So if you wanted MW2.exe to always run at 5 FPS. You'd want to use 182 / 5 = 36 (or 0x24)

So at AA300 just put 0x24

For a constant 45 FPS, it's 182/45 = 4 and therefore just put 4 at AA300

Hope that helps - if you need it for a different version let me know

Reply 3 of 9, by wiibur

User metadata
Rank Newbie
Rank
Newbie
LordEnum wrote on 2023-07-05, 10:04:
Using the exact version of the exe you have provided and are referencing here, the byte you'd want to change is at AA300. […]
Show full quote

Using the exact version of the exe you have provided and are referencing here, the byte you'd want to change is at AA300.

So if you wanted MW2.exe to always run at 5 FPS. You'd want to use 182 / 5 = 36 (or 0x24)

So at AA300 just put 0x24

For a constant 45 FPS, it's 182/45 = 4 and therefore just put 4 at AA300

Hope that helps - if you need it for a different version let me know

did you find that memory address by decompiling the executable or hooking it at runtime?

Reply 4 of 9, by LordEnum

User metadata
Rank Newbie
Rank
Newbie

Decompiling.

I looked at doing the same for MW2: Mercenaries - but it seems the MW2.exe there is compressed (Causeway compression with CWC? Can't tell) and I can't seem to be able to unpack it so can't patch it the same way.

Tried CUP386, Tron, etc none worked - there were also 2 old Causeway unpackers but couldn't get them to work either.

EDIT: Ah worked out how to do it 😀
So Mercs 1.06 is based on Causeway 3.25 and the unpacker I have only works for 3.49. However, you can use the official Causeway file CW349 like this CW349 -b +u MW2.exe to upgrade the Causeway version. Then you can run the unpacker UNPCWC349 on the exe. This creates a 2mb .EXE where there's a lot of zero junk at the end. But now byte 0xB3E8C is exposed so you can set the FPS (so putting 4 in there will set it to 45 fps)

Here it is https://nic.hopto.org/open/mw2/Mercs_106_45fps/MW2.EXE if anyone ever wants it

Reply 7 of 9, by s997863

User metadata
Rank Newbie
Rank
Newbie
LordEnum wrote on 2023-07-07, 19:04:
Decompiling. […]
Show full quote

Decompiling.

I looked at doing the same for MW2: Mercenaries - but it seems the MW2.exe there is compressed (Causeway compression with CWC? Can't tell) and I can't seem to be able to unpack it so can't patch it the same way.

Tried CUP386, Tron, etc none worked - there were also 2 old Causeway unpackers but couldn't get them to work either.

EDIT: Ah worked out how to do it 😀
So Mercs 1.06 is based on Causeway 3.25 and the unpacker I have only works for 3.49. However, you can use the official Causeway file CW349 like this CW349 -b +u MW2.exe to upgrade the Causeway version. Then you can run the unpacker UNPCWC349 on the exe. This creates a 2mb .EXE where there's a lot of zero junk at the end. But now byte 0xB3E8C is exposed so you can set the FPS (so putting 4 in there will set it to 45 fps)

Here it is https://nic.hopto.org/open/mw2/Mercs_106_45fps/MW2.EXE if anyone ever wants it

Thank you, LordEnum, for the Mech2 info. I'm able to set any framerate like this. This forced framerate method may be especially useful when running the game on actual old hardware: Last time I tried Mercs on a Pentium-3 800MHz under the win98 Dos prompt, the game speed sometimes jumped wildly. Fixing the FPS may help to stabilize it.

Your Mercs MW2 file also worked the same. Surprisingly, it worked on a 1.00 and 1.05 and 1.06 install folder of Mercs (only tested instant action so far). Thanks again!

update & warning on Mechwarrior 2 & Mercs FPS cap:
1. The FPS cap causes one problem: the game freezes if you try to open the options menu in-mission (ESC key). This problem seems to stem from the game itself because the same happens if you use the command line FPS option.

2. For Mechwarrior-2, looking at the address that LordEnum pointed out for capping the FPS, I found a matching string in my other Mech2 version. You might be able to play with the FPS in your own CD version if you can find these hex values in your MW2.EXE file in a hex editor:
4A 36 39 42 32 33 38 24 27 2B 12 12 15 07 07 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF 00 00 00 00 00 00 00 00 00
and change the last "00" to the desired value as instructed above by LordEnum. Setting it back to "00" stops the menu freeze problem.

Reply 8 of 9, by mustafacroat

User metadata
Rank Newbie
Rank
Newbie
LordEnum wrote on 2023-07-05, 10:04:

Hope that helps - if you need it for a different version let me know

LordEnum, if I could provide you with EXE's for other DOS executables in the MW2 series (i.e., NetMech, Ghostbear's Legacy) could you assist with decompiling and identifying the appropriate bit to set for locking the framerate on those titles as well?

Reply 9 of 9, by myne

User metadata
Rank Member
Rank
Member

I realise this is the DOS section, and so this is possibly sacrilege but...

Installer for the windows versions that works on modern windows (and jumpjets work) : A comprehensive guide to install and play MechWarrior 2 on new versions on Windows.

It uses the original CD, bundles DGVoodoo and DXWND in (which make it work) and it looks relatively prettier than the DOS versions.

Things I built:
Mechwarrior 2 installer for Windows 10/11 Re: A comprehensive guide to install and play MechWarrior 2 on new versions on Windows.
Dos+Windows 3.11 auto-install iso template (for vmware)