|
Re: Companion_ai
[Re: Erick_Castro]
#275969
07/02/09 22:45
07/02/09 22:45
|
Joined: Feb 2009
Posts: 2,154
Damocles_
Expert
|
Expert
Joined: Feb 2009
Posts: 2,154
|
Apart from the code, wich you can look though of course, here the mechanics of that guy:
---
This AI is based on finding a movement path without the need for creating a node-based pathfinding grid.
The nodes are created "on the fly" by the player when he moves.
The player continiusly "drops" nodes when walking. As the nodes are in a linked list, they somehow form a "chain", wich is the path for the AI to move.
The AI guy looks for the most recent node, that he can directly reach. Once he is there, he will go to an even more recent node. Similar to a Dog, sniffing his way.
This way the AI follows the player.
I dont remember exactly, but I think, when the AI gets stuck, he walks back his way, until he can find a suitable node again to follow.
---
The other part is the movement script, wich uses several traces, that makes the AI avoid to get to close to walls. So before colliding directly with something, the AI usually pushed itself away from the obstacle or turned a bit.
The same with jumping. The Players actually hover over the ground up to the hips. Similar to humans, the legs are basically fully flexible to adapt to narrow obstacles on the floor.
If the trace dow finds a distance lower than the leg-hight, the AI pushes itself up. If it is higher than the hip-hight, it stops pushing, and starts to fall.
|
|
|
Re: Companion_ai
[Re: 3run]
#286509
08/25/09 15:32
08/25/09 15:32
|
Joined: Nov 2008
Posts: 196 the wrong place
Muhsin
Member
|
Member
Joined: Nov 2008
Posts: 196
the wrong place
|
Does the companion attack enemies, if they attack the player?
Come and play my new browsergame - Valley Of Wolves: http://www.mafiacreator.com/ValleyOfWolvesHurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it! And be the most feared MafiaBoss in the World!!
|
|
|
|