View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002060VCMIAI - Adventure Mappublic2015-02-09 17:452015-10-15 03:00
Assigned ToIvan 
PlatformOSOS Version
Product Version0.97b 
Target VersionFixed in Version0.98 
Summary0002060: After loading game FuzzyHelper::estimateBankDanger not work properly
DescriptionAs result it's will always return zero danger for banks and AI will no longer able set goals properly: all heroes that not powerful enough to win will be sent to banks and die.

This one is somewhat tricky problem that me and @AVS spend multiple hours to investigate. It's happen because after loading the game "CBankInstanceConstructor::levels" no longer contain sub JSON vector called "guards". Without "guards" info "CBankInfo::getPossibleGuards" no longer able to return proper power of certain bank.

Though "chance", "combat_value" and "reward" are loaded properly. Full structure may be found here:
Additional InformationAlso we checked several things here:

  - On saving it's looks like "levels" are serialized properly.
  - In save file binary it's also looks like all information in place.
  - Even on loading of save it's looks like that "guards" vector it's looks like that serializer attempt to read it, but this isn't 100% checked.

So most likely something bad happen within deserialization process.

If you want to get more useful data set breakpoint here:
std::unique_ptr<IObjectInfo> CBankInstanceConstructor::getObjectInfo(ObjectTemplate tmpl) 
    return std::unique_ptr<IObjectInfo>(new CBankInfo(levels));
TagsNo tags attached.
Attached Files? file icon AI_SXX_Naga_bank.h3m [^] (1,890 bytes) 2015-02-09 17:45
zip file icon [^] (400,818 bytes) 2015-02-09 17:51

- Relationships
related to 0001918closedWarmonger AI Overconfident About Creature Banks 

-  Notes
SXX (administrator)
2015-02-09 17:52

Also attached special test map I used for easier testing.
SXX (administrator)
2015-02-09 18:03

Also it's possible that it's should be duplicate of 0001918, but may be separate problem too.
SXX (administrator)
2015-02-09 18:41

And here is one more other addition so it's won't be forgotten. Before I find out that problem with banks caused by actual game bug I'm get an idea that it's would be great to add some "memory" for the VCAI.

So VCMI originally threat banks danger based on config files because it's can't know actual level of the object. Though once hero visited bank and die here AI should "remember" what exactly level of bank it is and as result threat it's danger more carefully.

Also had idea to make sure that next hero that visit bank should be at least a bit more powerful that previous hero that died here.
SXX (administrator)
2015-03-18 08:07
edited on: 2015-03-18 08:09

Bump this one as it's currently biggest problem with VCAI.
If anyone may want to help with it this may be extremely useful.

Warmonger (administrator)
2015-03-29 11:02

Not sure why it's assigned to me. Probably Ivan is the guy responsible both for JSon parser and object rewrite.
SXX (administrator)
2015-03-29 14:51

I think it's just assigned automatically. :-)
Ivan (developer)
2015-03-30 22:01

Now this is an interesting bug. I still have no idea why this happened but seems to be fixed now.

Short version - serialized *changed* key of std::map insert of loading new key into a buffer (variable on stack)

As result - data from this key was overwritten by subsequent loading.

Weird. But should be fixed. [^]

- Issue History
Date Modified Username Field Change
2015-02-09 17:45 SXX New Issue
2015-02-09 17:45 SXX Status new => assigned
2015-02-09 17:45 SXX Assigned To => Warmonger
2015-02-09 17:45 SXX File Added: AI_SXX_Naga_bank.h3m
2015-02-09 17:51 SXX File Added:
2015-02-09 17:52 SXX Note Added: 0005433
2015-02-09 18:03 SXX Note Added: 0005434
2015-02-09 18:41 SXX Note Added: 0005435
2015-02-10 10:10 AVS Relationship added related to 0001918
2015-03-18 08:07 SXX Note Added: 0005655
2015-03-18 08:09 SXX Note Edited: 0005655 View Revisions
2015-03-29 11:00 Warmonger Assigned To Warmonger =>
2015-03-29 11:02 Warmonger Note Added: 0005665
2015-03-29 11:02 Warmonger Status assigned => new
2015-03-29 14:51 SXX Note Added: 0005669
2015-03-30 21:24 Ivan Assigned To => Ivan
2015-03-30 21:24 Ivan Status new => assigned
2015-03-30 22:01 Ivan Note Added: 0005676
2015-03-30 22:01 Ivan Status assigned => resolved
2015-03-30 22:01 Ivan Fixed in Version => 0.98
2015-03-30 22:01 Ivan Resolution open => fixed
2015-10-15 03:00 SXX Status resolved => closed

Site | Forums | Wiki | Slack | GitHub

Copyright © 2000 - 2022 MantisBT Team
Hosting provided by DigitalOcean