Coder Social home page Coder Social logo

sy17's Introduction

068A source code dump

This is a dump of the source code for the engine, graphics tool and player for 068A, our 64k demo released at Syntax 2017. It's been updated to fix a couple of minor things that have broken since release, but for the most part is identical to what we showed in the breakdown video with Ferris.

Goals of this dump:

  • You should be able to build and run a fully-functional demo and toolset.
  • You should be able to explore the code in this repo and maybe learn some things about how we built it.

To that end, we will accept pull requests and issue reports that help us achieve these goals. Other PRs and issues will not be accepted. For instance, a PR to fix a crash when starting the player is fine, but a PR that replaces part of our post-processing stack or fixes a synth bug is not.

Building

You'll need a 32-bit copy of mingw-w64. The MingW-W64-builds package works fine. Make sure to install the 32-bit version!

The demo is built with CMake. The Debug build plays an audio file, loads shaders from disk, supports live reloading and connecting to a Rocket compatible editor for sync-tracking. The Release build bundles up a synth, shaders and tracks into an optimized executable that plays the demo from start to end and can be krunched to around 50kb.

For example, to create a Debug build:

  • Create a folder at tool/cmake-build-debug
  • Inside that folder in the MinGW environment, run the following commands:
    > cmake -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" ..
    > cmake --build . --target tool
    

And to create a Release build:

  • Ensure the Debug build has run at least once to generate the export blob - see the section below on running the tool.
  • Create a folder at tool/cmake-build-release
  • Inside that folder in the MinGW environment, run the following commands:
    > cmake -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" ..
    > cmake --build . --target tool
    

Running the tool

The Debug build of the demo which is sometimes referred to as the "tool", has a few differing features from the Release build:

  • Playback and animations are all handled by the Rocket library and a compatible editor. I used emoon's editor mainly for folding and grouping support, which is included as rocket.exe in the repo.
  • Audio is played from a file instead of being generated by the executable. You can swap out audio.ogg in the repo with your own audio file to use different music.
  • Shaders are loaded from disk, can include other shaders, and support live reloading. Shaders are also validated with glslang before being compiled.
  • There's a "free camera" mode that allows you to fly around and experiment with different angles, focal lengths, etc.
  • The tool has a performance meter and debugging tools for textures and lights.

Before running the tool, make sure to open your Rocket editor and load the TRACKER.rocket file to import the tracking data used for the demo.

To use the "free camera" mode, click anywhere in the tool outside the debug windows. You can now use the following controls:

  • W/A/S/D to move around, Space to fly up and Ctrl to fly down, Shift to move faster.
  • Q/E to roll the camera left and right, R to reset roll and FOV.
  • Scroll wheel to adjust FOV.
  • P to print the camera position and direction to the debug console.
  • Escape to leave free camera mode and reset the camera to the tracker's settings.

When closed, the tool generates a binary blob of shaders and tracking data to be packed into a Release build. This is placed in ../player/export.cpp relative to the tool's current directory, which should Just Work if you run the tool from tool/cmake-build-debug.

Known issues

  • The rover doesn't show in Debug builds. It might just be in some weird place since the tracks aren't showing either.
  • Release builds seem to be overwriting the coloured output with the ambient occlusion channel.

License

The demo code is provided under the MIT license. It contains code from Rocket which is provided under the zlib license.

glslang is licensed under the 3-clause BSD license.

emoon's Rocket editor is provided under the zlib license.

Un4seen Developments' BASS audio library is used under a free for non-commercial use license.

sy17's People

Contributors

cpdt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

thelightway

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.