Skip to content

Sheep-y/ufoafterlight-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sheepy's UFO: Afterlight database

<Launch database>

This database shows the stats and dependency tree of selected technology, equipment, building, station, or training. It also shows the composition of enemy squads and information on enemy units.

Instead of opening it online, you can also right click the launch link and save it on your drive / memory to use it anywhere.

This is inspired by Kircket's Tech Tree, sparked by a discussion on Stream. Active development is NOT planned, because this database is a small sidetrack from the author's focus of the UFO: Afterlight wiki on Wikia.

Developer's Guide

This is a self-contained, interactive, high speed, small footprint database with 9000+ 'rows' of data in 30+ 'tables'. The HTML5 program is procedural in essence, has around 1600 lines of code (excluding data).

JavaScript code is in res folder.

  • core.js defines the main namespace. It also handles data initialisation and normalisation.
  • ui.js initialises the UI, provide access to url state, and find search matches.
  • event.js contains UI event handlers.
  • ui.builder.js builds entry boxes.
  • ui.event.js has all the actual event handlers.
  • desc.js generates description for data.
  • data are plain JS, simplified but mostly use original structure. They were manually converted by regx.
  • Except mapping.js and txt_trigger.js, both hand coded.
  • The underscore is a light custom JS library, but the program is mostly ES5.
  • html is HTML 5.
  • css is CSS 3.

Images are compiled to sprite, then optimised, and finally embedded as data uri. Data and text are deflated and Base64 encoded, keeping the program small. I find this much more efficient and reliable than HTTP compression.

The build tool 'CocoDoc' (a Java jar) is included in the project root. Run it and it will loads build config, which direct it to reads ufoal.html. If there is no error, it will create (overwrite) index.html.

The build tool is necessary to produce a self-contained deliverable, and to keep it small. If this is not required, it should be easy to change everything to html links.

This program is free and open, licensed under AGPL v3. Most text and icons are copyrighted 2007 ATLAR games.