flocking better for this suituation?any info on flocking?
i posted this earlier, but under a different heading:
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? i am told that flocking algorithms might be a better solution. anyone be able to comment on this or help me out at all?thanks all
I currently only use c# and directX9, in case its relivant and i didnt mention it in the post
Flocking would be interesting to try, actually. The original Game Programming Gems has a pretty nice article on the subject, and there are also websites like this which you should check out first.
Stopping people from walking into walls, but one thing that I think might be interesting to try would be to add a vector pointing to the center of the room for each character, to keep them in roughly one place. That would work pretty well for a small, square room. The question is whether you want them to stay relatively still, or to wander frantically around the room and never stop. I'd say not to mimick the flocking algorithm exactly, but to perhaps take several of the rules and use them, modify them, and come up with new ones.
Stopping people from walking into walls, but one thing that I think might be interesting to try would be to add a vector pointing to the center of the room for each character, to keep them in roughly one place. That would work pretty well for a small, square room. The question is whether you want them to stay relatively still, or to wander frantically around the room and never stop. I'd say not to mimick the flocking algorithm exactly, but to perhaps take several of the rules and use them, modify them, and come up with new ones.
-~-The Cow of Darkness-~-
January 04, 2005 05:27 PM
http://www.red3d.com/cwr/boids/
there are other interesting things (OpenSteer library) at that site as well...
good luck!
there are other interesting things (OpenSteer library) at that site as well...
good luck!
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.
It makes it easier.
Use as you see fit.
From,
Nice coder
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.
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
Popular Topics
Advertisement