Hey Developers. I have like a city type of map, with… Many… Many roads. We want the city to feel more alive, so we want Npcs, with the task of walking around the city. Only Issue? Planning their movement.
You see there is many issues that arise. Here is the main ones:
-
There is different ‘turns’ that an NPC might face. As seen by the light green arrows, upper left, they can make this 1/4th circle turns. But seen by the slightly lighter green arrows, in the middle right(ish) of the image, they make this right turn.
-
The NPC at some parts have to make a decision on what path to take ahead of them. As seen by the red & darker green arrows in the middle right, they can pick up, left, (and sometimes down, or right).
-
There is possible objects in the way that the NPC might hit. These are noted in a light blue circle, where there is a bus stop station and/or a street light.
-
I want the NPCs to follow the border of the sidewalk, and not walking on the roads (unless it’s on the pathway of decisions), or on the grass.
-
I need this system to be flexible, as other developers are editing/adding more roads.
To be clear. I am not asking for you to script this for me. I’m asking how I should plan this.
What I am asking is what is the best way to handle this, and the system? Use Pathfinding? Another movement method? And how can I sort all of this? How can I make sure the NPC is picking only possible options.
I know this is long, so sorry about that Any and all help is much appreciated!