A collection of R-based Monte Carlo simulators designed to analyze, calculate, and visualize the statistical probabilities of dice mechanics in various board games.
This repository serves as a toolkit for breaking down complex or modified dice combat systems to determine true expected values and optimal strategies.
Made with the help of Google gemini.
Standard Risk battle math is notoriously complex to calculate by hand once army sizes grow. The LOTR Trilogy Edition complicates this further by introducing modifiers that apply to the highest die rolled:
- Attacker Leader: +1 to the attacker's highest die.
- Defender Leader: +1 to the defender's highest die.
- Stronghold: +1 to the defender's highest die (stacks with Defender Leader for a total +2).
Included Scripts:
lotr_risk_skirmish.R: Contains the coresimulate_skirmish()function to resolve a single 3v2 (or smaller) engagement with any combination of the above modifiers.lotr_risk_analysis.R: Runs bulk simulations (e.g., n = 10,000) across all 8 possible modifier combinations to generate probability matrices and average army loss rates.lotr_risk_viz.R: Usesggplot2to visualize the effectiveness of different defensive and offensive setups.
To run the simulations and generate the visualizations, you will need R installed, along with the following packages: (TBD)
TBD