Auto-translated
I can assume that the game struggles with a large number of functions, such as the talkbox. And based on my observations, functions related to calculating moves also put a significant load on the game – if, for example, you run CalcHeroMoveCost in an infinite loop, the game will start to noticeably lag. And while the game might still handle it at the beginning, it may run out of resources closer to the end of the map, which could be the cause of the crashes. But these are just assumptions, I can't say for sure.