Author Topic: XPirateZ Squad Analyzer (Help Wanted)  (Read 15508 times)

Offline onionradish

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #15 on: April 14, 2016, 04:42:44 pm »
IMO, the important part is that in the end, each gal has a "favorite" weapon that you can equip her with, and it's not a complete misuse of her skills.

Weapon speed must be taken into account. Since you're comparing 2 attacks of one weapon versus 4 attacks of another (for example), target armor must be taken into account : it's substracted 2 times in the first case, and 4 times in the second case. An arbitrary armor value must be chosen. Or if you like overkill, do one calculation for a mostly harmless opponent, one for a moderately armored, one for a heavy, and average the three.

For effective damage, I generally multiply all these things together :
1) %chance of hitting
2) %chance of doing ANY damage on hitting
3) average damage of the attacks which overcome armor
4) a factor depending on the practical number of attacks in a round

For melee attacks speed, 4 could be counted by assuming the girl spends 1/2 of her TUs getting to the target, and the rest attacking. Count the attacks she can make, keeping the decimals.


I agree with the idea of getting to a "favorite" weapon and the practical number of attacks taking movement into account for melee.

If I'm understanding you on target armor, you're saying that the actual potential damage would need to be calculated after each hit, since most weapons do damage to armor so more damage from subsequent hits would get through the weakening armor? Also, why keep decimals on attack counts, in that fractional TU can't be used to attack in a turn? I'm interested in your ideas.


At a minimum, I'll probably tackle fleshing out the Weapons Table by hand at least for Melee weapons.  I think your sheets are strongest, so thats a great format.

I've some other Bootypedia projects first (Auxilliaries and Armor updates) so if someone can come up with a ruleset parser to grab weapon data before I get to it, that would be awesome. :)

I'm parsing the ruleset for all the weapon data so could give you that data in CSV if you want it for a spreadsheet. Tell me what you need. Also, thanks for the details on calculations, especially the polynomial one.


In this case, using Ivana as an example, you see that, of the weapons I entered, a rapier is the most reliable choice (because melee is good and strength not great), with cutlass a close second that could do more damage if you are lucky and get few misses (as shown by the cutlass' max damage being higher). Shooting wise, due to poor shooting accuracy, it's better to try to set her up for many rifle snap shots than anything else (and the sniper rifle is obviously a very poor choice).

One of the things that can be a surprise is how much each gal's stats can affect damage, especially for melee. And then how much accuracy can flip the table for potential damage.

Wardog  - Best Skill: Melee  [30]  (Left Hand: Cutlass [7], Right Hand: Fuso Knives [4])
--------------------
bravery: 20, firing: 51, health: 72, melee: 101, psiSkill: 0, psiStrength: 29, reactions: 73, stamina: 97, strength: 30, throwing: 56, tu: 76

* Cutlass               [  7]: 35  + 32.2 -> CUTTING     health: 67.2  armor: 6.7    stun: 16.8   
* Rapier              * [  6]: 20  + 40.4 -> CUTTING     health: 60.4  armor: 6.0    stun: 15.1   

max attacks per TU, (energy cost)
    --> max attacks * (weapon accuracy * melee/100) ==> hits * damage
cutlass     76 / 10 = 7, (7 * 6 = 42) -->  7 * (0.9 * 1.01)  ==> 6 * 67.2 = 403.2 avg dmg/turn
rapier      76 / 9 = 8, (8 * 7 = 56) -->  8 * (1.0 * 1.01)   ==> 8 * 60.4 = 483.2 avg dmg/turn


Freefall  - Best Skill: Firing  [63]  (Left Hand: Ax [12], Right Hand: Assault Rifle [8])
--------------------
bravery: 20, firing: 62, health: 74, melee: 39, psiSkill: 0, psiStrength: 33, reactions: 51, stamina: 75, strength: 63, throwing: 46, tu: 77

* Cutlass               [  7]: 35  + 33.0 -> CUTTING     health: 68.0  armor: 6.8    stun: 17.0   
* Rapier              * [  6]: 20  + 15.6 -> CUTTING     health: 35.6  armor: 3.6    stun: 8.9   

max attacks per TU, (energy cost)
    --> max attacks * (weapon accuracy * melee/100) ==> hits * damage
cutlass     77 / 10 = 7, (7 * 6 = 42) -->  7 * (0.9 * 0.39)  ==> 2 * 68.0 = 136 avg dmg/turn
rapier      77 / 9 = 8, (8 * 7 = 56) -->  8 * (1.0 * 0.39)   ==> 3 * 35.6 = 106.8 avg dmg/turn



The star to the right of the rapier means that the rapier isn't purchaseable from the black market. It has to be either captured from a battle or researched and then manufactured. At the early parts of the game, it may not be available to equip.
« Last Edit: April 14, 2016, 07:26:38 pm by onionradish »

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #16 on: April 14, 2016, 05:26:54 pm »
I love what you are doing, and where you are going with this, Onionradish (though I admit, I'm not sure I completely understand it. XD).  It sounds like it truly has the opportunity to be an incredible tool!

Quote
I'm parsing the ruleset for all the weapon data so could give you that data in CSV if you want it for a spreadsheet. Tell me what you need.

I'm basically looking for information to populate this sheet:
https://docs.google.com/spreadsheets/d/1kyo9x_RGeVEer73qqgUxvgsqBcScuQRAcA5j09bhOqw/edit#gid=0

Arthanor created it and its a good base line.  There may be some additional columns necessary, (for additional effects (ie Morale damage, energy costs, etc.)

Thanks a Ton!


Offline Yglorba

  • Sergeant
  • **
  • Posts: 48
    • View Profile
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #17 on: April 15, 2016, 01:06:09 am »
Don't forget to include weapon size in the tables.  Sometimes you want a 1x1 backup weapon that can fit on your belt for going up against specific enemies.

(Although there's also the ammo expense or availability...  I mean, is it just going to tell me that the BFG is the best weapon for everything?)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #18 on: April 15, 2016, 04:47:52 am »
hum... once you scale up your development, certain items drop off, of course and the choices may become more obvious. Like techblades being better than most melee weapons when you get them (unless your melee stat is terrible, I guess).

It might be possible to add sale prices as a column and normalize by that. So you can look at raw damage or damage/$$$? I'm not sure how otherwise..

Offline Yglorba

  • Sergeant
  • **
  • Posts: 48
    • View Profile
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #19 on: April 15, 2016, 10:03:40 am »
I think the only real solution is to list all the top weapons for your situation sorted by average damage, and let the player pick from them.  There are too many variables to completely automate selecting a single best weapon.

There's considerations like clip size, reload time, size / weight of ammo, range, etc.  The best the algorithm can do is point people generally in the right direction rather than giving them a single clear "optimal" choice.

Like, it's gonna say that Fusion Torches are an amazing weapon against armored opponents early on, isn't it?  Because if you do manage to get next to someone at the start of your turn and use one, it has ridiculous damage output and perfect accuracy!  Unfortunately...  most tanks don't just sit there and let you get next to them with full TUs.
« Last Edit: April 15, 2016, 10:06:11 am by Yglorba »

Offline onionradish

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #20 on: April 15, 2016, 08:19:46 pm »
The potential damage for a gal/weapon combination can vary quite a bit because of the complexity of the stat modifiers, and it's not always obvious from reviewing the bootypedia which weapon might be "better" for a particular gal. The example above shows that simplifying to "Rapier is always better than Cutlass" isn't necessarily true. That non-obviousness caused my interest in looking into this.

My first goal is to develop a "squad damage calculator" that takes each gal's stats into account to report the possible damage she could deal with an "available" weapon towards an enemy's health/armor/stun. Damage calculations assume a hit, but include supplementary stats on likelihood of her having a successful hit, excluding battle-specific conditions (kneeling, range, enemy armor, etc.).

An "available" weapon is one that is in posession, can be purchased through the black market, or has been discovered through research (potentially manufacturable). Weapon availability obviously changes as the game progresses. That means that even if the BFG is the ultimate weapon, if it's not available, it won't be calculated or shown. Gals can only equip what's available.

From the output of the calculator, a player can choose what they think is the "best" PRIMARY weapon for a gal. The "best" weapon will vary over time based on changes in each gal's stats and what weapons are available.  Secondary weapons (the backup melee weapon for a gal skilled in Firing, etc.) can also be selected from the list, based on whatever makes sense to the player, considering weight limits, etc.

This calculator can also report which gals deliver more damage from a given weapon, so if you have a limited number of Axes (or BFGs), you can give them to the gals who can use them best first.  Melee weapons vary the most; many of the guns deal the same potential damage, with accuracy as the only differentiator.

The initial "squad damage calculator" is intended to expose all the stats for the player to choose from. Because of the variety of weapons available (which increases as the game progresses) and the range of gal stats (new recruits as well as experienced ones), some additional info is needed for the player in role of "COMMANDER" to make those choices. One of the potential negatives to exposing those stats is that it can lead to min-maxing (spoiling the fun of decision-making).

Once the stat calculator is complete, a secondary idea is to develop a "recommendation engine" that will take each gal's stats and weapon stats into account to suggest a shortlist of available weapons suitable for that gal. That's where size, ammo capacity, accuracy, TU, weight and other considerations come into play, and where items would get filtered out.

I think there is some fun to player choice and assignment of a "favorite" weapon even if it isn't the best statistically. A recommendation engine would have to take the available weapons, gals, and other factors into account to suggest a shortlist of weapons for a gal, while still offering some choice. It's a potential "next step" after the stat calculator is done and may or may not be necessary or wanted. The choice of "best" weapon goes beyond stats into opinion and philosophy, so we'll see what shakes out once we have some stats to consider.


Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #21 on: April 17, 2016, 05:39:26 pm »
My opinion is that weapon choice depends alot on your target. Things like the poison knive give you totally wrong damage values if you don't account for target armor.
I've attached the spreadsheet that I use for melee. It considers target armor and damage modifiers. You can play around with it if you like.

Edit: Updated spreadsheet, had wrong numbers for the leather whip.
« Last Edit: April 17, 2016, 05:50:53 pm by Eddie »

Offline onionradish

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #22 on: April 19, 2016, 11:15:37 pm »
I've got accuracy calculations working now, but need to clean up the code and need to combine "weapons" which are responsible for accuracy based on the gal's stats plus type of action (snap, auto, aimed, etc.) with the "ammo" for the weapon (may be multiple types) which are responsible for raw potential damage so they can be presented/evaluated together. This is easy for melee which has no ammo, but ranged weapons get complicated.  :o

From using the rough output for my own very early game (April, year one, 28 hands), I see the need for lots of optional filters for the output. The list of potential weapons+ammo gets ridiculous quickly as research/capture reveals more potential weapons and the number of hands increases.

What kinds of "filter" criteria would be useful? Basically, for which gals would you want to see a report on possible/best weapons? Options can be customizable and combined -- I just need to add the capability before the tool is shared for use. For example:

  • only showing non-injured gals
  • only showing gals from base X or assigned to craft Y
  • only showing gals NOT assigned to a craft
  • only showing gals of rank X
  • only showing gals with no weapons equipped
  • only showing weapons that are "in stock" at a base or on a craft
  • only showing weapons with available ammo (or ammo > X)
  • only showing weapons that match the "best skill" of the gal (firing, melee, etc.)
  • only showing  weapons that are equippable within the weight limits after backpack/armor/etc. are considered
  • showing all "known" weapons (known by research but must be captured/manufactured)
  • optional "hide/show" options for particular weapons or types (and which ones)
  • etc.

Let me know what you'd want to see and when/how you might use analysis output. I'm finding that I most want to use the analysis for newbies (always), and only periodically for experienced gals depending on how their stats have changed or what research/capture has unlocked.

I'm also seeing potential value in accounting for "available weight" based on the armor equipped. Even if a hammer does more damage, if I can't wield it with my equipped basic armor plus beer and bandages, I don't want to see it.

Finally, for a tool like this, are you able or willing to run a Python script or would you want/need something else? I can compile it to an EXE, but that only works for Windows and might seem suspicious since it's not obvious what it does.

Calculations based on # hits versus an armored targed (given gal accuracy, TU, enemy armor, etc.) to show actual "received" damage (not just what was "delivered" based on weapon, ammo, gal, action) are entirely do-able, but will come later.
« Last Edit: April 19, 2016, 11:20:57 pm by onionradish »

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #23 on: April 19, 2016, 11:32:55 pm »
 :o  The array of possibilities, is indeed, almost overwhelming.   

Generally, I'd agree that its is very helpful early with raw troops as the differences in their skills make a significant difference.

Of the possible filters that you mentioned,
Rank: would be able to screen newbies,
Assigned to Craft: (From items on the craft).  This way you could even run the tool from a save before touching down at a tactical mission.
Best Skill: Nice to have, but maybe not critical.
All known: Some weapons may be out of reach (lack of parts, etc) but it could reveal an otherwise overlooked great matchup. (again, nice to have, but not critical?)
Non-injured could be good too. :)

Yeah, dealing with weight gets complex too, because, if you start swapping armors around, the options change considerably. :/  Not sure its critical.

As for script vs. .exe:  I'm not sure what is required to run a python script, perse.  I'm fine with an executable, 'cuz I'm a windows guy.  More important is the output.  A decent data table can be consumed by other tools to continue the analysis, I suppose.  This, rather than output only to the screen is what I'm thinking.

I may be thinking too narrowly, or don't have the scope of the possible here. 

Offline legionof1

  • Moderator
  • Commander
  • ***
  • Posts: 1899
  • Bullets go that way. Money comes this way.
    • View Profile
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #24 on: April 19, 2016, 11:40:24 pm »
My preference for filters would be something "Job" oriented. Finding the ideal weapon for a given task be it heavy support like HMG, or best rifle, CQC, etc. Then find gals who can do x within a certain tolerance. Oh noes im 2 str away from carrying the HMG and ammo. Big deal, do the job.

Offline Yglorba

  • Sergeant
  • **
  • Posts: 48
    • View Profile
Re: XPirateZ Squad Analyzer (Help Wanted)
« Reply #25 on: April 21, 2016, 11:49:17 am »
A filter for weapon size would be nice.  It can be useful to give your gals backup weapons specialized against specific kinds of enemies, but you'll often want to be able to fit those in your quickdraw or belt slots for easy access; if you have to put them in your backpack, drawing them takes more TU.