Living checklist for the current development push (git subtrees, Nix flake cleanup, experimental WASM / Android / R36S). Update this file when items land or scope changes.
- Add
AGENTS.md(coding standards, git-bundle handoffs, AI attribution) - Clarify handoffs: only
git bundle+git pull; nevergit fetch/git cherry-pickas a substitute for stacking - Flake Windows outputs under host system (
pingus-win32-x64/pingus-win32-x86), notpackages.*-windows - Drop
x86_64-darwinfromeachSystem(nixpkgs unstable dropped it)
- Vendor helper libraries under
external/viagit subtree add --squash- tinycmmc, uitest, argpp, geomcpp, logmich, sexpcpp, priocpp, strutcpp, tinygettext, xdgcpp, wstsound
- Avoid recursive submodule checkout when adding subtrees
- Nested upstream gitlinks (
external/*/external/tinycmmc) left as gitlinks only — real modules live atexternal/tinycmmc
-
tinycmmc_find_dependency: monorepo paths + aliases (geom→geomcpp,prio→priocpp,strut→strutcpp,sexp→sexpcpp) - Bootstrap
TinyCMMC.cmakefalls back to top-levelexternal/tinycmmc - Hardcoded module paths in argpp/logmich/strut/wstsound fixed for monorepo
-
sexpordered beforepriofor in-tree builds - Flake builds helpers with
callPackagefromexternal/*/(no flake inputs for those libs) - Flake inputs reduced to nixpkgs, flake-utils, Win32 SDL ports (+ SDL source tarballs for Android/wasm)
- Copy/adapt
mk/{wasm,android,r36s}andnix/{wasm,android,r36s}.nix(GP2X/Wiz not brought over) - Wire host-system packages:
pingus-wasm,pingus-android,pingus-r36s, PortMaster zips,arkos-sysroot, SDL helper outputs - CMake:
SDL3_DIR/SDL3_image_DIR,PINGUS_USE_GLES,EMSCRIPTEN_LINK_FLAGS, html suffix, skipxdgcppon Emscripten/Android -
PINGUS_ENABLE_SOUNDoptional on Emscripten (was forced OFF; now ON via flake when wstsound path is ready) - wasm
build-app.shuses Pingus CMake options (not SuperTuxENABLE_*)
- Port the C++ code from SDL2 / SDL2_image to SDL3 / SDL3_image
- CMake:
find_package(SDL3)/find_package(SDL3_image)(CONFIG) - tinygettext:
TINYGETTEXT_WITH_SDL3(SDL_iconv) - Native Nix build (
pkgs.sdl3,pkgs.sdl3-image) - Windows: SDL3 + SDL3_image cross-built from nixpkgs sources
(
nix/windows.nix), replacing the SDL2-win32 flake inputs - WASM: SDL3 + SDL3_image static builds instead of
build-sdl2*.sh - Android: SDL3 (ndk-build, Java glue from SDL3), real SDL3_image
(static, stb backend) instead of the
img_stb_min.cshim - Android: test the SDL3 APK on a device
- R36S: build SDL3 (KMSDRM + GLES) + SDL3_image against
arkos-sysrootand shiplibSDL3.so.0/libSDL3_image.so.0in the port - R36S: test the SDL3 build on the device (KMSDRM + GLES, joystick)
- Drop the now unused
sdl2-*-src,libxmp-srcandSDL2*-win32flake inputs
- Replace
{fmt}withstd::format/std::vformat(C++20) in Pingus, logmich, and priocpp - Replace libsigc++ with the small
pingus::Signal(src/util/signal.hpp) - Provide glm for Emscripten (
EXTRA_PREFIX_PATH) and confirmfind_package/ pkg-config under FIND_ROOT BOTH
- Strip SuperTux-only
EXPORTED_FUNCTIONS(_st_emscripten_*) from the link line; keep_main+ main-loop pause/resume only -
Legacy GL emulationsuperseded by real GLES2 shaders (FULL_ES2only) - Soften
mk/wasm/shell.htmlwhen optional_st_emscripten_*symbols are absent (guards already present; exports no longer require them) - Get a full
emcmake+ link ofpinguspast compile/link errors - Runtime: main loop / filesystem (
data/preload at/data), canvas resize, input - wstsound on Emscripten OpenAL (see section below) — not SDL2_mixer
Goal: real SFX + module music in the browser without OpenAL Soft. Use
Emscripten’s OpenAL 1.1 → Web Audio (-lopenal) and a slim codec set.
| Path | Formats | Decoder |
|---|---|---|
data/sounds/*.wav |
PCM WAV | in-tree WavSoundFile (no extra dep) |
data/music/*.it, one .s3m |
Impulse Tracker / Scream Tracker | libmodplug |
Not required for Pingus data: mpg123, libvorbis, opus. Keep those optional for desktop wstsound; do not pull them into the wasm closure unless a future asset needs them.
- Codecs as separate flake outputs (quick
nix build .#libmodplug-wasmwithout rebuilding the game):libmodplug-wasm— static libmodplug forwasm32-emscripten- Later: optional
libogg-wasm/libvorbis-wasmonly if needed
- Sources: fetch from the web first (
fetchurl). Vendor underexternal/only if packaging becomes painful or upstream disappears. - wstsound wasm build:
- Link Emscripten OpenAL (
-lopenal), not OpenAL Soft - CMake options to disable unused codecs (
WSTSOUND_WITH_MPG123=OFF, etc.) - Stub or
#ifdef __EMSCRIPTEN__EFX (alGenEffects/ effect slots) — not available in Emscripten’s AL - Avoid requiring pthreads
- Link Emscripten OpenAL (
- Pingus: stop forcing
PINGUS_ENABLE_SOUND=OFFon Emscripten once wstsound-wasm links; keep autoplay / first-gesture behaviour in mind → done: CMake respects-DPINGUS_ENABLE_SOUND; flake setsenableSound=true
-
libmodplug-wasmflake package (static, emconfigure/emmake or cmake) - wstsound CMake:
WSTSOUND_WITH_{MODPLUG,VORBIS,OPUS,MPG123,EFX}options; default wasm profile = modplug + wav only; Soft loopback excluded - wstsound builds under emscripten against
-lopenal(EFX stubbed) -
wstsound-wasmflake output for isolated testing - Wire
.#pingus-wasmwithenableSound=true+ preload music/sounds - Runtime: music + SFX after user gesture; greeting reflects real backend
- Detect
.s3mmagic inSoundFile::from_stream(SCRM) sogd-giirm.s3mroutes to ModPlug
- Porting OpenAL Soft itself to wasm
- Shipping mpg123/vorbis/opus on wasm “just in case”
- SDL2_mixer as the primary path (keep as a possible alternative only)
Runtime status (device / Fire tablet): menu, levels, levelsets, Options,
translations, and editor groundpieces work after asset-index + empty-datadir
fixes. Sound is still forced off (PINGUS_NO_SOUND).
- Stage
external/*/includeinto the NDK tree; excludesound_real.cpp(until sound lands) - GLES context attributes in OpenGLFramebuffer when
PINGUS_USE_GLES - Writable userdir via
SDL_GetAndroidInternalStoragePath - Asset I/O:
System::read_file/existviaSDL_IOFromFile - Load prio documents via
System::read_file(load_document) - Legacy
/images/...sprite paths stripped for AssetManager - GLES viewport synced to drawable size (1024×528 vs requested 1024×768)
- Pingus launcher icons (
mipmap-*/ic_launcher.png) - Translations: Android
FileSystemfor tinygettext + non-throwingpo/scan -
android-asset-index.txtsoopendirlists levelsets / prefabs / images - Empty-datadir
opendir_recursivepath fix (editor groundpieces) - Validate APK install on a device (Fire tablet / austin)
- Build/link remaining
external/static libs for each ABI where needed - [~] wstsound + OpenAL Soft + libmodplug for real audio (wiring in; see below)
- Pause/resume audio on Activity lifecycle
Parity with wasm: wstsound → OpenAL, codecs modplug + wav.
- Asset-aware open:
SoundManagerOpenFunc→System::read_fileinsound_real.cpp(#ifdef ANDROID) -
mk/android/scripts/build-audio-libs.sh— NDK CMake for OpenAL Soft (static) + libmodplug per ABI -
nix/android.nixaudioAndroidLibs+AUDIO_ANDROID_LIBSinto APK build - Stage wstsound (wav+modplug only) + prebuilt
.ainbuild-apk.sh -
Android.mk: whenENABLE_ANDROID_SOUND=1, link openal+modplug, compilesound_real.cpp+ wstsound,-lOpenSLES; else keep dummy - First successful
nix build .#pingus-androidwith audio libs (fix OpenAL source hash if fetch fails) - Device test: menu music (
.it) + SFX; pause on Activity lifecycle
Non-goals for this track: SDL2_mixer as primary path; full codec set; OpenAL EFX on mobile.
- Successful CMake configure against
arkos-sysroot(SDL2, GL/GLES, fmt, glm, libpng, …) - Build
external/for aarch64-sysroot or rely on sysroot packages - Binary runs under PortMaster with
SDL_GAMECONTROLLERCONFIG - Real screenshot/cover assets for PortMaster metadata
- Request ES 2.0 context via SDL when
PINGUS_USE_GLES/ Emscripten - Compile-time
PINGUS_DEFAULT_DATADIRfrom CMakeDATA_PREFIX(wasm preload at/data) - Shader-based OpenGL path shared by OpenGL 3.3 Core (desktop default)
and OpenGL ES 2.0 (
PINGUS_USE_GLES/ Emscripten):opengl_program.*, VBO draws, no fixed-function / no legacy GL emulation - Runtime verification on desktop GL 3.3, wasm GLES2, Android GLES2
- Runtime verification of data path (
DATA_PREFIX/ preload) on each port
- Run
nix flake lockafter input changes; prune unused lock nodes - CI:
nix build .#pingus+ optional port smoke jobs - Consider vendoring Win32 SDL under
external/later (optional)
Goal: data-driven Entity Component System for world objects and pingus,
with game logic separated from presentation. All work stays on the
ecs-refactor branch until it is in good shape; master is left alone.
Demo replay compatibility is not a constraint (the demos were never fully
reliable).
Regression check: extra/pingus-headless runs demos and levels without a
display; diff its output before/after a change:
find data -name '*.pingus-demo' -o -path 'data/levels/*.pingus' | sort \
| xargs -d '\n' build/extra/pingus-headless > results.txtArchitecture and how-tos: doc/ecs.md. Renderings can be compared as
well (pingus-headless -s DIR -T TICKS).
- Separate game logic from sprites
-
AnimationClock: animation timing from.spritemetadata - Actions use clocks instead of
Spriteframe state - World objects use clocks instead of
Spriteframe state - Seeded
RandominWorld(game_random,fx_random) replaces globalrand()in world code - Pingu actions hold no sprites, they describe their look
(
get_look()) as animations of the player's animation set
-
- Data-driven visuals
- Animation sets (
data/animsets/),AnimatedSpritecomponent; traps, teleporters and pingus use them - Game timing is explicit in the actions and traps, the art is mapped onto it proportionally; visual-only animations take their timing from the animation sets
- Declarative effects (sound, particles, overlay at a step) in the animation sets; bomber, exiter, splashed, guillotine and smasher use them
- Ice blocks, switch doors and conveyor belts use animation sets
- Pingu sprites defined inline in the player animation sets, the action button icons in gui/action-buttons; 147 .sprite files removed
- Liquid width in the collision map depends on the width of the level's surface sprite (game data from art)
- Animation sets (
- Headless smoke test
-
extra/pingus-headless(demos + levels with armageddon, offscreen screenshots) - Hook into ctest (
test_pingus_headless, tutorial levels) - CI job
-
- Shared object schema
-
ObjectSchema/ObjectDatadescribe all level object types - Editor reads, writes and derives its
HAS_*flags from it - Editor property panel generated from the schema,
HAS_*flags removed -
WorldObjRenderer(pingus-level2png) still has its own per-type code - (Maybe) move the type definitions into a data file
-
- World objects as entities + systems
-
ecs::Registry, components, systems for all 22 object types -
TriggerZone,Owner,ObjectId,SmallmapSymbolshared components -
WorldObjlevel object classes andWorldObjFactoryremoved - Global
WorldObj::worldreplaced by explicit references - Ground map and particles are plain services,
WorldObjremoved - Editor accesses properties by name, typed
LevelObjaccessors removed - Fixed system order (spawners, pingus, objects) instead of the old z-based update order
-
- Pingus as entities
-
Transform,PinguState,PinguBehavior,ActivePingucomponents,Pinguas interface component,PinguHolderno longer aWorldObj, systems inpingus/ecs/pingus.cpp - (Maybe) actions as data + systems instead of classes
-
Found along the way:
- 44 levels failed to load because of syntax errors (multi-string descriptions, malformed numbers/bools, unescaped quotes); fixed
- Editor dropped old
(color ...)values and snowintensityon save; fixed by the schema - 87 demos reference levels that no longer exist
- The (unused) smashed action shows
pingus/playerN/bomber, which is the whole bomber sprite sheet as one image - Fake exit smashed forever after the first trigger (looping sprite); fixed
- Build: an
LD_LIBRARY_PATHpointing at system libraries built against a newer glibc breaks linking innix develop; the develop shellHook clears system/usr/lib//libentries
-
SpriteViewerScreenfor.spriteand.animsetfiles viapingus path/to/file.{sprite,animset}(dispatch inapplication.cpp) -
pingus --sprite-viewopens the viewer without a file; optional FILE - Catalog browse:
[/]or PageUp/PageDown cycle all datadir sprites/animsets - Animset: up/down select animation, left/right direction, space pause,
./nstep when paused, R reload, Esc quit - HUD: name, frame, timing, loop; crosshair at draw anchor; effect-step markers; effects fire (sound, overlay, simple particles)
- Removed obsolete
extra/sprite-view(resource-name OpenGL smoke loop) - HUD panels for contrast;
Otoggles offset crosshair
Goal: the same level + input gives bit-identical results on every build
and platform (x86-64, win32-x86, aarch64, WASM), so demos replay
everywhere. Floats stay where they don't feed back into game logic
(rendering, sound, fx_random particles).
- Measure
- State hash in
src/pingus/state_hash.*;pingus-headlessprints it per file,--trace DIRper tick (--trace-pingusadds every pingu),--repeat Nchecks runs in one process - All demos and levels give the same hash on repeated runs
- Compare traces across builds: -O0/-O2, FMA (x86-64-v3), win32 under wine, aarch64, WASM
- Re-record reference demos; most current demos no longer replay (19 of 72 loadable ones save any pingus)
- State hash in
- Compiler flags for game logic
-
-ffp-contract=off, SSE2 math on win32-x86, no fast-math - Locale independent float parsing/writing that round-trips
exactly: sexpcpp detects float
std::from_chars/to_charsat configure time (falls back to classic-locale iostreams, e.g. R36S), priocpp writes up to 9 digits instead of 6 - No libm transcendentals in game logic (
std::sininangel.cpp)
-
- Fixed point for gameplay state
- Pingu position/velocity, gravity, deadly/terminal velocity, collider, boarder/slider/angel/superman
- Demo events store integer positions instead of raw float bits
- GP2X / Wiz / Open2x (explicitly excluded)
- Archive write, remote VFS, or other non-port features
- Pixel-perfect SuperTux Milestone 1 feature parity (different game)
# Packages
nix build .#pingus
nix build .#pingus-win32-x64
nix build .#wasm-sdl3 .#wasm-sdl3-image # SDL stack only
nix build .#pingus-wasm # full wasm app (WIP)
nix build .#arkos-sysroot
nix build .#pingus-r36s # WIP
nix build .#pingus-android # WIP
# Out-of-tree Debug develop loop (nix develop)
nix develop
pingus-configure && pingus-build && pingus-run
# or: nix develop -c pingus-run
# nix develop -c pingus-run-gdb- SuperTux Milestone 1 ports (source of packaging patterns): https://github.com/SuperTux-Origins/supertux-milestone1
- Pingus repo: https://github.com/Pingus/pingus