MantisBT - VCMI
View Issue Details
0002345VCMIMechanics - Adventure Mappublic2015-12-08 03:362016-09-14 02:59
0002345: Fog of War changing objects may completely cover heroes/towns
I was investigating crashes during AI movement and find out about the problem: it's looks like at least neutral Necropolis towns may completely cover objects of player like towns and heroes when player isn't being Red.
1 - Get my "SXX_TEST_MAP_v4.h3m" map: [^]
2 - Start game as pink player.
No tags attached.
has duplicate 0002175closed SXX Crash during AI turn 
has duplicate 0002153closed SXX Crash turn AI 
has duplicate 0002134closed SXX Crash during AI turn - current tile invisible 
has duplicate 0002274closed SXX green hero take sulfur mine and heroes quit 
has duplicate 0002287closed SXX Heroes just closed when turn AI 
has duplicate 0002108closed SXX Cover of Darkness close view of the city 
has duplicate 0002411resolved SXX Crash during AI movement 
related to 0002168closed SXX Terra incognito 
related to 0001750assigned SXX Cover of darkness covers dwellings, player owned guarded gates 
related to 0002251assigned SXX Mines (and possibly other objects) possessed by player get covered by necropolis town's cover of darkness 
jpg fow_bug.jpg (123,062) 2015-12-08 03:36
Issue History
2015-12-08 03:36SXXNew Issue
2015-12-08 03:36SXXFile Added: fow_bug.jpg
2015-12-08 04:02SXXNote Added: 0006148
2015-12-09 07:16SXXNote Added: 0006154
2015-12-09 07:16SXXStatusnew => resolved
2015-12-09 07:16SXXFixed in Version => 0.98f
2015-12-09 07:16SXXResolutionopen => fixed
2015-12-09 07:16SXXAssigned To => SXX
2015-12-09 07:28SXXRelationship addedhas duplicate 0002175
2015-12-09 07:41SXXRelationship addedhas duplicate 0002153
2015-12-09 08:14SXXRelationship addedhas duplicate 0002134
2015-12-09 08:15SXXRelationship addedhas duplicate 0002274
2015-12-09 08:31SXXRelationship addedhas duplicate 0002287
2015-12-24 13:07SXXRelationship addedrelated to 0002168
2015-12-24 19:48SXXRelationship addedhas duplicate 0002108
2016-02-10 05:05SXXRelationship addedhas duplicate 0002411
2016-09-14 02:59SXXRelationship addedrelated to 0001750
2016-09-14 02:59SXXRelationship addedrelated to 0002251

2015-12-08 04:02   
Some details on why it's was tricky to find and reproduce:

* When all 8 tiles around AI hero covered by FoW it can't move so it's can't trigger assertion/crash within moveHeroToTile.
* Still that hero may visit object under it (e.g visit town) and that "movement" clear FoW around.
* If any of tiles around hero aren't in FoW hero can attempt to move there because pathfinder don't check visibility of initial tile.
* Movement from invisible tile cause assertion/crash.

BTW for quite some time I think that weird problem has come due to my movement code changes, but looks like it's was there for a while and my changes just make it appear.
2015-12-09 07:16   
Fixed: [^]

Though all FoW-related code need massive refactoring.