Endless loop

Today i found another bug: An endless loop in the AI. Here is the console output:

virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
virtual const TerrainTile* CGameInfoCallback::getTile(int3, bool) const: (152 161 0) is not visible!
virtual std::vector<const CGObjectInstance*> CGameInfoCallback::getVisitableObjs(int3, bool) const: (152 161 0) is not visible!
Ending current game!

The hero was moving forth and back and forth and back and forth and back and so on. It never ended. It should at least have ended after using all movement points, but it did not end.

I’ve seen logs - no useful data there. Do you have map file, complete list of mods, some steps to reproduce? As more info you give as better chances to get it fixed.

i can give files of these errors

Could you enable tracing for AI logger? And I need a map file, .h3m I mean. So that I can check what is placed on certain coordinates. And steps to reproduce. Even if it means loading save file 10-20 times and press wait next day.

In settings.json
“logging” : {
“console” : {
“threshold” : “error”
},
“loggers” : [
{
“domain” : “ai”,
“level” : “trace”
},
{
“domain” : “network”,
“level” : “warn”
},
{
“domain” : “global”,
“level” : “warn”
},
{
“domain” : “mod”,
“level” : “warn”
}
]
}

The file is usually located in My Documents\vcmi

I have a map :slight_smile: Very big map. It is big enough to run into any possible bug after playing long enough. I hope it is finished now, i’m still testing it though.
Hints:
Red is meant to be played as human. It is a grass faction. I have tried it with new rampart and with Courtyard. Especially Courtyard fits well.
Blue is a swamp/water based faction. Best is Cove here.
Green is rampart.
Tan is a desert faction.
Purple is a dirt faction. Cathedral fits well here.
Pink is Necromancers.
Orange is Stronghold.
C012.h3m (163.2 KB)
Have fun with it. It needs more than a weekend to finish this map :slight_smile:
I forgot: Teal is a snow based faction. Special hint: There is one Tower town in that region.

I just got the next crash. I tested the map with ruins as purple, but i don’t think this bug is related to the ruins faction. It was during a pure AI battle, obviously with rampart faction.

CSpell::getLevelInfo invalid school level 4
Battle AI best: centaur -> greenDragon at 88 from -1, affects 1 units: 165 0 0 0
Battle AI best: woodElf -> greenDragon at 88 from -1, affects 1 units: 126 0 0 0
Battle AI best: unicorn -> greenDragon at 88 from 71, affects 1 units: 55 148 0 0
Battle AI best: unicorn -> greenDragon at 88 from 71, affects 1 units: 55 148 0 0
Battle AI best: unicorn -> greenDragon at 88 from 71, affects 1 units: 74 148 0 0
Battle AI best: unicorn -> greenDragon at 88 from 71, affects 1 units: 74 148 0 0
CSpell::getLevelInfo invalid school level 4
Battle AI best: dwarf -> greenDragon at 88 from 104, affects 1 units: 93 0 0 0
Battle AI best: centaur -> greenDragon at 88 from -1, affects 1 units: 165 0 0 0
Battle AI best: woodElf -> greenDragon at 88 from -1, affects 1 units: 172 0 0 0
Battle AI best: centaur -> greenDragon at 88 from -1, affects 1 units: 165 0 0 0
Battle AI best: centaur -> greenDragon at 88 from -1, affects 1 units: 165 0 0 0
Battle AI best: dwarf -> greenDragon at 88 from 104, affects 1 units: 66 0 0 0
Battle AI best: woodElf -> greenDragon at 88 from -1, affects 1 units: 126 0 0 0
Battle AI best: woodElf -> greenDragon at 88 from -1, affects 1 units: 126 0 0 0
Battle AI best: dwarf -> greenDragon at 88 from 104, affects 1 units: 66 0 0 0
Battle AI best: dwarf -> greenDragon at 88 from 104, affects 1 units: 66 0 0 0
terminate called recursively
terminate called after throwing an instance of ‘std::runtime_error’
Error: signal 11 :
./vcmiserver(+0x119982) [0x556bd6d70982]
/lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7fbde9747210]
/home/siegfried/prj/vcmi/build/bin/libvcmi.so(_ZN12RemoveObject7applyGsEP10CGameState+0x6a) [0x7fbdea509f3a]
/home/siegfried/prj/vcmi/build/bin/libvcmi.so(+0x6ea9d4) [0x7fbdea4549d4]
/home/siegfried/prj/vcmi/build/bin/libvcmi.so(_ZN10CGameState5applyEP5CPack+0xfb) [0x7fbdea43fc8b]
./vcmiserver(+0x7d486) [0x556bd6cd4486]
./vcmiserver(+0x72901) [0x556bd6cc9901]
./vcmiserver(+0x71e35) [0x556bd6cc8e35]
./vcmiserver(+0x72778) [0x556bd6cc9778]
./vcmiserver(+0x72845) [0x556bd6cc9845]
./vcmiserver(+0x8f178) [0x556bd6ce6178]
./vcmiserver(+0x11bcc8) [0x556bd6d72cc8]
./vcmiserver(+0x636e0) [0x556bd6cba6e0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7fbde97280b3]
./vcmiserver(_start+0x2e) [0x556bd6cbbc1e]

And another thing: On this map you have the opportunity to flag many lighthouses. After you got most of them you run into a strange pathfinding behaviour. If you try to unboard (go from ship to land) just a few tiles distance, the algoritm sends you across half of the water terrain. It is not possible to avoid that. It looks like some overflow issue.

I just retried, but saved directly before the crash.
Saves.tar.gz (2.8 MB)
The list of used mods:
Recourceful AI
Witchking Artifacts
H4 Artifacts regular
H2 Artifacts mod
Boost core
Alternative shooting centaurs
Necropolis creatures
Lost souls
Tides of war
Horn of the Abyss
Andruids expansion mods
In the wake of gods
VCMI essential files
Hidden H3 grafics
Combine grail
Unlucky ones
New skills
New old spells +
Pavillon town
Courtyard town
Ruins town
Northerners

I will try to reproduce it. Might take a while so.

Have fun with it. And don’t haste. The world will probably not go nuts if this takes a while :slight_smile:

Could you share your mods in a zip file somehow? Because I will spend ages to gather all the required mods myself. https://dropmefiles.com/ probably can help or dropbox or whatever.

Well, yes. I’ll pack them up tomorrow.

I had a very “funny” bug today. Never seen that before. It’s about the routing algorithm. Here is a screenshot :slight_smile:

Probably tile movement cost is something about zero.

That may be. The hero did never loose a single movement point while busy riding across the whole map.

I took a look at that dropmefiles, but they require a receiver email address.

It should give you just a link and email should be optional. Here is an example http://prntscr.com/14ie7kb
and the result https://dropmefiles.com/NRQW0

Probably we can arrange some minimal movement cost like 1 or 10. But it looks quite strange behavior that we can move across all the map in one turn.