Bug in latest version

Reporting new bugs in latest (unstable) version is easier to put into one thread instead of opening a new topic every time. :slight_smile:

I found this one: During battle, the AI does now often attack backwards. So, if i attack an AI hero, his army is on right side. Now his troops attack to the right, direction right, attacking my stacks that are on the leftmost side. The AI succeeds with that. I can do the same, but then the game crashes.

Maybe related to this: I can now walk my stacks one field left of the leftmost hex.

Already fixed actually. Today’s daily build should be with fix.

BTW, feel free to join our Slack or Discord - both are more active than these forums, so you may get answers to your questions / reports faster.

Memory leak in AI?

I sometimes have a crash, where everything freezes for quite some time. Then, after the client window closes, i get a system message that there is not enough memory to send a crash report. I found this in the client log:

[2023-Mar-03 09:39:47.249214] TRACE animation - Button clicked at 650x520
[2023-Mar-03 09:39:47.249254] TRACE animation - Parent is11CInfoWindow at 489x380
[2023-Mar-03 09:39:47.282103] TRACE network - Sending a request "10QueryReply". It'll have an ID=4941.
[2023-Mar-03 09:39:47.282118] TRACE network - Sending a pack of type 10QueryReply
[2023-Mar-03 09:39:47.283166] TRACE network - Received CPack of type 12RemoveObject
[2023-Mar-03 09:39:47.288225] TRACE animation - Fade anim started for obj 54 at (189 65 0); anim count: 1
[2023-Mar-03 09:39:47.288251] TRACE animation - Fade anim started for obj 54 at (189 66 0); anim count: 2
[2023-Mar-03 09:39:47.288271] TRACE animation - Fade anim started for obj 54 at (190 65 0); anim count: 3
[2023-Mar-03 09:39:47.288285] TRACE animation - Fade anim started for obj 54 at (190 66 0); anim count: 4
[2023-Mar-03 09:39:47.295300] TRACE ai - Entering virtual void

The last line leads to the assumption that there is a memory leak in the AI. But this is just an assumption. And yes, the log ends here apruptly.

Hi,

thanks. Speed is not important. I still have much work to do do finish my mod. That needs lot of time. So if those answers are not that fast, it is not that important. But i check that with discord soon.

I just upgraded to latest. And started a test with one of my test maps:
TestGrass

I got a crash. What i did was:
Day 1: Enter town, build town hall (for easier income calculation). Nothing more.
Day 2: Moved the mouse cursor around a little. Got a crash.

Console output was:

Saving lib part of game...
	Saving header
	Saving options
	Saving handlers
	Saving gamestate
Stopping music file Music/Grass.mp3 at 3.575000
Stopping music file music/CstleTown at 5.996000
Warning: empty path found...
Warning: empty path found...
Saving lib part of game...
	Saving header
	Saving options
	Saving handlers
	Saving gamestate
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)
Network error receiving a pack. Connection Connection with VCMI 1.2.0.GITDIR-NOTFOUND (server) (ID: 1 UUID: 7e1f90c7-ae0e-443c-98c7-c40a92b450f3) dies. What happened: read_some: End of file
Abgebrochen (Speicherabzug geschrieben)

That means that the server crashed. The last lines of the server log:

[2023-Mar-03 10:21:00.815084] INFO global - Saving lib part of game...
[2023-Mar-03 10:21:00.815110] INFO global - 	Saving header
[2023-Mar-03 10:21:00.815137] INFO global - 	Saving options
[2023-Mar-03 10:21:00.815151] INFO global - 	Saving handlers
[2023-Mar-03 10:21:00.830306] INFO global - 	Saving gamestate
[2023-Mar-03 10:21:00.843611] INFO global - Saving server state
[2023-Mar-03 10:21:00.844362] INFO global - Game has been successfully saved!
[2023-Mar-03 10:21:00.844383] INFO global - Game has been saved as Saves/Autosave_9
[2023-Mar-03 10:21:00.844391] TRACE global - Message 8SaveGame successfully applied!
[2023-Mar-03 10:21:00.844398] TRACE network - Sending a pack of type 14PackageApplied
[2023-Mar-03 10:21:05.385567] ERROR network - Network error receiving a pack. Connection Connection with VCMI 1.2.0.GITDIR-NOTFOUND (server) (ID: 1 UUID: 7e1f90c7-ae0e-443c-98c7-c40a92b450f3) dies. What happened: read_some: End of file
[2023-Mar-03 10:21:05.385682] INFO network - Thread listening for Connection with VCMI 1.2.0.GITDIR-NOTFOUND (server) (ID: 1 UUID: 7e1f90c7-ae0e-443c-98c7-c40a92b450f3) ended
[2023-Mar-03 10:21:05.448745] TRACE global - Leaving void CGameHandler::run(bool).

That seems to be some network communication error. An unknown packet perhaps? Since it is the loopback device, it is probably not a broken cable :slight_smile:

Update: I now made another test, just moved the mouse cursor around. It took a few seconds, then the same crash.

Update2: Same test, started the game, did nothing (no mouse movement, no keyboard, nothing). Waited for about 1 minute. Nothing happened. Then moved the mouse cursor, and after a few seconds same crash.

For the developers themselves, it is much more convenient to read about bugs in the bug tracker than on the forum. Which reads 3.5 people

ok, made a note. Next time i’ll try it there.