Advertisement

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

Started by January 04, 2005 09:50 AM
2 comments, last by Nice Coder 19 years, 10 months ago
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
I currently only use c# and directX9, in case its relivant and i didnt mention it in the post
I would look into flocking, not A*. Anyone has good links?
Advertisement
thank you. il put a post up for flocking info and google it
I currently only use c# and directX9, in case its relivant and i didnt mention it in the post
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.
From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.

This topic is closed to new replies.

Advertisement