Skip to content

sergioabreu-g/boids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boids

In 1986 Craig Reynolds created an artificial life simulation called Boids, which was able to closely imitate the behavior of flocks of birds. This is an implementation of the Boids Algorithm made in Godot (Godot v4.3.stable.official).

Boids preview

Getting Started

Prerequisites

You only need Godot v4.3.stable.official or a compatible/higher version.

Installing

Clone or download this repository and open the 'boids' project with Godot.

Guide of use

This algorithm is an example of an emergent behavior. This means that the behavior itself is not directly programmed, and rather shows up as a product of the interaction between some simple elements. So, we only have to code a set of rules every bird-oid object (boid) must follow, and then put them all together.

The main rules are cohesion, separation and alignment. You can find a more in-depth explanation in this video I made.

You can find 2 main scripts in the Godot project:

  • Flock. This is responsible for spawning the flock and then making the necessary calculations for each rule. This is done this way, instead of each boid deciding by itself, to allow for a more efficient and manageable code, since the flock script has access to all the boids.

  • Boid. This script acts as a container that can be accessed from the flock script. It's also responsible for updating the boid's position, rotation and velocity using the acceleration calculated by the flock's script in each frame.

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Acknowledgments

About

The Boids Algorithm implemented in Godot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published