# 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.

## 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 on other sites
I would look into flocking, not A*. Anyone has good links?

##### Share on other sites
thank you. il put a post up for flocking info and google it

##### 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.
From,
Nice coder

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
×

## Important Information

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!