Skip to content

Commit

Permalink
README updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurkotwal committed Nov 8, 2020
1 parent b540d96 commit c59e65b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
Binary file added .github/images/fs2020_alphaflightcontrols.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/sws_x55.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 29 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,44 @@ A tool to generate reference cards for HOTAS and game controllers. MRC is
designed to be flexible across many different controllers and many different
games.

Here are some example images:
## Flight Simulator 2020 - Alpha Flight Controls
![Flight Simulator 2020 - Alpha Flight Controls](.github/images/fs2020_alphaflightcontrols.jpg)
## Star Wars Squadrons - Saitek X-55
![Star Wars Squadrons - Saitek X-55](.github/images/sws_x55.jpg)
# Running MetaRefCard
### Debug mode
If you start MRC with a `-d` flag, it will run in debug mode. In this mode, you will get extra debugging messages and Go's pprof tool will be enabled. This will also enable `/test/$GAME` endpoints that pre-generate images for supported controllers. These endpoints are useful for testing, performance benchmarking and more.
### Production mode
MetaRefCard will default to running on port 8080 but this value can be overriden with the PORT variable.

# Setup
### Generate Device Model
Generates a yaml file based on `resources-source/edrefcard/bindingsData.py` that MRC can read.
#### Dependencies
Install modules - `pip3 install pyyaml`
#### Running the script
Command: `generateControllerInputs.py`

# Generate Hotas & Logo Images
Convert and resize source resources into *configured* sizes for MetaRefCard. Source images are found in `resources-source/hotas-images` and `resources-source/game-logos`. They exported to `resources/hotas_images` and `resources/game_logos` respectively.
# MetaRefCard Code
MetaRefCard is written in Go and is a web application.
## Dependencies
Install libjpeg-turbo-dev - `sudo apt install libjpeg-turbo8-dev` on Ubuntu. This library is used for fast jpg decoding/encoding.
## Building
Since this is a Go application, running `go build .` will compile the application. However, MRC also can be built to a container image with the `Dockerfile` provided simply with `docker build .`
### Generate Hotas & Logo Images
Convert and resize source resources into *configured* sizes for MetaRefCard. Source images are found in `resources-source/hotas-images` and `resources-source/game-logos`. They exported to `resources/hotas_images` and `resources/game_logos` respectively. Some of these hotas images were created by [EDRefCard](https://github.com/richardbuckle/EDRefCard) and MetaRefCard is very grateful for these.
#### Dependencies
* Inkscape - `sudo apt install inkscape`
* Imagemagick - `sudo apt install imagemagick`
#### Running the script
Command: `generateHotasImages.py`
### Generate Device Model
Generates a yaml file based on `resources-source/edrefcard/bindingsData.py` that MRC can read. These bindings are thanks to [EDRefCard](https://github.com/richardbuckle/EDRefCard)! MetaRefCard uses these bindings to generate configs for some controllers but also has its own device configs in `config/devices.yaml`
#### Dependencies
Install modules - `pip3 install pyyaml`
#### Running the script
Command: `generateControllerInputs.py`

# Code
MRC is written in Go and is a web application.
# Packages
## Go Packages
The entry package is `metarefcard`. Within this package is another package called `common` as well as a package for each game that is supported. For example Flight Simulator 2020 is under `fs2020` and Star Wars: Squadrons is under `sws`. `common` contains code that is shared across all the game packages.
# Directories
## Directories
`config` - runtime configuration. `config.yaml` is the main configuration file. Each package has their own config files too.
`metarefcard` - almost all of the go code for MRC.
`resources` - runtime resource files like fonts, web templates, static web files, game logos and generated hotas images.
`resources-source-source` - contains the source files used to generate resources
`testdata` - sample game input files used for testing.
`testdata` - sample game input files used for testing.
`tools` - scripts to benchmark endpoints

0 comments on commit c59e65b

Please sign in to comment.