Curing the AI's "Failure to Launch" | Rebuilding Heroes of Might & Magic [Episode 114]
Первый герой меча и магии
0:00 / 0:00
Curing the AI's "Failure to Launch" | Rebuilding Heroes of Might & Magic [Episode 114]
323 просмотра · 3 нед. назад
Первый герой меча и магии
235 подписчиков
323 просмотра · 3 нед. назад
In this episode of my Heroes of Might and Magic 1 engine rebuild, I chase down a stubborn castle-entrance bug and work on making the AI meaningfully more aggressive.
The bug: when a hero stands on a castle's entrance tile and another hero tries to swap troops or artifacts with them, the castle screen wrongly opens instead of the exchange screen. The entrance tile is a "walk-on" trigger that opens the castle, while a hero-to-hero swap is treated as a "pickup," and the two kept colliding. My first fix handled the case where the outside hero approaches, but the reverse direction (the hero inside the entrance targeting an adjacent hero) still misfired, opening the castle screen with the swap screen hidden underneath. Getting it fully solved turned into a real wild goose chase, with the AI chasing several red herrings and false "Eureka" moments before landing on the right guard that suppresses the walk-on trigger while the swap window is open.
On the AI side, I worked on what I call "failure to launch," where enemy heroes get stuck at home, never strengthen their armies, and can't clear the neutral monsters around their castle to expand. The improvements let AI heroes pool and transfer creatures between garrisons and heroes to build stronger stacks, lower the aggression threshold so they'll attack stacks they're 1.35x stronger than (down from 1.5x), keep faster creatures on smarter difficulties for better movement, disincentivize sitting idle, and fix an exploration failure where heroes ignored monster zone of control and kept re-targeting piles they could never reach.
I also add a fun cosmetic mod: swapping the battle-screen hero tents for the original 1994 demo standing-heroes-on-horseback sprites, with a fallback to the default tent art when the sprite folder isn't found.