Code Monkey home page Code Monkey logo

sync.lua's Introduction

Development PAUSED

NOTE: Development on this library has been paused, and efforts have shifted to a new way of doing things. This was done after receiving some feedback from users using sync.lua about not being a fan of its OOP-y structure and of the lack of clarity in server vs. client code separation. The new library addresses these issues head-on. Stay posted!

sync.lua

sync.lua aims to make Lua-based multiplayer games easier to write. You can write your game's code mostly as if you are writing a single-computer game and have automatic synchronization of your game state across multiple computers.

The library is meant to run in a LÖVE context but could work anywhere lua-enet and LuaJIT's FFI library are available (both built-into LÖVE by default).

Tutorials

Step by step guides that walk you through common sync.lua tasks.

  • Basic tutorial: This is probably what you want to read the first time you use sync.lua. Walks you through making a basic multiplayer game step-by-step from scratch. In the resulting game, each player that connects is given a single randomly-colored circle that they can move around on screen, and they can all see each others' circles.

Examples

Working code for simple games that use sync.lua.

  • example_basic.lua: The result of following the basic tutorial.
  • example_triangle_warz.lua: Each player is represented by a triangular ship that they can move around on screen and shoot at each other with. Demonstrates how you can keep track of multiple players, their scores, draw the user's player differently, keep track of entity-entity references (bullets need to keep track of their owners so they can increment the owner's score when they destroy a ship).
  • example_huge.lua: The server simulates 20000 randomly positioned and sized rotating rectangles. Each client can walk around this simulation an just sees at most about 25 rectangles at a time. Demonstrates the .isRelevant feature. Sending updates about all 20000 rectangles would grind the game to a halt. Instead, for each client, the server only sends updates for the 25 rectangles each client can see. Uses the shash library to query rectangles in each client's field of view efficiently.

Reference manual

The reference manual (work in progress) contains detailed information about all of sync.lua's features.

sync.lua's People

Contributors

nikki93 avatar ccheever avatar versine avatar jesseruder 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.