Git Product home page Git Product logo

swir's Introduction

SilbinaryWolf's Input Recorder for Go

Build Status Documentation Report Card

WARNING: Backwards compatibility on the file format is currently not guaranteed. This will change once the repository is tagged at v1.0.0 and I complete my game. The reason for this is because I want to ensure it has key functionality I require before calling it stable at v1.0.0.

Basic input recording system that writes what keys are held down per frame to a stream of bytes. Each key that can be held down takes up 1-bit of space per frame. This stream of bytes can used to play a users gameplay back for purposes such as integration testing, replays and more.

Install

go get github.com/silbinarywolf/swir

Quick Start

  1. I recommend you download the following repo that has an example. The reason for putting the example in this seperate repository was to ensure that this package has minimal dependendencies.
go get github.com/silbinarywolf/swir-examples
  1. Run the tests and observe the game playing itself
go test ./...
  1. Dive into the code here and see how this package can be tied into an Ebiten game.

Requirements

  • Golang 1.12+

Documentation

Ideas

I have ideas and features that I'd like to look into adding in the future, however, for now this package achieves the bare-minimum of what I need. Do not wait for me to implement these if you want or need them!

  • Recording Random Number Seeds
    • Not sure if this needs its own built-in API or if this is something a user should handle themselves. The Retro City Rampage talk on automated testing mentions that to keep tests working over time, you will want to decouple random seeds for gameplay and visual effects that don't actually affect gameplay.
  • Expose API to allow a user to write into the stream with custom events or behaviour (ie. level changed, log characters X/Y, etc)
    • ie. WriteEvent(event EventID, data []byte), where EventID is a constant between 1-127. (127-255 is reserved for internal events like keypresses)
  • Recording Mouse Movement / Click
    • Ideally this would use deltas between frames to try and keep the recording file as small as possible
  • Ability to stream recording information out to file system
    • This would allow long-running game sessions to not consume too much memory. The benefit of this too is that you could potentially record a players game session and be able to playback exactly what they did to reproduce bugs.

Credits

  • Brian Provinciano for inspiration from their GDC Talk, "Automated Testing and Instant Replays in Retro City Rampage"

swir's People

Contributors

silbinarywolf avatar

Watchers

James Cloos avatar  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.