#bevy-plugin #serialization #wrapper #component #traits #moonshine-save #plugins-systems

bevy_serialization_core

A crate which contains the plugins/systems that bevy_serializations_extras relies on, + some misc wrappers

4 releases

0.2.1 Mar 13, 2024
0.2.0 Feb 26, 2024
0.1.1 Feb 6, 2024
0.1.0 Jan 31, 2024

#779 in Game dev

Download history 8/week @ 2024-01-26 11/week @ 2024-02-02 16/week @ 2024-02-16 154/week @ 2024-02-23 30/week @ 2024-03-01 165/week @ 2024-03-08 42/week @ 2024-03-15 9/week @ 2024-03-22 28/week @ 2024-03-29 6/week @ 2024-04-05

97 downloads per month
Used in 3 crates (2 directly)

MIT license

54KB
1.5K SLoC

Rust 1K SLoC // 0.1% comments Rusty Object Notation 314 SLoC

bevy_serialization_extras

A library for bevy which contains wrappers/systems for managing serialization in bevy with moonshine-save for a more "hands off" serialization workflow

demo_gif.webm

Features

  • Out of the box serialization Through plugins for components
// Component <-> WrapperComponent
.add_plugins(SerializeComponentFor::<AsyncCollider, ColliderFlag>::default())

// AssetHandle <-> WrapperComponent
.add_plugins(SerializeAssetFor::<StandardMaterial, MaterialFlag>::default())

// WrapperComponent -> AssetHandle
.add_plugins(DeserializeAssetFrom::<GeometryFlag, Mesh>::default())

// Query -> Component, 
.add_plugins(SerializeQueryFor::<Linkage, ImpulseJoint, JointFlag>::default())
  • Serialization of groups of enities that compose an asset into their singular asset equivillent, and vice-versa

See: https://github.com/rydb/bevy_serialization_urdf

//Query <-> Asset
.add_plugins(SerializeManyAsOneFor::<LinkQuery, Urdf>::default())
  • Allows edititing unserializable(non-reflect) implementing components through the wrappers that convert to them

    E.G: Edit Rapier's ImpulseJoint through JointFlag

edit_example.png

  • type registration for wrappers through ManagedTypeRegistration trait

  • A visualization util to list serializable/unserializable components(W.I.P)

Usage

For implementations of plugin trait bounds, see /Wrappers

TODO

  • Add a mechanism for updating from old save versions to new save versions as to not break old save files.

Dependencies

~48–88MB
~1.5M SLoC