Jump to content
  • Advertisement
Sign in to follow this  

path finding , in 3d, in a world of constantly moving objects??

This topic is 5096 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

i have a square room. in this room i will have many people walking around, controlled by the computer. if they hit a wall or another person, they should slow down and turn to avoid collision. my problem here is how do i know which way to turn? lets say i colide with a wall and turn left, but theres another person there turning right? i have been told to look into path finding algorithms, like A*, but i cant see how i would apply this to a world of constantly moving obstacles, as if the obstacles dont stay still, a path cannot be calculated as it wont be there after all the other charachters move. also, im using directX and c# and i have no idea what heuristic i would use, how i would apply it to the world or anything. I briefly looked at A* before but its quite complicated. anyone had this problem before and could they help me with a solution? thanks all

Share this post

Link to post
Share on other sites
All you really do, is you apply four forces:

1st force: Random motion, just wanting to go anywhere.
2nd force: Repulsive force, it repells everything away from anything else with a force that gets exponentially stronger as you get closer.
3rd force: Group force, it attracts all the same sort of creatures to come together, but with a weak force That gets stronger as the creatures get weaker.
4th force: A movement force: Its a force attracting them all to a path. It doesn't exist when there is no path.

With those forces, you can end up with hepas of relitively complex patterns, for little effort. you simply give them a path to follow, and they'll all follow it.
(even A*, its pretty simple, and it won't hit anything)

It makes it easier.

Use as you see fit.
Nice coder

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!