Skip to content

Posts from I'm developing an AI for battles and auto-combat – I need your feedback.

No ratings yet — be the first to rate!
5 months ago
Auto-translated

Hi everyone, I'm exploring vibe coding and decided to try creating an AI for Heroes 3 with a decent auto-battle system and a generally smart opponent. Let's see what comes out of it.

I'd like to hear from players who are actively involved in the game: how relevant and interesting is this to you? Maybe we can gather some suggestions along the way. The development and training process isn't quick, but it's underway.
I'll be posting intermediate results here.

[spoiler=Spoiler: Current Progress]

HoMM3 AI: First Practical Training Results

We've launched a full-fledged RL pipeline for training a combat AI in a separate 7x7 arena model.

What's already implemented

1️⃣ Initiative (tick-based)

The battle is no longer "player turn -> enemy turn."

A tick system with varying speeds has been implemented:

•PLAYER_SPEED = 4

•ENEMY_SPEED = 2

•TICK_TARGET = 100

The enemy can go first – just like in the real game.

2️⃣ Enemy Types

We're currently training against three behavioral models:

Chaser – aggressively engages in melee combat

Kiter – maintains a distance of 2–3

Archer – attacks from a distance, weak in melee

Important: the archer is no longer a "turret." In melee, it loses its advantage (as in HoMM).

3️⃣ Retaliation

A counter-attack has been added for melee attacks.

4️⃣ RL Infrastructure

•PPO (Stable-Baselines3)

•log files + COPY blocks for easy publication

•env_signature – protection against incompatible models

•breakdown-eval (chaser / kiter / archer / mixed3)

Current Stage: 2 stacks for the player (arena_v3)

Added:

•2 independent stacks

•switching between active stacks

•the enemy chooses a target based on distance

•blocking of allied cells

•cooldown on switch

Currently, the model is still "raw" – the 2-stack system has drastically increased the state space, requiring extensive training.

What's Next

Short-term:

•stabilize the 2-stack training

•reduce truncation against kiter/archer

•bring mixed3 back to 0.65–0.70+

Mid-term:

•add a full-fledged zone of control (as in HoMM)

•implement focus targeting

•move to multi-unit (3–4 stacks)

Long-term:

•transfer the logic to VCMI

•train on real maps

•strategic layer (hero movement + recruitment)

[/spoiler]

Statistics

Welcome our newest member: recijeb