https://github.com/90-008/godot_boids
Addon for Godot that adds 2D / 3D boids (flocking). (THIS REPOSITORY IS A MIRROR)
https://github.com/90-008/godot_boids
boid boids flock flocking gdext gdextension godot rust
Last synced: 3 months ago
JSON representation
Addon for Godot that adds 2D / 3D boids (flocking). (THIS REPOSITORY IS A MIRROR)
- Host: GitHub
- URL: https://github.com/90-008/godot_boids
- Owner: 90-008
- License: mit
- Created: 2024-08-19T15:07:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-06T20:27:34.000Z (10 months ago)
- Last Synced: 2025-07-01T22:53:03.866Z (3 months ago)
- Topics: boid, boids, flock, flocking, gdext, gdextension, godot, rust
- Language: Rust
- Homepage: https://git.gaze.systems/dusk/godot_boids
- Size: 234 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# boids
addon for Godot that adds 2D / 3D boids (flocking).

it can handle about 2000 boids in a single flock at 11ms physics process tick on my PC (Ryzen 5600).
(keep in mind this is without any partitioning of sorts, so it's bound to get better)## install
download it from the [asset library](https://godotengine.org/asset-library/asset/3284).
or clone the repository, and run `just all` to build the libraries (in release mode) for all supported targets.
(requires [cross](https://github.com/cross-rs/cross), [just](https://github.com/casey/just) and [nushell](https://github.com/nushell/nushell))currently, linux, windows and web (wasm) is supported.
## usage
take a look at the [examples](./examples/boids/).
the addon folder also contains [a set of default properties extracted from the examples](./addons/boids/defaults/).## development
it's just a standard rust project under `rust`, so make sure you have `rustup` installed (or the toolchain specified under `rust-toolchain.toml`.)
also don't forget to have godot installed and available in your `PATH` (the extension currently targets 4.3).- **cargo features**
- enable `stats` feature to let the extension log into godot console timings for how long its processing the boids.## todo
- [ ] memoize calculated distances
- [ ] implement avoidance (point avoidance, edge avoidance)
- [ ] implement nodes for these (for 2d, point and a rect node and 3d point and a cube node, circle / sphere too)
- [ ] implement partitioning (quadtree/octree)
- [ ] do we just use `spatialtree` crate?
- [ ] write better usage documentation