1 unstable release
0.2.3 | Aug 18, 2023 |
---|
#1135 in Game dev
43KB
145 lines
YML based Dialog Structure
Example
If you want to compile the code at home, download assets here: disroot's cloud,
clone the repo, extract the assets in the root of the repo and run cargo run --example complete_example
.
RoadMap
- fully functional API to implement a dialog system into a (bevy game or any) app
- Usage
- Custom (De)Serialize implementation.
The field
content:
is interpreted as eithermonolog:
orchoices:
- Generic type for
Condition
- Generic type for an
extra
field on the DialogNode - Dynamic Macros
- Custom (De)Serialize implementation.
The field
- Exclude Bevy dependency
- Follow all guidelines from Rust API Guidelines
- Documentation
- Examples use
?
, nottry!
, notunwrap
(C-QUESTION-MARK) - Crate level docs are thorough and include examples (C-CRATE-DOC)
- create an example
- Examples use
- Interoperability
- Types eagerly implement common traits
- ...
- Future proofing (crate is free to improve without breaking users' code)
- Sealed traits protect against downstream implementations (C-SEALED)
- Structs have private fields (C-STRUCT-PRIVATE)
- Newtypes encapsulate implementation details (C-NEWTYPE-HIDE)
- Data structures do not duplicate derived trait bounds (C-STRUCT-BOUNDS)
- Documentation
- Usage
Contribute
Release's format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
This project also follows to A successful Git branching model.
We have to respect all the rust API convention. For the lore, follow all Bevy plugins guidelines.
Run cargo clippy
, cargo doc
before commit.
License
This project is free, open source and permissively licensed!
All code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
See the very good reasons for including both here.
Inspiration
- Medium: A Tree Structure implemented in Rust.
- Wikipedia: Dialogue Tree
- Wikipedia: Nonlinear Gameplay
- Bevy's SubReddit: Bevy Dialog Discussion
I began coding this as a tree strucutre dialog but a graph based is much more suited for a dialog. Maybe after this migration this crate is not needed anymore and will just do a devlog. (and free this name :)
Naming
Accordingly to this discussion, this is not a trivial question.
- yml-dialog
- dialog-structure
- md-to-dialog-tree
- fto-dialog
- bevy_dialog
- bevy_dialog_system
- bevy_fto_dialog / bevy_fob_dialog
Dependencies
~0.3–1MB
~22K SLoC