Death Generator

From Foone Wiki
Revision as of 13:09, 16 May 2019 by <bdi>Foone</bdi> (talk | contribs) (Created page with "The Death Generator (formerly known as the Sierra Death Generator) is my project for generating fake video game screenshots. === Design === The basic design of the death gene...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Death Generator (formerly known as the Sierra Death Generator) is my project for generating fake video game screenshots.

Design

The basic design of the death generator is that the central code (in the terribly named scripts.js) loads 3 or 4 files from games/GENERATOR_NAME/:

  1. a JSON file describing the layout of the font, plus special options
  2. a blank image which'll be used as the background
  3. a font image which contains both the characters for the font and any overlays or special effects needed
  4. (optionally) a .js file. Currently this is only used to provide GIF support for some generators.

The JSON file has (sadly) no documentation as to what it supports, but you can see the most basic structure by looking at a simple generator's JSON file, such as the Police Quest 2 generator.

There's also one central file which tells the main script which generators exist, plus some metadata about them: generators.js. Although for testing reasons if you manually compose a url to a generator that exists but isn't in generators.js, the scripts will load it but supply dummy values for the metadata. This is very handy for local testing, so you can start building the generator before filling out the metadata.

API/Automation

Two commonly asked questions are "Does the death generator have an API?" and "Can I easily run it from the command line?" and the answer to both questions is no. Both are on the to-do list but can't really be done with the current design.

The main obstacle is that it's HTML canvas based and explicitly tied to the HTML page it works with. At some point I'll split it out and use some kind of canvas wrapper to let you run it from the command line as a node.js app, but not that hasn't been done yet.

If you really really need to generate from the command line, you can. Not easily or quickly, but you can with a bit of work: Look into evaluate_test_cases.js. This is a node.js script that takes in a JSON file and then runs some headless Chromium instances against it, returning the output images (at 1:1 scaling instead of the default 2:1, you may want to disable this depending on your needs) encoded into JSON. test.py contains some example code for extracting the images from the response JSON.

Game Status

I've historically maintained lists in several places: my email inbox, my todo manager, a text file in the repo, issues on the repo, so why not add one more? Here's a list of requested games I haven't had a chance to get to yet.

Also there's a bunch of generators where I've started and not yet finished, for one reason or another. I'm trying to keep a list of those here, primarily to remind myself to FINISH THEM.

Links