A detailed combat simulator to help you choose the best equipment in Forge Master Idle RPG.
- Equipment Comparison: Run a detailed simulation to determine which of two pieces of equipment will perform better in a fight.
- PvP Simulation: Pit two fully customized characters against each other to see who comes out on top.
- Import / Export: Save your character setups as a JSON file and load them back in later, making it easy to manage multiple configurations.
This application is containerized and can be easily run using Docker.
- Build the Docker image:
docker build -t forge-master-companion .
You can also build the Docker image directly from the GitHub repository.
- Build the Docker image:
Note: You must use the
docker build -t forge-master-companion https://github.com/franckleveque/forge-master-companion.git
.gitURL for Docker to correctly fetch the repository.
Once the image is built, you can run it.
-
Run the Docker container:
docker run -d -p 8080:80 forge-master-companion
-
Access the application: Open your web browser and navigate to
http://localhost:8080.
To set up the project for local development, you will need Node.js, npm, and Python installed.
- Clone the repository:
git clone https://github.com/franckleveque/forge-master-companion.git cd forge-master-companion - Install JavaScript dependencies:
npm install
- Install Python dependencies (for E2E tests):
pip install -r requirements.txt playwright install --with-deps
To run the application for manual testing or development, start a simple web server from the project root:
python -m http.server 8000Then, open your browser to http://localhost:8000.
This project uses Jest for unit/integration testing and Playwright for E2E testing.
-
Run the unit test suite:
npm test -
Run the E2E test suite:
python -m pytest tests_e2e/
Note: The E2E test suite automatically starts and stops its own web server.
- Select the "Equipment Comparison" Tab.
- Enter Character Stats: Fill in your character's total damage, health, and weapon type.
- Enter Passive Skills: Input your character's total passive skill percentages as they appear in-game (i.e., with your old equipment on).
- Configure Active Skills: Set up your three active skills (type, base value, cooldown).
- Enter Equipment to Compare:
- For the "Old Equipment" and "New Equipment", enter the main stat and any passive skill bonuses each item provides.
- Compare: Click the "Compare Equipment" button. The tool runs a PvP simulation pitting your character with the "Old Equipment" against an identical version of your character equipped with the "New Equipment". The winner is declared the "Best Equipment".
Important: The tool automatically calculates your character's base stats. It assumes the stats you entered in steps 2 & 3 already include the bonuses from your "Old Equipment".
- Select the "PvP Simulation" Tab.
- Configure Player & Opponent: For both your character and your opponent, fill in their total damage, health, weapon type, passive skills, and active skills.
- Simulate: Click the "Start Simulation" button to run the fight. The winner will be announced, and a detailed combat log will be available.
You can save and load your configurations for either mode.
- To Export: Click the "Export to JSON" button. Your current setup (stats, skills, equipment) for the active tab will be saved to a file named
comparison_data.jsonorpvp_data.json. - To Import: Click the "Import from JSON" button and select a previously saved file. The data will populate the form automatically.
- Simulation Model: The simulation is deterministic, running on a high-precision time step (0.01s). It continues until a character's health reaches zero or a 60-second time limit is reached. This ensures consistent, reproducible results.
- Player Attack Speed: The "Vitesse d'attaque" passive reduces the time between attacks based on an exponential model. Every 100% bonus halves the time per attack.
- Weapon Delay: Melee weapons have a 2-second delay before their first attack to simulate the character walking to get into melee range.
- Probabilities (Crit, Block, etc.): All percentage-based chances are normalized for consistency. For example, a 10% chance to block will result in exactly 1 blocked attack for every 10 enemy hits.
- Lifesteal: Heals based on a percentage of auto-attack damage.
- Health Regen: Heals based on a percentage of maximum health per second.
- Double Chance: Triggers a second, independent auto-attack that can also critically hit.
- Active Skills: Are used as soon as their cooldown is available.