big-brain
big-brain is a Utility AI
library for games, built for the Bevy Game Engine
It lets you define complex, intricate AI behaviors for your entities based on their perception of the world. Definitions are heavily data-driven, using plain Rust, and you only need to program Scorers (entities that look at your game world and come up with a Score), and Actions (entities that perform actual behaviors upon the world). No other code is needed for actual AI behavior.
See the documentation for more details.
Features
- Highly concurrent/parallelizable evaluation.
- Integrates smoothly with Bevy.
- Proven game AI model.
- Highly composable and reusable.
- State machine-style continuous actions/behaviors.
- Action cancellation.
Example
As a developer, you write application-dependent code to define
Scorers and Actions, and then put it all together
like building blocks, using Thinkers that will define the
actual behavior.
Scorers
Scorers are entities that look at the world and evaluate into Score values. You can think of them as the "eyes" of the AI system. They're a highly-parallel way of being able to look at the World and use it to make some decisions later.
use *;
use *;
;
Actions
Actions are the actual things your entities will do. They are connected to
ActionStates that represent the current execution
state of the state machine.
use *;
use *;
;
Thinkers
Finally, you can use it when define the Thinker, which you can attach as a
regular Component:
cmd.spawn.insert.insert;
App
Once all that's done, we just add our systems and off we go!
new
.add_plugins
.add_plugin
.add_startup_system
.add_system
.add_system_to_stage
.add_system_to_stage
.run;
Contributing
- Install the latest Rust toolchain (stable supported).
cargo run --example thirst- Happy hacking!
License
This project is licensed under the Apache-2.0 License.