All Projects → proepkes → Unitylockstep

proepkes / Unitylockstep

Licence: mit
Modern Lockstep with clientside prediction and rollback

Projects that are alternatives of or similar to Unitylockstep

Ecs
ECS for Unity with full game state automatic rollbacks
Stars: ✭ 151 (-56.73%)
Mutual labels:  ecs, unity, networking
Entitas Sync Framework
Networking framework for Entitas ECS. Targeted at turnbased games or other slow-paced genres.
Stars: ✭ 98 (-71.92%)
Mutual labels:  ecs, unity, networking
Unity resources
A list of resources and tutorials for those doing programming in Unity.
Stars: ✭ 170 (-51.29%)
Mutual labels:  ecs, unity
Htframework
Unity HTFramework, a rapid development framework of client to the unity.
Stars: ✭ 179 (-48.71%)
Mutual labels:  ecs, unity
Pbd Fluid In Unity
A PBD fluid in unity running on the GPU
Stars: ✭ 350 (+0.29%)
Mutual labels:  unity, simulation
Gdk For Unity Fps Starter Project
SpatialOS GDK for Unity FPS Starter Project
Stars: ✭ 119 (-65.9%)
Mutual labels:  ecs, unity
Littlebee
关于帧同步和ECS的实现
Stars: ✭ 145 (-58.45%)
Mutual labels:  ecs, unity
Reeseunitydemos
Unity packages and demos—emphasizing ECS, jobs and the Burst compiler—by me, Reese.
Stars: ✭ 232 (-33.52%)
Mutual labels:  ecs, unity
Learning Unity Ecs 2
A bunch of small Unity projects where I explore and learn Unity's new ECS and Job System. Updated for the new API.
Stars: ✭ 65 (-81.38%)
Mutual labels:  ecs, unity
Pulsar
Protocol Learning and Stateful Fuzzing
Stars: ✭ 285 (-18.34%)
Mutual labels:  networking, simulation
Valvesockets Csharp
Managed C# abstraction of GameNetworkingSockets library by Valve Software
Stars: ✭ 273 (-21.78%)
Mutual labels:  unity, networking
Ecsrx
A reactive take on the ECS pattern for .net game developers
Stars: ✭ 288 (-17.48%)
Mutual labels:  ecs, unity
Entitas Lite
Entitas-Lite is a No-CodeGenerator branch of Entitas, and also a fast & easy ECS framework for C#/Unity.
Stars: ✭ 106 (-69.63%)
Mutual labels:  ecs, unity
Liquidsimulator
Cellular Automaton 2D Liquid Simulator for Unity
Stars: ✭ 302 (-13.47%)
Mutual labels:  unity, simulation
Lockstepplatform
Stars: ✭ 84 (-75.93%)
Mutual labels:  ecs, unity
Egocs
EgoCS: An Entity (GameObject) Component System framework for Unity3D
Stars: ✭ 211 (-39.54%)
Mutual labels:  ecs, unity
Unity Jobsystem Boids
No ECS, Job system and Burst only minimalist boids sample
Stars: ✭ 50 (-85.67%)
Mutual labels:  ecs, unity
Voxelman
Unity ECS + C# Job System example
Stars: ✭ 1,086 (+211.17%)
Mutual labels:  ecs, unity
orkid
Orkid Media Engine (C++/Lua/Python3/Linux/MacOs/OpenVR/Qt5)
Stars: ✭ 20 (-94.27%)
Mutual labels:  simulation, ecs
Gdk For Unity
SpatialOS GDK for Unity
Stars: ✭ 296 (-15.19%)
Mutual labels:  ecs, unity

UnityLockstep

Discord

Currently the rollback of adding and changing entities should be stable. If you spawn or navigate entities in multiple game-instances, all simulations will end up in a synced state, no matter how many packets drop or how high the lag is. Clientside prediction makes sure that local commands are executed under any condition.

Video

Architecture

Overview

Server UI

ServerUI

Getting started

  1. Open Server.LiteNetLib/Server.LiteNetLib.sln
  2. Run Server-project (Console), enter "1" when asked for room-size
  3. Open SampleScene in Unity
  4. Hit play and wait until connection to server is established
  5. Holding right mouse button will continously spawn new agents, press 'X' to navigate all agents to your current mouse position

Getting started (multiplayer)

  1. Build and run the Unityproject
  2. Start the server. The roomsize will default to 2 after a few seconds of no input
  3. Hit play in Unity so you should now have two instances of the game running
  4. Wait until both players are connected to the server. The server will display a message when the simulation has started.
  5. For controls, same as above

Work in progress (ordered by priority)

  1. Synchronizing framerate. If a client lags too much or lag compensation is too low, the delayed input will force every other client to constantly rollback the simulation. The project requires a solution to minimize the need of rollback for every client.
  2. Performance spikes are currently by design. In case of an input from the very past, a rollback of many (speak: thousands of) ticks at once occur. Adding constraints like max. input-offset and adjusting framerates for slow clients will help improving everyones performance. The target-frame for rollback is also not optimized, this can save lots of performance too.
  3. Rollback for despawned (e.g. killed) entities is not implemented yet, it will arrive after navigation, combat/projectiles and health is working.

Dependencies

  • The ECS-Project currently targets .NET Framework 4.6.1 (#806)
  • The server targets .NET Core Framework 2.2.103 (link to setup)

References

Inspired by LockstepFramework, in memory of SnpM: https://github.com/SnpM/LockstepFramework

Uses a fork of BEPUPhysics for deterministic physics: https://github.com/sam-vdp/bepuphysics1int

Uses FixedMath.Net for deterministic fp-calculations: https://github.com/asik/FixedMath.Net

Uses Entitas as ECS Framework: https://github.com/sschmid/Entitas-CSharp

The project includes an implementation example using LiteNetLib: https://github.com/RevenantX/LiteNetLib

Initial commit was targeting the following protocol: https://www.reddit.com/r/Unity3D/comments/aewepu/rts_networking_simulate_on_serverbeat/. The project has shifted to an architecture you see above.

Limitations

  • Physics values are limited to 1000 so keep your world in these limitations or shift the world when your values become too large
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].