Tile map collisions seem inaccurate

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By EpEp

I’m trying to generate a simple visibility graph for use as a A* graph (Yes I there’s a built in system but I want to use a obstacle vertex graph).
My process is as flows:

  1. Find the appropriate nodes for the graph, this is no problem
    Nodes
  2. Connect the points based on visibility, I do this by using intersect_ray. The water tiles have collisions. However I get a result as such:
    Missing connections

Obviously there are connections missing, by moving the edges of the collision bound of the water tile in by 1 pixel, this happened:
Correct connections except horizontal and vertical
Now all the connections are there but the ray slips through the 2 pixel gap between water tiles resulting in tiles horizontal or vertical to each other are always connected.

As far as I can see this is a engine bug, unless I’m doing something stupidly wrong.

Code is still a tad messy: GitHub - EpEpDragon/LifeSim