Hello. I’m pretty new to pathfinding, so I’m sorry if this sounds easy or dumb.
I’m making a game that’s 2D, top down. Basically it’s displaying a map, and I need to make paths between all the intersections. A point graph sounds perfect. The problem is some of the points will be far apart, as in a limited access highway, and some close together. So just doing a scan where it connects them by distance won’t work.
Another problem is that I need to be able to download new maps as the player progresses and load them into the same scene. Going though the example provided it looks like the number of nodes and their positions is done at design time. All that will change with each map they download, so it’s not known now.
What’s the best way to do this?
I wrote some code that loads in the node’s locations and the connections between them, and I can see the paths in the Unity editor. But I can’t get anything to follow it. Also, the paths just show up as white lines, not colored like I see in some of the other examples. Is that trying to tell me something?
Does anyone have any sample code for something like this I could look at? I’ve been programming since the 1980’s, but I guess I’m getting too old for it or something, because I’ve got over a week in trying to make it work and I’m little closer today than when I started.
Any push in the right direction would be GREATLY appreciated!