Addon for Godot that adds 2D / 3D boids (flocking).
Go to file
2024-12-06 23:08:18 +03:00
addons feat: add default properties for 2d and 3d 2024-12-06 22:29:26 +03:00
examples/boids fix: make 2d example boid sprite direction accurate 2024-12-06 23:06:15 +03:00
resources chore: update gifs 2024-12-06 23:06:27 +03:00
rust fix: remove avoidance field from boid properties as it was accidentally included 2024-12-06 22:39:25 +03:00
.gitattributes wip 2024-08-30 01:32:01 +03:00
.gitignore feat: add 3d example, update justfile so that only boids addon is packaged 2024-12-06 21:57:17 +03:00
export_presets.cfg build: add web export, fix wasm path 2024-11-28 18:16:19 +03:00
justfile feat: add 3d example, update justfile so that only boids addon is packaged 2024-12-06 21:57:17 +03:00
justfile.nu build: fix wasm builds 2024-11-28 23:57:29 +03:00
LICENSE.txt chore: init 2024-08-19 16:53:54 +03:00
project.godot feat: add 3d example, update justfile so that only boids addon is packaged 2024-12-06 21:57:17 +03:00
README.md docs: update readme links to gifs 2024-12-06 23:08:18 +03:00

boids

addon for Godot that adds 2D / 3D boids (flocking).

boids 2d boids 3d

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.

or clone the repository, and run just all to build the libraries (in release mode) for all supported targets. (requires cross, just and nushell)

currently, linux, windows and web (wasm) is supported.

usage

take a look at the examples. the addon folder also contains a set of default properties extracted from the examples.

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