Hi all. I'm not sure if I'm posting this topic in the right place and please correct me if I'm wrong. I'm about to implement steering behaviors and would like to know how I could combine it with A* on a navigation mesh if it's necessary.
I have the pursuit function very simple:
core::vector3df Pursuit(Agent* evader)
{
double dist = evader->pos().getDistanceFrom(m_Agent->pos());
double time = dist / evader->GetSpeed();
core::vector3df targetPos = evader->GetPosition() + (evader->GetVelocity() * time);
return Seek(targetPos);
}
since a navigation mesh doesn't have any static obstacles (as far as I've noticed it contains just the walkable areas), is the above function enough for a an evader to pursue an agent or it still needs an obstacle avoidance steering behavior or, I should use A* in each update to find a path from evader's position to targetPos calculated from pursuit function?
Steering Behavior and A*
Re: Steering Behavior and A*
Hard question... I did use a mix of dynamic avoidance and A*. Meaning I used A* to get a rough path and then I added some dynamic avoidance steering to avoid dynamic obstacles. And lastly I had some workaround that when the bot failed following the A* route it had for any reason (for example someone blocked off a whole entrance with dynamic obstacles and the AI got stuck on it) then I removed those links from my Navigation mesh (after a few failed attempts).
But these are questions that I can't answer generally, for that I didn't code such stuff often enough. There is a very good forum where more AI developers hang around, maybe try asking such questions there: http://forums.aigamedev.com/
But these are questions that I can't answer generally, for that I didn't code such stuff often enough. There is a very good forum where more AI developers hang around, maybe try asking such questions there: http://forums.aigamedev.com/
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm