Skip to content

DrPeterPun/nashdotdeck

Repository files navigation

Nash Equilibrium Hero Selector for Flesh and Blood

This project analyzes Flesh and Blood hero matchup data and calculates the Nash equilibrium for the metagame.

Files Generated

  • meta.csv - Original matchup data
  • win_rate_matrix.csv - Win rate matrix for all hero matchups
  • win_rate_report.txt - Detailed report of win rates
  • nash_equilibrium.csv - Nash equilibrium probabilities for each hero
  • nash_equilibrium.txt - Detailed Nash equilibrium report
  • wr_vs_nash_equilibrium.csv - Each hero's win rate against Nash equilibrium
  • wr_vs_nash_equilibrium.txt - Detailed report of win rates vs Nash
  • hero_selector_usage.py - Standalone Python script for hero selection
  • index.html - Interactive web-based hero wheel selector

Quick Start

Running the Analysis

# Install dependencies
uv sync

# Run the analysis
python main.py

This will generate all the CSV and TXT reports plus the Nash equilibrium calculations.

Using the Interactive Wheel

  1. Open index.html in your web browser
  2. Click the wheel or the "SPIN" button to randomly select a hero
  3. Heroes are selected with probability equal to their Nash equilibrium representation

Note: You need to serve the files via a local web server for the CSV to load properly. You can use:

# Python 3
python -m http.server 8000

# Then open http://localhost:8000 in your browser

Using the Python Hero Selector

python hero_selector_usage.py

What is Nash Equilibrium?

In game theory, a Nash equilibrium is a strategy where no player can improve their expected outcome by unilaterally changing their strategy. In the context of Flesh and Blood:

  • The Nash equilibrium shows the optimal distribution of hero choices
  • At equilibrium, all heroes in the optimal mix should have approximately equal win rates
  • Playing according to Nash equilibrium maximizes your expected win rate against optimal opponents

Interpretation

  • High percentage heroes in the Nash equilibrium are strong in the current metagame
  • Win rate vs Nash shows how each hero performs against optimal play
  • Heroes with positive advantage perform well against the meta
  • Heroes with negative advantage perform poorly against the meta

Requirements

  • Python 3.11+
  • pandas
  • numpy
  • scipy

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published