[SUPPORT] Advanced Turn Based Tile Toolkit

@Askyl: The error you’re seeing is because you are hitting the loop limit, roughly meaning you’re going above the maximum set limit of calculations to do during a tick. This makes UE4 assume that there is an infinite loop in progress which crashes the program instead of letting it freeze forever.

The reason for this in your case is that ATBTT does a lot of precalculation at begin play to reduce the need for heavy calculation during gameplay. How much is done depends on how you have set up the grid manager. If you have heightmaps enabled, for instance, a line trace is sent downwards on each tile location to determine their height. For multi-level grids several such traces are used, if you enable trace for walls one such trace is used between all neightboring tiles etc. Since you have a 320x208 grid that means that each such calculation is done 89600 times(!).

There are ways to get around this limit, but I’m curious why you need to have such an absolutely massive map. Even the “huge” map in CIV VI has a map size of only 128*80 tiles, making it roughly one 9th of your map in size.

For the solutions, though, there are two things you can do. The first is simply to increase the loop limit in project settings. It can be found in Project Settings -> Engine -> General Settings -> Maximum Loop Iteration Count. Try adding another zero to this, and I think the error should disappear. However, for maps of this size I would recommend pregenerating the grid before the game starts, so that clients would not have to do these calculations once the game has been built. Pregenerate Gameplay Grids is a public boolean in the grid manager. This uses the construction script, which also has a much higher loop limit. If you do this, note that any changes you make to the map after checking this boolean will not affect the map, so make sure to re-check this boolean if you make any changes.