Hello there guys, I wanted to share a issue that me and my team are having with the pathfinding obstacle maps
and a collision tilemap.
The problem
The issue is that we couldn't do a balanced obstacle map in the borders because the wall tiles are in the side of each tile and the obstacle map ends up being imprecise and I don't know how to correctly do the obstacle map in a 16x16 tile resolution.
Besides that when I use the pathfinding Construct 2 code to check the obstacle map it shows that the collision registers 1 tile more than it should even when snapping it to the 16x16 grid, but apparently, it considers one tile more like it was 17x17 and ends up registering the next tile, because if I recall correctly, with only one pixel as an obstacle in the grid, the pathfinding with take the whole place (Grid) as an obstacle.
The tileset of collision. you can see the wall in the side of the tile.
The enemies I have don't follow well the pathfinding, they either go through walls or get stuck if I try to avoid them going through them with solids, and probably it's because of this obstacle map being created incorrectly.
I'm using the code of the example of pathfinding to show the collision map in-game. The red area is the obstacle map.
What we tried
We tried adding a new specific tileset of full square 16x16 for the obstacle collision for the pathfinding but the problem persisted because it has to be 16x16 grid based and the tile of the wall will always be in one side of the tile, the problem persists and we can't find anything precise.
What we want
A correct and balanced collision map in space terms even with the wall being on a side, which was created like this to make a more optimized tileset, comfortable and fluid for the tileset creation, it's not the first game to be done in this way and I'd like to find out how could this be solved.
Maybe something like this without unsnaping the grid:
And here's some information about the tile collision. I have to say that I fixed the extra grid created for the obstacle map just reducing the edges of the colission but that probably will mean that the tilemap will do no optimization
for collisions, anyway, I'm not quite sure.
Hope anybody can help me and thanks in advance guys.