Skip to content

Automate screenshots of Quake maps (mapshots) using FTE and Playwright.

License

Notifications You must be signed in to change notification settings

quakeworld/automapshot-fte

Repository files navigation

automapshot-fte

Automate screenshots of QuakeWorld maps (mapshots) using FTE and Playwright

Aerowalk

Setup

pnpx playwright install --with-deps chromium
pnpm install
  1. Rename config.example.ts to config.ts
  2. Rename config.maps.example.ts to config.maps.ts
  3. (optional) edit config.ts

Configuration

General config (config.ts)

export default {
  width: 1280,
  height: 720,
  jpegQuality: 90, // 1-100
  skipExisting: true, // skip if screenshot already exist in /dist
};

Map config (config.maps.ts)

Camera position (first triplet) and angle (second triplet).

export default {
  "2bfree": "1380 1067 468 25 194 0",
  dm3: "1835 -342 18 19 128 0",
  outpost: "0 0 480 90 91 -59",
};

Usage

Screenshot all maps defined in config.maps.ts

pnpm exec playwright test

Screenshot single map (exact match)

pnpm exec playwright test --grep "#dm2#"

Screenshot multiple maps (wildcard match)

pnpm exec playwright test --grep "dm2"

Tips

Batch operations

Compression

Playwrights compression is sub-optimal. Use mogrify from the imagemagik package for better compression.

mkdir -p dist/compressed
mogrify -format webp -quality 80 -path dist/compressed dist/*.jpg

Creating thumbnails

mkdir -p dist/compressed/thumbs
mogrify -format webp -thumbnail 640x360 -path dist/compressed/thumbs dist/*.jpg

Related projects

About

Automate screenshots of Quake maps (mapshots) using FTE and Playwright.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project