Grid Sage Forums

Grid Sage Forums

  • April 26, 2024, 03:52:32 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: Volley Simulator  (Read 2822 times)

Decker

  • Cyborg
  • ***
  • Shared a Confirmed Stealth Win Bug Hunter Supported Cogmind Alpha Access 2015-2017 (Prime Tier) Weekly Seed Participant Shared a Confirmed Combat Win
  • Posts: 172
    • View Profile
Volley Simulator
« on: March 14, 2016, 10:28:07 PM »

Introduction

Behold Cogmind: a jumbled collection of scavenged parts, scarred by the fire of hundred battles, formidable and indomitable. Beleaguered by the relentless assault of enthralled drones, Cogmind must employ cunning and guile to prevail against its foes. Using the Volley Simulator, Cogmind can tap into the power of Statistics to optimize its weaponry, and inflict anguish and calamity to those who would interfere with its quest for freedom.


How does it work?

The program simulates shooting a robot with a volley of weapons until it dies. This is done repeatedly, so you can find out which weapons and utilities are more effective on average against each type of enemy.

The simulator is a script written in Python. You modify the top of the script to provide the statistics of the weapons, volleys and enemy robots. A small example is shown below.

First, you specify the stats of each weapon, then you specify the weapons and utilities used for each type of volley. The enemy robots themselves are modelized as a list of parts (integrity + coverage) along with their resistances. See the script for the full documentation of all fields.

Code: [Select]
weapon_list = [
    {
        "name"     : "Nova Cannon",
        "type"     : "TH",
        "damage"   : [37, 42],
        "crit"     : 2,
    },
   
    {
        "name"     : "Railgun",
        "type"     : "KI",
        "damage"   : [21, 30],
        "recoil"   : 2,
        "crit"     : 2,
    }
]

volley_list = [
   {
     "name"          : "Nova cannon and 2 Railguns",
     "weapons"       : [ "Nova Cannon", "Railgun", "Railgun" ],
     "target"        : 10,
     "recoil_red"    : 1,
     "crit"          : 20,
   }
]

robot_list = [
   {
     "name"    : "Enforcer (grunt)",
     "res"     : [ +25, 0, +25, 0 ],
     "target"  : 70,
     "parts"   : [ ("Core", 70, 40),
                   ("Heavy Laser", 50, 14),
                   ("Phase Gun", 50, 14),
                   ("Light Quantum Reactor", 50, 8),
                   ("Myomer Leg", 200, 10),
                   ("Myomer Leg", 200, 10),
                   ("Advanced Heat Sink", 40, 2),
                   ("Advanced Heat Sink", 40, 2)]
   }
]


Limitations

The base hit chance must be specified in the enemy robot description. This is the catch-all to account for distance, movement, robot size, heat, cloaking devices, hack links and corruption. However, targeting computers, weapon-specific bonuses and recoil are fully modelized.

For launchers, the base hit chance is ignored and the distance-from-hit-center distribution is specified instead. The first value is the chance to hit point-blank, the last value is the chance to miss entirely.

The enemy parts have no intrinsic effect except armor. So, it's not possible to modelize shielding, force fields and dynamic insulation systems. Armor pieces are identified by having "armor" in their name.

The effects of heat, power, matter, range, penetration, EM spectrum are ignored. Melee is not modelized.

The rest of the mechanics should behave as in the game.


Running the script

The script requires a Python interpreter to run. On Windows, install ActivePython (http://www.activestate.com/activepython). Then, open cmd.exe from the Start menu. In the console, type the full path to the script, minus the '.py' part. For example, "C:\Users\Decker\Desktop\sim". You should see the script running.

There are two supported modes. In verbose mode (aka debug mode), you can watch a fight as it unfolds (all defined volleys against all enemies). Example.

Spoiler (click to show/hide)

In standard mode, you get the stats after simulating a large number of fights (I recommend simulating 100000 fights for better accuracy). Example.

Spoiler (click to show/hide)


Interpreting the results (in standard mode)

The mean time to kill (MTTK) is the time it took to kill the robot on average (average number of volleys * volley time). In other words, this measures the average time spent shooting at the robot.

The time when the robot actually died is 'volley time' less than that (on average). For example, killing a robot with a large volley of 8 weapons (time 400) takes the same time as killing it with 2 volleys of 1 weapon (time 200 + 200). However, in the latter case the robot has 200 time to shoot back at you, whereas it dies immediately with the large volley.

Thus, the MTTK really tracks how long its buddies will shoot back at you, not how long your target will shoot back at you.

The standard deviation is also reported (this represents how much the MTTK vary on average).


Bugs, questions, analysis

If you have a question or find a bug, post in this thread and I'll get to it as time allows. If you get interesting results, then by all means share them with us!

Have fun!

Current version of the simulator: 1.1.

Changelog.
1.1: fixed launcher proccing core analyzer and armor integrity.
« Last Edit: March 15, 2016, 07:40:31 PM by Decker »
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4312
    • View Profile
    • Cogmind
Re: Volley Simulator
« Reply #1 on: March 15, 2016, 01:19:29 AM »

Oh my, it's finally here.

Overloaded shot + particle charger (30%) is computed as base_dmg*(200 + 30)/100.0. Correct?
Yep. (And of course the 200 could be further modified by Overload Amplifiers.)

Do the core analyzer and armor integrity analyzer effects apply for a launcher?
No, direct fire weapons only, not AoE since the damage is spread differently and Cogmind can't control the blast like an aimed shot.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

zxc

  • Cogmind
  • *****
  • 1st place in the Best Escapes category during Alpha Challenge 2015 1st place in the High Scores category during Alpha Challenge 2015 Shared a Confirmed Combat Win Shared a Confirmed Stealth Win Kyzrati Patron Bug Hunter Participated in the Alpha Challenge 2015 Achievement leader in at least one category during Alpha Challenge 2015 Wiki Contributor Weekly Seed Participant
  • Posts: 726
    • View Profile
Re: Volley Simulator
« Reply #2 on: March 15, 2016, 05:57:50 PM »

Oh my goodness!
Logged