Bevy_adventure
A framework for building 3d adventure games in Bevy.
Features
Interactivetrait is the backbone of the framework, allowing you to create powerful, dynamic objects in your world that can be interacted with and can affect other objects or global state.Scenetrait exposes aPlugin-like interface for managingGLTFscenes and assigning components to entities (based onbevy_scene_hook)WorldStateresource, a stringly-typed storage for tracking progressionInventoryresource allows you to track held items and create recipes for combining them- Automatic camera animation and state management, Component-based interface
- Support for multiple scenes (built on top of
iyes_loopless)
Examples
There is an elaborate example available at examples/main.rs.
Three scenes are included, with multiple objects that can be interacted with or picked up.
Notes
Save States
bevy_adventure intentionally omits implementing save state functionality, as different games will have different requirements.
If you want to implement this, here is what you need to keep track of:
CurrentSpotresource, which determines your current camera spot in the scene. When saving, save the name of theCameraSpotfrom this resource. When loading, create a newNextSpotinstance from the loaded name, and insert it withCommands.CurrentState<State>resource, (fromiyes_loopless) which determines what scene is currently loadedInventoryresource, which tracks what items the player is holdingWorldStateresource, the global game state storage
You will also have to enable the serde feature to allow serialization and deserialization of these resources.
Using WorldState
When you are building interactives, you have the ability to store information in the component itself or the WorldState.
The component should only hold temporary state information - like which drawer is open on a dresser or if an entity has been spawned.
If you want to store any other kind of information, it should be done in the WorldState resource. This is so other interactives in your scene can access this state (for example, you'd flip a switch and the lights would go out) and so you are storing state information in a single place.
TODO
- Audio
- Save state example
- Gamepad support
License
bevy_adventure is dual-licensed under MIT and Apache-2.0.
Compatibility
NOTE: We do not track Bevy main.
| Bevy Version | Crate Version |
|---|---|
0.9 |
0.1 |