# Symulacja stada (boids)

EN: **Boids and flocking simulation** · id `boids` · aliases: boids, flocking, flocking simulation, stado, symulacja stad

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Obliczenia ewolucyjne i inteligencja roju](https://aiatlasgraph.com/t/evolutionary.md) › [Inteligencja roju](https://aiatlasgraph.com/t/swarmintel.md) › Symulacja stada (boids)

## Description

- PL: Rozproszony model zachowania stada, w którym każdy agent steruje się trzema regułami względem sąsiadów w lokalnym zasięgu.
- EN: A distributed flocking model where each agent steers by three rules relative to neighbours within a local range.

## In one sentence

- PL: Trzy proste reguły ruchu, dzięki którym animowane ptaki, ryby czy tłumy poruszają się razem jak prawdziwe stado.
- EN: Three simple movement rules that make animated birds, fish or crowds move together like a real flock.

## Problem it solves

- PL: Ręczne animowanie tysięcy ptaków czy ryb byłoby niewykonalne, a losowy ruch wygląda sztucznie.
- EN: Hand-animating thousands of birds or fish would be impossible, and random motion looks fake.

## What it does

- PL: Każdy osobnik tylko omija zbyt bliskich sąsiadów, dopasowuje się do ich kierunku i trzyma się grupy; resztę robi wspólny efekt.
- EN: Each member only avoids neighbours that are too close, matches their heading and stays with the group; the joint effect does the rest.

## Everyday example

- PL: W filmie lub grze ogromna ławica ryb zgrabnie omija nurka; nikt nie rysował jej klatka po klatce, ruch wynika z reguł.
- EN: In a film or game a huge school of fish smoothly swerves around a diver; nobody drew it frame by frame, the rules produce it.

## This concerns you if you…

- PL: robisz animacje lub gry z wieloma postaciami
- PL: chcesz zobaczyć, jak porządek wyłania się z prostych reguł
- EN: make animations or games with many characters
- EN: want to see order emerge from simple rules

## Keywords

Craig Reynolds · steering behaviors · separation · alignment · cohesion · crowd simulation · spatial hashing · Vicsek model

## How it works

- PL: Agent widzi sąsiadów tylko w określonej odległości i kącie. Separacja odpycha od zbyt bliskich, wyrównanie dopasowuje kierunek do średniej sąsiadów, a spójność przyciąga do ich środka. Żądania przyspieszenia sumuje się według priorytetu do limitu przyspieszenia; dodaje się też omijanie przeszkód i podążanie za celem.
- EN: An agent sees neighbours only within a set distance and angle. Separation pushes away from those too close, alignment matches the neighbours' average heading, and cohesion pulls toward their centre. Acceleration requests are summed by priority up to a maximum; obstacle avoidance and goal seeking are often added.

## Limits

- PL: To model wizualny, a nie wierne odwzorowanie biologii ani metoda optymalizacji. Wynik zależy od wag reguł i zasięgu widzenia; przy wielu agentach trzeba szybko wyszukiwać sąsiadów, np. siatką przestrzenną.
- EN: It is a visual model, not a faithful biological account nor an optimisation method. Results depend on rule weights and view range; with many agents neighbour search needs speeding up, e.g. with a spatial grid.

## Key terms

- PL: **separacja**: Odsuwanie się od sąsiadów, którzy są za blisko.
- PL: **wyrównanie**: Dopasowanie kierunku lotu do średniego kierunku sąsiadów.
- PL: **spójność**: Kierowanie się ku środkowi pobliskiej grupy.
- EN: **separation**: Steering away from neighbours that are too close.
- EN: **alignment**: Matching flight direction to neighbours' average heading.
- EN: **cohesion**: Steering toward the centre of the nearby group.

## Related topics

Untyped, symmetric "see also" links.

- [Siatki nawigacyjne i odnajdywanie drogi (Navigation meshes and pathfinding)](https://aiatlasgraph.com/t/navmesh.md)

## Sources

- [Boids (Flocks, Herds, and Schools: a Distributed Behavioral Model)](<https://www.red3d.com/cwr/boids/>) `boids-reynolds` · by Craig Reynolds

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/boids · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
