MantisBT - VCMI
View Issue Details
0001918VCMIAI - Adventure Mappublic2014-10-11 16:022022-04-12 09:17
linuxrocks123 
Warmonger 
normalminoralways
closedfixed 
0.96b 
0.97b 
0001918: AI Overconfident About Creature Banks
The AI repeatedly dies at creature banks because it thinks they have zero difficulty. This appears to be due to a change in the JSON format. The attached patch fixes the issue. This may be a duplicate of issue 1850, but I have reproduced it in the latest git.
No tags attached.
duplicate of 0002145closed Warmonger ai not using threat assesment and just attacks everything in sight regardless on relative army strength 
related to 0002060closed Ivan After loading game FuzzyHelper::estimateBankDanger not work properly 
patch fuzzy.patch (2,835) 2014-10-11 16:02
https://bugs.vcmi.eu/file_download.php?file_id=1938&type=bug
patch fuzzy2.patch (2,829) 2014-10-12 00:48
https://bugs.vcmi.eu/file_download.php?file_id=1939&type=bug
Issue History
2014-10-11 16:02linuxrocks123New Issue
2014-10-11 16:02linuxrocks123Statusnew => assigned
2014-10-11 16:02linuxrocks123Assigned To => Tow
2014-10-11 16:02linuxrocks123File Added: fuzzy.patch
2014-10-11 16:04linuxrocks123Note Added: 0005013
2014-10-11 19:51WarmongerNote Added: 0005014
2014-10-11 19:52WarmongerNote Edited: 0005014bug_revision_view_page.php?bugnote_id=5014#r2647
2014-10-12 00:48linuxrocks123File Added: fuzzy2.patch
2014-10-12 00:58linuxrocks123Note Added: 0005015
2014-12-19 19:31WarmongerNote Added: 0005214
2014-12-19 19:31WarmongerStatusassigned => resolved
2014-12-19 19:31WarmongerFixed in Version => 0.97b
2014-12-19 19:31WarmongerResolutionopen => fixed
2014-12-19 19:31WarmongerAssigned ToTow => Warmonger
2015-02-10 10:10AVSRelationship addedrelated to 0002060
2015-03-25 09:29WarmongerRelationship addedduplicate of 0002145
2022-04-12 09:17PovelitelStatusresolved => closed

Notes
(0005013)
linuxrocks123   
2014-10-11 16:04   
Oh, the "getTacticalAdvantage" change isn't related to this bug I don't think. But I still think it's a valid fix.
(0005014)
Warmonger   
2014-10-11 19:51   
(edited on: 2014-10-11 19:52)
I don't think these changes are corrected. For example, evaluate(GatherArmy) is normalized by 1000 to keep it withing resonable limits. It's arbitrary formula, but more or less works. With fuzzy logic all that matters are proportions.

Adding false assertions before executable code makes no sense, either.

Expected combat value is now calculated using center-of-mass formula, but I did it just for test. May be confusing and not needed, but still gives a bit different results if you think about it ;)

(0005015)
linuxrocks123   
2014-10-12 00:58   
I uploaded a new version of the patch. I was off by a factor of 100 with the expectedCombatValue() calculation. I was calculating percents and so was multiplying by 0.01 to normalize, but it appears that was not correct. That's fixed now.

Warmonger:
- Re evaluate(GatherArmy): This part of the patch is trying to get the AI to gather armies more, since he's not doing it enough. I found the problem was elsewhere, but kept that in since I still thought it was a bug. If you think it's not, you're probably right, remove that part of the patch before applying. My fix for the AI gathering armies added a new goal "DefendTown", among other changes. I'll be uploading it soon, but I'm going to play against the AI to test (this will be the most enjoyable testing I've done in a while :).
- Re false assertions: minGuards() and maxGuards() are broken and always returning 0 because it appears they're expecting JSON tags which do not exist to be in the mapObjects config. The functions need to be deleted, but I put assert(0) in there to make sure no one else was using them before I did that.
(0005214)
Warmonger   
2014-12-19 19:31   
Most likely fixed in https://github.com/vcmi/vcmi/commit/df8289eee4c41183ac345509994dad35970e6412 [^]