# Dark Descent: source and build

Dark Descent is Episode 0 of LibreQuake 0.09-beta (8 levels), running in the browser on the FTEQW engine.

## Engine (GNU GPL version 2, see ../LICENSES/engine-fteqw-gpl-2.0.txt)

- dark-descent-engine-source.tar.xz: complete engine source used for this build:
  FTEQW (https://github.com/fte-team/fteqw) commit f09ac7cccd2d713ddf881d3f1324703082c2cfe4
  with our changes applied, plus the zlib 1.3.1 and opus 1.3.1 source archives it links.
- engine-changes.patch: our changes against that commit:
  - engine/web/sys_web.c: main() exported (build fix for Emscripten 3.1.6 with hidden visibility).
  - engine/web/ftejslib.js: FTEC.look() for touch look controls, Module.pixelScale to cap the
    render resolution on phones, Module.onConsoleLine so the page can follow the console.
  - engine/Makefile: export malloc/free for FTEC.cbufadd.
  - engine/server/savegame.c: autosaves are silent and report their name to the page
    (emscriptenfte_autosaved -> Module.onAutosave), used as checkpoints in the Android app.

Build (Linux, Emscripten 3.1.6):

    cd fteqw/engine
    make web-rel FTE_CONFIG_EXTRA=-DNO_SPEEX EMSDK=1

Output: release/ftewebgl.js and release/ftewebgl.wasm (copied to ../engine/).

## Game data

- Levels, monsters, sounds, textures and music: LibreQuake 0.09-beta
  (https://github.com/lavenderdotpet/LibreQuake), BSD 3-clause licence.
- The game code (progs.dat) is LibreQuake's QuakeC, GNU GPL version 2.
  Its source: librequake-v0.09-beta-qcsrc.tar.xz (tag v0.09-beta, commit d1515ca9bc01e590f2d54dc496f55c9a4ed72369).
- data-tools/build.py makes ../data/pak0.pak (configs) and ../data/lq_e0.pk3 (Episode 0 only) from the
  release paks. The only change to the levels: the exit of lq_e0m7 leads to lq_e0m1 instead of the hub map.
- Music: LibreQuake tracks 04, 05, 06, 07, 09, 10, 11 converted to MP3 (64 kbit/s) with ffmpeg.
