UnityLockstep Versions Save

Modern Lockstep with clientside prediction and rollback

0.0.5

5 years ago

This release contains mostly refactorings. The project is now split into 3 layers:

Core: Contains Entities and Components. It also provides an infrastructure for the upper layer to add features into. The infrastructure (class: World) allows to rollback changes that were made by the features.

Game: Contains features that change the state of the simulation. For example: spawning & moving game-entities.

Network: Handles network traffic. Provides a networked command-queue which is consumed by the simulation.

In addition this release includes a method to dump all commands to a file. A dump can be used for replaying games or debugging a desync. Currenty dumps are written to "C:\Log" (make sure the directory exists before creating a dump).

Also this release contains a prototype server UI, see Wiki for more information.

0.0.4

5 years ago

Days of debugging finally paid of. This release adds full rollback functionality for changes that happened during prediction when input arrives from the past. (Lesson learned: if components were added, they have to be removed when rolling back. Sounds trivial, I know!). The debugging left a little mess behind, so the next updates will be refactorings/cleanup.

Another good thing: A new feature for debugging was added. It is possible to dump the whole gamestate. A full dump consists of a few smaller dumps:

  • All active game-entities
  • All input-entities
  • A serialized log that lets you replicate a whole game with input simulation as it was ingame, see the dump-tests for an example.

0.0.3

5 years ago

This release splits the server into a separate project so development on the simulation can continue while the server is running. This release adds a first prototype for clientside prediction and rollback. The client runs the simulation with local commands. If remote input arrives, the simulation will roll back to the remote frame and fast forwards with the new input to the last local frame. Rollback only works for spawning entities so far, navigation feature is therefore disabled and will come back in the next release.

0.0.2

5 years ago

This release adds two buffers to the Simulation (one local, one remote). Commands are stored into the remotebuffer (adding lag compensation) and will be executed when the input from server arrives. Input that arrives later than the current local tick will not be executed which may lead to desyncs (in other words: the lag was higher than the lag compensation).

The next steps are:

  • rolling back to the received input and fast forward the simulation to the current local tick
  • the buffer from the server was removed but should be added again because: if a client receives an input he should be sure that it contains the input from all other clients for the given frame. this way the prediction for one frame can only miss once

0.0.1

5 years ago

A first working protoype. Frames get executed as soon as they arrive, which works for local network, Lag and packetloss is directly noticeable due to the stuttering simulation.