[SUPPORT] Advanced Turn Based Tile Toolkit

Okay, that makes sense. The grid is generated using collision traces. Specifically PathTrace for finding tiles that can be walked on and WallTrace to check for walls between tiles that should block off walkability. If your unit meshes and weapons block these trace channels you will end up with some weird behavior, so make sure that PathTrace and WallTrace is only blocked when needed.

Sorry, I was unclear. RunPathfinding does not generate the edge map that holds which tiles can be moved between. This is done by the grid manager at startup. What I meant is that if you run pathfinding for a unit (which checks what tiles it can move to from a tile given its move range) it calculates this move range using the current state of the GridEdges TMap. So lets say a unit starts its turn next to a closed door and you run pathfinding to find what tiles it can move to. The door blocks pathfinding so no tiles in range will be displayed at the other side of the door. But now you open the door through a custom function (Using AddEdgeBothWays, lets say). Now the GridEdges TMap is updated, but since Pathfinding was run before this change happened the tiles on the other side of the door are still not reachable. For this the unit will need to run RunPathfinding again. Makes sense?

Hmm, not 100% sure what is going on here, but I’ll give you some pointers. At the start of the game the GridManager finds walkable tiles by firing PathTrace line traces down from the sky to the center of each potential tile (provided heightmap is set to true or multilevel). If this trace is blocked this location will be added to GridLocations. If heightmap is not set to multilevel it will stop here. If it is, the trace will continue down to check for potential new overlapping tiles below this location. After this is done the grid manager loops through all tiles and check the height between them. If it is bigger than HeightImpassableCutoff the connections between the two will be removed. After this, if TraceForWalls is set to true a line trace using the WallTrace channel will be fired between the center of each tile and the center of its neighbors. If this trace is blocked the edge between them will also be removed.

For your doorway I’m guessing that the top of your door frame is blocking PathTrace causing the grid manager to add the top of the door frame as a tile that can be moved to. If heightmap is not multi-level in your game this is enough to cause the tile below the door frame to not be added. The tile on top of the door frame meanwhile is too high up compared to the surrounding tiles to be connected to them. If you are using multilevel heightmap I’m guessing that the height of your door frame is too small to allow a tile within it.

I suggest going through all the meshes in your map and making sure only things that should be walked on top of block PathTrace and only things that should block movement between two adjacent tiles blocks WallTrace. Do this and check if it solves all your walkability problems. During the same pass check that only meshes that should block line of sight block RangeTrace and only meshes that should provide cover block CoverTrace. See if this fixes your problems.

Love the look of your game, by the way. Let me know if you have a Twitter, website or something to follow its development :slight_smile: