Jump to content
  • Advertisement
Sign in to follow this  
SnOrfys

Curious about a navigation problem of mine

This topic is 3964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, I've got a bit of a conundrum that I wanted some input on before I try coding some solutions. I'm making a top-down game (visually similar to Diablo etc. but the gameplay is nothing like it) and the mapping software that I made for it generates a navigation graph for the map: [link removed because topic is old] Right now the game all happens in 3D but only on a single plane. I am attempting to add objects like ramps etc. that the player can go up/down on, like so: [link removed because topic is old] I know that I'll raise the node(s) on the flat, raised portions of the ramp, but the problem that I'm having is keeping the agent on the ground when going up the ramp, and here's why: When the agent travels from any point with a direct LOS to the node on top of the ramp, the pathfinding's smoothing algorithm will just make the node on top of the ramp the target node to travel to (this 'un-jerks' any paths that are found and greatly improves the realism of the agent's movement - so I can't get rid of it)... and that will produce a path that slowly raises the agent off of the ground. [link removed because topic is old] Seeing the problem? Ideas? [Edited by - SnOrfys on August 16, 2007 1:16:38 PM]

Share this post


Link to post
Share on other sites
Advertisement
You shouldn't be using the output of your path-planner to set the position of the actor directly.

Instead you need a basic physics model with collision to the floor, and a simple locomotion system that moves the actor according to the velocity set by the path-finder. Look into steering behaviors to do that for you.

-alexjc

AiGameDev.com

Share this post


Link to post
Share on other sites
I am using Steering behaviours (specifically, I'm working from Mat Buckland's Programming Game AI by Example - if it helps), and I'm seeking to the next point in the nodelist returned from the path planner (arriving if it's the last point in the list).

A physics model, even a basic one seems a bit overkill at the moment.

Share this post


Link to post
Share on other sites
What Alex was suggesting was that the output of the path planner should not be used as the actual path of the agent, only the desired path. In this case, what you actually want to use is the projection of the output path onto the floor.

You can do this quite easily using either a steering behaviour or a trivially computed required velocity vector.

Steering: move a 'target point' along the planners output path at the desired velocity of your character, but make sure the target point has a z coordinate equal to the height of the floor at that location. Have your character seek the moving target point.

Control: Given the current position and velocity of the character, compute the heading change that aligns its velocity vector with the projection of the planners output path on the floor.

Cheers,

Timkin

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!