Skip to content

Sierra-KPI/Hunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hunter

Table of Contents

Description

Steering behaviors aim to help autonomous characters move in a realistic manner, by using simple forces that are combined to produce life-like, improvisational navigation around the characters' environment. They are not based on complex strategies involving path planning or global calculations, but instead use local information, such as neighbors' forces. This makes them simple to understand and implement, but still able to produce very complex movement patterns

Badges

Theme Game


Example

public static Vector2 GetHerdVelocity(HerdAnimal[] herdAnimals,
    HerdAnimal currentAnimal)
{
    Vector2 perceivedCentre = Vector2.Zero;
    Vector2 separation = Vector2.Zero;
    Vector2 perceivedVelocity = Vector2.Zero;
    foreach (HerdAnimal animal in herdAnimals)
    {
        if (animal != currentAnimal)
        {
            perceivedCentre += animal.Position;
            if ((animal.Position -
                currentAnimal.Position).LengthSquared() < _distance)
            {
                separation -= (animal.Position -
                    currentAnimal.Position);
            }
            perceivedVelocity += animal.Velocity;
        }
    }
    perceivedCentre /= herdAnimals.GetLength(0) - 1;
    Vector2 cohesion = (perceivedCentre -
        currentAnimal.Position) * _cohesionCoef;
    perceivedVelocity /= (herdAnimals.GetLength(0) - 1);
    Vector2 alignment = (perceivedVelocity -
        currentAnimal.Velocity) * _alignmentCoef;
    return cohesion + separation + alignment;
}

Pictures

Picture1


Contributing

To get started...

Step 1

  • 🍴 Fork this repo!

Step 2

  • HACK AWAY! 🔨🔨🔨

License

License