Globe Previews a 128K Raycaster Engine for the 130XE

At the end of January 2022 globe, author of the first-person shooter Final Assault, posted a preview of a new raycasting engine that needs 128KB. Final Assault had to fit 64K. With four extra banks to spend on tables, textures and unrolled code, the new engine looks and moves noticeably better. It is a tech preview, not a game: you can walk around a test map, switch weapons and shoot.

Features of the preview

  • 80×48 resolution with fish-eye correction and proper scaling of wall slices.
  • Reworked weapons with short firing animations, muzzle-flash lighting and ejected shell casings.
  • Fully remappable controls: pick a preset or define your own on the Controls screen, then press ESC to play.
  • START+SELECT+OPTION switches between solid pixels and an "every other line black" mode that is about 5 fps faster. Add any other key to that combination to return to the Controls screen.
  • An on-screen readout shows the frame rate and ANG, the player's heading in hex. A full turn is 128 steps, so $00 is north, $20 east, $40 south and $60 west.

On a stock 130XE, one tester measured about 25 fps in full-pixel mode and 30 fps in line mode. globe gave the range as 23–33 fps depending on how much of the map is visible. Even a worst case (an empty map, looking across it into a far corner) gave 20 fps.

How it works

globe explained several tricks in the thread:

  • Four texture sizes. Normal walls use 32×32 textures. A 64×32 version is used when you stand close, so walls show fat pixels instead of stretched line patterns. 16×16 and 8×8 versions keep distant walls recognisable.
  • One giant unrolled drawing routine (about 10.5KB, against four pages in Final Assault) picks the right texture size as it draws.
  • Lookup-table multiplication. Fish-eye correction needs 40 multiplications per frame. A 5KB table makes each one cost a constant 12 cycles, against roughly 70–100 cycles for the fast shift-and-add or quarter-square routines globe looked at.
  • One 16K bank is entirely raycaster tables. A second holds the control setup, and two were still empty at the time of the preview.

A week later, build v17 added a Speed button for walking and running (walk at 4, run at 8) and adjustable turn rates. A quick fix followed for a bug in the turn-rate controls when they were mapped to anything other than the keyboard, first spotted with a SNACK gamepad adapter.

Getting it running

The first build loads from $0F00, below the memory most DOSes keep for themselves, so it has to be booted directly: use File > Boot Image in Altirra, a SIDE or AVG cartridge loader, SIO2PC/RespeQt, or a low-memory loader such as MyPicoDOS or xBIOS/xBootDOS. A second XEX loads from $2000, and testers confirmed it runs from SpartaDOS X. Memory must be 130XE-compatible. Use 128K, or a 256/320/576K Compy Shop setting. RAMBO modes and the 1088K setting crash it. Ultimate 1MB owners should select 576K Compy Shop, and the 576NUC+ works in 320K Compy mode.

Status

The XEX files are attached to the AtariAge thread "128KB raycaster engine WIP". In the same thread, shanti77 shared a separate experimental engine with doors and a 128×128 map. Fans have bumped the thread many times since, hoping for a full 128K game.

Credits