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:
- Find the appropriate nodes for the graph, this is no problem
- 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:
Obviously there are connections missing, by moving the edges of the collision bound of the water tile in by 1 pixel, this happened:
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: https://github.com/EpEpDragon/LifeSim