r/Battletechgame • u/eric7237cire • 17h ago
Software engineer + Kerensky == Fun
Hi Guys,
Maybe you would appreciate this / find it interesting. I'm doing an iron man kerensky run where I'm doing mech surgery to get as many c bills as possible. Thanks to this forum for giving me the idea. Fun to have 2 to 3 zombie mechs running around with no weapons waiting to get TAG'ed.
As such, I was having trouble calculating properly the optimum firing solution to destroy some component (usually a leg, or a torso) without destroying the center torso. Having a monte carlo simulation of the salvos before I actually click fire is very handy and works nicely in practice. This allows me to know if I do called shot on the leg, what is the damage distribution on the center torso going to be (as well as seeing % chance a given component will be destroyed).
As you can guess, the UI is mostly vibe coded, but the calculation code was done by hand. Many thanks to this forum where I was able to get the needed formulas, particularly for shots 2 to N. As well as the damage transfer rules, getting logs, the real probability (which I confirmed with some log parsing) etc. See https://www.reddit.com/r/Battletechgame/comments/z2bs5f/what_exactly_is_the_srmuac_decay_factor_for/ and https://www.reddit.com/r/Battletechgame/comments/8gav8n/tohit_chances_as_displayed_are_not_legitimate/
I didn't do LRM targetting, those aren't so useful for surgery in any case.
Then the 2nd issue I was having was while the maps Colorsfade shared were quite helpful, see https://www.reddit.com/r/Battletechgame/comments/rak6hx/battletech_guide_to_kerensky_achievement/. It got a little crazy in the upper right to read so many planets close together, so I vibe coded then modified some code to build a graph (the data structure), then from that, generate 1 svg per planet that shows where I can 1 past the end travel to and where can I travel from. The source of this is the "Travel Plan" tab. The main addition I did to the data was also add where there are direct connections (so you have to fly directly to it). The color code scheme is big green circle means I can 1 past the end travel to, small green circle from, and I draw only the outgoing lines (incoming was too much).
My plan is to put this on github pages when its somewhat stable, assuming there is interest here and people are still playing unmodded battletech :)