How would I make a GPS system like GTA 5?

Hello Robloxian,

I am wanting to create a GPS system similar to GTA 5.

Click an area of the map and it creates a waypoint of where you clicked and then a visual of what roads to use to get there.

I am wanting to get some ideas of how I would do it?

I’ve thought of pathfinding service but I don’t know how to make paths follow roads and not go to random places to get somewhere and I don’t really want to create custom nodes since the game I’m creating will have a lot of roads and I don’t want to create a million nodes. I have thought of making paths follow each end of a road but the way my game is it wouldn’t work out.

Has anyone got any ideas of how I should do it?

If you are willing to make it yourself and willing to send me a free model then go for it! You will get a percentage of credits depending on how much I change of it. But I am willing to try give it a go for myself!

4 Likes

I made a proof of concept system a while ago using A* pathfinding. It isn’t optimized at all, but I would definitely look into using A*. Just create a map of the nodes along the different roads. A* search algorithm - Wikipedia
I’m not sure the best way of how to map the directions on a gui after you get the path, but :man_shrugging:

2 Likes

I’m trying something right now.

I’m trying to use test nodes as a fake path for if I figure out how to keep path finding service to follow roads only and using a minimap system for viewports but paths only in the minimap. There’s probably a better way to do this but the best way I could think of. I’ll probably improve it in the future.

2 Likes

It’s sort of working. I will still try to find a better way to achieve my goal.

1 Like

I have a question:
How did you manage to make “fake nodes” so the pathfinding will only follow the given nodes? I really need that cause I also want to make a navigation system just as you did.

1 Like

Sorry, I haven’t got the code for that place file anymore because I’ve turned it into an empty baseplate for other projects.

I can’t remember how I did this. But when I did do this it was taking shortcuts and didn’t work properly.

2 Likes

Learn Graph Theory, which explains the information you need.

1 Like

Roblox Dijkstra's Algorithm - YouTube you are in luck I found a source code on the Djkstra Algorithm. Its very very veryyy usefull for navigation systems.