Map: TpF3 overtaking mod #1

Open
opened 2026-10-04 19:51:53 +00:00 by haylan · 1 comment
Owner

Destination

A proven dev environment and a feasibility verdict for a Transport Fever 3 script-mod that lets cars overtake slower or lower-priority vehicles: the mechanism chosen, tooling and VS Code setup settled, the repo junctioned into the game as the mod, and an AI-assisted workflow proven with a hello-world mod. The overtaking behaviour spec itself comes after this map.

Notes

Decisions so far

  • Can TpF3 scripting make cars overtake? — not feasible with the documented API; scripts can read vehicle state but no command sets lane, path position or speed, so only indirect approximations remain. Findings on branch research/overtake-feasibility.

  • What is the TpF3 mod tooling and mod structure? — Teal over Lua; entry points preRunFn/runFn/postRunFn wired in mod.json as <modid>::<file>@<fn>; debug via debugMode=true and debugPrint; VS Code with sumneko.lua + pdesaulniers.vscode-teal. Gaps: Teal workspace config, whether print reaches stdout.txt, how .tl compiles. Findings and offline docs on pushed branch research/mod-tooling.

  • Which fallback mechanism to pursue for overtaking? — visual pass-through of the blocker; multilane same-direction roads pass freely, two-way roads need an oncoming-traffic check; probe in game first, then custom lane definitions as the last avenue, else a negative verdict.

  • Locate the TpF3 install and junction the repo as a mod — game at D:/SteamLibrary/steamapps/common/Transport Fever 3; mod/ junctioned into the userdata staging_area as haylan_tf3_overtake; game ships a vscode-template for Teal type definitions.

  • Set up VS Code and the AI workflow for the mod — Teal config at repo root (committed template + gitignored local copy); install vscode-teal and tl (type-check only); offline docs + tealdef read access + a Modding section in CLAUDE.md; initial commit on main merging both research branches (push left to the human). Applied by the follow-up setup task.

  • Apply the VS Code and AI workflow setup — done: vscode-teal installed; tl 0.24.8 (on Lua 5.4) type-checks against the game's tealdef; main has history with both research branches merged (unpushed); Modding section in CLAUDE.md.

  • Hello-world mod loads in game — pipeline proven: game loads .tl directly (no build step), print reaches stdout.txt (agent reads it at <Steam>/userdata/<id>/3493540/local/crash_dump/stdout.txt), preRunFn on mod load, postRunFn on game start; modId kept equal to the folder name (mismatch untested).

  • Probe vehicle data and native passing in game — no native passing on any road. The read API gives segment, lane, direction and speed (blocked is useless). Nothing documented bypasses blocking. The engine switches lanes only at segment boundaries. Decision: drop two-way roads, pursue a lane switch on multilane roads. Findings on branch prototype/vehicle-probe.

  • Can rebuilding a road segment move a passer past its blocker?: no. replaceSegment rebuilds work, but on single-lane roads the vehicles keep their gap, lane and order. On multilane roads the leader moved lanes afterwards (passed on to the multilane ticket). Engine-thread scripts can't send debug commands or get callbacks; the GUI thread can.

  • Can a script swap the positions of a follower and its leader?: no. The debug component exchange refuses MovePath on both threads, and no command writes a line vehicle's position (teleport only to depots). No script mechanism overtakes on single-lane roads.

Not yet specified

  • Mod architecture: file layout, script entry points, how a speed/priority comparison is exposed (depends on the chosen mechanism).
  • How to test and debug behaviour in-game (logging, test saves).

Out of scope

  • Trains (later effort).
  • Publishing to mod.io (TpF3 has no Steam Workshop; mod.io is the official in-game mod browser — terms in docs/research/modio-terms.md).
  • The detailed overtaking behaviour spec.
  • The fake-car hack (despawn a real car and animate a custom entity past the blocker): heavy, unproven for road vehicles.
  • Non-player vehicles.
## Destination A proven dev environment and a feasibility verdict for a Transport Fever 3 script-mod that lets cars overtake slower or lower-priority vehicles: the mechanism chosen, tooling and VS Code setup settled, the repo junctioned into the game as the mod, and an AI-assisted workflow proven with a hello-world mod. The overtaking behaviour spec itself comes after this map. ## Notes - Domain: Transport Fever 3 modding (script-mods, Teal/Lua; see `.examples/ug_tf3_example_config_change`, whose script is `mod.script.tl`). Vocabulary in `CONTEXT.md`. - Sources: https://wiki.transportfever3.com/doku.php?id=modding:tools:external, https://wiki.transportfever3.com/doku.php?id=modding:scripting:modifiersfilters, https://wiki.transportfever3.com/script-doc/ - The repo contains the mod: `mod/` is junctioned into the game's `staging_area` as `haylan_tf3_overtake`; no build step unless research says otherwise. - Docs captured into the repo so the AI can read them offline. - Cars first, player-owned vehicles only. Overtaking is a visual illusion (the passer drives through the blocker). - Plan, don't do: the hello-world mod and the in-game probe are the only build work, as a Task and a Prototype. ## Decisions so far - [Can TpF3 scripting make cars overtake?](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/2) — not feasible with the documented API; scripts can read vehicle state but no command sets lane, path position or speed, so only indirect approximations remain. Findings on branch `research/overtake-feasibility`. - [What is the TpF3 mod tooling and mod structure?](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/3) — Teal over Lua; entry points `preRunFn`/`runFn`/`postRunFn` wired in `mod.json` as `<modid>::<file>@<fn>`; debug via `debugMode=true` and `debugPrint`; VS Code with `sumneko.lua` + `pdesaulniers.vscode-teal`. Gaps: Teal workspace config, whether `print` reaches `stdout.txt`, how `.tl` compiles. Findings and offline docs on pushed branch `research/mod-tooling`. - [Which fallback mechanism to pursue for overtaking?](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/7) — visual pass-through of the blocker; multilane same-direction roads pass freely, two-way roads need an oncoming-traffic check; probe in game first, then custom lane definitions as the last avenue, else a negative verdict. - [Locate the TpF3 install and junction the repo as a mod](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/4) — game at `D:/SteamLibrary/steamapps/common/Transport Fever 3`; `mod/` junctioned into the userdata `staging_area` as `haylan_tf3_overtake`; game ships a `vscode-template` for Teal type definitions. - [Set up VS Code and the AI workflow for the mod](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/5) — Teal config at repo root (committed template + gitignored local copy); install vscode-teal and `tl` (type-check only); offline docs + tealdef read access + a Modding section in CLAUDE.md; initial commit on main merging both research branches (push left to the human). Applied by the follow-up setup task. - [Apply the VS Code and AI workflow setup](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/9) — done: vscode-teal installed; `tl` 0.24.8 (on Lua 5.4) type-checks against the game's tealdef; `main` has history with both research branches merged (unpushed); Modding section in CLAUDE.md. - [Hello-world mod loads in game](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/6) — pipeline proven: game loads `.tl` directly (no build step), `print` reaches `stdout.txt` (agent reads it at `<Steam>/userdata/<id>/3493540/local/crash_dump/stdout.txt`), preRunFn on mod load, postRunFn on game start; modId kept equal to the folder name (mismatch untested). - [Probe vehicle data and native passing in game](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/8) — no native passing on any road. The read API gives segment, lane, direction and speed (`blocked` is useless). Nothing documented bypasses blocking. The engine switches lanes only at segment boundaries. Decision: drop two-way roads, pursue a lane switch on multilane roads. Findings on branch prototype/vehicle-probe. - [Can rebuilding a road segment move a passer past its blocker?](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/11): no. `replaceSegment` rebuilds work, but on single-lane roads the vehicles keep their gap, lane and order. On multilane roads the leader moved lanes afterwards (passed on to the multilane ticket). Engine-thread scripts can't send debug commands or get callbacks; the GUI thread can. - [Can a script swap the positions of a follower and its leader?](https://git.arthurerlich.de/haylan/tpf3-overtake/issues/12): no. The debug component exchange refuses `MovePath` on both threads, and no command writes a line vehicle's position (teleport only to depots). No script mechanism overtakes on single-lane roads. ## Not yet specified - Mod architecture: file layout, script entry points, how a speed/priority comparison is exposed (depends on the chosen mechanism). - How to test and debug behaviour in-game (logging, test saves). ## Out of scope - Trains (later effort). - Publishing to mod.io (TpF3 has no Steam Workshop; mod.io is the official in-game mod browser — terms in `docs/research/modio-terms.md`). - The detailed overtaking behaviour spec. - The fake-car hack (despawn a real car and animate a custom entity past the blocker): heavy, unproven for road vehicles. - Non-player vehicles.
haylan added the wayfinder:map label 2026-10-04 19:51:53 +00:00
Author
Owner

Correction: the old 'Steam Workshop publishing' out-of-scope line named the wrong platform — TpF3 has no Steam Workshop, the official in-game mod browser is mod.io (cross-platform). Rephrased to 'Publishing to mod.io'. New research note docs/research/modio-terms.md captures the mod.io ToU/AUP clauses that bind a published mod (uploading grants mod.io + Urban Games a perpetual irrevocable license; game-side rules override mod.io's per ToU §1.7).

Correction: the old 'Steam Workshop publishing' out-of-scope line named the wrong platform — TpF3 has no Steam Workshop, the official in-game mod browser is mod.io (cross-platform). Rephrased to 'Publishing to mod.io'. New research note docs/research/modio-terms.md captures the mod.io ToU/AUP clauses that bind a published mod (uploading grants mod.io + Urban Games a perpetual irrevocable license; game-side rules override mod.io's per ToU §1.7).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: haylan/tpf3-overtake#1