Git Product home page Git Product logo

sasd-protocols's Introduction

SASD Protocols

Tests of many syncronization methods with TCP:

Protocols

  • Timewarp + LocalLag
  • Perceptive Consistency
  • Trailing State Syncronization
  • Dead Reckoning

Build instructions

Requirements:

  • cmake >= 3.0
  • SDL2 (Graphics library)

Tested on linux and macOS.

First, compile netutils library:

# Inside the project root directory execute
cd src/netutils
mkdir build
cd build
cmake ..
make
make install

Then, compile tests:

# Inside the project root directory execute
mkdir build
cd build
cmake ..
make
make install # Copies useful start scripts to build directory

If succesful, the following binary files will be generated:

  • server: Broadcast server. Simulates p2p multicast with a TCP connection.
  • dr_server: Centralized server. Simulates game state updates and sends them back to all connected clients. Used for the dead reckoning protocol.
  • game_timewarp: Timewarp client implementation.
  • game_fasteventordering: Perceptive consistency client implementation.
  • game_deadreckoning: Dead reckoning client implementation.

How to run

Timewarp test:

As a p2p protocol, it need an instance of server running before any client is connected. To ensure consistency in tests, it is preferable to start all game_timewarp clients simultaneously.

To run predefined tests, from build directory execute:

# In a terminal
./server
# In another terminal
sh tw_start.sh

Perceptive consistency test:

As a p2p protocol, it need an instance of server running before any client is connected. To ensure consistency in tests, it is preferable to start all game_fasteventordering clients simultaneously.

Note that game_fasteventordering needs to know how many clients there will be connected, so it receives a single argument to acknoledge it at runtime.

To run predefined tests, from build directory execute:

# In a terminal
./server
# In another terminal
sh feo_start.sh

Dead reckoning test:

This protocol needs its server executed at the same time as the clients since it also simulates new states. To ensure consitency, all game_deadreckoning clients and dr_server must be started simultaneously.

To run predefined tests, from build directory execute:

sh dr_start.sh

Simulated lag

Lag can be simulated by modifying the following parameters:

Timewarp:

In the beginning of the file src/game_timewarp.c, a "lag matrix" is defined. Each cell indicates the lag from client row to client column.

Perceptive consistency:

In the beginning of the file src/game_fasteventordering.c, a "lag matrix" is defined. Each cell indicates the lag from client row to client column.

Dead reckoning:

In the beginning of the file src/game_deadreckoning.c, there are 2 "lag arrays":

  • input_lags indicate the simulated delay for the incoming states from the server.
  • local_lags indicate the delay between the event summoning frame and its execution frame (before it has reached the server and back).

Document compilation instructions

Required packages:

  • texlive-fourier

sasd-protocols's People

Contributors

autopawn avatar rcastill avatar

Watchers

James Cloos avatar  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.