NPC Artificial Intelligence - Shortest path algorithm
#1

Hello there,
Here is a piece of insight to a project on which I have been working on lately. It is based off Dijkstra's algorithm and the idea behind this was to make a bot able to move in a realistic way, not just going straight lines.
I started working on this way back, when "Alex009" had released the NPC plugin. I failed the first time. I haven't given up though, I just haven't had the time to finish this one, but now I present the outcome.

The coordination, especially in turns is pretty rough. With a better level of detail (more nodes) you can achieve greater precision that in turn will look way smoother than this. Plus, a few minor optimizations are also required, but that's really nothing compared to what I have so far.

The set up:
In use:
EDIT:

The result, a crowded partyy:



Reply
#2

Nice Idea, indeed,
but this aint an AI...
Reply
#3

I have to draw you people somehow xd
But anyway, it's a wannabe AI then, named the thread the same as the project went by when started. Now when I re-continued I didn't really hesitate how to call it
Reply
#4

Nice and i hope it will be more smooth on turns , etc.
Reply
#5

RELEASE IT D

(lol xD)
Reply
#6

Quote:
Originally Posted by lilswizy
View Post
Nice and i hope it will be more smooth on turns , etc.
I'll try to come up with an alternative way that gently chops off the corners and makes the bot walk on a curve shaped path when entering turns.

Until then, I will create and use a more detailed web/node map to make turns look better.
Reply
#7

Whoa epic, nice script man
Reply
#8

Nice. I have a GPS System using that algorithm (dijkstra's) which works perfect.

Taking nodes is annoying so I retrieved all nodes from San Andreas in paths folder. But I don't understand the linking ID. Actually the ID which links a node to another like you did.
Do you have any idea?
Reply
#9

Very interesting way of controlling the bots, good luck on perfecting it.
Reply
#10

Omg that algoritm (dijkstra) so haaardd. this would be perfect to make driving npc - taxis etc.. Keep up with good job.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)