hv-unified/simulator
GaboGG b69eabd1eb Fix: Spark of Life icon key, mana items after buffs
1. Spark of Life icon is 'fallenshield.png' not 'spark_of_life' -
   fixed BUFF_PRIORITY key so buff detection works correctly
2. Mana/spirit items moved to AFTER buffs in all 3 tiers -
   was drinking mana potions on turn 2 before buffs were cast
3. Priority order: Health items -> Cure -> Buffs -> Mana items ->
   Skills -> Spirit Stance -> Damage spells -> Channeling -> Attack
2026-07-22 06:13:54 -04:00
..
configs Add battle simulator and Forgejo repo setup 2026-07-20 19:36:55 -04:00
results Fix: Spark of Life icon key, mana items after buffs 2026-07-22 06:13:54 -04:00
src Benchmark v3: 17 configs, chan-mp-focused wins (149 rounds) 2026-07-21 14:12:54 -04:00
package.json Add battle simulator and Forgejo repo setup 2026-07-20 19:36:55 -04:00
README.md Add battle simulator and Forgejo repo setup 2026-07-20 19:36:55 -04:00

HV Unified Simulator

A headless battle simulator for HentaiVerse. Tests strategy configurations against simulated battles to find optimal settings.

Structure

simulator/
├── src/
│   ├── engine.js        # Battle engine (turns, damage, procs)
│   ├── entities.js      # Player, Monster classes
│   ├── formulas.js      # All wiki-known formulas
│   ├── strategy.js      # Port of the userscript strategy logic
│   ├── grindfest.js     # Grindfest simulation
│   ├── arena.js         # Arena simulation
│   └── runner.js        # Run configs, collect stats
├── configs/
│   └── default.json     # Default strategy config
├── results/             # Simulation output
├── package.json
└── README.md

Usage

node src/runner.js --rounds 1000 --config configs/aggressive.json

Strategy Config Format

{
  "name": "aggressive-items",
  "cureHP": 0.35,
  "cureItemHP": 0.65,
  "manaGemMP": 0.60,
  "spiritPotionSP": 0.40,
  "spiritStanceOC": 60,
  "useAttackSpells": false,
  "skillRendingAt": 5,
  "skillGreatCleaveOnlyBosses": true
}

How It Works

  1. Creates a simulated player at a given level with specified stats/gear
  2. Spawns monsters based on difficulty and battle type
  3. Runs the same strategy logic as the userscript (ported to Node.js)
  4. Tracks every action, proc, damage event
  5. Outputs summary stats + per-round logs