Skip to content

Releases: simgine/bevy_replicon

Bevy Replicon 0.35.0

26 Sep 15:27
9e39481

Choose a tag to compare

Added

  • PriorityMap component for authorized clients to control how often mutations are sent.
  • Signature component to match entities between client and server using hashes.
  • *_filtered methods for AppRuleExt that allow using With, Without and Or filters to define replication rules.
  • compact_entity with functions for serde to pack Entity more efficienly.
  • postcard_utils::entity_to_extend_mut and postcard_utils::entity_from_buf helpers that use compact_entity.
  • AppRuleExt::replicate_bundle_with to customize the priority of the bundle.
  • AppRuleExt::replicate_as* functions to convert the component into a different struct before serialization and after deserialiation.

Changed

  • Rename RepliconClientStatus to ClientState and RepliconServerStatus to ServerState. They are now regular Bevy states. As result, we now require StatesPlugin to be added. It's present by default in DefaultPlugins, but with MinimalPlugins you have to add it manually.
  • Replace ServerPlugin::tick_policy with ServerPlugin::tick_schedule, which specifies the schedule where the tick increments. By default, it's FixedPostUpdate. You can control how often it runs with Time<Fixed> resource. If you want to mimic TickPolicy::EveryFrame, set the schedule to PostUpdate.
  • All contexts now store AppTypeRegistry instead of TypeRegistry. To get TypeRegistry, call AppTypeRegistry::read.
  • All events now use ClientId wrapper instead of Entity.
  • AppTypeRegistry now available on replication for observers.
  • postcard_utils now a top-level module. Instead of bevy_replicon::shared::postcard_utils, it's now just bevy_replicon::postcard_utils.
  • Rename FromClient::client_entity into FromClient::client_id.
  • Rename DisconnectRequest::client_entity into DisconnectRequest::client.
  • Rename SendRate into ReplicationMode. The EveryTick variant was also renated into OnChange.
  • Rename ClientSet into ClientSystems.
  • Rename ServerSet into ServerSystems.
  • Rename ComponentRule::send_rate into ComponentRule::mode.
  • Rename replicon_channels module into channels.
  • Rename replication_rules module into rules.
  • Rename replication_registry module into registry.
  • Rename IntoComponentRule::register_component to IntoComponentRule::into_rule and move it to the shared::replication::rules::component module.
  • Rename NetworkStats to ClientStats and move it from shared::backend::connected_client to shared::backend. It's also now a separate resource from RepliconClient.
  • Rename RepliconClient into ClientMessages. It holds only messages now.
  • Rename RepliconServer into ServerMessages. It holds only messages now.
  • Replace IntoReplicationRule with IntoComponentRules, which returns only Vec<ComponentRule>.
  • Replace ReplicationBundle with BundleRules, which returns only Vec<ComponentRule> and uses an associated constant to customize the priority.
  • Hide ServerEntityMap mutation methods from public API.
  • Hide BufferedMutations from public API.
  • Hide server::increment_tick from public API.
  • ExampleClient::new now accepts impl Into<SocketAddr>. This makes it easier for backend developers to port examples since they usually specify IP address.
  • Switch from the FNV hasher to xxh3. It's faster and produces high-quality hashes. The hasher is now also wrapped in deterministic-hash, which ensures consistent endianness and handles usize portably.

Removed

  • ClientEntityMap. Use the newly added Signature component instead.
  • VisibilityPolicy::All. Use VisibilityPolicy::Blacklist instead, which is the default now. There are not performance difference when the list is empty.
  • entity_serde::serialize_entity and entity_serde::deserialize_entity. Use postcard_utils::entity_to_extend_mut and postcard_utils::entity_from_buf respectively; just swap the argument order.
  • SERVER. Use ClientId::Server instead.
  • SendRate::Periodic. Use PriorityMap instead.
  • TickPolicy. Set the schedule directly to ServerPlugin::tick_schedule.
  • All provided run conditions. Just use in_state or OnEnter/OnExit with ServerState and ClientState instead. server_or_singleplayer is just in_state(ClientState::Disconnected).

Bevy Replicon 0.34.4

28 Jul 22:51
e8f7ff9

Choose a tag to compare

Changed

  • Make DeferredEntity::new, DeferredEntity::flush and DeferredChanges public.

Bevy Replicon 0.34.3

01 Jul 16:02
0d391ea

Choose a tag to compare

Fixed

  • Make ProtocolHash deterministic across platforms by using fnv instead of foldhash.
  • Reset ServerMutateTicks on disconnect.
  • Avoid calling drop on uninitialized memory for components with Box or Arc during buffered insertion.

Bevy Replicon 0.34.1

21 Jun 20:16
9e89bb8

Choose a tag to compare

Changed

  • Log replication errors instead of panicking. We use panics only for things that should never happen, but users could sometimes trigger them by messing with entities, so we now log these errors to simplify debugging in those cases.
  • Spawn all allocated entities after processing each replicated entity.

Bevy Replicon 0.34.0

15 Jun 12:11
a899c5b

Choose a tag to compare

Added

  • Authorization system. By default we just verify compatibility between client and server, but it's customizable via RepliconSharedPlugin::auth_method.
  • Configurable SendRate for deterministic replication. Use SendRate::Once to send only the initial value, or SendRate::Periodic to only sync the state periodically.
  • AppRuleExt::replicate_with_priority to configure replication rule priority.
  • DisconnectRequest event to queue a disconnection for a specific client on the server.
  • ServerTriggerAppExt::make_trigger_independent.

Changed

  • AppRuleExt::replicate_with now accepts IntoReplicationRule trait that allows to define rules with multiple components.
  • Rename GroupReplication into BundleReplication.
  • Rename ReplicatedClient into AuthorizedClient.
  • Rename AppRuleExt::replicate_group into AppRuleExt::replicate_bundle.
  • Rename replication_registry::despawn_recursive into replication_registry::despawn.
  • Rename shared::event::trigger module into shared::event::remote_targets.
  • Rename ServerEventAppExt::make_independent into ServerEventAppExt::make_event_independent. It never worked for triggers.
  • ReplicationRule now stores Vec<ComponentRule> instead of Vec<(ComponentId, FnsId)>
  • RuleFns now available from prelude.
  • Initialize channels in App::finish instead of Startup. It's called automatically on App::run, but in tests you need to call App::finish manually.
  • Rules created with the same priority now evaluated in their creation order.
  • Component removals and insertions for an entity are now buffered and applied as bundles to avoid triggering observers without all components being inserted or removed. This also significantly improves performance by avoiding extra archetype moves and lookups.
  • The Replicated component is no longer automatically inserted into non-replicated entities spawned from replicated components.
  • Replace ServerEntityMap::get_by_* and ServerEntityMap::remove_by_* with an entry-based API. Use ServerEntityMap::server_entry or ServerEntityMap::client_entry instead.
  • Split ReplicationChannel into ServerChannel and ClientChannel for clarity.
  • Don't register an additional unreliable client channel for replication. While the server requires two channels, the client only needs one.
  • Print error instead of panic on mapping overwrite in ServerEntityMap.
  • Making trace logging level less verbose and more informative.

Removed

  • WriteCtx::commands. You can now insert and remove components directly through DeferredEntity.
  • RepliconClient::receive and RepliconServer::receive are now private since they should only be called internally by Replicon.
  • ServerPlugin::replicate_after_connect. Use RepliconSharedPlugin::auth_method with AuthMethod::Custom instead.
  • Deprecated methods.

Bevy Replicon 0.34.0 RC 1

02 Jun 23:05
bbf82b6

Choose a tag to compare

Pre-release

Added

  • Authorization system. By default we just verify compatibility between client and server, but it's customizable via RepliconSharedPlugin::auth_method.
  • Configurable SendRate for deterministic replication. Use SendRate::Once to send only the initial value, or SendRate::Periodic to only sync the state periodically.
  • AppRuleExt::replicate_with_priority to configure replication rule priority.
  • DisconnectRequest event to queue a disconnection for a specific client on the server.
  • ServerTriggerAppExt::make_trigger_independent.

Changed

  • AppRuleExt::replicate_with now accepts IntoReplicationRule trait that allows to define rules with multiple components.
  • Rename GroupReplication into BundleReplication.
  • Rename ReplicatedClient into AuthorizedClient.
  • Rename AppRuleExt::replicate_group into AppRuleExt::replicate_bundle.
  • Rename replication_registry::despawn_recursive into replication_registry::despawn.
  • Rename shared::event::trigger module into shared::event::remote_targets.
  • Rename ServerEventAppExt::make_independent into ServerEventAppExt::make_event_independent. It never worked for triggers.
  • ReplicationRule now stores Vec<ComponentRule> instead of Vec<(ComponentId, FnsId)>
  • RuleFns now available from prelude.
  • Initialize channels in App::finish instead of Startup. It's called automatically on App::run, but in tests you need to call App::finish manually.
  • Rules created with the same priority now evaluated in their creation order.
  • Component removals and insertions for an entity are now buffered and applied as bundles to avoid triggering observers without all components being inserted or removed. This also significantly improves performance by avoiding extra archetype moves and lookups.
  • The Replicated component is no longer automatically inserted into non-replicated entities spawned from replicated components.
  • Replace ServerEntityMap::get_by_* and ServerEntityMap::remove_by_* with an entry-based API. Use ServerEntityMap::server_entry or ServerEntityMap::client_entry instead.
  • Split ReplicationChannel into ServerChannel and ClientChannel for clarity.
  • Don't register an additional unreliable client channel for replication. While the server requires two channels, the client only needs one.
  • Print error instead of panic on mapping overwrite in ServerEntityMap.

Removed

  • WriteCtx::commands. You can now insert and remove components directly through DeferredEntity.
  • RepliconClient::receive and RepliconServer::receive are now private since they should only be called internally by Replicon.
  • ServerPlugin::replicate_after_connect. Use RepliconSharedPlugin::auth_method with AuthMethod::Custom instead.
  • Deprecated methods.

Bevy Replicon 0.33.0

27 Apr 07:34
494b651

Choose a tag to compare

Added

  • Support for no_std.
  • Relationships networking. Use SyncRelatedAppExt::sync_related_entities<C> to ensure that entities related by C are replicated in sync.
  • Seamless support for immutable components. For these components, replication is always applied via insertion.
  • server_just_started run condition.

Changed

  • Update to Bevy 0.16.
  • All serde methods now use bevy::ecs::error::Result instead of postcard::Result for more informative errors.
  • AppRuleExt::replicate_mapped, RuleFns::default_mapped and default_deserialize_mapped now deprecated. Entities inside components now mapped automatically, use methods without _mapped prefixes.
  • Use an observer instead of a system to track despawns.

Removed

  • parent_sync module and corresponding feature. Just replicate ChildOf directly.

Bevy Replicon 0.32.2

16 Apr 16:02
41a088f

Choose a tag to compare

Changed

  • Preserve removals before inserts

Bevy Replicon 0.32.1

16 Apr 16:02
21df4fc

Choose a tag to compare

Changed

  • Publicize ClientTicks component and its update_tick method.

Bevy Replicon 0.32.0

23 Mar 23:05
912ae3a

Choose a tag to compare

Added

  • RemoteEventRegistry to get channels for remote triggers and events.
  • ConditionerConfig for bevy_replicon_example_backend to simulate various network conditions.

Changed

  • Rename ChannelKind into just Channel.
  • Rename channels module into replicon_channels.
  • Rename core module into shared and RepliconCorePlugin into RepliconSharedPlugin. To avoid ambiguity with Rust's core, which will be used for no_std support in the next release.
  • Move replicon_server, replicon_client, connected_client and replicon_channels under backend module to group all backend-related API.
  • All methods with Into<Channel> now just accept Channel.
  • Use usize for channel ID. Backends now decide how many channels user can create.
  • Don't insert ClientVisibility at all if ServerPlugin::visibility_policy is set to VisibilityPolicy::All. Previously all calls were just no-op.

Removed

  • RepliconChannel and all methods from RepliconChannels, except channel getters. Now all channel configuration needs to be done on the backend side.