Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ec11bad
PS2: read the PS2 release's archive and convert its worlds to PC worlds
nolffan Oct 24, 2026
af9b27d
PS2: convert the PS2 release's models to PC models
nolffan Oct 24, 2026
be59653
PS2: decode the PS2 release's sound banks and voice streams
nolffan Oct 24, 2026
f221cc4
PS2: the PS2 levels' text, and the IDs it takes in CRes.dll
nolffan Oct 24, 2026
a8395d5
Client: the PS2 thief levels' loading screen, hands and intel
nolffan Oct 24, 2026
06526c7
Build: make modern PS2=1 adds the PS2 thief levels
nolffan Nov 16, 2026
20df763
PS2: the Baron's training rooms in "A Man of Influence"
nolffan Oct 24, 2026
44b59e5
PS2: the safe cracker's LEDs and coloured parts
nolffan Oct 24, 2026
60af216
Main menu: choose its Cate, young Cate with the PS2 levels
nolffan Oct 24, 2026
3323d54
Docs: package P8, the PS2 release's levels
nolffan Oct 24, 2026
b84157b
Young Cate menu: one check for the PS2 build and the Thief mod
nolffan Oct 27, 2026
2c9ee0f
PS2: the thief safes are marked ThiefCodeBreaker, as the Thief mod's
nolffan Oct 27, 2026
1b45894
PS2: M07S03's halves are m07s03a and m07s03b, the Thief mod's names
nolffan Oct 27, 2026
e8e5dcd
PS2: the intel popups are ScaleFX252-254, the Thief mod's numbers
nolffan Oct 27, 2026
97d88ff
Thief levels' loading screen: one, P9's, with the mod's text or the P…
nolffan Oct 27, 2026
0810cce
PS2: the PS2 levels draw with the PS2's own textures
nolffan Oct 27, 2026
0dd5434
Docs: P8 on top of P9, the three ways to play the thief levels
nolffan Oct 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ Since the first public release:
modern renderers left the processor at full precision, and the
collision tests came out differently. They now set it as the original
did. (issue #43)
- **The PlayStation 2 release's extra levels**, for a build from source
with your own PS2 disc image (`make modern PS2=1`; no public archive
yet). Young Cate's three "Nine years ago" flashbacks, as a thief in
London and Scotland, play inside missions 3, 5 and 13 as on the PS2,
with the lock pick and safe cracker; "A Man of Influence" gets the
Baron's secret training rooms under his courtyard. Interface options
can also put young Cate on the main menu, or any of the menu's other
Cates. The levels draw with the PS2's own textures. With the Thief mod
installed as well, the mod's versions of the same levels take their
place. ([`docs/MODERN.md`](docs/MODERN.md), P8)
- **Sound effects at retail loudness.** OpenMiles played most sounds
1.5-3 dB louder than Miles 6.0i (its volume curve was approximated, and
it did not round as Miles does); its volume, master volume and pan now
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ SRC_MOUNT := $(if $(NOLF_SOURCE),-v $(realpath $(NOLF_SOURCE)):/nolfsource:ro -e
DOCKER_RUN = docker run --rm --init --name $(CONTAINER) \
-u $(shell id -u):$(shell id -g) -e HOME=/tmp/home $(if $(JOBS),-e NOLFSRC_JOBS=$(JOBS)) \
$(if $(NOLF_ARCHIVES),-e NOLF_ARCHIVES="$(NOLF_ARCHIVES)") \
$(if $(PS2),-e NOLFSRC_PS2=1) \
-v $(CURDIR):/repo -w /repo $(SRC_MOUNT) $(IMAGE)

TOOLCHAIN_FILES = ext/toolchains/msvc-6.00-9782/VC98/Bin/CL.EXE \
Expand All @@ -58,6 +59,9 @@ help:
@echo "make debug the game with symbols and NOLFSRC_DEBUG logging, in out/nolf-legacy-debug/"
@echo "make modern the game with NOLFSRC_MODERN (the retail bugs fixed), in out/nolf-modern-release/"
@echo "make modern-debug both, in out/nolf-modern-debug/"
@echo " (with PS2=1, the modern ones also get the PS2 release's levels: the three"
@echo " \"Nine years ago\" flashbacks and the Baron's training rooms, from the PS2"
@echo " disc in ext/rez/isos/ps2/, in nolfsrcps2.rez; no public archive)"
@echo " (none of these is ever scored; build/variant.sh)"
@echo "make test scripted playtest of out/nolf-legacy-release/ ($(TEST_LEVELS)), under Xvfb"
@echo "make test-modern the same of out/nolf-modern-release/"
Expand Down
57 changes: 47 additions & 10 deletions build/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
# game's, with lithtools' lithrez (build/lithrez.sh),
# and its edits of the discs' data (src/modern/data/,
# ext/tools/moddata.py) into nolfsrcdisc.rez, before
# it.
# it; with PS2=1, the PS2 levels made from the PS2
# disc (build/ps2/) into nolfsrcps2.rez, after it.
# 5. audit every PE file in out/nolf-legacy-release/ listed with its origin;
# the build fails if any is unaccounted for or if a
# .rez archive still holds one.
Expand Down Expand Up @@ -115,23 +116,30 @@ mkdir -p "$OUT/Save"
MODERN=
case "${NOLFSRC_CFLAGS:-}" in *NOLFSRC_MODERN*) MODERN=modern ;; esac
[ -n "$MODERN" ] || mkdir -p "$OUT/custom"
# The PS2 levels (MODERN.md, P8; make modern PS2=1): nolfsrcps2.rez, made
# from the player's PS2 disc (step 4d), after nolfsrc.rez
PS2=
[ -n "$MODERN" ] && [ -n "${NOLFSRC_PS2:-}" ] && PS2=ps2
# nolfcmds.txt: the command file the engine starts with, as a fresh build
# writes it (the launcher rewrites it; build/playtest.sh uses it),
# build/nolfcmds.sh.
bash build/nolfcmds.sh "${NOLF_MIDDLEWARE:-retail}" $MODERN > "$OUT/nolfcmds.txt"
bash build/nolfcmds.sh "${NOLF_MIDDLEWARE:-retail}" $MODERN $PS2 > "$OUT/nolfcmds.txt"
# startup.txt: the rez stack NolfServ.exe, the dedicated server, loads (the
# retail one's names, Rez0-Rez8, then ours last, as nolfcmds.txt has them
# for the engine: custom/, with our game DLLs; in the modern build
# nolfsrcdisc.rez and nolfsrc.rez). `resources` copies the retail file
# again whenever this one differs in size, so the lines are added afresh
# each time.
# nolfsrcdisc.rez and nolfsrc.rez, and nolfsrcps2.rez with the PS2 levels).
# `resources` copies the retail file again whenever this one differs in
# size, so the lines are added afresh each time. (A modern build drops the
# PS2 line when it builds without the PS2 levels, and adds it with them.)
[ -n "$MODERN" ] && sed -i '/^Rez11 *=/Id' "$OUT/startup.txt"
if ! grep -qi '^Rez9 *=' "$OUT/startup.txt"; then
if [ -n "$MODERN" ]; then
printf 'Rez9 = "nolfsrcdisc.rez"\r\nRez10 = "nolfsrc.rez"\r\n' >> "$OUT/startup.txt"
else
printf 'Rez9 = "custom"\r\n' >> "$OUT/startup.txt"
fi
fi
[ -n "$PS2" ] && printf 'Rez11 = "nolfsrcps2.rez"\r\n' >> "$OUT/startup.txt"
# linux-run.sh: start the game with the host's Wine, through our NOLF.exe;
# linux-server.sh: a dedicated server, NolfServ.exe (build/game-scripts/;
# usage in their headers).
Expand All @@ -158,6 +166,10 @@ python3 build/retailextract.py lithtechres "$RETAIL" src/engine/lithtech/res
step "2c. Game of the Year text: the retail CRES.dll in $RETAIL -> src/game/ClientRes/goty/"
python3 build/retailextract.py goty "$RETAIL" src/game/ClientRes/goty

step "2d. the PS2 levels' text (modern build, make modern PS2=1): the PS2 disc in ext/rez/isos/ps2/ -> src/game/ClientRes/goty/ps2.rc"
if [ -n "$MODERN" ]; then bash build/ps2/ps2build.sh strings src/game/ClientRes/goty/ps2.rc
else rm -f src/game/ClientRes/goty/ps2.rc; fi

step "3. compile: libraries, game DLLs, engine (build/compile.sh: build/build.mk, ${NOLFSRC_JOBS:-$(nproc)} jobs)"
GAME_CONFIG=final bash build/compile.sh all
for f in src/engine/ltmsg/Release/ltmsg.dll src/engine/sres/Release/sres.dll \
Expand All @@ -179,11 +191,14 @@ if [ -n "$MODERN" ]; then
# else -- a player's own files, or Custom/*.rez for the launcher's
# custom archives -- stays, and so does custom/ then. Never for a legacy
# game directory, whose game DLLs live there.
# (and what a modern build before nolfsrcps2.rez installed there for the
# PS2 levels, by custom/PS2-DATA.txt's list)
bash build/ps2/ps2build.sh oldcustom "$OUT"
python3 build/retailextract.py oldcustom "$OUT"
else
# our archives, which only the modern build has (a legacy directory
# built while the legacy build had them too)
rm -f "$OUT/nolfsrc.rez" "$OUT/nolfsrcdisc.rez"
rm -f "$OUT/nolfsrc.rez" "$OUT/nolfsrcdisc.rez" "$OUT/nolfsrcps2.rez"
fi
# The manifest's rows for files no longer here, and for our archives and
# their entries (written again below), go.
Expand Down Expand Up @@ -256,10 +271,27 @@ else
--out "$STAGE/nolfsrcdisc" --list "$OUT/MODERN-DATA.txt" \
--skip nolfsrc.rez --skip nolfsrcdisc.rez

step "4c. archives: $STAGE/ -> nolfsrc.rez, nolfsrcdisc.rez (lithtools' lithrez)"
# A file in both would be ours twice, and one would silently win.
dup="$(cd "$STAGE" && find . -type f | sed 's|^\./[^/]*/||' | tr '[:upper:]' '[:lower:]' | sort | uniq -d)"
[ -z "$dup" ] || { echo "error: in both nolfsrc.rez's and nolfsrcdisc.rez's inputs: $dup" >&2; exit 1; }
if [ -n "$PS2" ]; then
step "4c. the PS2 levels (MODERN.md, P8): the PS2 disc in ext/rez/isos/ps2/ -> nolfsrcps2.rez, $OUT"
# Made from the player's PS2 disc, so never in the public archive
# (build/package.sh makes none of this game directory), and an
# archive of its own: nolfsrcdisc.rez stays what the public install
# scripts make from the PC discs. Its attribute files are the ones
# of nolfsrcdisc.rez with the PS2 recipes on top, and override them.
mkdir -p "$STAGE/nolfsrcps2"
bash build/ps2/ps2build.sh install "$OUT" "$STAGE/nolfsrcps2"
fi

step "4d. archives: $STAGE/ -> nolfsrc.rez, nolfsrcdisc.rez${PS2:+, nolfsrcps2.rez} (lithtools' lithrez)"
# A file in two of them would be ours twice, and one would silently win
# -- except nolfsrcps2.rez's attribute files, which are nolfsrcdisc.rez's
# with the PS2 edits.
dups() { # dups <staged directory>...
(cd "$STAGE" && find "$@" -type f 2>/dev/null) | sed 's|^[^/]*/||' |
tr '[:upper:]' '[:lower:]' | sort | uniq -d
}
dup="$(dups nolfsrc nolfsrcdisc; dups nolfsrc nolfsrcps2)"
[ -z "$dup" ] || { echo "error: in two of our archives' inputs: $dup" >&2; exit 1; }
bash build/lithrez.sh
# One fixed time (27 April 2001, the 1.003 update's readme's date) on every
# entry, so that every build of the same inputs makes the same bytes.
Expand All @@ -276,6 +308,11 @@ else
else
rm -f "$OUT/nolfsrcdisc.rez"
fi
if [ -n "$PS2" ]; then
pack "$STAGE/nolfsrcps2" nolfsrcps2.rez "packed by lithrez: the PS2 levels, from the PS2 disc"
else
rm -f "$OUT/nolfsrcps2.rez"
fi
fi

step "5. audit: every PE file in $OUT"
Expand Down
4 changes: 3 additions & 1 deletion build/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ $(eval $(call compile,$(CRES)/Release/main.obj,$(CRES),main.cpp,$(ENV_GAME),$(CL
CRES_RC := $(CRES)/goty/cres_goty.rc
# (a printf format: \\ is one backslash)
hash := \#
CRES_RC_FMT := $(hash)include "..\\ClientRes.rc"\r\n$(hash)include "goty.rc"\r\n$(foreach r,$(if $(MODERN),$(notdir $(wildcard src/modern/cres/*.rc))),$(hash)include "..\\..\\..\\modern\\cres\\$(r)"\r\n)
# The modern build adds the PS2 levels' text (goty/ps2.rc) when build/all.sh
# made it from the PS2 disc (MODERN.md, P8).
CRES_RC_FMT := $(hash)include "..\\ClientRes.rc"\r\n$(hash)include "goty.rc"\r\n$(foreach r,$(if $(MODERN),$(notdir $(wildcard src/modern/cres/*.rc))),$(hash)include "..\\..\\..\\modern\\cres\\$(r)"\r\n)$(if $(MODERN),$(if $(wildcard $(CRES)/goty/ps2.rc),$(hash)include "ps2.rc"\r\n))
$(CRES_RC): FORCE
@test -f $(CRES)/goty/goty.rc -a -f $(CRES)/goty/credits.txt || \
{ echo "error: $(CRES)/goty/ is missing -- build/all.sh writes it" >&2; exit 1; }
Expand Down
4 changes: 3 additions & 1 deletion build/nolfcmds.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# The game directory's nolfcmds.txt, as a fresh build writes it:
#
# build/nolfcmds.sh <retail|open> [modern]
# build/nolfcmds.sh <retail|open> [modern [ps2]]
#
# The retail NOLF.exe launcher writes nolfcmds.txt and runs
# "lithtech.exe -cmdfile nolfcmds.txt"; build/playtest.sh does the same with this one.
Expand All @@ -18,4 +18,6 @@ MOVIES=" +DisableMovies 1"
[ "${1:-retail}" = open ] && MOVIES=""
OURS="-rez custom"
[ "${2:-}" = modern ] && OURS="-rez nolfsrcdisc.rez -rez nolfsrc.rez"
# the PS2 levels (`ps2`, make modern PS2=1), from the PS2 disc: after ours
[ "${2:-}" = modern ] && [ "${3:-}" = ps2 ] && OURS="$OURS -rez nolfsrcps2.rez"
printf -- '-rez nolf.rez -rez nolf2.rez -rez nolfu003.rez -rez nolfgoty.rez %s ++screenwidth 640 ++screenheight 480 ++bitdepth 16 ++windowed 1%s\r\n' "$OURS" "$MOVIES"
8 changes: 8 additions & 0 deletions build/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ if [[ $ARCHIVES == *" private "* ]]; then
echo " $PKG: $(du -h "$PKG" | cut -f1) (unpacks to $NAME/)"
fi
[[ $ARCHIVES == *" public "* ]] || exit 0
# Nor of a game directory with the PS2 levels (make modern PS2=1): they are
# made from the PS2 disc, which the install scripts do not read
# (nolfsrcps2.rez, and their text in nolfsrc.rez's CRes.dll).
if [ -f "$OUT/nolfsrcps2.rez" ]; then
echo " $PARENT/$NAME-public.tar.gz: skipped (the game directory has the PS2 levels, nolfsrcps2.rez)"
rm -f "$PARENT/$NAME-public.tar.gz"
exit 0
fi

# The public archive: the scripts beside the rest, the disc files left out.
PUB="$PARENT/$NAME-public.tar.gz"
Expand Down
5 changes: 4 additions & 1 deletion build/playtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ grep -q '^EXT .* binkw32\.dll$' "$GAME/MANIFEST.txt" 2>/dev/null && MIDDLEWARE=o
# the modern build's own launcher names it
MODERN=
grep -q ' NOLFLauncher\.exe$' "$GAME/MANIFEST.txt" 2>/dev/null && MODERN=modern
CMDS="$(bash "$REPO/build/nolfcmds.sh" $MIDDLEWARE $MODERN | tr -d '\r\n')"
# and a build with the PS2 levels has their archive
PS2=
[ -n "$MODERN" ] && [ -f "$GAME/nolfsrcps2.rez" ] && PS2=ps2
CMDS="$(bash "$REPO/build/nolfcmds.sh" $MIDDLEWARE $MODERN $PS2 | tr -d '\r\n')"
SCREEN=1024x768
if [ -n "${PLAYTEST_RES:-}" ]; then
RW=${PLAYTEST_RES%x*}; RH=${PLAYTEST_RES#*x}
Expand Down
Loading
Loading