bevy_bundlication
Network replication for bevy based on a bundle pattern. Replication group rules for bevy_replicon using a bundle-like API.
Goals
- Simplify the definition of replication groups
- Simplify bandwidth optimization
Getting started
bevy_bundlication works with a pattern similar to a Bundle from bevy. Anything matching the bundle gets networked.
Each field needs to implement NetworkedComponent, this can be done manually or trough a blanket impl on types that have Component, Serialze and Deserialize.
For types where the blanket impl causes conflicts, the #[bundlication(as = Wrapper)] attribute can be used where Wrapper is a type that impletements NetworkedWrapper<YourType>.
Bundles can be registered to bevy_replicon using replicate_group::<Bundle>().
use *;
use *;
;
use *;
use ;
// We need Default on Player because we use the no_send attribute
;
// Speed derives all required traits for the NetworkedBundle blanket impl
;
// We define a type to network a type we don't own in a different way than its default behavior.
// This can also be used to network components without Serialize/Deserialize
// In this case we only network the translation part of Transform
;
License
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)
at your option.