Skip to content

Instantly share code, notes, and snippets.

@jhkrischel
Last active December 10, 2015 22:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhkrischel/7780da3b19b7440f7e85 to your computer and use it in GitHub Desktop.
Save jhkrischel/7780da3b19b7440f7e85 to your computer and use it in GitHub Desktop.
Perl script for simulating fate core combat

WE HAVE MOVED

You can find the Fate Core Combat Simulator here:

https://stash.krischel.org:444/projects/PUB/repos/fate-rpg/browse

If you want to git clone, you'll have to skip ssl verification:

git -c http.sslVerify=false clone https://stash.krischel.org:444/scm/pub/fate-rpg.git

After you've cloned, you can permanently skip ssl verification for the repo with this command:

git config http.sslVerify false
@jhkrischel
Copy link
Author

Interesting results - even a 1 skill difference makes a huge difference in eventual outcome (UPDATED):

Player vs. Player: 
*PvP Gun Skill diff -2:*
    Player 1 dies: 97.82%
    Player 2 dies: 2.18%
    Average # of actions before death: 16.962
*PvP Gun Skill diff -1:*
    Player 1 dies: 81.67%
    Player 2 dies: 18.33%
    Average # of actions before death: 18.9987
*PvP Gun Skill diff 0:*
    Player 1 dies: 46.54%
    Player 2 dies: 53.46%
    Average # of actions before death: 18.291
*PvP Gun Skill diff 1:*
    Player 1 dies: 14.08%
    Player 2 dies: 85.92%
    Average # of actions before death: 14.7396
*PvP Gun Skill diff 2:*
    Player 1 dies: 2.91%
    Player 2 dies: 97.09%
    Average # of actions before death: 11.2609

*By Hand Skill diff -2:*
    Player 1 dies: 99.13%
    Player 2 dies: 0.87%
    Average # of actions before death: 22.2085
*By Hand Skill diff -1:*
    Player 1 dies: 86.9%
    Player 2 dies: 13.1%
    Average # of actions before death: 25.3218
*By Hand Skill diff 0:*
    Player 1 dies: 47.51%
    Player 2 dies: 52.49%
    Average # of actions before death: 24.6035
*By Hand Skill diff 1:*
    Player 1 dies: 12.9%
    Player 2 dies: 87.1%
    Average # of actions before death: 19.6282
*By Hand Skill diff 2:*
    Player 1 dies: 1.84%
    Player 2 dies: 98.16%
    Average # of actions before death: 14.7434

@jhkrischel
Copy link
Author

More interesting data (UPDATED):

Player vs. Mook: 
*PvM with Guns:*
    Player 1 dies: 8.5%
    Mook 1 dies: 91.5%
    Average # of actions before death: 4.8392
*MvP with Guns:*
    Player 1 dies: 15.31%
    Mook 1 dies: 84.69%
    Average # of actions before death: 6.6933
*PvM with Guns Skill diff -1:*
    Player 1 dies: 26.02%
    Mook 1 dies: 73.98%
    Average # of actions before death: 7.5724
*MvP with Guns Skill diff -1:*
    Player 1 dies: 34.46%
    Mook 1 dies: 65.54%
    Average # of actions before death: 8.8982

*PvM with Hands:*
    Player 1 dies: 12.89%
    Mook 1 dies: 87.11%
    Average # of actions before death: 9.4109
*MvP with Hands:*
    Player 1 dies: 16.89%
    Mook 1 dies: 83.11%
    Average # of actions before death: 10.5751
*PvM with Hands Skill diff -1:*
    Player 1 dies: 39.5%
    Mook 1 dies: 60.5%
    Average # of actions before death: 14.296
*MvP with Hands Skill diff -1:*
    Player 1 dies: 44.95%
    Mook 1 dies: 55.05%
    Average # of actions before death: 14.8409

Having consequences is a major advantage of PCs vs. Mooks (no matter who goes first), but it can be flipped by a difference in skill of just 1.

@jhkrischel
Copy link
Author

Refactoring to include a built in test suite.

@jhkrischel
Copy link
Author

Working on an algorithm for deciding which consequences to use, but finally decided just to hard code the search space.

Coded for a length four string, with the first character MILD, moving up to the last character EXTREME, the proper order in which to use consequences looks like this:

XOOO
OXOO
OOXO
XXOO
XOXO
OXXO
XXXO
OOOX
XOOX
OXOX
OOXX
XXOX
XOXX
OXXX
XXXX

This will use the minimum number of consequences (thereby minimizing the number of free invokes exposed), and only use EXTREME as a last resort.

@jhkrischel
Copy link
Author

Consequences should work properly now, and I fixed a bug where I considered people dead because their stress track was filled (their stress track has to be exceeded, not just filled).

@jhkrischel
Copy link
Author

Massively refactored into packages, with prettier OOP style. Also added in stubs to allow asymmetrical attack/defense, as well as alternate mental parameters.

@jhkrischel
Copy link
Author

Now supporting the simulation of arbitrary teams. Teams both try to bluntly kill each other, in order, but you can customize every parameter of both physical and mental attack, defense, weapon, armor, stress, as well as consequences.

The only rub is that additional consequences (which are usually limited to either mental or physical) aren't handled very well.

@jhkrischel
Copy link
Author

Added multi-threading.

@jhkrischel
Copy link
Author

Multi-mook test run (Clone Team 1 is Player):

Player vs. Multiple Mooks:
Pv2M Guns Skill diff 0:
Clone Team 1 dies: 43.03%
Clone Team 2 dies: 56.97%
Average # of actions before death: 9.8332
Pv3M Guns Skill diff 0:
Clone Team 1 dies: 80.45%
Clone Team 2 dies: 19.55%
Average # of actions before death: 11.2632
Pv3M Guns Skill diff 1:
Clone Team 1 dies: 58.68%
Clone Team 2 dies: 41.32%
Average # of actions before death: 10.8521
Pv3M Guns Skill diff 2:
Clone Team 1 dies: 36.15%
Clone Team 2 dies: 63.85%
Average # of actions before death: 9.892

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment