Backroll is a pure Rust implementation of GGPO rollback networking library.
This is still in an untested alpha stage. At time of writing, the public facing API is largely stable, but a large portion of the functionality provided is still untested in real games.
Differences with the C++ implementation
- (Almost) 100% pure safe Rust. No unsafe pointer manipulation.
- Type safety. backroll-rs heavily utilizes generics to allow for
- Abstracted transport layer protocols - integrate and use any transport layer library you need. Comes with a raw UDP socket based implementation.
- Configurable at compile time - Almost all Backroll types takes a
BackrollConfiggeneric type parameter that specifies session constants. Does not require forking to change the hardcoded constants.
- Reduced memory usage - Backroll's use of generics potentially shrinks down the sizes of many data types.
- Vectorized input compression scheme - Backroll utilizes the same XOR + RLE encoding, but it's written to maximize CPU utilization.
- Multithreaded I/O - All network communications run within an async task pool. I/O polling is no longer manual, nor blocks your game's execution.
This repo contains the following crates:
- backroll - the main Backroll interface, intended to be used as the original GGPO. (Complete, untested)
- backroll_transport - An isolated set of transport layer abstractions.
- backroll_transport_udp - A transport layer implementation using raw UDP sockets.
- bevy_backroll - a integration plugin for bevy. (In Progress, untested).