Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🧠 Death.Fun Edge Tester - Streamlit Simulator

This Streamlit application is a simulator designed to analyze strategies for a tile-based multiplier game inspired by mechanics similar to those found on sites like death.fun.

It allows users to configure game parameters (specifically, a sequence of fixed cumulative multipliers) and simulate thousands of games for various strategies to determine Expected Value (EV), success rates, and analyze kill tile placement patterns.

Features

  • Configurable Game Parameters:
    • Define a sequence of fixed cumulative multipliers achieved after successfully clearing each row.
    • Set the number of simulations to run per strategy.
    • Uses a predefined, repeating tile pattern for rows: [7, 6, 5, 4, 3, 4, 5, 6, ...].
  • Strategy Simulation: Simulates strategies based on cashing out after a specific number of successful rows.
  • Detailed Results per Strategy:
    • Expected Value (EV).
    • Average Multiplier on successful cashout.
    • Success Rate (probability of reaching the target and cashing out).
    • Kill Rate (percentage of games ending in a kill for that strategy).
  • Kill Position Analysis:
    • For each row attempted within a strategy, view the frequency distribution of kill tile positions.
    • Includes a bar chart visualization for kill frequencies per row.
  • Overall Summary Table: Compares all simulated strategies by EV, target multiplier, success rate, and kill rate.
  • Interactive UI: Built with Streamlit, featuring:
    • A sidebar for configuration.
    • Tabs for easy navigation between different strategy results.
    • A dark theme for comfortable viewing.
    • Reset to default settings button.

Prerequisites

  • Python 3.7+ installed.
  • pip (Python package installer).

Setup and Installation

  1. Clone the Repository (or download the files): If this project is in a Git repository, clone it:

    git clone <repository_url>
    cd <repository_directory>

    Otherwise, ensure you have app.py and requirements.txt in the same directory.

  2. Create a Virtual Environment (Recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install Dependencies: Navigate to the project directory in your terminal and run:

    pip install -r requirements.txt

    This will install Streamlit, Matplotlib, and NumPy.

How to Run the App

  1. Make sure your virtual environment is activated (if you created one).
  2. Open your terminal in the project directory (where app.py is located).
  3. Run the following command:
    streamlit run app.py
  4. Streamlit will typically open the app automatically in your default web browser. If not, it will display a local URL (usually http://localhost:8501) that you can open.

Using the App

  1. Configure Parameters (Sidebar):
    • Fixed Cumulative Multipliers: Enter a comma-separated list of the multipliers you achieve after successfully clearing 1 row, 2 rows, 3 rows, and so on (e.g., 1.1, 1.32, 1.66, ...). The number of multipliers determines the maximum number of successful rows that strategies will be simulated for.
    • Simulations per Strategy: Set how many full games should be simulated for each defined strategy (e.g., for aiming for 1 success, 2 successes, etc.). Higher numbers give more statistically accurate results but take longer.
    • The Tile Pattern ([7, 6, 5, 4, 3, 4, 5, 6], repeating) is fixed and displayed for reference.
  2. Run Simulation: Click the "🚀 Run Simulation" button.
  3. View Results:
    • A progress bar will show the simulation status.
    • Once complete, results for each strategy (e.g., "1 Success", "2 Successes") will appear in separate tabs.
    • Each tab displays key metrics: EV, Average Multiplier on Cashout, Success Rate, and Kill Rate.
    • Within each tab, an expander titled "Kill Analysis Details" contains:
      • A bar chart visualizing kill tile frequencies for each row attempted in that strategy.
  4. Strategies Summary Table: Below the tabs, a summary table compares all simulated strategies.
  5. Reset Defaults: Click "Reset Defaults" in the sidebar to restore the initial multiplier and simulation count settings.

Files in the Project

  • app.py: The main Streamlit application script containing all the UI and simulation logic.
  • requirements.txt: Lists the Python dependencies required to run the app.
  • README.md: This file.

Potential Future Enhancements

  • Allow user to define the TILE_PATTERN.
  • More advanced statistical analysis of kill patterns (e.g., checking for sequential biases).
  • Option to export simulation data (e.g., raw kill logs) for external analysis.

Feel free to contribute or suggest improvements!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages