MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001112VCMIAI - Battlespublic2012-09-30 06:442012-09-30 16:16
ReporterWarmonger 
Assigned ToTow 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionduplicate 
PlatformOSOS Version
Product Version0.89d 
Target VersionFixed in Version 
Summary0001112: BattleAI crash when AI can cast 0 spells
DescriptionBest error message ever.
Steps To ReproduceReproductible with attached save - when blue attacks red castle.
TagsNo tags attached.
Attached Filespng file icon Casting spells sounds like fun.png [^] (6,964 bytes) 2012-09-30 06:44


rar file icon Crash1112.rar [^] (458,243 bytes) 2012-09-30 06:53

- Relationships
duplicate of 0001114closedTow Crash on AI turn when Green hero attacks Purple town 

-  Notes
(0003136)
Tow (developer)
2012-09-30 11:34

Duplicate to 0001114 — it is related to handling shooting towers, not an AI issue.
Fixed in r2960.
(0003141)
Zamolxis (viewer)
2012-09-30 13:40
edited on: 2012-09-30 13:41

Strange that it's duplicate, because the text on my Console was saying something else (really about the towers).

But nevertheless, it was fun to see such Console message... :-) Who coded it like this, and when is it supposed to appear? Perhaps when AI tries to make a non-casting creature/object to cast a spell?

(0003144)
Tow (developer)
2012-09-30 14:09

> Strange that it's duplicate, because the text on my Console was saying something else (really about the towers).

It is because you used StupidAI, and here is the BattleAI — their output is different.
The bug happens, when AI asks about tile accessibility for current stack, if the current stack is towers.

> Who coded it like this, and when is it supposed to appear? Perhaps when AI tries to make a non-casting creature/object to cast a spell?

It was me.

Algorithm is:
1) Get list of spells the hero can cast (first log), erase the ones we don't know how to work (second log).
2) Create list of all possible {spell, target} pairs. (third log)
3) If the list is empty (no possible casts), abort casting. (no log unfortunately)
4) Select the best cast and attempt it.

AI didn't try any casting here. (If it would, it would give an explicit message.) After collecting a list of possible casts, it checked for it size. If it is zero it aborts casting and starts thinking about stack. Which was the turret.
(0003145)
Zamolxis (viewer)
2012-09-30 14:56

Thanks for all the details. I didn't realize the Stupid/BattleAI could be the reason the messages are different.


One question though: did the defending castle have a hero with Ballistics? Otherwise I'm not sure the approach is correct. Heroes cannot cast before the turrets unless they have Ballistics. Unless it's a logic restricted to AI vs AI battles only which speeds up the calculation of casualties.
(0003146)
Tow (developer)
2012-09-30 15:35

> One question though: did the defending castle have a hero with Ballistics?

It's the Artillery skill that gives control over turrets. Yes, there was a hero with garrison, all seems legit. :)
AI uses the same engine procedures to check if casting spell is possible at given moment, so there should not be any bugs. (though... we never know.)


> Unless it's a logic restricted to AI vs AI battles only which speeds up the calculation of casualties.

We don't have such technique, all battles are played using the same rules.
(0003147)
Zamolxis (viewer)
2012-09-30 16:16

Thanks. And good to know there aren't different rules for AI.

- Issue History
Date Modified Username Field Change
2012-09-30 06:44 Warmonger New Issue
2012-09-30 06:44 Warmonger Status new => assigned
2012-09-30 06:44 Warmonger Assigned To => Tow
2012-09-30 06:44 Warmonger File Added: Casting spells sounds like fun.png
2012-09-30 06:53 Warmonger Reproducibility have not tried => always
2012-09-30 06:53 Warmonger Steps to Reproduce Updated View Revisions
2012-09-30 06:53 Warmonger File Added: Crash1112.rar
2012-09-30 06:56 Warmonger Summary BattleAI crash when AI knows 0 spells => BattleAI crash when AI cna cast 0 spells
2012-09-30 06:56 Warmonger Description Updated View Revisions
2012-09-30 06:56 Warmonger Summary BattleAI crash when AI cna cast 0 spells => BattleAI crash when AI can cast 0 spells
2012-09-30 11:34 Tow Note Added: 0003136
2012-09-30 11:34 Tow Status assigned => closed
2012-09-30 11:34 Tow Resolution open => duplicate
2012-09-30 11:34 Tow Relationship added duplicate of 0001114
2012-09-30 13:40 Zamolxis Note Added: 0003141
2012-09-30 13:41 Zamolxis Note Edited: 0003141 View Revisions
2012-09-30 14:09 Tow Note Added: 0003144
2012-09-30 14:56 Zamolxis Note Added: 0003145
2012-09-30 15:35 Tow Note Added: 0003146
2012-09-30 16:16 Zamolxis Note Added: 0003147

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean