Skip to main content

Crate bevy_ggrs

Crate bevy_ggrs 

Source
Expand description

bevy_ggrs is a bevy plugin for the P2P rollback networking library GGRS.

See GgrsPlugin for getting started. For an overview of the internals, see the architecture doc.

Re-exports§

pub use ggrs;

Modules§

prelude
Convenient re-exports of the most commonly used types. Glob-import this to get started.

Structs§

AdvanceWorld
Label for the schedule which advances the current world to the next frame.
Checksum
Represents a total checksum for a given frame.
ChecksumFlag
Flags an entity as containing a checksum for a type T
ChecksumPart
Represents a checksum value for a specific type, flagged by ChecksumFlag.
ChecksumPlugin
A Plugin which creates a Checksum resource which can be read after or during the SaveWorldSystems::Snapshot set in the SaveWorld schedule has been run.
ChildOfSnapshotPlugin
Specialized snapshotting plugin for ChildOf components.
CloneStrategy
A Strategy based on Clone
ComponentChecksumPlugin
A Plugin which will track the Component C on Rollback entities and ensure a ChecksumPart is available and updated. This can be used to generate a Checksum.
ComponentMapEntitiesPlugin
A Plugin which updates the state of a post-rollback Component C using MapEntities.
ComponentSnapshotPlugin
A Plugin which manages snapshots for a Component using a provided Strategy.
ConfirmedFrameCount
The most recently confirmed frame. Any information for frames stored before this point can be safely discarded.
CopyStrategy
A Strategy based on Copy
EntityChecksumPlugin
A plugin that contributes a checksum of the current rollback entity state to the frame checksum.
EntitySnapshotPlugin
A Plugin which manages the rollback for Entities. This will ensure all Entities match the state of the desired frame, or can be mapped using a RollbackEntityMap, which this Plugin will also manage.
GgrsComponentSnapshot
A storage type suitable for per-Entity snapshots, such as Component types.
GgrsConfig
A sensible default GGRS Config type suitable for most applications.
GgrsPlugin
GGRS plugin for bevy.
GgrsSchedule
The schedule that runs your rollback game logic each GGRS frame.
GgrsSnapshots
Collection of snapshots for a type For, stored as As
GgrsTime
A Time type for use with GGRS. This time is guaranteed to be in-sync with all peers, and reflect that exactly RollbackFrameCount frames have passed at the RollbackFrameRate rate. Note that in the GgrsSchedule, this is the default time.
GgrsTimePlugin
This plugins provides Time<GgrsTime>, which is rolled-back automatically, and will also automatically replace Time<()> when accessed inside GgrsSchedule.
ImmutableComponentSnapshotPlugin
A Plugin which manages snapshots for a Component using a provided Strategy that works with immutable components.
LoadWorld
Label for the schedule which loads and overwrites a snapshot of the world.
LocalInputs
Inputs from local players. You have to fill this resource in the ReadInputs schedule.
LocalPlayers
Handles for the local players, you can use this when writing an input system.
MaxPredictionWindow
The maximum prediction window for this Session, provided as a concrete Resource.
PlayerInputs
A resource holding the inputs for all players in the current GGRS frame.
ReadInputs
Label for the schedule which reads the inputs for the current frame
ReflectStrategy
A Strategy based on Reflect and FromWorld
ResourceChecksumPlugin
Plugin which will track the Resource R and ensure a ChecksumPart is available and updated. This can be used to generate a Checksum.
ResourceMapEntitiesPlugin
A Plugin which updates the state of a post-rollback Resource R using MapEntities.
ResourceSnapshotPlugin
A Plugin which manages snapshots for a Resource using a provided Strategy.
Rollback
Marker component that flags an entity for inclusion in the rollback save/load schedule.
RollbackDespawnPlugin
Plugin that enables rollback-safe despawning via RollbackDespawned.
RollbackDespawned
Marks an entity as despawned, contains the frame that the entity was despawned on.
RollbackEntityMap
A Resource which provides an entity-to-entity mapping describing how Entity IDs changed during a rollback.
RollbackFrameCount
Keeps track of the current frame the rollback simulation is in
RollbackFrameRate
Resource describing the rate at which the AdvanceWorld will run.
RollbackId
A stable identifier for rollback entities, used as a key in snapshot storage. Automatically inserted when Rollback is added to an entity.
RollbackOrdered
A Resource which provides methods for stable ordering of RollbackId components.
RunGgrsSystems
A SystemSet label for the system that drives all GGRS schedules each Bevy frame.
SaveWorld
Label for the schedule which saves a snapshot of the current world.
SnapshotPlugin
This plugin sets up the LoadWorld, SaveWorld, and AdvanceWorld schedules and adds the required systems and resources for basic rollback functionality.
SnapshotSetPlugin
Sets up the LoadWorldSystems and SaveWorldSystems sets, allowing for explicit ordering of rollback systems across plugins.
SyncTestMismatch
Triggered when a SyncTestSession detects a checksum mismatch after rollback resimulation. This means the resimulated state diverged from the original — indicating a rollback correctness issue.

Enums§

AdvanceWorldSystems
Set for ordering systems during the AdvanceWorld schedule.
LoadWorldSystems
Set for ordering systems during the LoadWorld schedule. The most common option is LoadWorldSystems::Data, which is where Component and Resource snapshots are loaded and applied to the World.
SaveWorldSystems
Set for ordering systems during the SaveWorld schedule.
Session
Defines the Session that the GGRS Plugin should expect as a resource.

Traits§

RollbackApp
Extension trait to ergonomically add rollback plugins to Bevy Apps
RollbackDespawnCommandExtension
Extension trait for EntityCommands that adds rollback-safe despawn methods.
Strategy
Describes how to efficiently transform a Target into a Stored version, and vice versa. Any implementation for a Strategy should form a bijection between Target and Stored

Functions§

checksum_hasher
Returns a hasher built using the seahash library appropriate for creating portable checksums.

Type Aliases§

GgrsComponentSnapshots
Typical Resource used to store snapshots for a Component C as the type As. For most types, the default As = C will suffice.
GgrsResourceSnapshots
Typical Resource used to store snapshots for a Resource R as the type As. For most types, the default As = R will suffice.