Game systems
Adventures
A run from the first fight to the boss: a road with side paths to chests, shops and bonfires, lives and gold, and a save that fits in a few lines.
Hub › AdventureAn adventure is a short run: the hero (or a whole party) travels a road, fights what blocks the way, detours to chests and shops, and ends at a boss. The kit's run model (Scripts/Runtime/Run) handles the map, travel rules, fights, gold, lives, loot, shops and saves. Your game only draws it. The 02 Adventure demo is a complete, playable example.

The Adventure asset
Create › AutoBattleKit › Adventure. One asset is the recipe for a run.
| Field | What it does |
|---|---|
| Database, Item Rules, Ruleset | Content, rarity and tier rules, battle rules (empty = defaults). |
| Loot Table, Shop Table | What chests drop and shops sell. Both follow the hero's class rules. |
| Fights | Fights before the boss (the demo uses 6). |
| Side Roads | On: chests and shops sit on optional roads to the left and right of the main road. Off: one straight road, with a chest or shop between fights. |
| Side Road Chance, Chest / Shop Weight, Min Chests / Shops | How many side roads, what they lead to, and guaranteed minimums. |
| Encounters | Enemy pools by fight number ("from fight 3: wolf, skeleton, spider"). The latest matching entry wins. Each entry has a Group Size for party runs (0 = as many as the party). |
| Boss, Boss Allies | The last fight. In a party run the allies fight beside the boss. |
| Party Size | Heroes on the road. 0 = the ruleset's max team size (1 for 1v1 games). Above 1 the run is a party run. |
| Starting Gold, Gold Per Fight, Lives | The economy. Losing a fight costs a life; at zero the run ends. |
| Loot Level Per Fight, Shop Rounds Per Fight | How fast chest loot and shop tiers grow along the road. |
| Extra Slots, Unlock Slot Every | Slots the hero can unlock, one every N fights won. |
| Starter Weapon | Begin with a common weapon the hero can use, chosen by the seed. |
| Healing | How the hero heals between fights (below). |
Healing between fights

Hub › Adventure asks the question and saves the answer on the Adventure asset:
| Style | What happens |
|---|---|
| Bonfires (default) | Health carries between fights. Rest at bonfires (on side roads, between fights, and one before the boss) to heal. |
| Heal after every battle | Health carries, but every win heals you to full. |
| Level ups heal | Every few wins: more max health and a full heal. |
| A flask | A few charges to drink whenever you choose. |
| In-battle healing only | Nothing heals between fights; healing items, regen and team healers are all you have. |
| Full health every fight | Each battle starts fresh (classic autobattler). |
Mix them under Fine-tune healing (for example, bonfires that refill a flask). After a loss you come back with Revive Health %.
Items can heal after combat in any style: give an ability the trigger After winning a battle and a Heal effect (Amount > Of Stat > Max Health 30 for "heal 30%"). The Adventure page can add an example, the Traveler's Canteen.
In code: run.Health, run.MaxHealth, run.Damage, run.Rest() at a bonfire, run.DrinkFlask(), run.Level. CombatantTemplate.startingDamage starts any battle hurt.
Party runs
Give the Adventure a team ruleset (Party Line, Skirmish, Mayhem or your own with a max team size above 1), or set Party Size yourself, and the run becomes a party run:
- The player picks up to Party Size heroes; the first one leads.
new RunState(adventure, heroes, seed)takes the list. - Every fight is a team battle. Each stop draws a group from its encounter pool (the entry's Group Size, or the party size; duplicates allowed, so three wolves are a pack), and the boss brings its Boss Allies.
MapNode.allieslists them;MapNode.Labelreads "Wolf +2". - One inventory for the party, owned by the front hero (chests and shops filter for their class). Equipped items are dealt front to back: the first item to the leader, the second to the next hero, and round again (
run.ItemsFor(member)), the same rule the Balance Lab uses. - Every member carries their own damage between fights (
run.HealthOf(i),run.MaxHealthOf(i),run.DamageOf(i)); bonfires, flasks, level ups and after-battle heals reach everyone. A lost fight revives the whole party. - Saves keep the whole party (
RunSave.heroIds,damages); older one-hero saves still load.
The 02 Adventure demo ships two adventures: the 1v1 road and Party Adventure (three heroes on the Mayhem content, enemy groups, the Lich King and friends). Pick one on the first screen; the party is built from the character bar with Add.
Map and travel
RunMap.Generate(settings, seed) builds the road; the same settings and seed always give the same map, enemies, chests and shops. Each MapNode has a kind (Start, Fight, Chest, Shop, Boss, Bonfire), a column along the road, a lane (-1 left, 0 main, +1 right) and its links.
Travel rules:
- You can walk to a linked stop once the current one is cleared (a fight won, a chest opened).
- An unbeaten fight blocks the road, but you can always retreat the way you came, to gear up and try again.
run.PathTo(node)finds a route through cleared stops, shops and bonfires, so one click can walk several stops. It returns null when a fight or an unopened chest is in the way.
Playing a run
var run = new RunState(adventure, chosenClass, seed); // map, inventory (weapon slot + backpack), gold, lives
run.TravelTo(node); // or walk run.PathTo(node) stop by stop
if (run.MustFight)
{
BattleResult result = run.Fight(); // deterministic; show it however you like
run.Resolve(result); // win: gold, maybe a new slot; loss: a life
}
List<ItemInstance> loot = run.OpenChest(); // once per chest, filtered for the class
Shop shop = run.ShopHere(); // same shop every visit, shares the run's gold
if (run.Won) ... else if (run.Lost) ...
run.Changed fires after travel, fights, gold and inventory changes, so a view can refresh.
A fight doesn't have to be where the party stands. run.Fight(node) runs any stop's fight (an ambush, or the boss walking up when a clock runs out: run.Fight(run.Map.Boss)), and run.Resolve(result, node) applies it with the usual rules: a win clears that stop, carries health and pays gold (beating the boss wins the run), a loss costs a life. The party doesn't move. run.NextFightSeedAt(node) gives the seed if your view replays the battle.
Saving
Battles are deterministic, so a save is small: the seed, the hero, gold, lives, health, flask charges, where you are, what's cleared, which bonfires were used and the inventory. run.Save() returns a RunSave you can store with JsonUtility; RunState.Load(adventure, save) rebuilds the map from the seed and restores everything else.
Balancing a run
The demo's enemies were tuned with a bot that plays full runs with bonfire healing: it takes side roads, equips loot greedily, buys what it can afford and rests when hurt. With the kit's content it wins about 74% of runs (57-87% depending on the hero: the Pyromancer's wands and tomes hit hard, the Duelist is fragile), and losses spread along the road with the Lich as the last wall. The same content with full health every fight wins more often, so re-check balance when you change the healing style. You can script the same loop with RunState (no scene needed) to check your own adventure after every content change.
The demo
Demos/02 Adventure/Adventure.unity (rebuild it with Tools › AutoBattleKit › Demos › Create Adventure Sample). Its heroes and enemies are the kit's content (the 8 heroes every demo uses; 11 road enemies in three stages and the Lich, from SampleContent.RoadEnemies); items and tables come from Loot & Shop.
- Pick a hero and press Begin. Toggle side roads off for the straight-road layout.
- Glowing stops can be reached. Hover a stop for the enemy's stats and abilities.
- Battles play out on screen; Skip fast-forwards, Continue applies the result.
- Chests pop their loot beside the chest: Take sends an item to the hero, then choose the weapon slot, a slot, or the backpack.
- In shops, buy, lock and reroll; select an item in your inventory to sell it.
- Health carries between fights (shown at the top). Walk to a bonfire when hurt to rest; at full health it keeps for later.
AdventureDemo.cs is only drawing code on top of RunState. Replace it with your own map screen and keep the run model.