MechWarrior 5: Mercenaries

MechWarrior 5: Mercenaries

XenoPax Optimize 4.0
Kamikaze_Llama  [developer] 28 May, 2022 @ 2:12pm
3
2
5
What This Does. And Doesn't.
There has been a lot of confusion about what this mod does over the year or so it's existed, so I thought I'd finally write up something pretty detailed about what it does (and doesn't) actually do.

Basically, this mod is about fixing the problems with MW5's hitbox geometry. That sounds complicated and technical, but it really isn't.

Basically, in any video game, we need ways to detect whether Object A touched Object B, or whether a raycast (essentially, a line drawn through 3D space) intersects a given object, and so forth.

These operations require a lot of math, starting with some simple trigonometry (how far away something is, what angle relative to a ray, etc. and then getting into math that's considerably heavier- finding whether a 3D volume intersects another one. While each check doesn't "take a long time" on modern processors, during each game-frame of activity, it's happening hundreds, thousands, or even tens of thousands of times. It adds up fast.

This is an area of game development that is really basic, and you'd think any modern game would've been carefully curated by its developers, to ensure that it's as efficient as possible.

MW5, unfortunately, appears to have been put together pretty sub-optimally. I can't speculate on why this occurred, but it clearly did, and despite bringing it up with them directly via Discord, and this mod existing to demonstrate that there are these problems, I've never gotten a single response from them, let alone see any of it get fixed.

So there was a whole bunch of stuff that was done in this game that wasn't done properly at all, or was done properly, but was overkill for the context.

The first category, "stuff that's just wrong", includes things like using 3D multi-faceted primitives when a simple sphere or cuboid would have served just as well. This mod fixes that in well over a hundred places.

The second category, "stuff that was overkill for the game as designed", required some editorial choices.

For example, 'mechs had hitboxes, often 3D cuboids (rather than cheaper-to-compute spheres and lozenges) for every weapon they could mount. Because these hitboxes are mounted on something that moves, they consume even more CPU resources than usual, and most of them are a waste of resources.

For example, an individual laser weapon on a torso doesn't need a hitbox at all; a hit on the weapon is just passed to the armor / internal structure of the body, and it doesn't do anything graphically, etc.

So most of these were eliminated. I've kept the hitboxes on really big weapons that stick out of certain 'mechs, like missile launchers on Catapults, because they matter to players, but generally, I've cut all the ones where I didn't feel it would make an impact.

There's also similar stuff involving buildings, where they had hitboxes you'd never interact with buried deep in level geometry, etc., and all of that's been fixed up.

All of these hitbox changes add up a to a considerable impact on the game's performance, with pretty minimal effects on gameplay, with very few practical tradeoffs.



So, that's what the mod does.

Things people have said it does, but it doesn't:

1. It doesn't mess with any content that wasn't in the base game, like new 'mechs or stuff in vonBiomes, etc.

2. It doesn't mess with how things get drawn on the screen.

3. It doesn't effect how things spawn.

4. It doesn't change how 'mechs take damage.

Etc., etc.

Basically, all this does is fix up hitbox issues. That's all. It doesn't touch code directly, it doesn't mess with AIs, or art, or third-party content, etc.

Oh, and "why does YAML say it conflicts?" Basically, don't worry about it. What YAML changes doesn't effect the big changes to buildings, terrain objects, etc. that make the game run a lot better. YAML's changes make the game perform a bit worse, but it's not a really big deal.
Last edited by Kamikaze_Llama; 28 May, 2022 @ 2:15pm
< >
Showing 1-3 of 3 comments
ChuToy_89 16 Sep, 2022 @ 2:32am 
That is excellent.

Thank you for writing this up and providing such a good explanation of how things work and why, and thank you VERY much for making this mod. (I noticed that CPU usage was very, VERY high for the level of complexity of this game, so something that would improve performance by fixing such CPU-intensive overheads is excellent indeed.)
Last edited by ChuToy_89; 16 Sep, 2022 @ 2:33am
FkYoSht 10 Jan, 2023 @ 4:07pm 
+100000000000000 rep
FunkyPumpkinツ 14 Dec, 2024 @ 1:46pm 
Hey there fellas, what is the load order for this cookie? Some say it's the 1, some - the last one. So....what is it?)
< >
Showing 1-3 of 3 comments
Per page: 1530 50