gamestdio / Timeline
Licence: mit
Timelines implementation for lag compensation techniques in networked games
Stars: ✭ 65
Programming Languages
javascript
184084 projects - #8 most used programming language
Labels
Projects that are alternatives of or similar to Timeline
Retrotanks
RetroTanks: Atari Combat Reimagined, built in Meteor.js. Great isomorphic JavaScript example.
Stars: ✭ 9 (-86.15%)
Mutual labels: multiplayer
Doom Lgs
A multiplayer Node.js light gun shooter inspired on Doom
Stars: ✭ 36 (-44.62%)
Mutual labels: multiplayer
Mdframework
A multiplayer C# game framework for Godot 3.2 Mono.
Stars: ✭ 34 (-47.69%)
Mutual labels: multiplayer
Librg
🚀 Making multi-player gamedev simpler since 2017
Stars: ✭ 813 (+1150.77%)
Mutual labels: multiplayer
Gophergameserver
🏆 Feature packed, easy-to-use game server API for Go back-ends and Javascript clients. Tutorials and examples included!
Stars: ✭ 61 (-6.15%)
Mutual labels: multiplayer
Factorioscenariomultiplayerspawn
A custom scenario for Factorio which provides each player a unique starting spawn point in a multiplayer game.
Stars: ✭ 43 (-33.85%)
Mutual labels: multiplayer
Dodgem
A Simple Multiplayer Game, built with Mage Game Engine.
Stars: ✭ 12 (-81.54%)
Mutual labels: multiplayer
Swords And Ravens
A reimplementation of the board game "A Game of Thrones: The Board Game 2nd Edition"
Stars: ✭ 29 (-55.38%)
Mutual labels: multiplayer
Medguireborn
MedGui Reborn is a frontend/launcher (GUI) for Mednafen multi emulator, written in VB .Net with Microsoft Visual Studio Community
Stars: ✭ 40 (-38.46%)
Mutual labels: multiplayer
Godot Multiplayer Demo
A multiplayer demo using Godot Engine's (2.2) high level networking
Stars: ✭ 52 (-20%)
Mutual labels: multiplayer
Frag.exe
Multiplayer First-Person Shooter written in C++ using my own engine, Qor
Stars: ✭ 8 (-87.69%)
Mutual labels: multiplayer
Colyseus Tic Tac Toe
Turn-based multiplayer example powered by Colyseus
Stars: ✭ 61 (-6.15%)
Mutual labels: multiplayer
Multiplay Grpc Server
gRPC server for Multiplaying in Rust
Stars: ✭ 41 (-36.92%)
Mutual labels: multiplayer
@gamestdio/timeline
Timelines implementation for lag compensation techniques in networked games. Use it both on server and/or client-side according to your needs.
- Take snapshots of game state
- Interpolates and extrapolates values based on snapshots taken.
API
-
createTimeline([ maxSnapshots=10 ])
- Create a Timeline instance -
Timeline#takeSnapshot( state[, elapsedMs ] )
- Record state on timeline history -
Timeline#at( elapsedMs[, interpolate=true ] )
- GetProxy
object containing interpolated values between recorded states. -
Timeline#offset( elapsedMs[, interpolate=true ] )
- Same as#at
, but from the last snapshot taken.
Example
import { createTimeline } from '@gamestdio/timeline'
var timeline = createTimeline()
// first game state snapshot
timeline.takeSnapshot({
player: { x: 100 },
enemy: { x: 0 }
})
setTimeout(() => {
// take second game state snapshot after 1000ms
timeline.takeSnapshot({
player: { x: 0 },
enemy: { x: 100 }
})
//
// Retrieving a previous state
//
console.log( timeline.at( 0 ).player.x )
// => 100
console.log( timeline.at( 0 ).enemy.x )
// => 0
//
// Interpolating data from known states
//
console.log( timeline.at( 500 ).player.x )
// => 49.75124378109453
console.log( timeline.at( 500 ).enemy.x )
// => 50.24875621890547
//
// Extrapolating data between an unknown state
//
console.log( timeline.at( 1500 ).player.x )
// => -49.25373134328358
console.log( timeline.at( 1500 ).enemy.x )
// => 149.2537313432836
}, 1000)
To execute this example run the following command:
node --harmony --harmony-proxies example/usage.js
References
License
MIT
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].