https://github.com/itsdoot/bevy_observed_utility
Ergonomic and Correct Utility AI for Bevy Engine
https://github.com/itsdoot/bevy_observed_utility
Last synced: about 1 year ago
JSON representation
Ergonomic and Correct Utility AI for Bevy Engine
- Host: GitHub
- URL: https://github.com/itsdoot/bevy_observed_utility
- Owner: ItsDoot
- License: apache-2.0
- Created: 2024-08-19T03:55:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-05T01:48:35.000Z (over 1 year ago)
- Last Synced: 2025-03-27T17:21:25.195Z (over 1 year ago)
- Language: Rust
- Homepage: https://crates.io/crates/bevy_observed_utility
- Size: 177 KB
- Stars: 26
- Watchers: 1
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# bevy_observed_utility
A state-of-the-art utility AI library for Bevy, built using ECS [observers](https://docs.rs/bevy/latest/bevy/ecs/prelude/struct.Observer.html), with a focus on ergonomics and correctness.
See the [documentation](https://docs.rs/bevy_observed_utility/latest/bevy_observed_utility) for a complete walkthrough example of using the library.
## Get Started
```toml
[dependencies]
bevy_observed_utility = "0.2.0"
```
| Bevy Version | Crate Version |
|--------------|---------------|
| 0.14 | 0.1.0 |
| 0.15 | 0.2.0 |
## Features
- Minimal boilerplate: Add utility AI to pre-existing entities with little ceremony.
- Highly expressive: Build scoring hierarchies for whatever occasion, as complex or as simple as needed.
- Order-correct scoring: Hierarchies score their children before their parents.
- Familiar design: Reuses standard `Parent`/`Children` hierarchy components to build actor entities that select actions based on their child score entities.
- Pay-for-what-you-use performance: Scoring and Picking variants' observers are only registered when they're spawned for the first time.
- Game flow agnostic: Works well with both real-time and turn-based game simulation.
## Design Goals
In order of priority:
- **Correctness**
- Scoring entity trees are scored in depth-first post-order traversal, ensuring that all children are scored before their parents.
- **Ergonomics**:
- Adding scoring, picking, and actions to pre-existing entities should have little boilerplate.
- **Modularity**:
- Adding new kinds of scoring and picking should be easy.
- Adding different ways of handling actions should be easy.
- Both turn-based and real-time games should be supported.
- **Performance**:
- Pay only for what you use: Scoring and picking observers are only added if they are used.
- Scoring and picking should be reasonably fast. Action performance is up to the user.
## Lifecycle Visualized

## License
`bevy_observed_utility` is dual-licensed under either:
- MIT License
- Apache License, Version 2.0
at your option.