Expand description
bevy_ggrs is a bevy plugin for the P2P rollback networking library GGRS.
See GgrsPlugin
for getting started.
Re-exports§
pub use ggrs;
Modules§
Structs§
- AddRollback
Command - An
EntityCommand
which adds aRollback
component to an entity. - Advance
World - Label for the schedule which advances the current world to the next frame.
- Checksum
- Represents a total checksum for a given frame.
- Checksum
Flag - Flags an entity as containing a checksum for a type
T
- Checksum
Part - Represents a checksum value for a specific type, flagged by
ChecksumFlag
. - Checksum
Plugin - A
Plugin
which creates aChecksum
resource which can be read after or during theSaveWorldSet::Snapshot
set in theSaveWorld
schedule has been run. - Child
OfSnapshot Plugin - Specialized snapshotting plugin for
ChildOf
components. - Clone
Strategy - A
Strategy
based onClone
- Component
Checksum Plugin - A
Plugin
which will track theComponent
C
onRollback Entities
and ensure aChecksumPart
is available and updated. This can be used to generate aChecksum
. - Component
MapEntities Plugin - A
Plugin
which updates the state of a post-rollbackComponent
C
usingMapEntities
. - Component
Snapshot Plugin - A
Plugin
which manages snapshots for aComponent
using a providedStrategy
. - Confirmed
Frame Count - The most recently confirmed frame. Any information for frames stored before this point can be safely discarded.
- Copy
Strategy - A
Strategy
based onCopy
- Entity
Checksum Plugin - Entity
Snapshot Plugin - A
Plugin
which manages the rollback forEntities
. This will ensure allEntities
match the state of the desired frame, or can be mapped using aRollbackEntityMap
, which thisPlugin
will also manage. - Ggrs
Component Snapshot - A storage type suitable for per-
Entity
snapshots, such asComponent
types. - Ggrs
Config - A sensible default GGRS Config type suitable for most applications.
- Ggrs
Plugin - GGRS plugin for bevy.
- Ggrs
Schedule - Ggrs
Snapshots - Collection of snapshots for a type
For
, stored asAs
- Ggrs
Time - A
Time
type for use with GGRS. This time is guaranteed to be in-sync with all peers, and reflect that exactlyRollbackFrameCount
frames have passed at theRollbackFrameRate
rate. Note that in theGgrsSchedule
, this is the default time. - Ggrs
Time Plugin - This plugins provides
Time<GgrsTime>
, which is rolled-back automatically, and will also automatically replace [Time<()>
] when accessed insideGgrsSchedule
. - Immutable
Component Snapshot Plugin - A
Plugin
which manages snapshots for aComponent
using a providedStrategy
that works with immutable components. - Load
World - Label for the schedule which loads and overwrites a snapshot of the world.
- Local
Inputs - Inputs from local players. You have to fill this resource in the ReadInputs schedule.
- Local
Players - Handles for the local players, you can use this when writing an input system.
- MaxPrediction
Window - The maximum prediction window for this
Session
, provided as a concreteResource
. - Player
Inputs - Read
Inputs - Label for the schedule which reads the inputs for the current frame
- Reflect
Strategy - A
Strategy
based onReflect
andFromWorld
- Resource
Checksum Plugin - Plugin which will track the
Resource
R
and ensure aChecksumPart
is available and updated. This can be used to generate aChecksum
. - Resource
MapEntities Plugin - A
Plugin
which updates the state of a post-rollbackResource
R
usingMapEntities
. - Resource
Snapshot Plugin - A
Plugin
which manages snapshots for aResource
using a providedStrategy
. - Rollback
- This component flags an entity as being included in the rollback save/load schedule with GGRS.
- Rollback
Entity Map - A
Resource
which provides an [EntityMap
], describing howEntities
changed during a rollback. - Rollback
Frame Count - Keeps track of the current frame the rollback simulation is in
- Rollback
Frame Rate Resource
describing the rate at which theAdvanceWorld
will run.- Rollback
Ordered - A
Resource
which provides methods for stable ordering ofRollback
flags. - Save
World - Label for the schedule which saves a snapshot of the current world.
- Snapshot
Plugin - This plugin sets up the
LoadWorld
,SaveWorld
, andAdvanceWorld
schedules and adds the required systems and resources for basic rollback functionality. - Snapshot
SetPlugin - Sets up the
LoadWorldSet
andSaveWorldSet
sets, allowing for explicit ordering of rollback systems across plugins.
Enums§
- Advance
World Set - Load
World Set - Set for ordering systems during the
LoadWorld
schedule. The most common option isLoadWorldSet::Data
, which is whereComponent
andResource
snapshots are loaded and applied to theWorld
. - Save
World Set - Session
- Defines the Session that the GGRS Plugin should expect as a resource.
Traits§
- AddRollback
Command Extension - Extension trait for
EntityCommands
which adds theadd_rollback()
method. - GgrsApp
- exstension trait for
App
to add GGRS specific functionality - Rollback
App - Extension trait to ergonimically add rollback plugins to Bevy Apps
- Strategy
- Describes how to efficiently transform a
Target
into aStored
version, and vice versa. Any implementation for aStrategy
should form a bijection betweenTarget
andStored
Functions§
- checksum_
hasher - Returns a hasher built using the
seahash
library appropriate for creating portable checksums.
Type Aliases§
- Ggrs
Component Snapshots - Typical
Resource
used to store snapshots for aComponent
C
as the typeAs
. For most types, the defaultAs = C
will suffice. - Ggrs
Resource Snapshots - Typical
Resource
used to store snapshots for aResource
R
as the typeAs
. For most types, the defaultAs = R
will suffice.