Skip to content

Latest commit

 

History

History
1594 lines (1353 loc) · 127 KB

MODS.md

File metadata and controls

1594 lines (1353 loc) · 127 KB

MODS.md — mods, tweaks, and what stays the base engine

Status: design agreed 2026-11-04; §8.1's overlay, canonical/DLC mods and their uuids (§14), and the first tweaks are built (§12), the rest is not. People are forking OpenSWOS to add what they want, and that is good, but the project cannot merge every fork. A mod system lets those features exist without being merged, so the engine has to become flexible enough to host them. This file records the decisions, the survey they came from, and the plan.


1. Decisions (the owner, 2026-11-04)

  1. The line: what makes the engine able to do more is the base; what makes the game different is a mod. There are exceptions (§4, tweaks).
  2. PR #11 (petarku, HISTORIC TOURNAMENTS): the PC/SWOS 2020 .DIY reader and the competition-load speedup go into the base; HISTORIC TOURNAMENTS becomes the first content mod.
  3. CPU cards ("the computer gets cards too") goes into the base as a tweak: two forks built it independently (petarku, benefactorr).
  4. Code mods start as source mods compiled in, with Lua script support at the same time.
  5. World 2026-27 becomes a mod, once the overlay and registries exist.
  6. The pitch format is base (§6): Tile Map Editor's maps, made with Tile Map Editor, with a binary form the Amiga reads.
  7. Tweaks: behaviour that differs from the original but is not a mod -- small fixes of the original's annoyances -- in [tweaks] of SWOS.ini, off by default (§4).
  8. The original is always buildable: every divergence from the Amiga game sits behind a preprocessor switch (§5), and the Amiga gets an OCS/ECS target with the original graphics beside the AGA one (§7).

We call them mods: the word the SWOS scene already uses (the SWOS 96/97 Mod, "modding"). A SWOS 2020 "DLC pack" is a mod you download.


2. The survey (17 forks, 2026-11-04)

Fork What it adds Kind Shared files it had to edit
bomb2777 / OpenSWOS-Indoor 6-a-side indoor: a court with glass walls, the hall's art, indoor rules (2 x 20 min, red card = 5-minute penalty, keeper throw, two-man wall), indoor tactics, ball off the glass, online by direct IP a match mode 43: pitch, ball physics, players, AI, fouls, camera, bench, rollback registry, replays, netplay
petarku / game-modes shooting practice, penalty shootout, CHALLENGES (.CHL scenarios with stars and progress), CPU cards, 36-team European presets, a menu-testing rig modes on the existing match main menu, OPTIONS, translations
petarku / PR #11 SWOS 2020's historic Euros, World Cups and club cups; a PC .DIY reader; a faster competition load a format + content the menus compiled for the Amiga, saves, strings, the preset list
benefactorr / Career+ ageing and retirements, AI transfers each season, player search, AI squad rotation, AI red cards, more fouls, AI injury subs, finance/offer tuning, longer careers, a 24-club Yugoslavia career systems + tuning + data 31: career setup and season, transfers, job offers, menus, saves
Znidz / OpenSWOS3DS the Nintendo 3DS, stereoscopic 3D, touch menus a platform the platform, audio, sprites
tomaszstaniak / aros-swos AROS a platform the platform, audio, paths
SWOS-United accounts, SWOS 2020's online look its own online service online menus, the identity header

What it shows:

  • No fork is only data, and none is only code. Each is a few new systems, some content, and menu rows.
  • Every fork edits the same places, the places the engine has no way in: menus (rows in FRIENDLY, OPTIONS, PRESET COMPETITION; the Amiga's compiled menu_data.c), strings (string_symbols.c regenerated by nearly every fork), settings (SWOS.ini keys, OPTIONS rows), the match's constants (players per side, pitch size, match length, physics, card rules), career events (season start and end, the transfer window, AI decisions), and saves.
  • Ports are not mods. The 3DS and AROS stay forks or come back as targets (as PortMaster did).
  • A deep mode like Indoor stays partly code even with every hook below; the hooks make most of it data and the rest small.

3. What is base and what is a mod

Base: the original game, faithful to the Amiga and DOS releases (the replay rig and the golden careers prove it); platforms and infrastructure (ports, netplay, saves, replays, the setup); reading formats (PC .DIY, SWOS 2020's files, Tile Map Editor maps); the capabilities mods need (§8); bug fixes and speedups; tweaks (§4).

Mods: new modes (indoor, practice, challenges), rule and balance changes, new career systems (ageing, AI transfers), and content: competitions, worlds, team data, pitches, kits, graphics, music, commentary, translations.

PR #11 split this way: the .DIY reader, the load speedup (petarku offered it as its own PR: take it first) and the Amiga's folder listing / data-root loading are base; HISTORIC TOURNAMENTS -- SWOS 2020's cups, which Insane has agreed may be redistributed, with a manifest -- is the first content mod, shown by a generic "competitions from mods" row in PRESET COMPETITION so no mod edits teams.c or menu_data.c again.


4. Tweaks: [tweaks] in SWOS.ini

A tweak changes how the original behaves where the original annoys: small, self-contained, off by default, one key each. First ones:

Key What it does From
cpu_cards the computer's players are booked and sent off too petarku, benefactorr
no_teammate_tackles a team-mate does not tackle the player on the ball a Reddit report
tackle_controlled_player a slide tackle is made by the player you control, not another a Reddit report

Before any of these is written, check it against the original (data/SWOS2.s, and swos.asm for DOS): a report is not automatically right. If the original does it, it is a tweak; if only OpenSWOS does it, it is a bug and is fixed in the base for everyone.

A tweak that changes a match is match rules online: it travels in the host's rules like the lobby's switches (SHORT PRESSES, CARDS/INJURIES: include/netplay_match.h), the joiner plays the host's, the recorder and .SRP record it, and adding one raises NETPLAY_COMPAT. The golden careers and the replay corpus run with every tweak off, so they keep proving the original.

A mod may switch a tweak ON -- the owner, 2026-11-04, for Career+'s "more fouls" and "the AI substitutes its injured players". The rules:

  1. The tweak is the game's, not the mod's. It is an ordinary [tweaks] key, built in, off by default. A mod cannot add one or change what one does; it can only switch on one that is marked OFFLINE-ONLY, through one call, ModApi_SetTweak(slug, "cpu_cards", 1) (src/tweaks.c keeps a mod's switches apart from the player's, and which mod made each; callable from init). A tweak that is match rules online is never a mod's to switch (byMod 0).
  2. Online always wins. A match against another player plays without it, whatever a mod or SWOS.ini says; so do the rigs and the golden careers. The mod stays a career (or modes) mod: it never has to be alike in both games.
  3. The player can see it. The tweak's row in OPTIONS shows who switched it ("ON (CAREER+)"); turning the mod off puts the tweak back to the player's own setting.
  4. Replays keep it. A recording stores the tweaks in force, so a replay or --srp-resim plays the same match.

5. The original, always buildable

Every behaviour that differs from the Amiga game -- tweaks, mods, the worlds, gameplay styles the original never had -- is compiled in only under a switch, so one flag builds the original:

  • SWOS_ORIGINAL=1 (both makefiles): no tweaks, no mod loader, no worlds (SWOS_WORLDS=0, which exists), only the AMIGA and DOS gameplay styles. Additions that do not change how the game plays (widescreen, netplay, the setup) are not divergences and stay.
  • New divergent code is written behind its switch from the start (as SWOS_WORLDS code is: CLAUDE.md, "new world code must keep that true").

6. Pitches: Tile Map Editor's format, in the base

The pitch becomes a Tile Map Editor map: layers, some above the players, and animations with easing (docs/PITCH_FORMAT_V2.md; the format is Tile Map Editor's own, D:\Projects\GitHub\TileAgent docs/FORMAT.md). Stage 1 is in the game: a DOS-graphics pitch drawn from a .tmj (docs/PITCH_MAPS.md). Since 2026-11-07 the reader is itself a mod, pitchmaps (canonical, off by default; the owner: everything as a mod): the engine has only the pitch hooks (ModDef pitchLoaded / pitchColoured / pitchDropped / pitchTiles / pitchCondition, §16), and the pitches made with it are mods too (their grafs_dos/pitch<N>.tmj).

  • SDL reads the .tmj and its images directly (the runtime in third_party/tilemapeditor).
  • The Amiga reads a binary, never JSON (parsing JSON on a 68k takes seconds per file): .PCH, the layout in PITCH_FORMAT_V2.md §6 -- tile indices not offsets, big-endian, a magic, a version and a capability word. It takes the base layers and the crowd's animation and refuses a pitch that needs more (over-sprite layers, alpha, many animations) cleanly. Chip RAM has ~4 KB headroom beyond the 82 KB pitch buffer, so a pitch must fit what the game has.
  • Who writes the binary: one C writer, in the Tile Map Editor runtime, used by both Tile Map Editor's export and OpenSWOS Setup. An author exports .PCH from Tile Map Editor; a mod that ships only the .tmj gets its .PCH made by the setup when it builds an Amiga drawer. One writer, so the two never disagree.
  • Next stages (PITCH_MAPS.md, "what the map could take over next"): the crowd's behaviour, the adverts, the flags and goals from the map instead of the engine's code; then the AGA and OCS tiers' pitches as maps too.

7. The Amiga OCS/ECS target

The original's graphics on the original's chipset, as its own build beside the AGA one: make -f Makefile.amiga OCS=1 -> bin/SWOS2_OCS, the 4-bitplane grafs/ tier, without #define AGA (include/display.h: the switch exists, last verified before the recent AGA work, docs/AGA.md). Its own SWOS drawer in the setup. To measure first: the binary's size and what it needs of chip and fast RAM -- the AGA build needs 8 MB of fast; an A500 or A600 with an expansion, or an emulator set up as one, is the likely floor, and the doc will say so.


8. What the engine needs (the order to build it)

  1. The overlay and the manifest. A mod is a folder with mod.json: id, name, version, author, targets (sdl, amiga, both), what it changes (cosmetic, gameplay, career), its files per target, and for the Amiga the sizes it needs. swos_data_path() on SDL and the resload file calls on the Amiga look through each enabled mod, in order, before the base data. The enabled list: [mods] in SWOS.ini, data/MODS in an Amiga drawer. On the Amiga a mod replaces a file, not memory: files already load on demand into their own buffers.
  2. Registries instead of edits. A mod adds menus and rows at named insertion points, strings with their translations, and settings with their OPTIONS rows. On the Amiga a mod ships its menus already packed (the binary the JSON loader makes today), never as JSON. (2026-11-06: so it does -- baked into the program at build time, §30.)
  3. The ruleset. One structure the match reads instead of constants: players per side, the pitch's size and walls, match length, card and substitution rules, physics parameters, the tactics set. Much of Indoor becomes a ruleset plus art; what is left becomes generic features in the base (walls, time penalties).
  4. Match setup. Who plays, the starting state, how it ends, how it is scored: shooting practice, penalties and challenges become data.
  5. Career events and saves. Season start and end, the transfer window, AI decisions, as hooks; each mod a named section of the JSON save (named fields, never addresses: CLAUDE.md).
  6. The online contract. A gameplay mod's id, version and hash go in the handshake, and two builds whose gameplay mods differ do not start a match (like a different NETPLAY_COMPAT). cosmetic mods may differ. The goal (the owner, 2026-11-04): mods in multiplayer -- two players with the same gameplay mods, at the same versions, play each other; the matchmaker lists a game only to players whose gameplay mods match (as it does by NETPLAY_COMPAT), and the lobby says which mod is missing or differs. Built (§17): the handshake refuses a player whose gameplay and data mods differ (uuid, version, files). Tweaks travel the same way, in the host's rules (§4). Recordings carry the mod list, so a replay and --srp-resim play by it. A gameplay mod's match state registers with the rollback registry (src/sim_state.c).

9. Code mods

Source mods first. mods/<id>/ with its sources and mod.json, built into the binary (like fork.mk), enabled or not at run time from the list in §8.1. They work on every target, the Amiga, iOS and the web included, and stay deterministic. They call the hooks of §8; they never patch the engine's code. They are how the hooks get tried on real cases: Indoor and Career+ are the first two to port.

Lua at the same time. Lua 5.4 (MIT: fine beside GPL-3.0-or-later), embedded, calling the same hooks as the source mods -- a script can do what a source mod can, through one API.

  • Runs on every SDL target (desktops, phones, the web, handhelds).
  • Numbers are integers for anything a match or career sees (a luaconf.h with 32-bit integers): floats differ across machines and the Amiga has no FPU, and both peers of a match must compute the same.
  • The Amiga builds -nostdlib, so Lua there needs the small libc it uses (allocation over the game's heap, strings, setjmp); a 68020 is fast enough for menus and season events, not for anything run per player per frame. A mod says whether its scripts are needed on the Amiga.
  • Scripts are sandboxed: no files outside the mod's folder, no network, no OS.

Native modules (.so/.dll, an Amiga LoadSeg module) are not planned: per-target, impossible on iOS and the web, and broken by every engine change.


10. Distribution

One manifest format and one index for every mod manager: OpenSWOS Setup on a PC or Mac, SWOS Launcher's DLC Manager on the Amiga (over Roadshow), the phone copy. An index entry says which targets a mod is for -- which also gives SWOS United and SWOS United Amiga their own downloads. Mods are hosted by their authors (content with other people's rights stays theirs, as World 2026-27 is Davide's); the index only points to them, with each file's hash.

10.1 The index (the owner, 2026-11-09)

One file, index.json, read by every mod manager (SWOS Launcher's DLC Manager first; OpenSWOS Setup later), falling back to SWOS 2020's CSVs where a manager still has them:

{ "format": "openswos-mod-index", "version": 1,
  "mods": [ { "uuid": "…", "slug": "…", "name": "…", "version": "1.0", "author": "…",
              "changes": "cosmetic", "slot": "pitch", "targets": ["sdl"],
              "url": "https://…/<slug>.zip", "sha256": "…", "size": 123456, "about": "…" } ] }
  • format / version: this format; a manager refuses a version it does not know.
  • per mod, as its mod.json says (§14): uuid (its identity -- a DLC's uuid4, never changed), slug (its folder in Mods_Root(): letters, digits, - and _, at most 31, MODS_ID_MAX; a longer one is left out, the log says so), name, version, author, changes, slot ("" or absent: none), targets, about (one line);
  • url (a zip whose root is the mod's folder contents: mod.json at its top), sha256 and size of that zip.

10.2 A manifest's keys for managers: "slot" and "online"

  • "slot": one mod of a slot on at a time -- pitch, commentary, fx, title_music, menu_music, teamdb (what SWOS 2020's DLC types replace whole). The game keeps the first enabled mod of a slot and logs the others it leaves out (src/mods.c load_one); Setup and the manager show a slot as pick-one. Cups, team packs and backgrounds have none: several can be on. A title_music mod brings sound_dos/title.mp3 (the CD-style song, [audio] title_music = mp3) or sound_dos/title.xmi (played on the emulated AdLib, title_music = midi; docs/DOS_SOUND.md "The CD track"); either needs [audio] music = pc. cutscenes_hd: the PC cutscenes' upscaled pictures (video_dos/hd/<clip>.mpg; docs/DOS_VIDEO.md).
  • A mod's downloaded data: <player folder>/moddata/<slug>/ (ModApi_DataDir; the owner, 2026-11-16: "Any data downloaded from DLC should go into the user's SWOS data folder", built-in mods included). Not mods/<slug>/: a folder there IS a downloaded mod of that name and would hide a canonical one. The first user: pitch maps (the DLC Manager's Pitch Maps) are not mods but data of the canonical pitchmaps mod -- a pack (Tile Map Editor's own generic "Export As Zip": its package.json, the map and its images, a preview) unpacks into moddata/pitchmaps/<uuid>/, the uuid being the map's identity (Tile Map Editor keeps it through every edit; a newer version with the same uuid replaces the folder), and the mod's Pitch map setting chooses one, listed by package.json's name ("choices_ext": "/" -- a setting whose choices are folders, labelled by the "label_file" in each; folders starting with . are skipped, a manager's install in progress). The DLC Manager turns pitchmaps on and sets [mod.pitchmaps] map = <uuid> when a map is turned on. It draws with the PC graphics only.
  • "online": false: not for online play (an offline-only team database). MULTIPLAYER says which mods are on that are not for it and does not start until they are off (Mods_OfflineOnly, menus.c MultiplayerMenuSelected), rather than a match being refused later.
  • Keys the game does not know (a converter's own, "swos2020": {...}) are ignored.

10.3 Sound in a mod's own format (2026-11-09)

Commentary folders (sound_dos/commentary/<category>/) take .raw, .wav, .mp3, .ogg and .aiff; the PC sound table takes a mod's sound_dos/<fx|hard|pierce>/<name> as .raw, .ogg, .wav, .mp3 or .aiff (lower-case table names, src/dos_sound_tables.h) before the game's .raw. All of it mono, at its own rate. --dos-sound-selftest with SWOS_MODS_ENABLED checks a sound pack (SWOS_DOS_SOUND_TRACE=1 names each file taken from it).

10.4 Team database mods (the owner, 2026-11-09)

SWOS 2020's team database DLC as mods: another season's teams in 96/97's game, offline only. "slot": "teamdb", "changes": "data", "online": false; src/teamdb.c, applied once at start-up while the mod is on. The mod carries:

  • data_json/teams/<COUNTRY>.json -- the database's own format, unchanged (World 2026-27's author converts into it): scripts/decode_data.py --data-dir <the pack's DATA> --dump-json; a team file 96/97 has no JSON for goes as the binary data/TEAM.NNN (read through the overlay, but no 96/97 league holds it);
  • data/EUROCUP.TMD, EUROCWC.TMD, UEFACUP.TMD, POOLPLYR.DAT -- binaries, as the game reads them (the European cups' draw lists are taken from the TMDs: SWOS 2020's fixTMDData);
  • data_json/translations/<lang>.json -- the renames: "strings" and "countries" pairs ("_aYugoslavia": ["SERBIA", "SERBIAN"]), merged over the game's (src/translations.c);
  • data_json/teamdb.json: {"format": "openswos-teamdb", "version": 1, "name", "season_year", "fixes": "1111100", "points_for_win", "nationality_codes": {"114": "LBY"}, "leagues": {"<file>": {"divisions_count", "rounds", "points_for_win", "begin_month", "end_month", "divisions": [{"teams", "promoted", "promoted_po", "relegated", "relegated_po"}]}}}.

What it does, as SWOS 2020's init.cpp fixupLeague did per database: each country's league (team files 0..79) sized by its teams' league byte; when a division grew, the season a month longer and, past 12 clubs, played twice; the Greek / Israeli / Italian / Scottish rules by the fixes switches (career.opt's first line: team, month, each-match, greek, israel, italia, scotch); El Salvador without moves from 2021; points_for_win; then leagues, explicit overrides by team-file number. Real match days for odd divisions (src/fixture_rounds.c, as a world's: the original's odd tables make a career panic, 0x1313). A country's cup with more places than its file has clubs goes down to the largest power of two that fits (the season change draws its clubs until every place is taken: 1994-95 1.0's Israel, 15 clubs for 16 places, hung). A league cut to fewer divisions relegates no one from its new bottom one. No away goals in the European cups from 2022. The nationality codes, and the career's years from season_year (World_FirstYear). Not ported: SWOS 2020's dead Taiwan / San Marino / Spain cases, and its five substitutes for every cup. [teamdb] log lines name every league it changed.


11. Order of work

  1. This document; reply to petarku (PR #11's split); take his speedup PR.
  2. §8.1 the overlay and manifest, both targets; HISTORIC TOURNAMENTS as the first mod.
  3. §8.2 registries; §4 the first tweaks (each checked against the original first).
  4. §5 SWOS_ORIGINAL; §7 the OCS/ECS target.
  5. §8.3-8.6 ruleset, match setup, career events, the online contract; §9 source mods and Lua, with Indoor and Career+ as the first ports (with their authors).
  6. §6 the .PCH writer in Tile Map Editor's runtime and the Amiga's reader; later pitch stages.
  7. World 2026-27 as a mod.
  8. The online-provider hook, with SWOS United as its first user (§13).

12. Built so far

The overlay (§8.1), both targets (include/mods.h, src/mods.c):

  • SDL: [mods] enabled = a, b in SWOS.ini (or --mods=a,b, or SWOS_MODS_ENABLED for one run). Mods are folders in mods/ in the player's game folder ($SWOS_MODS elsewhere), each with a mod.json; one whose targets lacks "sdl", or with no folder or manifest, is left out and the log says why ([mods] lines). swos_data_path() looks in each mod, in order, before the assets folder and the game's own files; swos_data_path_base() (saves, deletes) never does. Mods start before translations load, so a mod can carry its own.
  • Amiga: the drawer's data/MODS, one id a line (an id ending in * is not cosmetic), read at the first file read; make_read_path() in src/resload.c looks in PROGDIR:mods/<id>/ (or mods/<id>/ under WHDLoad) for every load, never for a save.
  • Online: a mod whose changes is not "cosmetic" (or says nothing) keeps MULTIPLAYER off ("TO PLAY ONLINE, TURN OFF THE MOD ..."), until §8.6.
  • Checked: SDL -- a test mod's en.json renamed an OPTIONS row (screenshots with and without), MULTIPLAYER refused with a gameplay mod; Amiga (FS-UAE) -- a test mod's grafs_aga/MENUBG.RAW replaced the main menu's backdrop (screenshots with and without); --menu-selftest and scripts/replay_v2_test.sh --all unchanged with no mod.
  • OpenSWOS Setup installs mods (tools/swosdata/app/main.cpp, "the mods"): the Mods extra on its first screen adds a Mods screen -- the mods installed (canonical and DLC), each On / Off ([mods] of this computer's SWOS.ini, the list the game reads) and Remove (a DLC's folder); a mod's .zip dropped on the window, picked with "Install a mod...", or found in Downloads is installed: its mod.json (at the zip's root or in one folder) checked as the game checks it (a uuid; sdl or amiga in its targets; not a canonical uuid), the folder put in the player's mods/<slug> (slug: the manifest's id, else the zip's name; the same uuid under another slug is replaced), turned on. --mod-install=ZIP does it without the window. Making an Amiga drawer copies the mods that are on and made for the Amiga into its mods/, and writes data/MODS (no data/MODS when none is). Checked: an install, a refusal (no uuid), the screen with a mod in Downloads, a drawer with data/MODS = indoor-hall*, the German screen. Everywhere the setup puts the game, the mods that are on go too:
    • the WHDLoad package: staged as a drawer gets them, its mods/ and data/MODS in the package's data/ (SwosData_MakeWhdload's modsDir);
    • a phone, over the Wi-Fi copy: the setup lists each mod's files as mods/<slug>/... beside the assets and sends [mods] in the phone's SWOS.ini; the phone (src/phone_fetch.c) puts them in its own mods folder, replaced whole once everything came (a setup that sends no mods leaves the phone's as they are);
    • a handheld's card: into the port's player folder, swos/conf/.swos/mods/, with [mods] in its SWOS.ini. Checked: the phone copy end to end (a Windows setup, the Linux game's --phone-fetch: the mod in its mods folder, [mods] enabled in its SWOS.ini); the handheld copy (--handheld-copy); a WHDLoad package (its log: 2 mod files; the names in the archive). Not yet run on a phone, a handheld or under WHDLoad itself.

The first tweaks (§4) (include/tweaks.h, src/tweaks.c): [tweaks] in SWOS.ini, each true | false, off by default but the five below the table (TWEAKS_DEFAULT_ON); off online and under every rig (Tweaks_On, so the golden careers and the replay rigs play the original); the Amiga has none. On the settings' RULES OPTIONS page: the five, STRONGER KEEPERS, CPU TACTICS.

Key The original (checked: SWOS2.s and swos.asm agree; our C matched) The tweak
cpu_cards TryBookingThePlayer / TrySendingOffThePlayer give no card to a side with no human (SWOS2.s:26026) src/tackle_foul.c: every side by the same rolls
tackle_controlled_player whichever of the controlled player and the pass receiver is nearer the ball slides (SWOS2.s:30408-30431 and 31116-31146) src/update_players.c: on a human's team only the controlled player slides
no_teammate_tackles the receiver runs onto the ball (passingBall), may slide on your fire press and is handed control on reaching it (SWOS2.s:31146-31215) while a human's controlled player has the ball (within 72), the receiver comes to support distance only: no slide, no hand-over
more_fouls PlayerTacklingTestFoul waves on every tackle not from behind (direction more than 1 apart) one in 16 of those is a foul -- its roll (Rand) taken only with the tweak on (benefactorr's Career+)
ai_injury_subs the computer never substitutes: BenchCheckControls answers only a player calling the bench at a stoppage, the computer replaces an injured player with the bench player nearest his position (the keeper by the reserve keeper), within its substitutes; never the managed career club (benefactorr's Career+)
stronger_goalkeeper_ai the keeper's reach table by style (_kGoalkeeperDiveDeltas, ApplyGameStyle) SWOS 2020's --stronger-goalkeeper-ai: one step lower in the styles with the Amiga's keepers (AMIGA, AMIGA60, MOON; docs/DOS_GAMEPLAY.md §10)
unlimited_transfers BuyPlayerMenu refuses with "the club is unwilling to purchase players" when fewer than 2 of the season's transfer slots are left (SWOS2.s:103795) SWOS 2020's UNLIMITED TRANSFERS: BUY PLAYER only needs room for 2 in the career's player pool (transfer_market.c)

ON by default (2026-11-10, the owner: SWOS 2020's launcher always passed its league rules, --career-crash-fix=1111111 --always-points-per-win-3=1, core/src/game_launch.cpp; a fork without the other tweaks still builds these with PROJECT_TWEAK_FIXES, SWOS United does):

Key The original The tweak
contest_own_ratings a contested ball's roll rates one side by a team-mate, the player with the opponent's line-up number (both releases: SWOS2.s:23439-23443, swos.asm "A1 -> opponent's controlled player, but A6 -> this team?"; docs/BALL_CONTEST.md) each side rated by its man at the ball (src/ball_possession.c). Was [gameplay] contest_own_ratings, off by default; that key is no longer read (every earlier SWOS.ini wrote false)
league_crash_fixes SWOS 2020's fixupLeague (src/init.cpp) fixes 1-3 a division sized by its file's clubs; if one grew, the season a month longer and the clubs meeting twice. Nothing changes in 96/97's own leagues (checked: 0 of them); a guard for other data
league_rules_2020 its fixes 4-7 Greece from October (its cup September-June), Israel plays twice (not 3), Italy relegates/promotes 3 (not 4), Scotland plays 3 times (not 4)
three_points_for_a_win each league's own every league 3 points for a win
five_substitutes each league's and cup's own 5 substitutes from a bench of 5 (SWOS 2020's mSub 5*16+5)

The four league ones change 96/97's competition graph (TeamDb_ApplyLeagueTweaks, src/teamdb.c: from a snapshot of the leagues as installed, at start-up and when RULES OPTIONS changes one) -- not with a team database mod (its teamdb.json "fixes" and "points_for_win") or another world. A career copies its leagues when it starts and saves them, so it keeps the rules it began with.

Checked: with every tweak off, rollback_test.sh --all, replay_v2_test.sh --all and netplay_test.sh --all pass; both targets build. Not yet played with the tweaks on.


13. SWOS United: a thin fork plus a mod (agreed 2026-11-04)

SWOS United (github.com/SWOS-United/SWOS-United) is three things, and only two are a mod:

Part Where it goes
SWOS 2020's online look: MATCH MAKING, RANKINGS, LEAGUES, the lobby, CHOOSE GAMEPLAY's icons the United mod -- menus and their handlers, through the registries (§8.2)
accounts and its own servers: SWOS-API log-in, swos.swosunited.com's rankings and leagues, its matchmaker the United mod, as a source mod (it talks to the network and handles log-ins: not a sandboxed script), through a new online-provider hook: which server, how to log in, where rankings and leagues come from
its identity: name, icon, phone app ids (com.swosunited.game), installer, player folder, netplay tag stays the fork: include/project_identity.h, its packaging and icons. A mod cannot rename an app or give it an installer

The aim is a thin fork: project_identity.h, packaging, icons and the mod -- no shared file edited, so a merge of OpenSWOS never conflicts. (The merge of 2026-11-04 had five.)

Order: after the registries (§8.2) and the online contract (§8.6). The online-provider hook is designed with United as its first user, and with United's team: it changes how they work. It is also the hook any fork uses for its own online service (FORKING.md: a fork runs its own server).

Syncing United while it moves -- the care it needs:

  • Until the hook exists, United stays a full fork and merges OpenSWOS as today (git merge upstream/main, never rebase; FORKING.md). Its online code is where conflicts come from (src/online_menus.c, src/platform_sdl.c, include/project_identity.h).
  • Move United's code into its mod one piece at a time, each piece in its own United commit: a screen goes into mods/united/ as soon as the registry it needs exists in OpenSWOS, and its edits to the shared file are removed in the same commit. Never half-move a screen.
  • Each sync, after the merge: build both targets; --menu-selftest; check the identity header kept United's values (app id, tag, servers) and that player-facing paths name com.swosunited.game (the Android folder in INSTALL.md and the install page); and log in and play a match through United's own server, which OpenSWOS's tests never reach.
  • Shared decisions stay explicit: where OpenSWOS and United both have a feature (XBOX in CHOOSE GAMEPLAY, 2026-11-04), the merge keeps OpenSWOS's in OpenSWOS's look and United's in its own; a conflict there is resolved by asking, not by picking a side.
  • OpenSWOS never merges United (FORKING.md); a United fix OpenSWOS wants is cherry-picked.

14. Canonical mods and DLC mods; every mod a UUID (the owner, 2026-11-04)

Some of SWOS 2020's features become mods, so mods come in two kinds:

Canonical DLC
What part of OpenSWOS: maintained in the repo, shipped in every drop, tested with each release downloaded: by its author, or the project's, hosted outside the game
Where the game's own mods/ (MODS_CANONICAL_DIR; bin/mods/, git-tracked) the player's mods/ folder (Mods_Root()), put there by OpenSWOS Setup or the Amiga DLC Manager
Rights only what OpenSWOS may ship anything its author may share. Content with other people's rights is always DLC: World 2026-27, SWOS 2020's cups (HISTORIC TOURNAMENTS' data), the SWOS 2020 pitches. The engine capability that reads it can be canonical (the .DIY reader is base)
On when its manifest says "default": true, unless [mods] disabled names it; or when [mods] enabled does only when [mods] enabled names it
Online matched like a DLC when it changes the match: on in one game and off in the other is a different game (§17) matched by uuid, version and the hash of its files (§17)

Every mod has a uuid in its mod.json, separate from its folder's name (the slug, a readable label that may change). The uuid is the identity in saves (a career made with a career mod records its uuid and version), the handshake, recordings, the index, and dependencies.

  • Canonical: uuid5(NAMESPACE, "mod/<slug>"), NAMESPACE being the project's (af19cc5a-6529-537b-935b-407bd73b75fb, scripts/assign_team_uuids.py), written into the manifest once and never changed: python3 -c "import uuid;print(uuid.uuid5(uuid.UUID('af19cc5a-6529-537b-935b-407bd73b75fb'),'mod/<slug>'))"
  • DLC: a random uuid4, made by its author when the mod is made.
  • Refused (the log says which): a mod with no uuid; a second mod with a uuid already on; a DLC with a canonical mod's uuid. The Amiga reads no manifest, so it trusts the setup's data/MODS, which the setup writes from manifests it has checked.

Order: the [mods] enabled list first, in its order (a slug that is a DLC folder is that DLC, else the canonical mod of that slug), then the canonical mods on by default. A file two mods have comes from the first.

Static mods (2026-11-07, Playa's request for SWOS United) are canonical mods that are part of the game rather than a choice. PROJECT_STATIC_MODS in include/project_identity.h names them PROJECT_DEFAULT_MODS (same file) is the softer one: canonical mods a fork turns ON by default -- still listed, a player may turn them off (SWOS United: dosmenus). PROJECT_OFF_MODS (2026-11-12) is its opposite: canonical mods a fork turns OFF by default, still listed, a player may turn them on (SWOS United: challenge-classics, challenge-collection). by slug.

  • Always on, in the place a default mod takes, whatever their "default" and [mods] disabled say. A rig still takes only the cosmetic ones (§26), as for the defaults.
  • Never listed: not on OPTIONS -> MODS, not in its "N ON" (Mods_CountListed), and not on OpenSWOS Setup's Mods screen.
  • The Amiga: the setup always writes them into a drawer's data/MODS.
  • The log marks them static in its [mods] on: line, and names a listed slug that isn't there.
  • Online: they count as any canonical mod does (§17).
  • Only canonical mods: a DLC is never static.
  • OpenSWOS lists none, so every one of its mods can be turned off. A fork lists the mods its game is built on, its own or OpenSWOS's, without editing their mod.json.

When the first canonical mod lands, add mods to the trees every drop stages (build_dist.sh FULL_DATA_DIRS, build_installer.sh DATA_DIRS, make macos-app, packaging/mobile/CMakeLists.txt, build_portmaster.sh, the Amiga drawer), as the other tracked bin/ trees are.

Checked (SDL): a DLC with no uuid refused; a DLC with one on; a DLC with a canonical uuid refused; a canonical mod on by default and off with disabled. Both targets build.


15. Registries (§8.2): what exists, what is built, what comes next

What a mod can already do on SDL, through the overlay alone (found 2026-11-04):

  • Replace any menu. The original's 47 menus are rebuilt from data_json/menus/*.json at every start (MenuJson_InstallAll, on by default), and those reads go through the overlay; the SWOS 2020 and OpenSWOS menus load from JSON when first shown. Limit: an original menu may not grow past its compiled size (it is written over the compiled bytes; a bigger one is skipped and logged) -- growing one needs MENUS.md §1e's call-site repoint.
  • Replace formations (data_json/tactics, on by default) and the career parameters (career_params.json).
  • Replace a country's clubs (data_json/teams/<COUNTRY>.json, the database's format with ids of the mod's own: docs/TEAM_IDS.md), with its leagues (competitions/leagues.json). A country's clubs have a range of global team numbers sized to 96/97's; a mod's file with more clubs grows it at start-up and moves every later country's (DataJson_FitModTeamFiles, as a world's do), so the league tables keep them apart. Career+'s Yugoslavia is the case: 24 clubs where 96/97 had 10, which ran into Algeria's and Argentina's numbers (panic 0x5555 in its first season).

Built: strings (src/translations.c). A mod's data_json/translations/<lang>.json holds only the strings it adds or changes, and is merged over the game's: each key it has replaces the game's or joins the table, the first mod in the list winning a key two mods have. The game's own file is read without the overlay, so a mod never replaces the whole table. Checked: two mods each renaming an OPTIONS row and both renaming a third -- both renames shown, the first mod's winning the shared one.

Next, in order:

  1. A MODS screen (OPTIONS -> MODS) -- built (src/mods_menu.c, openswos/modsMenu.json): every mod on disk (Mods_Scan), canonical then DLC, up to 8 rows of name, version and kind with ON / OFF / CANNOT (a mod that cannot be on: fire says why); fire turns one on or off, written to SWOS.ini at once, and in play at once (since 2026-11-17, below: "Mods without a restart"; until then from the next start). OPTIONS' value says how many are on; hidden on the Amiga (its list is data/MODS). Checked: the screen with a canonical, a DLC and a broken mod; toggling both kinds wrote enabled=hall, disabled=classics and the next start played by it; --menu-selftest covers it. Still to come: each mod's own page (its settings, item 2), more than 8 mods. Mods add to the game there, and at named hooks, rather than by squeezing rows into the original's screens -- those keep their layout, so SWOS_ORIGINAL stays the original and two mods never fight over one row.
  2. Mod settings. mod.json "settings": [{ "key", "label", "choices": [...], "default" }], kept in SWOS.ini [mod.<slug>], shown on the mod's page, read by its code (Mods_Setting(uuid, key)).
  3. Named hooks where a mod's content appears in the game: "competitions from mods" in PRESET COMPETITION (HISTORIC TOURNAMENTS is its first user), then modes (FRIENDLY, the main menu) as mods need them -- each a generic entry the engine draws from what mods register.
  4. Handlers. A data-only mod's menus use the handlers the game already has (the menu symbol registry, _menuSymbols); a code mod (§9) registers its own as <slug>.<name>.
  5. The Amiga has no menu symbol registry (menu_symbols.c is SDL-only) and no run-time translations. Its mod menus will be packed binary (scripts/menu_json_to_bin.py, MENUS.md §3) whose references are indices into a compact Amiga registry; measure its size first.

16. Built-in mods and their hooks (2026-11-04)

A built-in mod is code in the game with a canonical manifest (bin/mods/<slug>/mod.json), the first kind of code mod (§9) and the way a feature that is "different" (§3) ships without a fork: its code runs only while the mod is on (Mods_IsOn), turned on or off on OPTIONS -> MODS like any other. The code runs at hooks, fixed points of the engine, never patches of it (include/mod_hooks.h, src/mod_hooks.c: one row per mod, its slug and its hooks):

hook where what may be done there
ModHooks_FrameDrawn(renderer) platform_sdl.c's present, after the frame and its HUD, before the CRT effects, the touch controls and the swap draw over the finished picture in its logical size. Runs once per frame SHOWN, so never on a re-simulated one: the place to keep a mod's own state
ModHooks_PitchDrawn() game_loop.c, after ScrollToCurrent drew the pitch into the frame being made, before the sprites draw into the 8bpp frame UNDER the players. The frame may be one GGPO re-simulates and never shows, so only draw here
ModHooks_PlayerSetsRaw() color_sprites.c ConvertColorsAndTextSprites, once a match, before the player sets are recoloured read the raw art (team 1's first set, sprites 227..327)
ModHooks_ReplayFrameBegin(first, fresh), ModHooks_ReplaySprite(image, left, top) highlight.c DrawReplayFrame (the in-match replay) and replay_v2.c ReplayV2_DrawFrame (VIEW's .SRP): the pitch drawn, before the sprites; then each recorded sprite draw under the replay's sprites; learn where its players are (ModApi_ReplayPlayerFeet)
ModHooks_PlayerDrawn(sprite, gfx, x, y) sprites.c DrawQueuedSprites, right after a player sprite is drawn, before anything is drawn over it redraw that sprite's own pixels, draw beside it; draw only, as PitchDrawn

A built-in mod is one ModDef (include/mod_api.h): its slug and the hooks it has, each optional, defined in its own src/mod_<slug>.c and listed in src/mods_builtin.c. A fork lists its own in src/fork_mods.inc (extern const ModDef ModDef_<slug>; lines, then #define FORK_MOD_LIST &ModDef_<slug>,), a file OpenSWOS does not have, so a merge never meets it. init runs at start-up (after the mod list, before the menus are built from JSON); src/mod_hooks.c calls every hook of every mod that is on. The hooks, by what they are for (include/mod_api.h says each one's exact point):

what how where it runs
drawing frameDrawn, frameUnder, pitchDrawn, playerSetsRaw, playerDrawn, replayFrameBegin, replaySprite, spritesBegin, spriteDraw, frameKept the table above; spriteDraw moves a sprite's drawing or leaves it out (1) -- the HUD's clock, a name, the result band's grid sprites -- the sprite itself never changed (SDL only); frameKept while a pause shows the same frame; frameUnder runs, for every mod, before any frameDrawn -- shading that belongs to the picture, under what the other mods draw (display2020's band, under the flags). With Platform_FrameShown / Platform_HudLayerBuffer a frameDrawn mod can read what the picture holds (SWOS United's display2020)
a menu overlay (H5) menuDrawn menu_system.c: each menu frame, before it is shown (a whole redraw: DrawMenu; else MenuProc's frame)
entries (H1, H6) ModApi_AddEntry(point, slug, label, fn) in init MODPOINT_MODES: the main menu's MODES button (entry 16, above CREDITS; shown only while an entry is there, never on the Amiga) opens openswos/modEntriesMenu, the list; MODPOINT_AFTER_MATCH: the same list after a friendly the player played (game_loop.c, after its REPLAY / EXIT). ModApi_ShowEntries(point) shows any point's list from a fork's own screen
its own menus (H10) ModApi_RegisterHandlers(slug, {name, fn}[], n) in init; ModApi_ShowMenu(path) handlers named <slug>.<name> in the menus' JSON, resolved only while the mod is on; a mod's replacement of one of the game's menus names its own onInit, never the engine's
settings (H7) mod.json "settings"; ModApi_Setting / SettingInt / SetSetting SWOS.ini [mod.<slug>] (Settings_Save keeps sections it does not know); the mod's page: OPTIONS -> MODS, fire on its name (openswos/modPageMenu), fire cycles a choice; up to 32 settings, eight rows at a time with the MODS screen's scroll arrows. The weather mod's two
save data (H8) ModApi_SaveFile / LoadFile(slug, name, ...) the save folder's mods/<slug>/<name>, durable as a save (Resload_SaveFileAt: the web's sync, the Switch's commit); named fields, never dumps
a match of its own (H2, H4) ModApi_DefaultSetup, ModApi_PlayMatch(slug, &setup, &result) -- blocks until it is over; then ModApi_EndMatch, StartShootout, Score, MatchFrames, ModMatch(slug) src/mod_match.c: a friendly without its menus, as the arcade cabinet plays one -- the teams by id (file << 8 | ordinal), each side CPU / player 1 / player 2 (SetupPlayers asks no one), pitch, length, subs, extra time / penalties / straight to a shoot-out, replays, the stadium screen and the REPLAY menu or not, the match's name, the score and the minute (0-44) at kick-off (InitGameRestoreTeams' end); the friendly's own settings put back after. What comes after (retry, its menu) is the mod's own code, after PlayMatch returns
match events (H3) matchStart, matchFrame, matchEvent, matchEnded every match: kick-off; each frame after the clock; goal / own goal / penalty goal (GoalScored), foul, yellow, second yellow, red, injury (tackle_foul.c), half time, second half, full time, extra time, shoot-out, each shoot-out kick (NextPenalty, in or not), the final whistle; the result. Each with its team (0 top, 1 bottom), the player's index, the minute and the frame. Never for a frame GGPO re-simulates (NetplayMatch_Resimulating)
a pitch's picture (SDL, DOS tier) pitchLoaded, pitchColoured, pitchDropped, pitchTiles, pitchCondition pitch.c: after the game's own pitch files, when the fans have their kits, before the next pitch; pitchTiles once a frame -- the function giving each cell's tile, NULL the engine's (animated_patterns.c too); pitchCondition the condition's palette entries (dos_graphics.c). Drawing only: the match plays on the game's own files. The pitchmaps mod
the online lobby lobbyKeepsReady the other player's side changed: return 1 to keep this player's GO (SWOS United's menus2020: SWOS 2020's way) -- safe, the other's own GO drops with their change
an online match as played (H3) netFrame, matchMoment, soundEvent, netConfirmed for what must say only what FINALLY happened (SWOS United's Discord posts): netFrame(frame) before each frame is played, again after a rollback (what frames >= frame said is void); matchMoment every event of every run, re-simulations included; soundEvent the PC sound events (dos_sound.h: the woodwork, a corner, a penalty, a save -- every run, offline too); netConfirmed(frame) once every frame <= frame is final. Tag what you hear with the frame, drop it at netFrame, keep it at netConfirmed

| the online account (United) | Account_UserSelected(name) (online_account.h) | a player's row chosen in the matchmaking list (SWOS 2020's MATCH INFO / PLAYER INFO) |

Checked: SWOS_MOD_MATCH_TEST=1 (with SWOS_HARNESS_TURBO=1) plays a mod's match at the first main menu -- Norway v New Zealand, CPU v CPU, 2-1 at minute 40 -- logs its events and result and quits with PASS (it played to 90 minutes, 4-1: an injury, a goal, half time, the second half, fouls, a goal, full time, the final whistle); SWOS_MOD_MATCH_TEST=entry makes it a MODES entry instead, to try by hand. SWOS_MOD_EVENT_LOG=1 logs any match's events. SWOS_SKIP_INTRO=1 starts at the main menu. Next (from SWOS United's mapping of SWOS 2020's modes, G1-G15): the sides and the kick-off team before StartingMatch, sent-off players after it, a starting minute past a period's boundary, ghost players as a draw-time filter, a forced restart, a frozen clock, classified events (headers, tackles) -- each a hook as practice, challenges and speedrun are ported.

The mod API (include/mod_api.h, src/mod_api.c): what a mod asks the game -- whether a match or a replay is on, the pitch type and minute, the players (where, facing, face, name), the camera, the screen, the frame to draw into, the palette, its own folder -- never the game's globals, so an engine change changes mod_api.c and no mod.

Neither may write match state: the frame buffers are not in it (src/sim_state.c), and a mod's own state must not be either. A built-in mod that is cosmetic plays online like any other cosmetic mod. No random number the game draws may be taken (Rand, libc rand): a mod keeps its own generator.

weather (off by default; src/mod_weather.c): the first built-in mod.

  • The weather. C4ppy77's pitch-weather (third_party/pitch_weather, MIT, ported to C: OPENSWOS.md there), drawn at FrameDrawn with SDL_RenderGeometry (SDL 2.0.18; built only where the SDL has it, src/pitch_weather_impl.c). From the match's pitch type: frozen snow, muddy heavy rain, wet rain, soft drizzle, none on the others. Its intensity drifts over the 90 minutes (the clock's minute) from a seed taken at kick-off from real time.
  • The mud. On a muddy, wet or soft pitch every player leaves footprints: one every 5 pixels he moves on the ground, left and right foot either side of his way, none across a jump (a restart). They are added and aged at FrameDrawn (so a rollback never doubles them) and stamped at PitchDrawn, a pixel at a time through a palette table: each entry's nearest entry in the palette shown toward a dark earth brown, at three strengths, rebuilt every second (a match's palette fades). A print starts dark and dries through the three, and in the last quarter of its life its pixels go one by one, so the pitch never fills up: 14 s on muddy, 8 s wet (both starting at full strength), 5 s soft (starting a level lighter). Both palettes, the Amiga's and the PC's, take it. A replay has a trail of its own (the match's waits), made at ReplayFrameBegin from the players its last frame showed, each followed by the nearest of where they were; it starts again at a replay's start or a jump.
  • SWOS_WEATHER_PITCH=<0..6> plays a pitch type's weather and mud whatever the match's -- for a test: SWOS_WEATHER_PITCH=1 SWOS_PRESENT_CAPTURE=150 SWOS_PRESENT_CAPTURE_FROM=1500 bin/SWOS.x86_64 --mods=weather --replay-test=../tests/replay/<a .swr> --dos-graphics=off writes the presented frames as swos_presentNNN.png.
  • The splashes. On a rain pitch, drops hitting the pitch, in the pitch's own cells of 32 pixels (so they stay where they hit as the camera moves): 4 slots a cell, a share of them raining (150 heavy, 90 rain, 35 drizzle a screen at full intensity, times the weather's), each landing a drop every 360 ms somewhere new in its cell -- a dot, a crown, a ring going, 60 ms each -- stamped under the players through a lightening palette table. Real time.
  • SDL only ("targets": ["sdl"]): neither hook exists on the Amiga.

hair (off by default; src/mod_hair.c; inspired by crom1): players with more than one head of hair.

  • At PlayerSetsRaw the raw frames are kept, with where each one's hair is (raw 9, 12, 13). At PlayerDrawn an outfield player's frame is made again for his look, in raw colours, and every pixel that changed is written through his face's colour table, only where the frame still shows his sprite's pixel.
  • Looks: blonde (face 3's yellow and orange), black, receding (the 96/97 Mod's 'E' shape: the hair's top row skin, and the next row's hair with a pixel on both sides), shaved (the skull's tone, nearest the palette has to the Mod's), ponytail (the owner's 3x3 PONYTAIL.bmp in hair colour 9: as drawn facing left, mirrored facing right, down the back facing away, unseen from the front; upright frames only). Goalkeepers keep theirs.
  • Who looks how: looks.csv in the mod's folder (the Mod's bald-looks format: country,club,name,look[,face], matched by full name and club; bald is shaved, all bald -- the owner's choice, 2026-11-08), else a hash of his name (7% receding, 6% shaved, 4% ponytail; white 14% blonde, 10% black; ginger 30% black), so a player always looks the same. SWOS_HAIR_LOOK=<look> gives everyone one (a test's).
  • Marco's shaved art (the Mod's tools/shavedart.json, per frame per skin) is used when it is in the mod's folder as shavedart.json, else the hair becomes the skull's colour, its lowest row a shade. Neither it nor the Mod's packs/bald-looks-2627.csv is in this repo: the Mod's data is not MIT (its LICENSE §2) -- the owner asks Davide and Marco first.

17. Worlds as mods; mods online (2026-11-04)

(Europe 1984-85 is one too, world8485, uuid 48496e1d-27d7-49d8-acff-c428814a1bc6 for ever: docs/WORLD_2026_27.md §6g. The setup installs every world package it is given; an Amiga drawer takes one world mod.)

World 2026-27 is a DLC mod, world2627 (uuid 15ea9117-6aa0-4968-a293-6cf33092ff33, for ever; "changes": "data", both targets). Its code stays in the engine -- the league splits, the play-offs, the rules library, behind SWOS_WORLDS -- because that makes the engine able to do more (§1); the mod is its data, Davide's, hosted apart as before (scripts/make_world_package.sh -> dist/OpenSWOS-World-2627.zip, now with a mod.json an older setup ignores). OpenSWOS Setup installs the package into the player's mods folder (SwosData_InstallWorldMod; swosdata --world PKG --mods-dir DIR), turns it on, and takes away an earlier setup's copy in the assets folder, so the mod's being on is what decides:

mods/world2627/
  mod.json
  data_json/worlds/2627/    WORLD.ini, teams/, competitions/  -- the PC game's, through the overlay
  amiga/data/               the Amiga's team files and WORLD   -- a drawer's or WHDLoad package's
                                                                  mods/world2627/ gets these only

The game needed nothing: every read of a world goes through swos_data_path, which looks in the mods first. With the mod off (and no older copy), [world] 2627: its data is not installed ... playing 9697. A mod with an amiga/ folder gives the Amiga that folder's contents (its files for that target); the drawer and the WHDLoad package take the world's mod with the Amiga tab's World 2026-27 tick (ModsToDrawer), and on the Amiga its data/WORLD names the world as before. The phone and the handheld copy it as every DLC mod that is on. Next (for a world with new dates and no rebuild): what scripts/world_import.py compiles into src/world_data.c read from the mod, and the setup's fixed tag (SD_AMIGA_WORLD) taken from the mod.

Online: the same mods play each other (the owner, 2026-11-04). What a mod changes:

"changes" means online
cosmetic how the game looks or sounds never matters
modes matches and screens of its own; a normal match untouched (practice, challenges) never matters
career careers and their saves never matters
gameplay how a match plays both players need it alike
data what a match plays with: teams, a world both players need it alike

A mod that says nothing counts as gameplay; canonical mods are no exception (one game can have a canonical mod on and the other off). Mods_OnlineSignature hashes, in uuid order, each such mod's uuid, its version and a hash of all its files (taken at start-up), so a copy edited by hand or half updated is another mod. The handshake (src/p2p_link.c, protocol 6, the setup packet's bytes 32-35) refuses a player whose signature differs: YOUR MODS ARE DIFFERENT / BOTH NEED THE SAME MODS: OPTIONS, MODS (P2P_FAIL_MODS; the self-test's case 4f). The world mod plays online because the server checks both teams against its list anyway (TeamRegistry.inc, which carries the world's teams). NETPLAY_COMPAT 10. Next: the matchmaker lists a game only to players with the same signature (as it does by NETPLAY_COMPAT), and the lobby names the mod that differs.

Sprite sets (2026-11-04): a mod with "sprites": "jaguar" is drawn by the Jaguar tier -- its grafs_jag/ sheets to the tier's colour roles, its four shading settings its own (docs/JAGUAR.md, "Sprite sets as mods"; scripts/make_jag_graphics.py --mod DIR). The Jaguar's own art stays an asset tier the setup builds from the player's cartridge.

For forks' screens (SWOS United's asks, 2026-11-04): ModApi_FindEntry(point, slug) and ModApi_RunEntry(point, index) run one mod's entry from a fork's own screen (its SPEEDRUNS row); ModApi_IsMainMenu() / Menu_IsMainMenu() say the main menu is up by the menu being shown (_swosMainMenu's buffer), so a mod's replacement of it, with its own onInit, still gets the build line and the career autopilot; and the Makefile rebuilds mods_builtin.o when a fork's src/fork_mods.inc first appears (make would not, and __has_include hides it).

18. SWOS 2020's modes as canonical mods (2026-11-04)

Ported from SWOS 2020's own code (the owner's choice), mapped onto the engine by SWOS United's docs/SWOS2020_MODES_MAP.md (its G1-G15 are the hooks still to add).

practice (src/mod_practice.c, bin/mods/practice: canonical, "changes": "modes", on by default -- so the main menu's MODES button is there): MODES -> PRACTICE opens its own menu (practice/practiceMenu, in the mod's folder; handlers practice.shootout, practice.demo, practice.exit, which a fork's menus can name too):

  • PENALTY SHOOTOUT (SWOS 2020's, 2026-11-09: its challengeGame2Practice_OnSelect / ChallengeGame gameMode 1, shootoutTeamsMenu.json): its team screen -- CHOOSE TEAMS (the friendly's team screen titled SHOOTOUT / START SHOOTOUT, ModApi_ChooseTeamsTitled) or two random teams of a group (ALL, EUROPE ... CUSTOM: its 96/97 team files, ModApi_RandomTeamData; team 1 the player's, team 2 the CPU's) -- and GOALKEEPER CONTROL (PLAYER each time it opens, or COMPUTER). Then VERSUS, PLAY MATCH with the kick order beside the line-up (10 by the second man .. 1 by the eleventh: playerRowDrawn + menuDrawn), the stadium, named SHOOTOUT, and straight to penalties at 120: cameraTop (the top goal), hideHud RESULT, shortStops (its GS_GK_55_50 = 1 and StartingMatch's 1), shootoutStats (the statistics' GOALS the shoot-out's, no possession), keeperDive (its setPlayerGKControl and the swos.asm patches it drives: the stick of the defending player as the kick comes -- right / left a low dive that way, up-right / up-left a high one, nothing he stays, up the game's keeper, down as before -- in ShouldGoalkeeperDive's answer, the dive's side and GoalkeeperJumping's height; the keeper carries the player mark, 4 lower). On the pitch (matchDrawn, a new hook after the sprites and the statistics; SDL only): the board of names, score, five kicks a side (its tick and cross) and whose turn, the kicking side's takers (head, number, name; the kicker highlighted), the darkened band and the two kits, the keeper's arrow (not when both sides are players') and who plays each side (CPU / Keyboard1 / Joypad). Its three layouts (DOS 320, Amiga 336, wide 480) centred in the frame. ModApi_Shootout, ModApi_ShootoutTaker, ModApi_MatchKit, ModApi_ControllerName give the mod what it draws. Not taken from SWOS 2020: its far keeper also obeying the stick (here only the defending one), its MarkPlayerSP writing +4 through a stale pointer, its gkTurn 4 marking the wrong keeper. SWOS_PRACTICE_SHOOTOUT_TEST=1 plays one CPU v CPU headless: PASS when it has a winner and its board was drawn (SWOS_PRACTICE_SHOOTOUT_PLAYMATCH=1: through PLAY MATCH, team 1 yours).
  • DEMO GAME (SWOS 2020's demoGamePractice_OnSelect): two random teams of every file, CPU v CPU, team 1 kicking off, from the 89th minute -- a minute to watch -- named DEMO GAME.
  • The menu itself is SWOS 2020's practice.mnu (imported): FRIENDLY MATCH (the game's), TEAM TRAINING, PENALTY SHOOTOUT, DEMO GAME, its help line under them.
  • TEAM TRAINING (SWOS 2020's trainingModePractice_OnSelect, 2026-11-09; its practiceSetting.mnu and teamTrainingControls.mnu imported with scripts/import_swos2020_menus.py): ATTACK GOAL, CPU SKILL (which original custom team the CPU is: JUST NIPPING OUT, THE SAD TRUTH, TWI, TRUE BLUE, PROFESSIONALS, or RANDOM), each side's lines on or off, CPU GHOSTED (its outfielders play unseen: ghosts), TACKLE ALLOWED (noTackles), PITCH TYPE, CONTROLS HELP; CHOOSE TEAM (one team, ModApi_ChooseOneTeam, titled TEAM TRAINING) or RANDOM TEAM. Its pictures beside the settings and on the controls screen (the pitch, the goal, the skill's stars, its keeper; the keys) are SWOS 2020's character maps, bin/mods/practice/pixmaps.txt (scripts/extract_swos2020_pixmaps.py; SDL). The match: clock at 0, no cards or injuries, the player's team kicking off, no result banner; its drills on the keys (ModDef.matchKey, new: a key during a match, before the game's): F1-F7 a free kick before the goal attacked, ALT one where the controlled player is (ModApi_ControlledPlayer), F8 / F9 a corner, F10 / F11 a kick / a high kick (ModApi_PressFire), F12 the kick-off again (ModApi_Restart takes MODRESTART_KICK_OFF now), 9 / 0 the player's goal kick, - / = the CPU's. After it, the settings again. SWOS_PRACTICE_TRAINING_TEST=1: every drill in turn, CPU v CPU, PASS when all are taken. New in the setup (the map's G1, G4, G7, G9): playingUp / kickOff (set where the game draws them, InitGameRestoreTeams), linesOut[2] (MODLINE_*: those outfielders sent away at InitPlayersBeforeEnteringPitch's end and put in the tunnel, as a sent-off man is -- the AI, possession and team control already play around sentAway), clockStopped (the start minute put back each frame, as SWOS 2020 does), noCards (_cardsDisallowed), noInjuries (no roll in PlayerTackled). Menus of a mod's own: ModApi_MenuText / MenuVisible / MenuNav. Built since: the drills (F1-F12, Left Alt, 9 0 - =: forced restarts, G6 -- TEAM TRAINING only, as SWOS 2020's controls.cpp gates them on g_TrainingMode), ghost players (CPU GHOSTED, G5), the manual keeper (the shoot-out's, G8).

petarku-practice was removed on 2026-11-11: petarku, its author, said SWOS 2020's practice covers it -- its shoot-out lets you choose the shooting order (in a friendlier way), and its team training is the same as his shooting practice (Playaveli agreed).

Checked: the menus draw from the mod's JSON; DEMO GAME plays two random teams; SWOS_MOD_MATCH_TEST=shootout plays a shoot-out from kick-off (every kick an event, 4-2); SWOS_MOD_MATCH_TEST=training plays 3000 frames with lines out (seen: one team's midfield alone) and the clock still at 0, ended by the mod -- PASS; check_netplay_compat.sh unchanged.

speedrun (src/mod_speedrun.c, bin/mods/speedrun: canonical, "modes", on by default; SWOS 2020's challengeGame0Extras / checkSpeedrunWinningCondition): MODES -> SPEEDRUN, eight targets with their best times -- 1 GOAL, HEADER, 3 GOALS, TACKLE, 10 GOALS, YELLOW CARD, MATCH, RED CARD. A target, the team screen (yours is the one you play), a 3-minute match on a normal pitch, your team kicking off; the clock is the match's FRAMES from kick-off (SWOS 2020 kept wall-clock seconds), shown in seconds at the style's rate (ModApi_FrameRate: Amiga 50, DOS 70, XBOX 60). The target met ends the match (ModApi_EndMatch); the final whistle without it fails (MATCH: win it). Then YOUR TIME, YOUR BEST, PLAYED and TRY AGAIN (ModApi_ChosenAgain: the same two teams) or EXIT. The records are JSON of named fields (the owner: JSON is our format for data), save/mods/speedrun/records.json ("format": "openswos-speedrun", per target played, best_frames, last_frames, best_teams). No leaderboard (a server's). The engine's new events for it (the map's G11, classified, not from the commentary): a goal's arg MODGOAL_HEADER (its scorer headed the ball within 75 frames: headers.c tells ModMatch_Header) and MODEVENT_TACKLE (a good tackle, tackle_foul.c). TACKLE is SWOS 2020's (2026-11-07, from its checkSpeedrunWinningCondition: a goal while its last commentary line was a tackle's): your team SCORES with its tackle the last thing before the goal -- a tackle of theirs, a foul, a card, an injury, a goal or a break in between spoils it. (It was "win the ball with a good tackle", and both post to SWOS 2020's leaderboards.) SWOS 2020's difficulties (2026-11-07): run {target, difficulty} of the mod's speedrun service plays one of five preconfigured pairs (BEGINNER .. MASTER: SWOS 2020's were the PC game's TEAM.072 clubs, not in this database; these are 96/97's, each pair's skill points in SWOS 2020's band for it -- Brazil v San Marino, Italy v Wales, England v Germany, Scotland v Italy, Luxembourg v Germany), and the difficulty goes with the run online. targets and style give the screens the records and the rate; MODES -> SPEEDRUN opens speedrun-screens (open) when a mod offers it (SWOS United: SWOS 2020's menus). Checked: SWOS_SPEEDRUN_TEST_DIFFICULTY=0..4 with SWOS_MOD_MATCH_TEST=speedrun:<n> plays a pair CPU v CPU (BEGINNER 1 GOAL in 2739 frames, MASTER 9458). Checked: SWOS_MOD_MATCH_TEST=speedrun:<n> (fixed teams, team 0 counted as yours) -- TACKLE in 1236 frames and 1 GOAL in 1219, PASS, records.json written; header goals found across the replay corpus (15 of 178 goals, in the matches with headed goals); check_netplay_compat.sh unchanged.

challenges (src/mod_challenges.c, bin/mods/challenges: canonical, "modes", on by default; SWOS 2020's scenario mode): MODES -> CHALLENGES, each OPEN, DONE or LOCKED (locked while an easier one is not done, as SWOS 2020's setScenariosLocked); one shows its teams (YOU / CPU), the score, the minute and what wins it, PLAY; then YOU BEAT THE CHALLENGE / NOT THIS TIME, QUICK RETRY or EXIT. Its format is OpenSWOS's own (the owner: JSON is our format for data -- not challenges.ini, not .SCN): data_json/challenges/*.json in any mod that is on, "format": "openswos-challenges" (the file's header comment has every field): database teams BY UUID, which is yours, the score, the minute (0-89), shirt numbers already sent off, extra time / penalties, "win": win, draw (at least) or exact (win_score, yours first). A challenge pack is a mod of such files. Progress: save/mods/challenges/progress.json (openswos-challenges-progress: completed, attempts). The mod's own six, from 96/97's teams: HOLD ON, LAST MINUTES, DERBY DAY, TEN MEN, TWO ALL, THE COMEBACK. New in the engine for it: a start in the SECOND half (the map's G2: minute 46-89 sets _halfNumber 2; 45 plays as 46, half time's own minute), players sent off before kick-off (ModMatchSetup.sentOff, G3: by shirt number, gone as a sent-off man), ModApi_TeamByUuid, ModApi_MenuSelect. Checked: SWOS_MOD_MATCH_TEST=challenge:<id> (CPU v CPU) -- THE COMEBACK from 3-0 at 46 to the whistle without a half time (5-0), TEN MEN from 1-1 at 60, progress written; the list (its locks) and a challenge's screen drawn; check_netplay_compat.sh unchanged.

Format version 2 (2026-11-07): SWOS 2020's scenarios. Every field its challenges.ini has (the file's header comment lists them): a title, five description lines and a win message; teams from a .EDT in the challenge's own mod ("teams": [{"file": "teams/X.EDT", "name": ...}], found by name as SWOS 2020 found them: .DIY teams are converted into one); who plays up and kicks off; the subs; a golden or silver goal; a shoot-out alone; the second leg of a tie (first_leg: UpdateTime's aggregate and away goals); players starting injured; locked (its whole category closed, as SWOS 2020's isCategoryLocked); and the start as a restart -- a corner, a free kick at one of SWOS 2020's seven spots (or x/y; deep: its "HOME" ones), a penalty, a throw-in or a GOAL KICK (new, MODRESTART_GOAL_KICK), its team and wing drawn at PLAY when -1 (SWOS 2020's RANDOM). A minute from 90 starts IN extra time (its half by the minute, as StartFirstExtraTime leaves it); 120 with shootout shows 120. Locking is now per category, and with more than one category the list opens on the categories (listExit goes back to them). The binary is version 2 (version 1 still read); the Amiga keeps the list on the heap only while the challenges are open. scripts/convert_swos2020_challenges.py <dir> <out> writes SWOS 2020's 92 as a pack mod (8 categories, one file each) -- never part of OpenSWOS (its teams are others'; SWOS United ships it). Checked: each restart kind and the extra-time, shoot-out, silver-goal and second-leg starts CPU v CPU (SWOS_MOD_EVENT_LOG logs where a restart put the ball), the 8 packs read back from the setup's binary field for field, the categories screen drawn, compat unchanged.

For a fork's screens (2026-11-07): the mod offers the service challenges -- categories, list {category}, info {id} (every field, <key>\t<value> lines), play {id} (this mod's result screen, then won) -- and MODES -> CHALLENGES opens challenges-screens (open) when a mod offers it, its own screens otherwise. SWOS United's draws SWOS 2020's menus with it. Packs are read in file-name order ACROSS the mods (a pack's categories come where its file names put them: SWOS 2020's 01-... before challenges.json). A shoot-out challenge gives the keeper to the player (manualKeeper, SWOS 2020's "MANUAL GK CONTROL"). Progress of a challenge whose pack is off is kept as read and written back (it was dropped by the next save).

Format version 3 (2026-11-12): "unlock_after". A challenge's "unlock_after": [categories] (up to four) closes its whole category until every challenge of those categories is completed -- SWOS 2020's SWOS MASTERS, open once FIFA WORLD CUP, UEFA EURO CUP, ISS DELUXE and ISS 64 are done (its confirmCategory). Our list says LOCKED, and picking it "COMPLETE FIRST"; the service's categories line is <name>\t<done>\t<all>\t<closed>\t<needs>, closed 1 for "locked", 2 for waiting, needs the categories it waits for. The binary is version 3 (unlockAfter[4][32] at the record's end; 1 and 2 still read). The converter (pack 1.1) now writes SWOS 2020's screen as it was: SWOS MASTERS first and waiting for the four, EUROPEAN CUPS, DOMESTIC COMPETITIONS and FANTASY CUPS (never released there) left out -- 73 challenges in 5 categories. Checked: SWOS_MOD_MATCH_TEST=challenge:categories prints the service's lines (SWOS MASTERS 2 with no progress, 0 with the four completed); every pack through the binary and back, field for field. CLASSICS is a pack mod of its own (2026-11-12): challenge-classics (OpenSWOS's six, from HOLD ON to THE COMEBACK, the same file and ids: progress is kept), no longer inside the challenges mod, which is now the engine alone -- so a fork can do without the pack (PROJECT_OFF_MODS).

19. Team packs (2026-11-04)

Teams a mod brings: data_json/teampacks/*.json in the database's team format, numbers 150-249 (210-249 until 2026-11-09), made with scripts/make_team_pack.py (docs/TEAM_IDS.md §6). Engine, not a mod ("able to do more"): one lookup in the country-file search (src/team_packs.c), after which the team database, the matches and the online rule take them as the database's. A pack mod is "changes": "data". SWOS United's fun cup is the first user.


20. Competitions from mods; HISTORIC TOURNAMENTS (2026-11-04)

petarku's PR #11 (HISTORIC TOURNAMENTS, by the5ar) as a canonical mod, classics (src/mod_classics.c, bin/mods/classics), on the engine pieces of §3's split.

  • The row is the game's (src/mod_comps.c, MODPOINT_COMPETITIONS): ONE row above WORLD CUP in PRESET COMPETITION's world list (teams.c SelectTeamsFinalMenu; its tables hold 10 rows, so mods never get more than one). It carries the entry's label when one mod has an entry, MORE COMPETITIONS (a list) when more do. A marker in _leaguesPtrTable stands for it; the selection catches it before anything reads it as a competition.
  • The flow (include/mod_api.h, "competitions from mods"): the entry's select shows the mod's screens; one loads a file (ModApi_LoadCompetition: our JSON .DIY or the PC game's / SWOS 2020's, in any world, the player's options and USER tactics kept, every team COMPUTER, SAVE offering the file's name), may show its teams (ModApi_CompTeam*, MODCONTROL_*), and on PLAY calls ModApi_StartCompetition: the screens are left, the chooser closes, and PresetCompetitionMenu starts it as LOAD OLD COMPETITION's is (StartContest). Backing out: ModApi_UnloadCompetition.
  • Helpers it needed, for any mod: ModApi_MenuCurrentEntry, ModApi_MenuEntryRect / SetMenuEntryRect, ModApi_MenuNav4, ModApi_MenuColour, ModApi_MenuDisabled, ModApi_MenuRedraw, ModApi_ShowError, ModApi_ListFiles, ModApi_AssetsDir, ModApi_CompetitionFileName, ModApi_EntryLabel.
  • The cups (2026-11-05: in the mod). Insane's SWOS 2020 tournaments, with permission: every World Cup (1930-2026) and Euro (1960-2024, and the 2022 Women's Euro), the 2021 Africa Cup of Nations, Gold Cup and Copa America, and the 1991-96 European Cups and Champions Leagues. They are JSON .DIY (--convert-diy of the SWOS 2020 files), in mods/classics/classic/{uefa, worldcup,continental,club}/, each group with an index.json of names (scripts/make_classics_index.py, --check) so a list is shown without reading every file. The player's assets folder (classic/) is still read first; a file of the same name there wins. CONTINENTAL CUPS is a fourth button under NATIONAL. With no cups at all, no row. Its menus are the fork's, as the mod's JSON (classics.<name> handlers, literals for the fork's strings).
  • On the Amiga too (§30): the same JSON .DIY, read by the save format's reader, so the PC game's binary .DIY reader never runs there. Loading one takes about 2 s (16 teams) to 5 s (48) on an A1200.
  • Checked through the real menus (key script + captures): the row, CLUB's list, a SWOS 2020 cup's teams, a toggle (COMPUTER -> PLAYER-COACH), PLAY starting the league; the PC game's 14-team CANADA ROGERS CUP in three columns.

21. petarku's game modes: the match hooks (PR #3, 2026-11-04)

What petarku's (the5ar's) modes needed from the engine, as ModMatchSetup fields (include/mod_api.h) and fixed points in the match code, each a no-op unless a mod's match is being played: no online match, rig or recording meets them (check_netplay_compat.sh: 30 unchanged at NETPLAY_COMPAT 10).

Field What Where it acts
kickOffAlways (H1) kickOff's team takes every kick-off, after goals and each period PrepareForInitialKick, handleGoalScored (game_timers.c)
hideClock (H2) no clock on the screen UpdateTime
playMatchScreen (H3) the friendly's PLAY MATCH screen before kick-off ModMatch_SetupPlayers steps aside
manualKeeper (H4) at a penalty, a player's keeper dives where the stick is held (1: neutral = the game's, 2: neutral stands) UpdatePlayers shot_at_goal, GoalkeeperForceDiveAnim
shootoutOrder[2][10] (H5) the takers by line-up slot NextPenalty
restart (H6) the first kick-off is a corner, free kick or penalty instead PrepareForInitialKick -> GameTimers_ModRestart
pitchNumber (H7) the pitch's art 1..6, after its random numbers SetPitchTypeAndNumber
scorers[8] (H7) goals already in the scorer lists at kick-off (with score) ModMatch_KickOff, through GoalScored

Plus ModApi_TeamPlayer / ModApi_ChosenTeamPlayer (a squad by line-up slot: name, position, shirt, skills) for a mod's own squad screen. The restart is the engine's own: a corner as CheckIfBallOutOfPlay sets one, a free kick in tackle_foul.c's bands and quadrants, so it then plays as in any match.

manualKeeper in every match (petarku's fork has it at any penalty a human defends, online too) would be a TWEAK -- match rules online, a NETPLAY_COMPAT raise -- and is checked against SWOS2.s first (§4); not done.

Self-tests: SWOS_MOD_MATCH_TEST=hooks (2-1 at 40', a corner start, no clock, three preloaded scorers, pitch 3; seen on screen: the corner, the lists [mods] scorer list) and =order (a shoot-out by slots 1..10, logged per kick).

The challenges format (openswos-challenges, §18) reads them, each optional: "pitch_type" 0..6, "pitch_number" 1..6, "restart": {"kind": "kick_off"|"corner"|"free_kick"|"penalty", "team", "wing", "x", "y"} and "scorers": [{"team", "shirt", "minute", "penalty"}] (up to 8). Checked with openswos-78's collection pack: hold-your-nerve starts on Malta's corner at 80' with Italy's #9 in the scorer list (35').


22. Europe's league phases in 96/97 (PR #3's H8, 2026-11-04)

petarku's CHAMPIONS / EUROPA / CONFERENCE LEAGUE for 96/97 is a mod's data on the engine World 2026-27 already plays them with (src/league_phase.c: pots, country rules, tie-breaks).

  • The gate is the cups, not the world: the league phase plays when LeaguePhase_InstallCups installed records (a world's in World_InstallBaked, or a mod's), where it used to be "the world is not 96/97". Without a mod, 96/97 installs none and plays its own cups, as before.
  • ModApi_SetLeaguePhases(slug, cups[3], places, count, seeds) from the mod's init (the world is set later): the three records (CompetitionLeaguePhase), each country's places from the second season ({team file, CL, EL, UECL}) and the UEFA seeds of the qualifying rounds (WorldUefaSeeds, uefa_coef.h; NULL for none). Kept by LeaguePhase_SetModEurope; when the world is 96/97, World_InstallBaked installs them and World_LeaguePhaseCups / World_UefaSeeds answer with them (a world's own always win).
  • A career qualifies through the UEFA qualifying rounds when there are league phases, so a career needs the seeds; PRESET needs only the records, shown through the mod's own MODPOINT_COMPETITIONS entry. The data -- the 36-club tiers -- is the mod's, not the engine's.
  • The mod: canonical euro36 (src/mod_euro36.c, bin/mods/euro36; petarku's, by the5ar), off by default (the owner, 2026-11-05: 96/97 plays its original cups unless the player turns it on in OPTIONS -> MODS). Its clubs are petarku's curated tiers (scripts/euro36_tiers.json, written into src/mod_euro36_data.inc by scripts/make_euro36.py); the UEFA seeds a career draws on are DERIVED from the clubs' strength, the game's own metric, not real coefficients (the owner's choice). PRESET COMPETITION -> EUROPE then lists its three cups by their own names: the table is _europeTable, which LeaguePhase_InstallCups repoints. "career": never online. Rigs: off, as every default-on gameplay mod (§26).

23. SWOS 2020's modes: the rest of the match hooks (G5, G6, G9, G10, G13; 3.2)

What API Where
a break now, mid-match (G6: training's drills) ModApi_Restart(kind, team, wing, x, y) from matchFrame GameTimers_ModRestart
the final whistle with a winner (G10: golden / silver goal, a speedrun's target) ModApi_FinalWhistle(winner) _winningTeamPtr + EndOfGame, as a shoot-out ends
quick restarts, every carded foul a red, no slide tackles (G9) quickRestarts, straightReds, noTackles game_timers.c (both timers), tackle_foul.c, PlayerBeginTackling
the result banner or the player's name not drawn (G13) hideHud (MODHUD_RESULT, MODHUD_PLAYER_NAME) DrawQueuedSprites (picture only)
players who play but are not drawn (G5) ghosts[2] (a bit per line-up slot) DrawQueuedSprites (picture only)

The custom-challenge editor (map 3.2) is the challenges mod's: NEW CHALLENGE on its list (now in pages of six) chooses two teams on the friendly's screen, then the score, the minute, what winning is and who you are on the info screen's rows; SAVE AND PLAY writes it to the player's save/mods/challenges/custom.json in the challenges format (ids by ModApi_ChosenTeamUuid) and plays it. A player's own challenges never lock or are locked.


24. The news ticker -- SWOS United's, not OpenSWOS's (2026-11-05)

SWOS 2020's ticker is a mod of SWOS United's (its menus2020 has the ticker row; OpenSWOS's own menus have none), moved there on the owner's word: SWOS 2020's look and service belong to United, OpenSWOS keeps what any mod can use. What stays here are the pieces it is made of: a menu's "ticker_entry" (docs/MENUS.md §13), ModApi_MenuTickerEntry, ModApi_DrawText / ModApi_TextWidth and ModApi_RestoreMenuBackground. The mod as it was written here is in commit 0d924c1d (src/mod_ticker.c, bin/mods/ticker).


25. The online provider (H9)

The hook §13 asked for: a mod runs a project's online service at run time, where a fork used to compile its own online_account.c (PROJECT_ACCOUNTS, which still works and turns this off). ModApi_SetOnlineProvider(slug, &provider) from the mod's init: name, mmHost / mmPort (its matchmaker) and any of the account functions of include/online_account.h -- the log-in check, the web pages, RANKINGS / LEAGUES / MATCH LOGS / RANKED, OPEN's mode, the lobby's calls, matchPlayed. A field left NULL keeps OpenSWOS's answer (no accounts). The server the player typed on the log-in screen still wins over mmHost (and a test's SWOS_MM_HOST over both). Since 2026-11-07 it also has the newer account calls (chosenStyle, joinAllowed, playerInfo, cupLocked, lobbyClosed, matchTournament, showPlayer, teamImport*).

A fork's own online SCREENS (how they look, not the service): src/online_menus.c includes a fork's src/online_menus_fork.inc at its end when the file exists (OpenSWOS has none), and asks its online_menus_fork() for an OnlineMenusFork table -- MATCH MAKING drawn its own way (ownsMatchMaking, matchMakingDraw), a join request, CHOOSE GAMEPLAY's layout, the lobby's layout, rows, style name, status and chat colours, getting ready, a live match's start and end, MULTIPLAYER SETTINGS, its menus' handlers. Same translation unit, so the fork's code uses the file's helpers; each hook is optional. SWOS United's is SWOS 2020's table and lobby (Playaveli's work, 2026-11-07): a merge of OpenSWOS never meets it. The step before a full provider mod (§13).


25b. Menu backgrounds (the backgrounds mod)

A true-colour picture behind every menu (src/mod_backgrounds.c, bin/mods/backgrounds; canonical, on, with no picture of its own in OpenSWOS -- so nothing changes until there is one). [mod.backgrounds] image = a file in the mod's images/ or the player's game folder's backgrounds/ (Documents\SWOS\backgrounds), PNG, BMP or JPEG (stb_image, third_party), or off; not set, the first picture in the mod's images/ -- which is how a fork makes one its default (SWOS United ships SWOS_United.png there). The MODS page lists them ("choices_from" / "user_folder" in a setting: "off" and the image files of those folders, up to 8).

The engine's side (ModDef menuBackdrop): when the game loads a menu backdrop (menubg*, frontend.c LoadOverlayToFrontbuffer), a mod's picture makes the backdrop one KEY colour, MENU_BACKDROP_KEY 62 -- one of the backdrop's own (33-62), which no button, text or picture uses: measured on the main menu, the SWOS 2020 log-in and MODS. While the menus are up (ModApi_InMenus) the presenter shows the picture wherever the frame has the key: the GPU one draws it covering the window at full size and the frame over it with the key see-through; SDL's renderer puts its colours into the key's pixels at the game's own size. In a match or a replay the key is any colour: never shown there. Best made 1920 x 1080 (16:9) with what matters inside the centre 1440 x 1080, which a 4:3 window keeps -- it is cropped to the window's aspect, centred.

25c. PC menu shading (the dosmenus mod)

The menus' buttons shaded as the PC game shades them (src/mod_dosmenus.c, canonical, on by default since 2026-11-08 -- the owner, so F5 works out of the box; needs the PC game's grafs_dos/FILL.256, which the setup installs). The PC game (swos.asm DrawEmptyMenuItem) draws a box of menu colour c pixel by pixel as ramp menuItemColorTable[c] of its menu palette plus FILL.256's shade (0-31, a dithered gradient, dark bottom-left to bright top-right, 320 x 200) at that pixel; a 1-pixel line flat. Here the engine says which boxes it fills (ModDef menuFill, menuDrawBegin when the whole menu is drawn again: menu_system.c), and the mod paints, under the other mods (frameUnder), every pixel of those boxes that still has the box's colour in the PC game's colour for that place -- the 336 x 256 menu mapped onto the map. Text and pictures on a button have other colours: untouched. The palette's fades do not reach it (a fade-in shows the buttons at full colour). F5 switches between this and the Amiga's flat menus while the game runs (Playa's ask, 2026-11-08; §34), not remembered -- the mod being on is what the menus show.

Mods without a restart (2026-11-17)

The owner: "changing mods no longer requires a restart". A mod turned on or off on the MODS screen, or a setting changed on its page, is played at once (Mods_Reload, src/main.c): the list is read again (Mods_Init, as at start: --mods / SWOS_MODS_ENABLED / SWOS.ini, the arcade cabinet's) and every mod on is set up afresh (ModHooks_Reload): what the inits registered is cleared first -- MODES / COMPETITIONS rows (ModEntries_ResetForReload), services and hotkeys and a mod's shader preset (ModApi_ResetForReload: the run's SWOS_SHADER again), PLAY MATCH's (ModExtras_ResetForReload) -- then every init runs again, so a mod turned off leaves nothing and one turned on is as at start; menu handler tables are registered once per mod (kept: only that mod's menus name them); the match words are handed out again. Everything else was already live: each hook asks Mods_IsOn as it is called, a mod's own menus load when first shown, data reads go through the list as it is. Only from the menus (the MODS screen is under OPTIONS): never in a match or online.

What still needs the game started again (Mods_NeedsRestart): what is installed once at start -- a "career" or "data" mod, a Jaguar sprite set, a mod that saves into a career (careerSave / careerLoad), and any mod carrying files other than its pictures, shaders, clips, flags, pitch maps, challenges and its OWN menus (data_json/menus/<slug>/): competitions, teams, tactics, translations, the game's menus, graphics, sounds, music, a world. For those the screen says "... WHEN YOU LEAVE: THE GAME STARTS AGAIN", and EXIT starts the same program with the same arguments, the intro skipped, and closes this one (Main_Relaunch: desktops; the browser, phones and the Switch say "FROM THE NEXT START"). Of the canonical mods only euro36 is one.

SWOS_MOD_RELOAD_TEST=1 turns practice, speedrun and dosmenus off and on 40 times through Mods_Reload: each off with its MODES row gone, on with it back once, nothing refused or run out (MOD RELOAD TEST PASS).

26. The rigs play without gameplay mods

The rigs prove the original game, as they do with every tweak off (§4): under --replay-test (the replay corpus, the rollback and netplay rigs, check_netplay_compat.sh), --srp-resim and --career-golden, a canonical mod that is on by default is on only if its "changes" is cosmetic (Mods_SetRig, src/mods.c). A mod the run names itself (--mods=weather) is still on: that is a test asking for it. So a default-on career mod (openswos-78's euro36) leaves the golden careers as they are.

Galleries (2026-11-09): a mod of pictures only -- images/<title>.png|.bmp|.jpg and a mod.json, no code -- adds them to the choice: the page lists the images/ of every enabled mod (after the backgrounds mod's own, before the player's folder), sorted by name, each name once, up to 256; with more than a page's rows the setting opens a scrolling list (openswos/choiceMenu, --menu=openswos/choiceMenu:backgrounds:image to look at it). The picture is found in the same places. A choice is a file name, so two galleries' pictures of one name are one choice: name them apart. BMP is read as it is (stb_image); PNG or JPEG only makes the download smaller.

27. Career events and a mod's section of the career save (§8.5; Career+'s §3.4)

A career mod's ModDef has career hooks (include/mod_api.h). They run only while the mod is on, never on the Amiga, never in a match and never online. Unlike the other hooks, a career hook may change the career: its squads and its players, through the game's career code.

hook runs
careerNew() InitCareer: the new career's clubs set up, before its first InitializeNewSeason
careerSeasonEnd(season) the end of ContinueCareerNextSeason, after either job branch: the next season set up (season its index)
careerBeforeContinue() ContinueCareer, before the season's menu: may show a mod's menu (RETIREMENT NEWS)
competitionFinished(r) each title of the season end, as career_season.c decides it: every league division once its table is settled (before the moves are counted), the career country's main cup, its second and third cups, and the European cups' holders (after Career_UpdateUefaCupCompetitionSlot). r: the season, comp_id, ModCompKind, the division, the winner's team id. A title with no winner (0xFFFF) is not told.
playerMoved(m) a buy (Career_RemovePlayerAndAddAsTrialist: his club's slot -> your free slot) and a sale (Career_TransferPlayerAndAddReplacedToMarketPool: your slot -> the buyer's slot of the player he replaced)
playerCreated(c) a new player made by the game, who the hook may change: a trialist in the career club (Career_GenerateTrialistForTeamPlayer, and Career_ConvertPlayerToTrialistFromName for the training match's), and the player another club gets in place of the one you bought (MODPLAYER_REPLACEMENT) -- before that club's copy goes into the career pool

A squad's line-up changes only reorder the career club's index list (_currentMatchPlayers); a player keeps his slot in the team file, so they are not moves.

The save. A mod's careerSave(out) writes its object's members with ModJson_Printf (named fields, never addresses: CLAUDE.md); the career's JSON gets "mods": {"<slug>": {...}} after its last member, and only when a mod that is on wrote something, so a career without career mods saves as it always did (the golden careers). On load, after the career's pointers are rebuilt, each mod that is on gets careerLoad(json, len): its object, or NULL / 0 when the save has none (start its records empty). The loaded career's "mods" members are kept as their text: a mod that is off this session has its section written back unchanged at the next save, so turning Career+ off for a while loses none of the career's Career+ data; a mod that is on and has careerSave writes its own instead. A new career keeps none.


28. Rows in the career screens (Career+'s §3.5)

Four more points for ModApi_AddEntry (include/mod_api.h), each a row the game's screen shows only while a mod that is on has an entry there -- with the entry's label, or MORE (the list of them, ModApi_ShowEntries) when several mods have one -- and hides otherwise (always on the Amiga):

point the screen the row
MODPOINT_BUY_PLAYER TRANSFER MARKET -> BUY PLAYER entry 8, above EXIT; the five rows close up (local y 48-136) to make room
MODPOINT_TRANSFER_MARKET TRANSFER MARKET entry 31, beside BUY PLAYER (the two centred, 100 wide each)
MODPOINT_NATIONAL_ADD_PLAYER a national team's ADD PLAYER entry 4, under ABROAD
MODPOINT_COMPETITION_STATS a competition's STATISTICS entry 6, after WINNERS (or in its place when WINNERS is hidden)

Each is the menu's last entry, so every original entry keeps its number, and the screen's own init lays it out (ModRow_Show, include/menus.h): without an entry the screen is the original's.


29. A player's row in a list (playerRowDrawn; Career+'s §3.5)

ModDef.playerRowDrawn(row) runs when a player's row has been filled and before it is drawn, in three fills: a squad (SquadAfterDrawCommon, MODROWS_SQUAD: cells 46-63), PLAY MATCH's line-up (DrawPlayerEntries, MODROWS_PLAY_MATCH: cells 31-36) and every transfer screen's player row (BuildTransferPlayerMenuEntry, MODROWS_MARKET: 12 cells from the row's first) -- your transfer list, the domestic and foreign markets, another club's squad (BUY OTHER PLAYERS), an offer's players, VIEW SQUAD and a national squad. row says the team, the player's slot in its file (where the screen knows them: every one of these does except a market row with no player behind it) and the row; the hook rewrites cells with ModApi_MenuText (text it keeps) and may show, hide or move them. Display only: it changes no game state (Career+'s ratings, totals, ages and nationalities). For the text: ModApi_SquadGoalsView says which of a squad's views is shown (GOALS, or SKILLS), ModApi_NationalityCode a nationality's three letters as the game shows them.


30. Mod code on the Amiga (2026-11-05)

The owner: "we must add mod support for the Amiga after Career+". The built-in mods' code now builds into the Amiga binary too: one mod API, one set of hooks, the same src/mod_<slug>.c on both targets. Run-time loading of mod code (LoadSeg, a script language) is still not planned (§6).

What makes it build there:

  • A C library. The m68k toolchain has none (its only header is a three-line string.h). include/amiga_libc/ (stdio, stdlib, string, ctype, stdint) is on Makefile.amiga's -isystem path only, and src/amiga_libc.c is behind it: snprintf with flags, width and precision (no floating point -- none of the mods print one; 64-bit decimal without libgcc), malloc/free over swos_io_alloc (Exec, or WHDLoad's heap), strtol, qsort, the str* calls, and getenv = NULL. fprintf/printf go to _gAmigaLog, a 4 KB ring in .data that the harness reads (_gAmigaLogPos bytes written so far). It has no file calls on purpose: a mod's file goes through swos_io/resload, so the mod overlay and WHDLoad apply.
  • No JSON on the Amiga (2026-11-06; docs/DATA_BSON.md: JSON is too slow on a 68k -- the owner). What a mod brings as JSON for the PC, the Amiga gets as binary, made before it ever runs:
    • Menus are baked into the program. tools/menu_bake is a HOST program built from the same src/menu_load_json.c the SDL game reads menus with (MENU_BAKE: big-endian words, 4-byte pointer slots, and each slot recorded as a handler or string by name, or a literal's text). Makefile.amiga bakes every menu of a mod whose mod.json names the Amiga, plus the MODES list, into obj/menus_baked.c (include/menu_baked.h). MenuJson_Load there copies a baked menu and fills its slots: a mod's own handlers (ModApi_RegisterHandlers) and two of the game's symbols, SetExitMenuFlag and _aExit (add one to menu_resolve in that file when a mod names another). A new mod menu needs only a rebuild. The JSON menu builder is not in SWOS2.
    • A mod's data is converted by OpenSWOS Setup when it copies the mod into a drawer (SwosData_AmigaMod, tools/swosdata/lib/amiga_mod.c, with the game's own readers through lib/sd_json.c): data_json/challenges/<name>.json -> challenges/<NAME>.BIN (include/challenge_pack.h: one JSON reader for game and setup, src/challenge_pack.c) and classic/<group>/index.json -> INDEX.BIN (include/classics_index.h); the JSON and the mod's data_json/ are left out of the drawer. swosdata --amiga-mod DIR... does it by hand (the harness: run it on bin/mods/* -- its output is gitignored).
    • A mod's own records are fixed binary records there: speedrun's RECORDS.BIN, challenges' PROGRESS.BIN and the editor's CUSTOM.BIN (a challenge pack) -- big-endian, versioned (each file's layout is in its mod's header comment). The PC keeps their JSON.
    • Saves are the exception, for now: career, season and competition saves (and so the classics' tournaments, which are JSON .DIY) are the save format's JSON on both targets (the owner, 2026-11-06: leave them, measure first). Measured on the harness's A1200 (68020, 8 MB fast RAM): a career's 836 KB load takes 254 s, its save 14 s.
  • The hook sites in the game are no longer SDL-only, except where the hook itself is: the renderer's frameDrawn (no renderer: SDL_Renderer is an opaque type, so a ModDef is the same struct on both targets), the replay viewer's replayFrameBegin/replaySprite (no .SRP), LIVE CAST, the online provider, the menu extras and the OPTIONS -> MODS screen.
  • Mods start in mainC (src/SWOS.c) before the front end, after resload has read data/MODS.

What the API answers differently there (include/mod_api.h says so at each call):

the Amiga
ModApi_Ticks the VBlank count x 20 ms
settings (ModApi_Setting, SetSetting) no SWOS.ini: save/MODS.INI holds them, the same [mod.<slug>] sections, read when the mods start (never from inside a match frame) and written whole on each SetSetting
save files (ModApi_SaveFile/LoadFile) save/<slug>_<name>: resload makes no folders, and FFS names are 30 characters
ModApi_ListFiles Resload_ListDir: the mods' folders first
competitions JSON .DIY only (no DOS .DIY); no assets folder, no whole-match replay
teams no team database: ModApi_TeamByUuid is 0, so a mod gives the team's number too (ModApi_TeamByUuidNumber: taken when the uuid is the one derived from it, docs/TEAM_IDS.md -- one SHA-1, src/team_uuid.c); ModApi_ChosenTeamUuid derives a 96/97 team's; ModApi_TeamPlayer reads the team file
team packs, netplay, the ticker row none (0, ModMatch_Quiet 0, -1)
ModApi_PaletteColour/NearestColour not yet: they come with the first mod that draws there

Which mods: src/mods_builtin.c lists a mod with MOD_AMIGA once it builds and plays there, and MOD_SDL until then; its mod.json "targets" then includes "amiga", which OpenSWOS Setup reads to copy it into an Amiga drawer and list it in data/MODS. Ported: practice, euro36, speedrun, challenges (and the data mod challenge-collection: its files carry each team's number, "team": "5017", beside the uuid, and the editor writes it too), classics (its cups as JSON .DIY in the mod, checked below). Not yet, each for a reason of its own:

  • hair and weather: they draw pixels, and ModApi_Frame is the SDL build's chunky frame (a byte a pixel). The Amiga's screen is bitplanes, so a mod that draws needs a drawing API that knows them (and ModApi_PaletteColour from the copper list) -- its own piece of design. The rain draws through the renderer too. The drawer carries no data_json/ (its menus are baked).

Memory: against the build before it, 54 KB more code and 30 KB more BSS (the loader's scratch is allocated per menu on the Amiga; its tables are cut down there).

Checked (FS-UAE, A1200, data/MODS = practice): MODES on the main menu, its screen, PRACTICE's menu from the mod's folder, a DEMO GAME (a mod's match, CPU against CPU) played to its end and back to the practice menu, and TEAM TRAINING's menu; SPEEDRUN's screen and its records saved and read back; CHALLENGES' list from both mods' folders, HOLD ON's page, and its match kicking off at 70 minutes, Italy 1-0 Brazil; HISTORIC TOURNAMENTS from PRESET COMPETITION, its WORLD CUP list (22, from the index), the 1966 World Cup's 16 teams and its four groups as they were. The data checked in memory: the 1966 and 2026 World Cups loaded on the Amiga (ModApi_LoadCompetition from gdb) and written back with SaveJson_WriteDIY equal the same done on SDL in every named field; the only differences are the raw blobs' host byte order (the named fields correct them on load) and major_trophy_bonus_value, two bytes read as one host word (the same bytes on both). On SDL the mod tests are unchanged (SWOS_MOD_MATCH_TEST=1, shootout, speedrun:0/3, SWOS_SHOOTING_TEST), and so are the golden careers and check_netplay_compat.sh.


31. The career's players (src/mod_career.c; Career+'s §3.5)

Ten calls (include/mod_api.h) that go through the game's own career code, so what a mod does is kept, saved and shown as the game's own transfers are. A team is file << 8 | ordinal, a slot a player's place in the team's file (0-15; 0-31 for your club); each gives -1 outside a career or when it cannot.

call what it does
ModApi_CareerTeam(team, out) the club's 16 players as the career has them: its live copy (the current team, your club, the selected teams, the TMD pool), else its file's record with the career's pool on it, as GetTeamPointer gives -- but the team-file buffer a screen may be showing is put back as it was (Career_PeekTeam, TeamFile_PutAside/PutBack: allocated, as the Amiga keeps no second buffer), and an id with no team file gives -1 (LoadTeamFile halts on one, panic 0x8008)
ModApi_SetCareerPlayer(team, slot, player) another club's player becomes player for the rest of the career: the claim in the career's foreign pool (updated, or one added; -1 when the pool is full, foreign_pool_capacity) and every live copy (Career_WriteTeamPlayer). Never your club: its players change through the game's transfers
ModApi_OfferForPlayer(team, slot) the game's MAKE OFFER screen for that player, with BUY PLAYER's own tests first (time left to negotiate, room in the squad); 1 when the transfer was made. From a MODPOINT_BUY_PLAYER / MODPOINT_TRANSFER_MARKET entry the screen then closes as it does after the game's own buys
ModApi_CallUpPlayer(team, slot) a national selector's pick, from the MODPOINT_NATIONAL_ADD_PLAYER entry: refused as the squad screen greys players out (another nationality, already in the squad, unavailable); when the entry returns ADD PLAYER closes and the game adds him as HOME / ABROAD would, a full squad included (Career_AddInternationalPlayerPicked)
ModApi_CareerTeamName(team, out, cap) the club's name, found as ModApi_CareerTeam finds it (a 17-letter name has no NUL in the file; this one has)
ModApi_ViewedCompetition(&id, &league, &division) from a MODPOINT_COMPETITION_STATS entry: the contest that STATISTICS screen shows -- its id (as competitionFinished gives it), whether it is its country's league, and then its division; a cup otherwise (a continental league phase too). Read from _diyCompetitionStart as the WINNERS screen reads it (WorldWinners_Viewed)
ModApi_CareerClubs(each, ctx) every club of the career's countries (those with a league: no national team, no joke teams), each as ModApi_CareerTeam would give it -- team id, name, division, line-up order (playerNumbers), its 16 -- a team file at a time (Career_ForEachClub: read once and copied, so each may call the rest; the team-file buffer put back). About 1,500 clubs, about 2 s on a desktop: once a season, not every frame
ModApi_PlayerValue(player) his value in thousands, as the transfer screens show another club's player (_avgTeamValueBases[_avgTeamValues[price]])
ModApi_SetOwnPlayer(slot, player) your club's player at slot 0-31 (the reserves too) becomes player, a new man in his place (Career+'s retirements): the career squad and its live copies, its values marked to be worked out again (Career_WriteOwnPlayer). Not a national team's squad
ModApi_ListPlayer(slot) your player onto your transfer list: 1 when he is on it already (the game's own add does not check), -1 when the list is full (transfer_list_capacity) or the slot is empty

Both targets: on the Amiga, Career_PeekTeam asks resload whether data/team.NNN is there (Resload_FileSize) where the SDL build asks the data_json corpus, then the binary file.


32. The flags mod (2026-11-05)

flags (src/mod_flags.c, bin/mods/flags; canonical, cosmetic, on by default, SDL only) draws each team's flag beside its name on the result banner: kick-off, a goal, half and full time, as the owner's sketch had it.

  • Which flag: the world's own first -- worlds[<tag>]'s teams[] and, for a club, countries[] (World 2026-27's country 41 is Serbia's league, not Yugoslavia's; 1984-85's Yugoslavia, its clubs and its national team, SFR Yugoslavia's flag with the red star); then teams[], by the team's database id (the 143 national teams of 96/97: one renamed, or a custom team made from one, keeps its flag); then names[] when SWOS spells the country unlike the flag's file (HOLLAND -> Netherlands, REPUBLIC IRELAND -> Ireland, WEST GERMANY -> Germany, CZECHOSLOVAKIA -> the Czech flag, SERBIA-MONT. -> Yugoslavia...), else the file with the name's letters (GREECE -> Greece), else, for a club, the flag of the country it plays for (countries[], by World_FileCountry: a world's second team file is its country's; World 2026-27's new countries -- Andorra, Kosovo, Qatar... -- are there by their numbers). Every 96/97 national team and club country has one, and so does every team of the historic tournaments: SOVIET UNION, EAST GERMANY, ZAIRE, C.I.S. and both Yugoslavias (96/97's the plain FR Yugoslavia tricolour -- GoSquared's had a chequered shield that read as Croatia's, a player's report of 2026-11-25) are OpenSWOS's own drawings at the set's size (scripts/draw_extra_flags.py), DUTCH E. INDIES plays under the Dutch flag and GUADELOUPE under the French. A BMP of a name in a mod's flags/ adds or replaces one. A competition's own teams (a .DIY's, file 72) go by name only.
  • The art: GoSquared's 24-pixel flag set (MIT, LICENSE_Flags.txt in the mod), each flag the icon's 22 x 16 middle, in true colour through the renderer (frameDrawn, over the HUD).
  • API it added (include/mod_api.h): ModApi_MatchTeam (the banner's two teams: name, file and ordinal) and ModApi_ResultBanner (whether it is up, its box, its names' row).
  • Checked: SWOS_MOD_MATCH_TEST=1 SWOS_MOD_MATCH_TEAMS=5012,5013 (Greece v Holland) with SWOS_PRESENT_CAPTURE: both flags at the banner's ends, level with the names.

33. Services: what one mod offers others (2026-11-07)

A mod registers a service by name (ModApi_RegisterService) and any mod calls it (ModApi_CallService(name, method, args JSON, out, cap)): -1 none, 0 done (out the answer), 1 pending. A build without the mod has no service, so the mod that calls it works as before: a fork ADDS a service, the calling mod stays the one both projects share. A call never waits on a network -- a method that needs one answers 1 until its answer has come (the caller asks again as its menu draws), and a result sent is queued and sent in the background. Never from inside a match frame.

"online-records" (offered by SWOS United's online-records mod, on SWOS 2020's servers -- its SWOS-API): the online side of two mods both projects have.

caller method args answer
challenges (list) challenges.completed {} the player's beaten challenges, <category>\t<name> a line -- marked done here too
challenges (a page) challenges.stats {"id","name","category"} a line for the page's ONLINE row
challenges (a win) challenges.won the same -- (sent)
speedrun (a run) speedrun.finished {"target","key","done","frames","ms","style","yours","theirs","teams"} -- (sent)
speedrun (the result) speedrun.line {"target","style"} the result screen's bottom line

A challenge is known online by its name and its pack's "category" (SWOS 2020's were). A speedrun's target is SWOS 2020's game mode (the eight in the same order); yours/theirs are each team's skill points (its sixteen players' seven skills), by which SWOS 2020 sets a run's difficulty.

34. Hotkeys (2026-11-08)

A mod may have keys of its own: ModApi_AddHotkey(slug, "F5", "what it does", fn) from its init (SDL builds; include/mod_api.h). The key is named as SDL names it, and is the mod's CHOICE: the player can move it or switch it off in SWOS.ini -- [mod.<slug>] hotkey = F7 / off.

  • Which keys: only the ones the game leaves alone -- F1, F4, F5, F6, F7, F8, F10, Insert, Home, End, Page Up/Down, Scroll Lock, Pause. Refused: F2 (the arcade's service menu), F3 (the match chat), F9/F11/F12 (screenshots), the letters and digits (play, the menus, typing), and a key another mod already has (the first to ask keeps it; the log says who).
  • When: pressed alone (no Ctrl/Alt/Shift/GUI), not repeating, and not while a name is typed; anywhere -- menus or match. The game never sees a mod's key (platform_sdl.c asks ModApi_Hotkey first).
  • What a handler may do: change what is DRAWN, nothing else -- it works during an online match, on one machine only, so anything that touched the match would part the two games.

The first: dosmenus' F5 (§25c), switching the menus between the PC's shading and the Amiga's.

A mod's message the player answers: ModApi_ShowDialog(title, text, buttons, count, default) -- the game's own dialog screen (docs/MENUS.md §14), from the menus, never during a match.

35. SWOS 2020's match extras (2026-11-09, the SWOS 2020 port)

Seven of SWOS 2020's in-match features, as hooks in the engine (src/mod_extras.c, the "match extras" block at the end of include/mod_api.h) and canonical mods (all SDL). What changes how a match plays happens only in ModApi_OfflineMatch() -- a match that is not online and not a rig's (the replay and rollback rigs, --srp-resim, the career autopilot), as Tweaks_On decides it -- so scripts/check_netplay_compat.sh and the rigs see the game unchanged.

Mod / place SWOS 2020's What On by default Test
autoplay (modes) F1 AUTOPLAY (game.cpp toggleAutoPlayMode) F1 in a player v CPU match: the CPU plays the player's team until F1 again; "AUTO-PLAY" at 15, 25. Not in a mod's match (training, shoot-out, speedrun, challenges), never online yes SWOS_AUTOPLAY_TEST=1
balltrails (cosmetic) --ball-trails (drawSprites) five discs behind the loose, moving ball, colour 121, under it no SWOS_MOD_MATCH_TEST=1 SWOS_BALLTRAILS_TEST=1
practice, setting radar RADAR IN TEAM TRAINING (render.cpp showRadar) TEAM TRAINING's pitch at a tenth, top left: lines, players in their shirts' colours, the ball on SWOS_PRACTICE_TRAINING_TEST=1 (fails when it was not drawn)
pitchselect (modes) SELECT PITCH (menu.cpp showPitchSelectMenu) PLAY MATCH (first player's screen, not VIEW RESULT or training) asks PITCH 1-5, TRAINING PITCH or RANDOM (1-5). Its menu bin/mods/pitchselect/data_json/menus/pitchselect/selectPitchMenu.json, imported from selectPitchNonWidescreen.mnu. The pitch preview beside the list is not drawn no SWOS_PITCHSELECT_TEST=1..6
netstats (cosmetic) F7 frame-fairness strip (mpgame.cpp drawImGui, ConnectionQualityTracker) online: rollback timeline, balance bar, advantage, jitter, why it warns; F7 (a hotkey) cycles WHEN POOR / ALWAYS / NEVER ([mod.netstats] show) yes SWOS_NETSTATS_TEST=1 prints at a live match's end (not run headless)
src/match_chat.c CHAT WINDOW SCALE (F11/F12), AUTO CLOSE CHATBOX [chat] scale 0..8 (1x .. 5x), Page Up / Page Down in an online match (F11/F12 are screenshots here); [chat] auto_close 1..5 s (was a fixed 6) 1x, 5 s --chat-selftest
scoreboard (cosmetic) --new-scoreboard=1..4 (the clock + score corner, showTeamIcons) the clock, both kits and the score on a darkened box at a corner ([mod.scoreboard] corner: top-left, top-right, bottom-left, bottom-right); the game's clock not drawn; at the top left the player's name 7 lower no SWOS_MOD_MATCH_TEST=1 SWOS_SCOREBOARD_TEST=1
display2020 (cosmetic; launcher options, agent B) --new-show-result, --remove-darken-banner (render.cpp showTeamIconsLarge, drawDarkenRect) Playaveli's SWOS United mod, same slug and uuid: [mod.display2020] kits (each side's kit under its name on the result) and band = smooth / game / off (the result band evenly darkened, the game's grid, none); its scoreboard is the scoreboard mod's. Also rows on SETTINGS -> DISPLAY (docs/SETTINGS.md) no SWOS_MODS_ENABLED=display2020 SWOS_MOD_MATCH_TEST=1 SWOS_DISPLAY2020_TEST=1

The hooks, for any mod: ModApi_Ball (the ball's place, step, speed, loose), ModApi_SpriteKind (a spriteDraw sprite is the ball / the HUD clock / the player's name), ModApi_SetTeamControl / ModApi_TeamControl (who plays a team from now; every team its own again at the final whistle and the next kick-off), ModApi_SetMatchPitch / ModApi_PitchNumber (the next match's pitch art; after SetPitchTypeAndNumber's random numbers, so the generators are untouched; spent at the final whistle; a mod match's pitchNumber wins), ModApi_OnPlayMatch (PLAY MATCH pressed, play_match_menu.c PlayMatchSelected, may show a menu), ModApi_NetStats (ping, jitter, GGPO's frames behind both ways, the delay, rollbacks -- by size, from cbLoad -- and holds; NetplayMatch_Stats, read only), ModApi_OfflineMatch, ModApi_AnyModMatch.

For a MULTIPLAYER settings row: MatchChat_Scale/SetScale, MatchChat_AutoClose/SetAutoClose (include/match_chat.h), kept in PlatformInitOptions.chat_scale / chat_auto_close.

SWOS 2020 port: challenges, speedrun, the file lists and after the match (2026-11-09)

The rest of SWOS 2020's challenges and speedrun screens, ported faithfully (its menus imported with scripts/import_swos2020_menus.py, its handlers from game.cpp / replaysMenu.cpp):

  • Custom challenge editor (challenges mod, src/mod_challenges.c): SWOS 2020's DESIGN SCENARIO (customChallengesEditMenu.json) over the challenge format's own fields -- teams (the friendly's team screen: both, and who plays each), its name (typed: ModApi_MenuInputText, the game's InputText), the score, the minute (-10 -1 0 +1 +10), the first leg, extra time / penalties / a direct shoot-out, substitutes, the direction, the pitch, the starting event and its taker, the win condition (any score, at least a draw, golden / silver goal), difficulty; TEST (played once, no attempt or progress kept), SAVE, DELETE, EXIT -- with SWOS 2020's rules between them (setTotalScoresToSame, kick-off minutes, 120 = a shoot-out). SET CARDS AND INJURIES is customChallengesSentOffInjuryNewMenu.json (each side's sixteen by shirt; at most 4 sent off and -- the format's limit -- 8 injured a team; the goalkeeper never). EDIT on one of the player's own opens it again. The format gains the restart kind "random" (SWOS 2020's RANDOM starting event: one of six drawn at PLAY); no record layout changed. Not ported: UNIFORMS (a challenge keeps no kits), PITCH SET (SWOS 2020's own pitch art) and CPU INJURY (switched off in SWOS 2020 itself). Test: HOME=<scratch> SWOS_MOD_MATCH_TEST=challenge:editor.
  • SORT BY under the player's own challenges (customChallengesSortByMenu.json): date (newest first), team, creator / team, creator / level, level -- [mod.challenges] sort. Ours carry no creator's name: CREATOR puts the player's own before those fetched for them.
  • CHANGE TACTICS after a try (SWOS 2020's retryExitEx), beside QUICK RETRY: the match again with the PLAY MATCH screen first (ModMatchSetup.playMatchScreen).
  • Speedrun difficulty (speedrun mod): selectSpeedrunDifficultyMenu.json after a target -- FREE TEAM CHOICE or one of the five PRECONFIGURED TEAMS pairs, BEGINNER .. MASTER, with its trophies and stars; the card targets go straight to the teams (SWOS 2020's card picker had only SELECT TEAMS); LEADERBOARD (its server) hidden. Test: SWOS_SPEEDRUN_TEST_PICKER=1 SWOS_MOD_MATCH_TEST=speedrun:<n>.
  • Speedrun on the pitch: SWOS 2020's showSpeedrunTimerInfo -- the run's time top left where the clock was (the clock hidden), the target and the difficulty (a free choice's by the skill points) top right -- and, once the result panel has gone at full time, showSpeedrunShowResult's band: SPEEDRUN COMPLETED and the time, or SPEEDRUN FAILED. Drawn into the match frame (matchDrawn, SDL). It replaces report 0060's HUD, keeping its purpose.
  • ModApi_DrawMap / ModApi_DrawMapAtEntry (src/mod_menu_tools.c): SWOS 2020's small pictures (drawMapEx, drawMapExHalf) from a mod's pixmaps.txt, which scripts/extract_swos2020_pixmaps.py now writes per mod (--mod).
  • File list SORT OPTION (core, src/file_io.c): SORTED BY NAME / SORTED BY DATE beside ABORT on the LOAD and SAVE screens (entry 51 of the select files menu, compiled and JSON alike) -- by name, the game's own order and the default, or each extension's newest first. [general] file_sort = name | date. SDL (the Amiga's listing has no dates: the button is hidden there).
  • QUICK ACCESS after a friendly (core, src/quick_access.c, bin/data_json/menus/openswos/quickAccessMenu.json): SAVE HIGHLIGHTS (SWOS 2020's SAVE AND SHARE: sharing needs its server), FULL MATCH REPLAYS (LATEST.SRP in the highlights viewer), CONTINUE. Off by default, as SWOS 2020 shipped it: [general] quick_access = true. SDL.

Retro Palettes: the paletteq mod (2026-11-09)

src/mod_paletteq.c, bin/mods/paletteq (canonical, cosmetic, SDL, off by default): the picture in an old machine's colours through OpenSWOS's own slang shader, shaders/paletteq.slang -- the method of Jungool's C64 mode: each game pixel taken whole (the pass draws at the window's size and every screen pixel reads the game pixel it lies in, so the blocks stay hard-edged), a 4x4 Bayer dither fixed to the game's pixel grid (a scrolling pitch keeps its pattern), then one read of a lookup strip (PALETTE_LUT, N tiles of N x N: red across, green down, blue the tile; N is its height) that holds every colour's nearest palette colour.

Settings: Palette -- amiga-ecs (the OCS/ECS colour space, 4,096 colours), amiga-aga (SWOS's own AGA palette, from src/swos_amiga_data_imports.c), dos-vga (the VGA BIOS's mode 13h palette), c64 (Colodore), nes, master-system (6-bit RGB), mega-drive (9-bit RGB), game-boy, virtual-boy, atari-secam, amstrad-cpc, zx-spectrum, msx (TMS9918), intellivision (Wikipedia's YIQ table), super-cassette-vision, odyssey2 (RGBI), cga, pico-8; Dither on / off; Dither strength auto (the palette's own: little for 4,096 colours, much for 4), low, medium, high (the shader's DITHER). The GPU presenter only. One preset draws the picture: with retrotv on as well, this one shows.

The strips and the presets are made by scripts/make_paletteq.sh with scripts/palette_to_lut.py (from Jungool, with OpenSWOS's palettes added: the ECS gamut and the VGA palette by rule, SWOS's AGA palette read from the source, the consoles from Wikipedia's List of video game console palettes): by CIEDE2000 -- the weighted RGB distance lost the hue (the NES and PICO-8 pitches came out brown and orange) -- but CGA, whose green pitch is white by hue and the remembered cyan-and-magenta dither by brightness. A palette: its colours in palette_to_lut.py, a line in make_paletteq.sh, a row in mod_paletteq.c's table and mod.json's choices. Checked: --slang-selftest compiles the preset for GLSL 410 / ES 300, Metal and HLSL; the algorithm run on a match frame for every palette (by eye).

36. Gameplay mods: rules in the match state; the arcade mod (2026-11-12)

The first canonical gameplay mod is arcade (src/mod_arcade.c, docs/ARCADE.md "Game modes -- the arcade mod"): the arcade cabinet's game modes (GOLDEN GOAL so far) played in any friendly. The owner's decision, 2026-11-12: the cabinet stays in the core and uses the mod; the modes and their rules are the mod's. What it needed of the engine is general -- any mod that changes how a match plays uses the same:

what how where
state of its own in the match ModDef.matchWords (n 32-bit words), ModApi_MatchState(slug, &n) g_modMatchWords (src/mod_hooks.c, 32 words between the mods that are on), a SIM_OPTIONAL region of src/sim_state.c: saved and loaded by a rollback, sent in a resync and the lobby's kick-off state, recorded in a .SRP. Handed out at start-up, in the built-in list's order, only to a mod that is on and whose "changes" is gameplay / data -- both online players have the same such mods, so the same words are the same mod's. With no such mod on the region is not there at all: not in the state, its hash, nor the layout hash the handshake and the recordings compare -- a build with it off is, online, the build it always was
rules decided where a friendly is set up ModDef.friendlyRules(ModFriendlyRules *out) offline at InitAndPlayGame (the FRIENDLY menu's, the cabinet's, a mod's own ModApi_PlayMatch; not training); online on the HOST in NetplayLobby_Start, for a single friendly (lobby mode FRIENDLY, no legs), before the setup and the kick-off state are taken. The mod arms its words from the player's settings and asks the setup for the slowest clock and/or its replays (ModFriendlyRules); the game puts the player's own GAME LENGTH / AUTO REPLAYS back after the match. Never on the joiner, nor for a recording played again
the match's name ModDef.matchName() InitAndPlayGame, every machine, from the words: the stadium's title in place of FRIENDLY
the rules, each frame ModDef.matchStep() src/game_loop.c, after the clock, on every frame simulated -- an online match's re-simulations too (unlike matchFrame): the one hook that may change the match, through ModApi_EndMatch, ModApi_StartShootout; it reads where the match is with ModApi_MatchPhase (in play, a shoot-out, a goal's celebration, a replay) and ModApi_Score

The words are cleared before each offline friendly is set up, before the host offers a match, and after every friendly, so a cup, a league or a career match never sees them set.

Online, the host's settings are the match's -- without a word on the wire: the host's words travel in the kick-off state the START message already carries (both players load it before the match is set up), the slow clock and the replays in the setup it already carries. The joiner's own settings are never read. If the host has no kick-off state to send, it clears its words, so the two play the same (plain) rules. Both players need the mod alike (§17's signature); a new mode or rule is a new version. NETPLAY_COMPAT was not raised: nothing on the wire changed, and a plain match is bit for bit what it was (check_netplay_compat.sh unchanged).

The rigs play without it (§26: a gameplay mod is off in a rig unless the run names it). A recording of an online arcade friendly plays again with --srp-resim=<file> --mods=arcade (the layout hash then includes the words).

SWOS_MOD_MATCH_TEST=arcade[:seconds] (--mods=arcade, SWOS_HARNESS_TURBO=1 SWOS_SKIP_INTRO=1) plays one GOLDEN GOAL friendly CPU v CPU headless and passes when the rules decided it: a golden goal or, level at the limit, a shoot-out.

37. The PC cutscenes: the dosvideos mod and careerEvent (2026-11-12)

dosvideos ("PC cutscenes", canonical, "changes": "cosmetic", "targets": ["sdl"], on by default as dosmenus is: with no PC data it plays nothing; src/mod_dosvideos.c) plays the PC game's career cutscenes -- FLIC clips, decoded by our own src/flic.c -- at the moments the PC game plays them. The clips, their sounds, the decoder and how a clip is shown: docs/DOS_VIDEO.md.

The hook. ModDef careerEvent(const ModCareerEvent *) (include/mod_api.h; ModHooks_CareerEvent, core, both targets -- nothing on the Amiga listens), told where swos.asm calls its cutscenes. Display only: what runs there may show something and wait for the player, never change the career, its saves or the game's random numbers.

kind our place the PC game's (swos.asm) the clip
MODCAREER_MATCH DIY_PlayOrSimulateLeagueFixture's end (src/diy_competition.c, career_result_event) cseg_88A12's end (cseg_89147, ~121465): selTeamNumber != -1, the mode it was called with (dseg_180586) not RESULT, not the off-season (dseg_10E848), won or lost by 3+ WIN / LOSE, the first time and then every third such result (dseg_180588)
MODCAREER_CUP_FINAL DIY_PlayCupMatchAndAdvance, the winner decided (and, hasGroups 2, each stage's end) cseg_28E76's cseg_295B0 (~30075): [esi+47h] -- hasGroups -- 0 or 2, the same career/mode/off-season tests, not a draw WCUP / LCUP
MODCAREER_NEW_SEASON ContinueCareerNextSeason (src/career_init.c), staying, before InitializeNewSeason PlayNewSeasonAnimations (~102208), from ContinueCareerNextSeason's no-job branch WCUP if playWinCupAnimation, else PROM if promoted, else RELE if relegated
MODCAREER_CHAIRMAN ShowChairmanMessage (src/chairman_memo.c), before the memo's menu PlayChairmanScene (~82804), the first thing ShowChairmanMessage does CH<n>_<id> / CHP_<id>, id = dseg_17BB14[currentMessage]

The PC game tests the career team in each: WIN when the winner is careerTeam, LOSE otherwise -- ours tells only results with the career team in them (a career's played or watched match always has it). A cup final drawn and decided on penalties plays nothing (the match's goals are equal), as in the PC game.

The rules the mod keeps (its own, in memory -- display only):

  • The result counter (dseg_180588): -1 at a new career (InitNewSeason, from the new career's menu: ours careerNew), never saved -- the PC game does not reset it on a load, nor do we. A 3+ result with -1 plays and sets 3; else it counts down and plays at 0, setting 3 again.
  • The chairman's scenes (PlayChairmanScene): only with the CHAIRMAN SCENES option on (here the mod's "Chairman scenes", on: SetDefaultOptions sets g_chairmanScenes = ON) and the sound on; memo 0 has no scene; scene ids 24-26 -- memos 24-26, the frequent ones: TRIAL_PLAYER_LEFT_CLUB, RESERVE_PLAYER_LEFT_CLUB, PLAYER_JOINED_CLUB_ON_TRIAL -- only every fourth time (dseg_17BB8E, never saved).
  • Which of the three chairmen (chairmanIndex, CH1..CH3, voices ECA..ECC): picked again at every welcome memo (19, 20, 33, 34: ShowGreetingMessage / ShowLastSeasonMessage) as (rand & 7) / 3, never the one before -- the PC game with Rand2, the mod with a generator of its own (never the game's). The PC game kept chairmanIndex in the career file; we save nothing, so a loaded career starts with the first chairman until its next welcome memo.
  • A national team's memos (27-38) are the president's: CHP_<id>, a frame every 6/70 s.

Settings ([mod.dosvideos]): room (Dressing room: WIN, LOSE, WCUP, LCUP, PROM, RELE), chairman (Chairman scenes) and, since 1.1 (2026-11-14), hd (Upscaled clips: a clip's video_dos/hd/<name>.mpg in place of its picture when there is one -- docs/DOS_VIDEO.md, "The upscaled clips"), all on by default.

Never played (ModApi_CutsceneBlocked): under the career autopilot (the golden careers), a rig (--replay-test, --srp-resim, --career-golden), online, in a match, with no sound, with the intro skipped (the PC game's skipIntro: SWOS_SKIP_INTRO, [general] skip_intro), or with no window. The counters still count (the PC game counts before it looks at skipIntro). Each moment logs one line: [dosvideos] <clip>: <why> (...), ... -- not played (<rule>), or the count.

Checked: SWOS_DOSVIDEO_TEST=rules runs the rules on made-up events (21 checks: the counter's 1st and 4th, the cup final drawn, the season's order, the scenes' every fourth, the president's, 300 welcome memos never giving the same chairman twice) -- DOSVIDEOS RULES PASS. SWOS_DOSVIDEO_TEST=<clip>,... plays clips at the main menu. scripts/career_golden_test.sh passes unchanged with the mod on (it is cosmetic, so on in the rig): its careers tell the mod their moments -- the chairmen's scenes, WCUP / PROM / RELE at the seasons' ends -- and it plays none ("not played (the career autopilot)"). SWOS_DOSVIDEO_TEST=career lets the autopilot's moments play: ENG1-WOLVES, two seasons, 32 chairman's scenes played inside the career's own flow, and its three season saves the golden record's byte for byte. The autopilot answers RESULT for every fixture, so it never reaches MATCH or CUP_FINAL (a played or watched match): those two are checked by the rules test and by reading, not yet in a played career.