Giter Site home page Giter Site logo

interoplationtest's Introduction

Interoplation Test

An app that demonstrates networking synchronization and server side prediction (via interpolation)

How to add new data attributes for rendering

  • Create the basic attribute in a clientInit function or something corresponding to that.
    • This initialization should be called in the socket onConnection method
  • Depending on what the data is, in can be computed in the initialization
    • For example if it's the starting x/y coordinates and you want to randomize them, they should be computed as soon as they're created in the initialization
    • As a counter example, you can wait until the client is ready to join the game and make the coordinates based on client information when the time comes to emit data to the server ("onJoinGame" etc)
  • If this is data (like rendering information) that's going to be shared with other clients, make sure the other client sockets receive the data in a syncing method (example: syncSockets.js)
  • The server update function should check for several steps before sending them to the client.
    • Compute the attributes
    • Check that they're synced
    • Check that they're ready to be sent to clients
  • The client should recieve the data in an "onUpate" kind of method
    • First the client should distribute the data to the appropriate local objects that correspond to other client sockets.
    • Initially the client should not handle it's own socket data uniquely.
  • The client should not change the data attribute itself OR ANY data attributes that aren't purely input based

Helpful Resources!

interoplationtest's People

Contributors

e-a-n avatar

Stargazers

Dmitrii Vasilev avatar

Watchers

James Cloos avatar Dmitrii Vasilev avatar  avatar

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.