OpenXcom Forum

Modding => Tools => Topic started by: TheCurse on May 17, 2020, 03:22:26 pm

Title: Weapon Balance Tool
Post by: TheCurse on May 17, 2020, 03:22:26 pm
I´ve created a simulator for the OXCE weapon accuracy behaviour.
It can draw nice graphs of hit ratio / distance (always 0 -50), as well as dmg/turn over distance.


Repository:
https://github.com/t3chn0l0g1c/oxceShooter

No need to build from source, there´s a pre-packed .jar in there.

It has no gui mode too, so you can just generate the input files and let it run over all weapons and compare yourself.
Needs java installed (openjdk 13 or higher )


Feedback, bug reports and feature requests welcome.

Big thanks to all the modders and engine guys helping me with their time and knowledge, especially Meridian. :)
Title: Re: Weapon Balance Tool
Post by: Bobit on May 17, 2020, 04:37:49 pm
Very nice... maybe CQB would be worthwhile? Or, more ambitiously, AI could use these numbers to calculate optimum firing distance? And consideration of cover? And AI consideration of cover?  :P

3 weapons seems a little small if you're trying to get a feel for all the weapons in the mod.
Title: Re: Weapon Balance Tool
Post by: TheCurse on May 17, 2020, 05:21:58 pm
nope, CQC would be a completely different calculator.
Optimum firing distance is easy, its closest possible (>minrange).
Cover is not calculated, i´d need to have an actual map for that.
AI does not need this, pretty sure...

3 Weapons is what i can put on the graph without cluttering it up (thats 9 curves) and running out of colors... ;)
Feel free to use noGui mode and visualize the results yourself, for all weapons you can find...
Title: Re: Weapon Balance Tool
Post by: ohartenstein23 on May 17, 2020, 05:24:56 pm
There's already an option for AI to use this kind of information to determine firing mode. And this is not the thread to keep pushing your considerations of cover.

Looks like a useful tool, I used similar calculations when designing weapons a while ago but never wrote dedicated functions for it. Part of balance considerations should probably involve the target too - armor, resistances, and armor damage makes big differences for where weapons are effective.
Title: Re: Weapon Balance Tool
Post by: TheCurse on May 17, 2020, 06:31:20 pm
yes, i agree.
but tbh it was already horrible writing up that UI, and with armor i´d be a lot more input...

if you (or anyone else) really wants that included i can do it too.

currently there´s not even buckshot or area dmg in there.

if i do that too i might have nightmares about drowning in input fields or so... ;)
Title: Re: Weapon Balance Tool
Post by: Bobit on May 17, 2020, 07:00:56 pm
Well armor/resistance decides damage independent of the accuracy curve, and is not too hard to calculate yourself before plugging it in.

I think maybe I'll use noGUI and some code to make an excel chart for best XCOMFiles weapons at each range.
Title: Re: Weapon Balance Tool
Post by: vadracas on May 19, 2020, 12:57:49 am
Would it be possible to allow this to load weapon data from a .rul file? As in, if you enter the string name of the weapon it finds it in the file?


I have no experience with java, so no idea if this is feasible.
Title: Re: Weapon Balance Tool
Post by: TheCurse on May 19, 2020, 10:18:30 am
its possible at least.
though i´d have to write a parser for the rul files.
not looked into that yet...
Title: Re: Weapon Balance Tool
Post by: Ranakastrasz on December 02, 2021, 12:54:54 am
How do I use accBonus and damageBonus, for, say, a sniper rifle in The Xcom Files with 0.01*acc*acc?
Title: Re: Weapon Balance Tool
Post by: The Reaver of Darkness on December 03, 2021, 11:33:22 am
How do I use accBonus and damageBonus, for, say, a sniper rifle in The Xcom Files with 0.01*acc*acc?
It doesn't appear to have a field for accuracyMultiplier or damageMultiplier.

In the ruleset, it is parsed as:
Code: [Select]
items:
  - type: STR_SNIPER_RIFLE
    accuracyMultiplier:
      firing: [0.0, 0.01]
This means that net accuracy is: (0.0*firing) + (0.01*firing²)
You can calculate the weapon's accuracy based on the soldier and input the values manually.
Title: Re: Weapon Balance Tool
Post by: Ranakastrasz on December 03, 2021, 08:33:14 pm
Manual it is then. oh well.
Title: Re: Weapon Balance Tool
Post by: TheCurse on December 07, 2021, 06:46:07 am
you can enter that in the GUI.
e.g. for 0.01 acc², input to the acc field "0.01²"