aliens

Author Topic: Web-based resulting per-unit weapon power and accuracy calculator tool  (Read 6349 times)

Offline mk-fg

  • Sergeant
  • **
  • Posts: 17
    • View Profile
Hey,

Mod has plenty of items, stats of which depend heavily on unit using these, and often in a complicated and non-obvious way.
Wrote a python console script on my last playthrough to print/compare final power/accuracy/etc values from unit stats, but recently been watching person streaming latest version, and struggling with the same thing, who doesn't have easy access to linux console.
Analysis screen provides all the formulas in a very nice way, but not per-unit values, which were most interesting and hard to calculate manually in the first place.
Alt-target and Ctrl+M damage displays don't help much either, as weapons are usually pre-selected on inventory screens, where these hotkeys aren't available.

So did translate that console calculator into a simple html/js calculator tool here:
https://mk-fg.github.io/games/openxcom/piratez-melee-calc.html

It can be used to get resulting weapon/ammo stats based on specified unit attributes and compare these for multiple items via sortable table (WARNING - Mild Spoilers):
https://mk-fg.github.io/games/openxcom/piratez-melee-calc.html?i=longbow.aux_power_fisto.sniper_rifle.blood_ax.slugga.ppsh_4.chainsaw_heavy.barbarian_ax

Intended use is to search and pick any number of currently-available weapons for comparison table, then plug unit stats at the top and pick whatever is best based on rough "dpu" value (power * accuracy / tu cost).
Note that such "dpu" estimate is indeed quite rough, due to how probabilities/spreads work over multiple attempts and not taking target stats (armor, dodge, etc) into account, but other columns provide additional info to manually correct for anything else as necessary (e.g. pick by top single-hit power or accuracy).
It's not intended to provide neither exhaustive item description or stats (like in-game research/analysis do), nor make any lists of items, just a gist on few known/picked ones and a quick comparison.

Implementation is an html served from github.com directly, pulling js lib from d3js.org (or next to it, if saved locally) and JSON ruleset data cache from the same repository.
Latter is generated by the aforementioned predecessor python calculator script, but hopefully should stay roughly up-to-date for while (though feel free to drop msg if not, trivial to update), and otherwise can be generated as suggested in the repo description and used locally.
Script stores all input in the URL, which can persist between browser reloads and be easily shared to e.g. point out some interesting stats/picks.

There are probably similar tools elsewhere, but thought I'd share this one in case it might be useful to someone else too, as such html version should be quite accessible, requiring neither spreadsheet software nor linux console.
Feel free to point out any issues with it here or on github, should probably be easy to fix.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
Alt-target and Ctrl+M damage displays don't help much either, as weapons are usually pre-selected on inventory screens, where these hotkeys aren't available.

Alt hotkey in Inventory is already implemented... it will be available with the next release in few days.

Cool website tho :)
« Last Edit: July 04, 2018, 02:54:33 pm by Meridian »

Offline FG

  • Colonel
  • ****
  • Posts: 161
    • View Profile
GJ  :)

Offline mk-fg

  • Sergeant
  • **
  • Posts: 17
    • View Profile
Alt hotkey in Inventory is already implemented... it will be available with the next release in few days.

That's an awesome news!
Thanks for all your work on OXCE, and looking forward to such out-of-game hacks made redundant.

Offline LytaRyta

  • Colonel
  • ****
  • Posts: 313
  • Lisbeth ;p My Engrish is easy bad, Csaba is dead!
    • View Profile
    • svetmightandmagic.cz
excellent!

(yet, what about take in account, (and calculations, various "conditions of gals - for example, stunned, wounded, - light w., mortal w. ,  panicked, paralysed, (choked), etc..

+ everloaded, ( "overweighted,  "pretažená)

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
You people are completely insane. What do you even need this info for.

Offline mk-fg

  • Sergeant
  • **
  • Posts: 17
    • View Profile
(yet, what about take in account, (and calculations, various "conditions of gals - for example, stunned, wounded, - light w., mortal w. ,  panicked, paralysed, (choked), etc..
+ everloaded, ( "overweighted,  "pretažená)

Should be rare enough to not worth bothering with I'd think, if you mean weapon accuracy and such changes from these.

You people are completely insane. What do you even need this info for.

Yeah, guess maybe given such variety, using rules of thumb like "looks good for high str" instead of precise math would be a better idea in the first place.
Though then guess one should also trust that mod doesn't have like 10x variance in weapon effectiveness, to not blindly equip something rather useless.

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
You people are completely insane. What do you even need this info for.

I use a spreadsheet for melee damage. It accounts for enemy armor, dodge and resistances. Especially with enemies that have like 70% daze and 100% electric damage modifiers, this helps me to choose between handle and stun baton for example. Also, it tells me which weapons won't work at all because of high dodge or high armor. Reticulan mechtoids are a prime example of "what weapon can actually damage them?"

Some interesting observations I have gotten from the spreadsheet:
- Kung Fu punch is the best Kung Fu option most of the time. The kicks have more dpu only vs armored targets (30+), but against these fistycuffs perform better. So as long as you bring fistycuffs, you have no use for the kicks.
- The axe is a top notch low tech can opener vs heavy armor. Some versions ago the spiked mace had that spot, but now the axe is better. The axe wins because of better accuracy.
- The ninja stick is not worth it. High melee gals are better off using Kung Fu punch and fistycuffs, low melee gals perform better with handle or stun baton. The size makes the ninja stick even less useful. A bit disappointing, considering it's a bounty prize.

Offline legionof1

  • Moderator
  • Commander
  • ***
  • Posts: 1899
  • Bullets go that way. Money comes this way.
    • View Profile
Having done tons of this sort of math, i can see the appeal for having a inbuilt function do it for you. Sorta like RPG gear comparisons. The density of choice in piratez does lead to alot of time spent doing expected performance comparisons. 

Everyone has there own subjective targets for a good weapon, but we do like easily available empirical data on the choices. 

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
With all the available items, it's actually a boon to try and play capture only. You have less choices you need to compare xD

The problem with melee is that it's hard to get a gut feeling because there are too many variables involved. Damage modified by several stats, secondary damage (hp damage on a stun weapon), accuracy and speed.
For example: on a maxed out gal, the fistycuffs have slightly more dpu than a barbarian sword (vs unarmored target with 20 dodge). You wouldn't have guessed that...

Are the stats relly needed? No, you don't need to min-max everything. Most items do what you expect them to do. I crunch the numbers more out of curiosity.

Offline LytaRyta

  • Colonel
  • ****
  • Posts: 313
  • Lisbeth ;p My Engrish is easy bad, Csaba is dead!
    • View Profile
    • svetmightandmagic.cz
Alt hotkey in Inventory is already implemented... it will be available with the next release in few days.

Cool website tho :)

..but i dont see it, (at least, not in changelog (list of changes for v.99J3 )

Offline FG

  • Colonel
  • ****
  • Posts: 161
    • View Profile
..but i dont see it, (at least, not in changelog (list of changes for v.99J3 )
Hover the mouse cursor over the item then press and hold the ALT-key.

Offline bouchacha

  • Captain
  • ***
  • Posts: 59
    • View Profile
Yeah, guess maybe given such variety, using rules of thumb like "looks good for high str" instead of precise math would be a better idea in the first place.
Though then guess one should also trust that mod doesn't have like 10x variance in weapon effectiveness, to not blindly equip something rather useless.

Seconding this. Ideally you could just rely on heuristics for "good enough" outfitting but there is indeed a huge variance in damage and effectiveness so it ends up feeling very frustrating when you don't do it properly. Especially since the latest version hid the (very significant) stat bonuses under the ANAL tab. I completely understand why that had to happen but it got rid of some very important guidance.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
The next version will have the accuracy and damage formulas back on the main page, just automated. (Praise Meridian.)

Offline mk-fg

  • Sergeant
  • **
  • Posts: 17
    • View Profile
Praise Meridian.
Bit of a shame that classic XCOM UI leaves no room for seamless tooltips like all the ones with Alt key he added, as maybe otherwise all that contentious analysis info would've fit there, without needing several extra clicks.