2024-08-30 18:19:26 +03:00
|
|
|
# boids
|
2024-08-19 16:53:54 +03:00
|
|
|
|
2024-08-30 18:33:58 +03:00
|
|
|
addon for Godot that adds 2D / 3D boids (flocking).
|
2024-08-19 16:53:54 +03:00
|
|
|
|
|
|
|
![boids](./resources/boids.gif)
|
|
|
|
|
2024-08-30 21:05:08 +03:00
|
|
|
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)
|
|
|
|
|
2024-08-30 18:33:58 +03:00
|
|
|
## usage
|
2024-08-19 16:53:54 +03:00
|
|
|
|
2024-09-25 18:20:28 +03:00
|
|
|
download it from the [asset library](https://godotengine.org/asset-library/asset/3284).
|
2024-09-22 03:21:46 +03:00
|
|
|
|
2024-11-28 21:39:18 +03:00
|
|
|
or clone the repository, and run `just build-all` to build the libraries (in release mode) for all supported targets.
|
2024-11-28 21:39:46 +03:00
|
|
|
(requires [cross](https://github.com/cross-rs/cross), [just](https://github.com/casey/just) and [nushell](https://github.com/nushell/nushell))
|
2024-08-19 16:53:54 +03:00
|
|
|
|
2024-08-30 18:33:58 +03:00
|
|
|
## development
|
|
|
|
|
2024-11-28 21:41:34 +03:00
|
|
|
it's just a standard rust project under `rust`, so make sure you have `rustup` installed (or the toolchain specified under `rust-toolchain.toml`.)
|
2024-08-30 18:33:58 +03:00
|
|
|
also don't forget to have godot installed and available in your `PATH` (the extension currently targets 4.3).
|
|
|
|
|
|
|
|
- **cargo features**
|
2024-11-28 23:57:29 +03:00
|
|
|
- enable `stats` feature to let the extension log into godot console timings for how long its processing the boids.
|
2024-08-30 18:33:58 +03:00
|
|
|
|
|
|
|
## todo
|
2024-08-19 16:53:54 +03:00
|
|
|
|
2024-08-30 18:19:26 +03:00
|
|
|
- [ ] 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)
|
2024-08-30 18:33:58 +03:00
|
|
|
- [ ] do we just use `spatialtree` crate?
|
2024-08-30 18:19:26 +03:00
|
|
|
- [ ] write better usage documentation
|