All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.29.0 - 2024-12-02
- RTT, bytes per second and packet loss information for
RepliconClient
andConnectedClients
. ClientSet::Diagnostics
for systems that collect client diagnostics.
- Sending removals and despawns for hidden entities.
- Update to Bevy 0.15.
- Make
core::replication::replication_rules::ReplicationRules
public. - Various optimizations for replication messages to use fewer bytes.
- Accept
Vec<u8>
instead ofCursor<Vec<u8>>
for serialization. ConnectedClients
now storeConnectedClient
instead ofClientId
with more information about the client.- All
TestFnsEntityExt
now acceptFnsId
. - Move replication-related modules from
core
module undercore::replication
. - Move
Replicated
to thereplication
module. - Split the
ctx
module and move event-related contexts undercore::events_registry::ctx
and replication-related contexts undercore::replication_registry::ctx
. - Separate paths from
diagnostics
module by/
and their parent path nowclient/replication
instead ofreplication/client
. - Provide replication statistics by sum instead of per second and use
usize
for it. - Use fixed integer encoding for ticks for server events.
- Rename
ServerPlugin::change_timeout
intoServerPlugin::mutations_timeout
. - Rename
ServerInitTick
intoServerUpdateTick
. - Rename
ReplicatedClient::init_tick
intoReplicatedClient::change_tick
. - Rename
ReplicatedClient::get_change_tick
intoReplicatedClient::mutation_tick
. - Rename
ReplicationChannel::Init
intoReplicationChannel::Updates
. - Rename
ReplicationChannel::Update
intoReplicationChannel::Mutations
. - Rename
ClientStats
intoClientReplicationStats
. - Rename
ClientDiagnosticsPlugin::MESSAGES
intoClientDiagnosticsPlugin::REPLICATION_MESSAGES
. - Rename
ClientDiagnosticsPlugin::BYTES
intoClientDiagnosticsPlugin::REPLICATION_BYTES
. - Rename
ClientDiagnosticsPlugin::ENTITY_CHANGES
intoClientDiagnosticsPlugin::ENTITIES_CHANGED
. - Rename
ClientDiagnosticsPlugin::COMPONENT_CHANGES
intoClientDiagnosticsPlugin::COMPONENTS_CHANGED
.
FnsInfo
, use(ComponentId, FnsId)
instead.- Deprecated functions and structs from previous releases.
0.28.4 - 2024-10-15
ComponentId
to all component-related contexts.
- All custom functions now accept the newly added
DeferredEntity
instead ofEntityMut
. This new entity type provides read-only access to the world.
- Synchronize server events with init messages properly when
ServerTick
is not updated every app tick.
0.28.3 - 2024-09-13
- Ignore replicated components that don't have type registration or missing
#[reflect(Component)]
inscene::replicate_into
instead of panicking. - Rename
has_authority
condition intoserver_or_singleplayer
. Old name still works, but marked as deprecated.
0.28.2 - 2024-09-09
- Make
ReplicatedClients::new
public.
0.28.1 - 2024-09-04
- Client event buffering.
0.28.0 - 2024-09-03
ServerEventAppExt::make_independent
to let events be triggered without waiting for replication on the same tick.ConnectedClients
(the same name as the old resource that was renamed intoReplicatedClients
) with client IDs for all connected clients (but may not be replicated yet).ServerPlugin::replicate_after_connect
to enable replication right after connection (enabled by default, same as old behavior).
- Rename
connected_clients
intoreplicated_clients
. - Rename
ConnectedClients
toReplicatedClients
. - Rename
ConnectedClient
toReplicatedClient
.
- Emit an error instead of panic on events deserialization on client.
- Buffering for events that have mapped entities.
0.27.0 - 2024-07-04
- Update to Bevy
0.14.0
. - Move
bevy_replicon_renet
to a dedicated repository. ServerEventsPlugin
andClientEventsPlugin
can be disabled on client-only and server-only apps respectively.- Put
ClientDiagnosticsPlugin
underclient_diagnostics
feature (disabled by default) and make it part of theRepliconPlugins
group. - Put
scene
module underscene
feature (enabled by default). - Put
parent_sync
module underparent_sync
feature (enabled by default). - Put
client
module underclient
feature (enabled by default). - Put
server
module underserver
feature (enabled by default). TestFnsEntityExt::serialize
now acceptsRepliconTick
for server tick instead of usingServerTick
resource internally.- Move
replicon_client
,server_entity_map
,replicon_server
,connected_clients
undercore
module. These modules are needed for both client and server. - Move
VisibilityPolicy
toconnected_clients
module. - Move
server::events::event_data
module tocore::event_registry::server_event
. - Move
client::events::event_data
module tocore::event_registry::client_event
. - Move
ClientEventAppExt
,client::events::SerializeFn
,client::events::DeserializeFn
,default_serialize
,default_serialize_mapped
,default_deserialize
andFromClient
tocore::event_registry::client_event
. - Move
ServerEventAppExt
,server::events::SerializeFn
,server::events::DeserializeFn
,default_serialize
,default_serialize_mapped
,default_deserialize
,ToClients
andSendMode
tocore::event_registry::server_event
. - Speedup removals caching.
- Do not divide values per seconds by the number of messages for
ClientDiagnosticsPlugin
.
0.26.3 - 2024-06-09
- Logging for sending and receiving messages.
- Do not send empty ack messages from client.
0.26.2 - 2024-06-05
Debug
/Clone
derives toServerEvent
.Debug
/Copy
/Clone
derives toTickPolicy
.ClientSet::SyncHierarchy
forParentSync
updates.
0.26.1 - 2024-05-27
- Regression in server events reset logic.
0.26.0 - 2024-05-26
ClientEventsPlugin
andServerEventsPlugin
that are required for events (available from theRepliconPlugins
group). Can be disabled if you don't use them.
- Custom events are now registered with serialization and deserialization functions instead of systems. This makes the API more convenient since the purpose of custom systems was to customize serialization.
- All events are processed in one system instead of a separate system for each event. Bevy does a similar optimization for event updates. It won't be that noticeable since users register much fewer replicon events.
- Rename
ConnectedClient::change_tick
intoConnectedClient::init_tick
. - Rename
ConnectedClient::get_change_limit
intoConnectedClient::get_change_tick
. - Rename
Confirmed
intoConfirmHistory
. - Rename
replicon_channels
module intochannels
. - Rename
replication_fns
andReplicationFns
intoreplication_registry
andReplicationRegistry
. - Rename "packets" into "messages" in client diagnostics.
bevy_replicon_renet
now properly setsRepliconClientStatus::Connecting
whenRenetClient
is connecting.
0.25.3 - 2024-05-24
- Fix replication with a removal at the same tick.
0.25.2 - 2024-05-18
- Fix replicating previously spawned entities to a newly connected client with visibility policy different from
VisibilityPolicy::All
.
0.25.1 - 2024-05-16
- Fix possible overflow in
Confirmed::contains_any
.
0.25.0 - 2024-05-11
AppMarkerExt
to customize how components will be written based on markers present without overriding deserialization functions. Now third-party prediction crates could be integrated much easier.AppRuleExt::replicate_group
andGroupRegistration
trait to register and customize component groups. A group will be replicated only if all its components present on an entity.ServerSet::StoreHierarchy
for systems that store hierarchy changes inParentSync
.- More tracing.
Debug
impl forRepliconClientStatus
.
SerializeFn
now accepts regularC
instead ofPtr
.DeserializeFn
now does only deserialization and returnsC
. Use the newly added marker-based API if you want to customize how component will be written. See docs forAppMarkerExt
for details.- Rename
AppReplicationExt
intoAppRuleExt
. AppRuleExt::replicate_with
now acceptsRuleFns
struct with functions. You no longer can customize removals this way, use the mentioned marker-based API instead.- Writing to entities on client now done via
EntityMut
andCommands
instead ofEntityWorldMut
. It was needed to support the mentioned in-place deserialization and will possibly allow batching insertions in the future (for details see bevyengine/bevy#10154). - Return iterator from
RepliconClient::receive
instead of popping the last message. If you usedwhile
loop with it before, replace it withfor
. - Use new
ServerInitTick
resource on client instead ofRepliconTick
. If you usedServerEventAppExt::add_server_event_with
, useServerInitTick
instead ofRepliconTick
in your receive function. - Use new
ServerTick
resource on server instead ofRepliconTick
. - Replace
ServerEntityTicks
withConfirmed
component. The component now also stores whether the last 64 ticks were received. - Now serialization/deserialization, removal, despawn and writing functions accept context to access additional information.
- Move
replicon_tick
module underserver
module since now it's used only on server. - Move
Replication
tocore
module. - Move all functions-related logic from
ReplicationRules
into a newReplicationFns
and hideReplicationRules
from public API. - Move
despawn_recursive
intoreplication_fns
module. - Rename
serialize_component
intodefault_serialize
and move intorule_fns
module. - Rename
deserialize_component
intodefault_deserialize
and move intorule_fns
module. - Rename
deserialize_mapped_component
intodefault_deserialize_mapped
and move intorule_fns
module. - Rename
remove_component
intodefault_remove
and move intocommand_fns
module.
dont_replicate
module. Use the newly addedAppRuleExt::replicate_group
or newtypes.
- Reversed order of the received messages from
RepliconClient
.
0.24.1 - 2024-03-07
- Fix compilation issue when multiple
PartialEq
impls are present forusize
.
0.24.0 - 2024-03-06
- Provide
ServerTestAppExt
extension trait for exchanging messaging between apps in tests.
- Rename
Replication
intoReplicated
. Old name is still available via deprecated alias. - Abstract out all I/O and
renet
dependency. We will continue to provide first-party integration with renet viabevy_replion_renet
. But users can write their integration with other messaging libraries. So now users need to additionally add messaging-related plugin. In case ofbevy_replion_renet
it'sRepliconRenetPlugins
. - Replace usage of
RenetServer
andRenetClient
with ourRepliconServer
andRepliconClient
respectively. Use types fromrenet
(or other library) only when you need to connect / disconnect or write some library-specific logic. In other cases prefer using the newly provided types to make your code messaging-library independent. Unlike the old types from renet, these resources are always present in the world. So instead of usingresource_(exists/added/removed)
for network-related conditions, use special conditions provided incommon_conditions
module. - Move
has_authority
tocommon_conditions
module. - Replace conditions from
renet
with ours, seecommon_conditions
module. Available inprelude
. - Replace usage of
ClientId
fromrenet
with our own with the same name. In user code only the one frombevy_replicon
should be used. - Replace
SERVER_ID
constant withClientId::SERVER
. - Replace use of
RenetConnectionStatus
with ourRepliconClientStatus
. - Replace
ServerEvent
fromrenet
with our own with the same name. In user code only the one frombevy_replicon
should be used. - Rename
replicon_core
module intocore
. - Rename
EventType
intoChannelKind
and move intocore
module. - Replace usage of renet's
SendType
with ourRepliconChannel
. - Rename
NetworkChannels
intoRepliconChannels
and move intoreplicon_channels
module. - Rename
ReplicationChannel::Reliable
andReplicationChannel::Unreliable
intoReplicationChannel::Init
andReplicationChannel::Update
respectively. - Channel creation methods in
RepliconChannels
now acceptRepliconChannel
with full channel configuration. - Make
default_max_bytes
field inRepliconChannels
public. - Move
RepliconChannels::get_server_configs
andRepliconChannels::get_client_configs
to create channels configs forrenet
intoRenetChannelsExt
extension trait provided bybevy_replion_renet
. Make sure to import it to use these methods. - Move
ClientEntityMap
andClientMapping
toclient_entity_map
submodule. - Rename
ReplicationPlugins
intoRepliconPlugins
. - Rename
ClientCache
intoConnectedClients
. - Rename
ClientState
intoConnectedClient
. - Replace
RepliconChannels::set_client_max_bytes
andRepliconChannels::set_server_max_bytes
withRepliconChannels::server_channel_mut
andRepliconChannels::client_channel_mut
respectively with more rich configuration. - Move
ClientEventChannel
toclient_event
module. - Move
ServerEventChannel
toserver_event
module. ClientMapper
,ServerEntityMap
,BufferedUpdates
,ReplicationRules
,ReplicationChannel
,ClientEventChannel
,ServerEventChannel
,ServerEventQueue
andEventMapper
are no longer inprelude
module. Import them directly.
0.23.0 - 2024-02-22
- Common conditions now follow the new pattern without returning a closure.
Mapper
andMapNetworkEntities
in favor ofEntityMapper
andMapEntities
introduced in Bevy 0.13.0
- Make
scene::replicate_into
update previously added entities.
0.22.0 - 2024-02-17
- Change
ClientEventAppExt::add_mapped_client_event
to clone the events instead of draining them. This means that mapped client events must now implementClone
- Misuse of
Vec::reserve
that would cause excess allocations.
0.21.2 - 2024-01-27
- Increase publicity of
ClientState
API.
0.21.1 - 2024-01-22
ClientCache::visibility_policy()
returns the configured policy.
0.21.0 - 2024-01-22
- Control over client visibility of entities.
- Rename
ClientsInfo
intoClientCache
. - Rename
ClientInfo
intoClientState
. - Allow calling
dont_replicate::<T>
with the insertion ofT
instead of afterReplication
insertion. dont_replicate::<T>
can panic only indebug_assertions
is enabled.
0.20.0 - 2024-01-13
- API for custom server messages now uses
server_event::serialize_with
andserver_event::deserialize_with
. For more details see the example in the docs. - Speedup serialization for multiple clients by reusing already serialized components and entities.
- Hide extra functionality from
ServerEventQueue
. - Move server event reset system to new set
ClientSet::ResetEvents
inPreUpdate
. - Make
NetworkChannels
channel-creation methods public (create_client_channel()
andcreate_server_channel()
). - Implement
Eq
andPartialEq
onEventType
.
LastChangeTick
resource,ClientsInfo
should be used instead.
- Don't panic when handling client acks if the ack references a despawned entity.
0.19.0 - 2024-01-07
renet_serde
feature which reexportsserde
feature frombevy_renet
.ClientSet::Reset
which can be disabled by external users.ServerEntityMap::remove_by_client()
for manual client cleanup.BufferedUpdates
,ServerEntityTicks
to public API.
- Move the client reset system to
PreUpdate
to let clients react more promptly to resets. - Replace
Ignored<T>
withCommandDontReplicateExt::dont_replicate
. Replication
entities with no replicated components will now be spawned on the client anyway.
0.18.2 - 2023-12-27
- Fix missing removals and despawns caused by events cleanup.
0.18.1 - 2023-12-21
- Cache replicated archetypes for faster iteration.
- Fix crash caused by registering the same type for client and server events.
- Fix replication for entities when
Replication
component is added after spawn.
0.18.0 - 2023-12-19
- Send all component mappings, inserts, removals and despawns over reliable channel in form of deltas and component updates over unreliable channel packed by packet size. This significantly reduces the possibility of packet loss.
- Replace
REPLICATION_CHANNEL_ID
withReplicationChannel
enum. The previous constant corresponded to the unreliable channel. - Server events use tick with the last change instead of waiting for replication message without changes.
- Include despawns before removals to optimize space for case where despawns are presents and removals aren't.
TickPolicy::EveryFrame
andTickPolicy::MaxTickRate
now increment tick only ifRenetServer
exists.ServerSet::Send
now always runs. Replication sending system still runs onRepliconTick
change.ClientMapping
no longer containstick
field.- Use
EntityHashMap
instead ofHashMap
with entities as keys. - Use
Cursor<&[u8]>
instead ofCursor<Bytes>
. - Replace
LastRepliconTick
withRepliconTick
on client. - Move
ClientMapper
andServerEntityMap
toclient_mapper
submodule. - Rename
replicate_into_scene
intoreplicate_into
and move it toscene
module. - Derive
Debug
forReplication
andIgnored<T>
.
AckedTicks
resource.TicksMap
resource.
- Fix missing reset of
RepliconTick
on server disconnect. - Fix replication of removals that happened after replication on the same frame.
0.17.0 - 2023-11-13
- Tracing for replication messages.
Debug
derive forLastRepliconTick
.
- Update to Bevy 0.12.
0.16.0 - 2023-10-30
- API to configure max channel usage bytes in
NetworkChannels
.
- Rename
SendPolicy
intoEventType
. - Rename
NetworkChannels::server_channels
intoNetworkChannels::get_server_configs
. - Rename
NetworkChannels::client_channels
intoNetworkChannels::get_client_configs
.
0.15.1 - 2023-10-22
- Register
Replication
type and add#[reflect(Component)]
.
0.15.0 - 2023-10-21
network_event::server_event::send
helper for server events in custom sending functions.- Optional
ClientDiagnosticsPlugin
, which writes diagnostics every second. Reflect
derive forReplication
.
- Optimize despawn tracking.
- Hide
id
field inEventChannel
and addClone
andCopy
impls for it. - Remove special functions for reflect events and advise users to write them manually instead. Reflect events are easier now because sometimes you can directly use reflect serializers from Bevy instead of manually writing serde traits.
- Do no trigger server events before world update arrival.
Debug
requirement for events.
0.14.0 - 2023-10-05
- The ability to pre-spawn entities on client.
- Rename
NetworkEntityMap
toServerEntityMap
.
0.13.0 - 2023-10-04
- The ability to set custom despawn and component removal functions.
TickPolicy::EveryFrame
to updateRepliconTick
every frame.
- Use more compact varint encoding for entities.
- Now all replication functions accept
RepliconTick
. - Rename
NetworkTick
intoRepliconTick
and move it intoserver
module. - Rename
LastTick
intoLastRepliconTick
.
derive_more
dependency.
- Fix the entire world was always sent instead of changes.
- Fix crash with several entities spawned and updated.
0.12.0 - 2023-10-01
- High-level API to extract replicated entities into
DynamicScene
.
- Hide
ReplicationRules
from public API. - Move logic related to replication rules to
replicon_core::replication_rules
module.
0.11.0 - 2023-09-25
- Serialize all components and events using varint.
- Serialize entities in optimal way by writing its index and generation as separate varints.
- Hide
ReplicationId
,ReplicationInfo
and related methods fromReplicationRules
from public API. - Rename
ReplicationRules::replication_id
intoReplicationRules::replication_marker_id
. - Use serialization buffer cache per client for replication.
- Correctly handle old values on packet reordering.
- Bevy's
Tick
was replaced with dedicated typeNetworkTick
that increments on server update, so it can be used to provide information about time.AckedTick
was replaced withServerTicks
that also contains mappings fromNetworkTick
to Bevy'sTick
and currentNetworkTick
. - Functions in
AppReplicationExt::replicate_with
now accept bytes cursor for memory reuse and return serialization errors. - Rename
ReplicationCore
intoRepliconCore
with its module for clarity. MapNetworkEntities
now accepts genericMapper
and doesn't have error handling and deserialiation functions now acceptNetworkEntityMap
. This allowed us to lazily map entities on client without extra allocation.- Make
LastTick
public.
0.10.0 - 2023-09-13
MapEventEntities
was renamed intoMapNetworkEntities
and now used for both components and events. Built-inMapEntities
trait from Bevy is not suited for network case for now.AppReplicationExt::not_replicate_with
was replaced with component markerIgnored<T>
.- Reflection was replaced with plain serialization. Now components need to implement serde traits and no longer need any reflection. This reduced reduced message sizes a lot. Because of this mapped components now need to be registered with
AppReplicationExt::replicate_mapped
. - Derive
Clone
andCopy
forReplication
. - Make
ServerPlugin
fields private and addServerPlugin::new
. - Make
AckedTicks
public. - Make
NetworkEntityMap
public.
0.9.1 - 2023-08-05
- Fix event cleanup.
0.9.0 - 2023-08-01
ClientSet
now available fromprelude
.
- Move
has_authority()
toserver
module.
0.8.0 - 2023-07-28
- Put systems in
PreUpdate
andPostUpdate
to avoid one frame delay. - Reorganize
ServerSet
and move client-related systems toClientSet
.
0.7.1 - 2023-07-20
- Re-export
transport
module frombevy_renet
.
0.7.0 - 2023-07-20
- Update to
bevy
0.11. - Mappable network events now need to implement
MapEventEntities
instead ofMapEntities
.
ClientState
andServerState
, use conditions frombevy_renet
andresource_added()
/resource_exists()
/resource_removed()
.ServerSet::Authority
, usehas_authority()
instead.
0.6.1 - 2023-07-09
- Update
ParentSync
inCoreSet::PostUpdate
to avoid one frame delay.
0.6.0 - 2023-07-08
SendPolicy
added to API of event-creation for user control of delivery guarantee (reliability and ordering).
ParentSync
no longer accepts parent entity and just synchronizes hierarchy automatically if present.
0.5.0 - 2023-06-26
ServerSet::ReceiveEvent
andServerSet::SendEvent
for more fine-grained control of scheduling for event handling.
- Update server to use
TickPolicy
instead of requiring a tick rate.
- Unspecified system ordering could cause tick acks to be ordered on the wrong side of world diff handling.
- Crash after adding events without
ServerPlugin
orClientPlugin
.
0.4.0 - 2023-05-26
- Swap
registry
andevent
arguments inBuildEventSerializer
for consistency withReflectSerializer
. - Update to
bevy_renet
0.0.12.
0.3.0 - 2023-04-15
- Support for sending events that contains
Box<dyn Reflect>
via custom serialization implementation.
- Accept receiving system in
add_client_event_with
and sending system inadd_server_event_with
. - Make
EventChannel<T>
public.
0.2.3 - 2023-04-09
- Panic that could occur when deleting
RenetServer
orRenetClient
resources.
0.2.2 - 2023-04-05
- Do not panic if an entity was already despawned on client.
0.2.1 - 2023-04-02
- Incorrect last tick detection.
0.2.0 - 2023-04-01
- Use
#[reflect(MapEntities)]
from Bevy 0.10.1 instead of custom#[reflect(MapEntity)]
.
- Tick checks after overflow.
0.1.0 - 2023-03-28
Initial release after separation from Project Harmonia.