Answer the question
In order to leave comments, you need to log in
How to make a navigator for the game?
I think everyone played GTA5 and there was a GPS navigator. I tried to do this first: write down the coordinates of the intersections and look for the nearest intersection for the player and put a mark there. I did it, but I did not take into account the fact that the intersection may be behind a fence and the player will stupidly not be able to get there ... And the fact that there may be a bridge over the player and it turns out that he will stupidly not get there ... My second idea is to redraw game map in the format: 1 - road, 0 - everything else.
For
example
:
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
billion
_
_
But
there
are two questions. Is it possible to make it even easier and how to programmatically draw such a map?
Answer the question
In order to leave comments, you need to log in
You need to read about pathfinding algorithms, you can start with wikipedia . For the general case of graph navigation, the A* algorithm is usually used . For 3D worlds it is more convenient to use navigation mesh , there is a good Recast library to work with them .
Why not make these intersections the vertices of the graph? edges - passability between vertices, and edge parameters - distance between intersections.
First you need to properly compose a question, indicate what technologies are used and what exactly is needed (you may be surprised, but not everyone played GTA5). If you need to find a route to a point, then use pathfinding algorithms, there are many of them, google it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question