Skip to content

Majki/es_core

 
 

Repository files navigation

Overview

es_core is an experimental framework for low latency, high fps multiplayer games.

Goals

Please read http://ttimo.typepad.com/blog/2013/05/es_core-an-experimental-framework-for-low-latency-high-fps-multiplayer-games.html [3] for a general introduction and some background about this project.

Architecture

Each logical part of the framework executes in it's own thread. The input thread (main.cpp, also doing the initialization), the game thread (game.cpp) and the renderer thread (render.cpp). The threads communicate with each other using a lightweight messaging system, backed by ZeroMQ.

ZeroMQ provides a safe and efficient abstraction for thread communication. For more details, see 'Multithreaded Magic with 0MQ' [1]. This design also enables easy support for other languages in the future.

The game thread runs on a fixed tick and feeds an interpolating renderer locked at the display refresh speed. On each tick, the game thread updates it's internal state and produces a new render state for the renderer to interpolate towards. For more details on this approach, see 'Fix your timestep!' by Glenn Fiedler [2].

Demo

The demo is a simple head bouncing in front of the camera, which can be spun around by mouse drags. It highlights the major aspects of the architecture, and provides a starting point that is easy to replace by your own design.

There are a few limitations for simplicity right now. The renderer runs at the vertical refresh speed, and there is no toggle to go fullscreen. If you run from the console some simple statistics showing the game thread scheduling and the renderer interpolation will print out.

Binaries are provided for MacOS X, Windows and GNU/Linux. You can them directly at https://s3.amazonaws.com/es_core/es_core.binaries.zip [4], or run them from a git clone.

If running from git, make sure to run from the binaries/ folder so the executable finds the sample media.

On Windows you will need the Visual C++ Redistributable for Visual Studio 2012 installed, which you can obtain from http://www.microsoft.com/en-us/download/details.aspx?id=30679 (vcredist_x86.exe)

The GNU/Linux binaries were compiled for x86_64 on a Debian Sid system. No work has been done towards making them binary compatible with a broader range of GNU/Linux distributions yet. Fortunately compiling on GNU/Linux is the easiest, so go ahead and do that if the binaries don't work.

The MacOS X binaries will run fine on an OSX 10.8 system, but more work is needed for compatibility with older releases.

Compile

You will need to obtain and compile the following dependencies:

At the time of writing, SDL 2.0 is only available from Mercurial, and Ogre 1.9 RC1 was just released but this code was not updated and still uses 1.8.

If you compile for GNU/Linux or MacOS X, you will need scons: http://scons.org/

Windows

Use the Visual Studio 2012 project files (MSVC Express will work)

MacOS X

Compiling Ogre 1.8 is likely to give you the most trouble. You will need basic familiarity with cmake, and you may have to fix a few things by hand. I use macports for all the Ogre dependencies (boost, libzzip etc.).

The demo only targets the x86_64 architecture at this time, and ignores i386. You may need to edit the XCode project generated by cmake to set that up. You may also need to install the libraries through macports with the +universal option.

Invoke scons at the top of the es_core folder once you've compiled the dependencies.

GNU/Linux

Should present no particular difficulties. Invoke scons at the top of the es_core folder once you've compiled the dependencies.

License

This source code is released under the "Modified BSD License". See LICENSE for details.

Feedback

Yes please! The best feedback is code and patches. I can also be reached on IRC easily, look for TTimo on Freenode or Quakenet.

References

About

An experimental framework for low latency, high fps multiplayer games

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published