1 unstable release
0.1.0 | Jun 16, 2017 |
---|
#1638 in Game dev
6 stars & 2 watchers
17KB
424 lines
boids-rs
An implementation of Craig Reynold's Boids algorithm implemented in Rust using the Amethyst game engine.
Boids simulates a flock of birds with coordinated group behaviour. Several rules applied to each boid in turn. These rules allow the flock to exhibit various behavioural characteristics.
Rules
- Separation: Steer to avoid crowding local flockmates
- Alignment: Steer towards the average heading of local flockmates
- Cohesion: Steer to move towards the average position (center of mass) of local flockmates
Dependencies
If you are compiling on Linux, make sure to install the dependencies below.
Debian/Ubuntu
apt install gcc pkg-config openssl libasound2-dev cmake build-essential python3 libfreetype6-dev libexpat1-dev libxcb-composite0-dev libssl-dev libx11-dev libfontconfig1-dev
Other operating systems
See Amethyst README.
Build and Run
- Ensure you have version 1.47.0 of the rust compiler installed.
There is bug in amethyst version 0.15 preventing compilation
with newer versions of rustc. You can override rustc version for current directory with following command
$ rustup default 1.47.0
. - Build the project
$ cargo build --release
(NOTE: There is a large performance difference when compiling without optimizations, so I recommend alwasy using--release
to enable to them) - Once complete, the binary will be located at
target/release/boids
- Use
$ cargo run --release
to build and then run, in one step
Dependencies
~34–46MB
~800K SLoC