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
EntityCommandwhich adds aRollbackcomponent 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
Pluginwhich creates aChecksumresource which can be read after or during the [SaveWorldSet::Snapshot] set in theSaveWorldschedule has been run. - Child
OfSnapshot Plugin - Specialized snapshotting plugin for
ChildOfcomponents. - Clone
Strategy - A
Strategybased onClone - Component
Checksum Plugin - A
Pluginwhich will track theComponentConRollback Entitiesand ensure aChecksumPartis available and updated. This can be used to generate aChecksum. - Component
MapEntities Plugin - A
Pluginwhich updates the state of a post-rollbackComponentCusingMapEntities. - Component
Snapshot Plugin - A
Pluginwhich manages snapshots for aComponentusing 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
Strategybased onCopy - Entity
Checksum Plugin - Entity
Snapshot Plugin - A
Pluginwhich manages the rollback forEntities. This will ensure allEntitiesmatch the state of the desired frame, or can be mapped using aRollbackEntityMap, which thisPluginwill also manage. - Ggrs
Component Snapshot - A storage type suitable for per-
Entitysnapshots, such asComponenttypes. - 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
Timetype for use with GGRS. This time is guaranteed to be in-sync with all peers, and reflect that exactlyRollbackFrameCountframes have passed at theRollbackFrameRaterate. 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 replaceTime<()>when accessed insideGgrsSchedule. - Immutable
Component Snapshot Plugin - A
Pluginwhich manages snapshots for aComponentusing a providedStrategythat 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
Strategybased onReflectandFromWorld - Resource
Checksum Plugin - Plugin which will track the
ResourceRand ensure aChecksumPartis available and updated. This can be used to generate aChecksum. - Resource
MapEntities Plugin - A
Pluginwhich updates the state of a post-rollbackResourceRusingMapEntities. - Resource
Snapshot Plugin - A
Pluginwhich manages snapshots for aResourceusing a providedStrategy. - Rollback
- This component flags an entity as being included in the rollback save/load schedule with GGRS.
- Rollback
Entity Map - A
Resourcewhich provides an [EntityMap], describing howEntitieschanged during a rollback. - Rollback
Frame Count - Keeps track of the current frame the rollback simulation is in
- Rollback
Frame Rate Resourcedescribing the rate at which theAdvanceWorldwill run.- Rollback
Ordered - A
Resourcewhich provides methods for stable ordering ofRollbackflags. - Save
World - Label for the schedule which saves a snapshot of the current world.
- Snapshot
Plugin - This plugin sets up the
LoadWorld,SaveWorld, andAdvanceWorldschedules and adds the required systems and resources for basic rollback functionality. - Snapshot
SetPlugin - Sets up the [
LoadWorldSet] and [SaveWorldSet] sets, allowing for explicit ordering of rollback systems across plugins.
Enums§
- Advance
World Systems - Load
World Systems - Set for ordering systems during the
LoadWorldschedule. The most common option is [LoadWorldSet::Data], which is whereComponentandResourcesnapshots are loaded and applied to theWorld. - Save
World Systems - Session
- Defines the Session that the GGRS Plugin should expect as a resource.
Traits§
- AddRollback
Command Extension - Extension trait for
EntityCommandswhich adds theadd_rollback()method. - Rollback
App - Extension trait to ergonimically add rollback plugins to Bevy Apps
- Strategy
- Describes how to efficiently transform a
Targetinto aStoredversion, and vice versa. Any implementation for aStrategyshould form a bijection betweenTargetandStored
Functions§
- checksum_
hasher - Returns a hasher built using the
seahashlibrary appropriate for creating portable checksums.
Type Aliases§
- Ggrs
Component Snapshots - Typical
Resourceused to store snapshots for aComponentCas the typeAs. For most types, the defaultAs = Cwill suffice. - Ggrs
Resource Snapshots - Typical
Resourceused to store snapshots for aResourceRas the typeAs. For most types, the defaultAs = Rwill suffice.