Giter VIP home page Giter VIP logo

black-prediction's Introduction

This original owner has unexpectdly deleted the master project, this is a fork.
Although they did create this for anyone to use and modify, be aware no licence is present in the github.

Black Prediction

This is a client side prediction and server reconciliation plugin for Mirror. It is a completely server authoritative movement solution.

Download Unity Package: -link temporarily removed-

Feature

  • Client side prediction.
  • Server reconciliation.
  • Input buffer.
  • Speed exploit prevention.
  • Supports both default Unity CC and KCC.

Quick Start

  • Create a build.
  • Host inside the build and join as client inside the editor.
  • Move around on the client to try out prediction and reconciliation.
  • Modify the client's player prefab and alter the speed for movement and jump.
  • Realize that it gets snapped back to the position that it belongs to according to the server.
  • Drag the latency simulation script inside of the NetworkManager Transport field to see how it works through latency.

Tutorial

  • Open MovementData.cs script.
  • Add in desired movement inputs inside of ClientInput struct and results inside of ServerResult struct.
  • Do NOT edit MovementEntity.cs and MovementSimulation.cs scripts unless you know what you are doing.
  • Create your player movement script and have it derive from MovementEntity.cs script.
  • Add all the required function overrides and follow ExampleMovement.cs inside the example folder to see how it should be implemented.
  • Create your own player prefab. Add Network Identity, NetworkTransform, and your newly created playerMovement script to it. Go to your start scene and drop it in the NetworkManager Player Prefab field.
  • Create a new GameObject in your game scene with NetworkIdentity and MovementSimulation.cs script attached to it.
  • Create a build and test how it works.

#KCC

  • Delete OnEnable and OnDisable from KinematicCharacterMotor.cs
  • Open up KinematicCharacterSystem.cs
  • Delete "if (Settings.AutoSimulation)" inside "FixedUpdate"
  • Change "FixedUpdate" to "public static void Simulate()"

To Do

  • Fix camera rotation reconciliation.
  • Add Rigidbody/KCC example.
  • Add editor helper so the user does not need to edit the scripts directly.
  • Add interpolation for reconciliation.
  • Add performance checks to save bandwidth.
  • Support non-mirror networking solutions.

Video Previews

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.