Code Monkey home page Code Monkey logo

rewind-viewer's Introduction

Rewind viewer

MIT License C++ standard OpenGL RAIC Build status

Fast Russain AI Cup championship match viewer with rewinding support written in OpenGL

Overview

The viewer has several advantages in comparison of local-runner with drawing plugin:

  • All figures are drawn using your video adapter, so no more problems with slow drawing
  • Rewinding - ability to navigate between game tick
  • In Pause navigation - zoom and navigate in any game state
  • Handy mouse navigation

Obvious drawbacks:

  • Viewer running as standalone application, it knows nothing about local runner or your strategy, so you need manually send all data (like buildings, units etc.) and you can draw only data visible by your strategy
  • In theory, high memory usage, because it needs to store all drawing primitives for rewinding support

ℹ️ Currently viewer reached 1.3 version and developments is on hold. There definitely will be building support after round 1 and fog of war support right after round 2. Minor bugfixes and optimization may come during the championship, but not so much.

Binaries

Source code with changelog for significant releases can be found in github releases page.

Prebuilt windows binaries for other version, such as bugfixes can be found here. It is required to have x86 C++ Redistributable for Visual Studio 2015 installed to run prebuild windows binaries.

Build

Clone repository with submodules:

git clone --recursive https://github.com/kswaldemar/rewind-viewer.git

Unix, MacOS:

mkdir build && cd build
cmake --CMAKE_BUILD_TYPE=Release ..
cmake --build .

Windows:

mkdir build && cd build
cmake ..
cmake --build . --config Release

Note: Compiler with c++14 support needed. That means Visual Studio 2015 or higher on Windows.

⚠️ Note: Viewer should be launched from the same folder, where resources is located. So you need to manually copy resources to build folder, or copy executable to project root directory.

Strategy integration

You need a special client to be able to send messages to the viewer. See example C++ client for information about JSON based message protocol and implement one for your language of choice. Also, see client examples for official local runner.

Sample usage:

  1. Start the viewer.
  2. Start localrunner, preferably in render_to_screen=false mode.
  3. Start your strategy of choice.
  4. To be able to drew things in the viewer you will need to create a client, send data to the client in your strategy, and close the frame with client command.
  5. There is no need to close the viewer after the strategy is done, just start from step 2. Old drawn data will be cleaned after new connection.

License

Project sources distributed under MIT license, third parties distributed under their own licences

Credits

Project created with help of many great libraries:

  • glad for loading OpenGL functions
  • glm math library for OpenGL
  • glfw for creating window and crossplatform context handling
  • ImGui for UI widgets inside application
  • nlohmann json for json operating
  • csimplesocket for network interaction
  • stb_image for images processing
  • loguru for logging support

Resources:

rewind-viewer's People

Contributors

andrewb330 avatar bamx23 avatar core2duo avatar darkkeks avatar dbf256 avatar elsid avatar ivlevastef avatar karloid avatar kswaldemar avatar mortido avatar olsh avatar stulentsev avatar supaflyenjoy 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.