flame-engine / radiance

This library is a collection of AI algorithms used in games.
MIT License
22 stars 3 forks source link

Separation #18

Open st-pasha opened 2 years ago

st-pasha commented 2 years ago

Description of Separation from https://www.red3d.com/cwr/steer/gdc99/:

Separation steering behavior gives a character the ability to maintain a certain separation distance from others nearby. This can be used to prevent characters from crowding together. To compute steering for separation, first a search is made to find other characters within the specified neighborhood. This might be an exhaustive search of all characters in the simulated world, or might use some sort of spatial partitioning or caching scheme to limit the search to local characters. For each nearby character, a repulsive force is computed by subtracting the positions of our character and the nearby character, normalizing, and then applying a 1/r weighting. (That is, the position offset vector is scaled by 1/r 2.) Note that 1/r is just a setting that has worked well, not a fundamental value. These repulsive forces for each nearby character are summed together to produce the overall steering force. See Figure 14:

separation behavior

Perumallpardhiv commented 1 year ago

I will try this. Assign me

st-pasha commented 1 year ago

Go for it!