View on GitHub

FOnline: The Life After

Fallout-like game based on the FOnline Engine

FOnline: The Life After - Agent Instructions

Project front door for AI maintainers working on FOnline: The Life After (TLA). Read this before changing anything. Keep this file as the single source for agent-facing repository practices; CLAUDE.md and .github/copilot-instructions.md intentionally point here.

What This Project Is

Repository Orientation

Adding or removing a native extension file requires updating the relevant AddEngineSources(...) block in CMakeLists.txt under COMMON, SERVER, CLIENT, or BAKER.

Build And Verify

VS Code tasks in .vscode/tasks.json are the authoritative workflow. The same commands can be run directly from the terminal.

Task When to use
Bake Resources After edits in Scripts/, Dialogs/, Maps/, Items/, Critters/, Texts/, Gui/, or TLA.fomain.
Force Bake Resources When incremental baking may be stale. Use sparingly.
Compile AngelScript Fast script syntax/API check.
Build :: TLA_Server, Build :: TLA_ServerHeadless, Build :: TLA_Client, Build :: TLA_Mapper, Build :: TLA_Editor, Build :: TLA_Baker, Build :: TLA_ASCompiler, Build :: TLA_UnitTests Build one target in Build/Auto, RelWithDebInfo.
Prepare :: TLA_* Bake Resources plus the corresponding build target.
Launch :: TLA_Server [windows] / [linux] Build, bake, then run the server with LocalTest.
Launch :: TLA_UnitTests [windows] / [linux] Build, bake, then run engine unit tests.
Generate :: GuiScreens.fos Regenerate Scripts/GuiScreens.fos from Gui/*.fogui.
Generate :: Version Update VERSION via Tools/GenerateVersion/generate_version.py; do not hand-edit VERSION.
Format :: Scripts, Format :: Prototypes, Format :: Main Config, Format :: All Format the relevant authored files.

Typical command equivalents:

cmake --build Build/Auto --config RelWithDebInfo --target BakeResources
cmake --build Build/Auto --config RelWithDebInfo --target TLA_Server
cmake --build Build/Auto --config RelWithDebInfo --target TLA_Client

Baseline verification after an engine bump or broad script/content change:

  1. Bake Resources
  2. Build :: TLA_Server
  3. Build :: TLA_Client
  4. If runtime startup matters, run TLA_ServerHeadless or Launch :: TLA_Server [windows] and confirm startup reaches "Start server complete!".

For native engine-facing changes, also build/run TLA_UnitTests when the touched surface is covered by engine tests.

Engine Update Workflow

The engine moves frequently. Handle submodule bumps deliberately:

  1. Inspect Engine status and recent upstream commits first.
  2. Prefer fast-forwarding Engine at coherent upstream boundaries instead of a large blind jump.
  3. After each bump: Bake Resources -> build affected targets -> fix script/config/native fallout.
  4. Cross-check H:/lf-7 when upstream renames or signatures shift. It runs on the same engine and often has the migration pattern already.
  5. Do not commit, stage, or push unless the user explicitly asks. The user reviews and commits changes themselves.

Typical breakage points after a bump:

Engine Vs Game Boundary

Before adding behavior, pick the narrowest correct layer:

  1. Gameplay rules, quests, dialogs, AI, GUI behavior -> AngelScript in Scripts/ or authored content.
  2. Project-specific native bridge or helper -> SourceExt/, wired through CMakeLists.txt.
  3. Reusable engine capability -> Engine/ only when the change belongs to every game using the engine.
  4. Runtime/build configuration -> TLA.fomain or a [SubConfig].

When a serialized contract changes (properties, save data, network-visible data, generated content IDs), check whether ///@ MigrationRule metadata or a config/version bump is required.

Native Extensions

Native exports use engine annotations:

Native C++ conventions:

AngelScript Conventions

Content Pipeline

Authored inputs:

Scripts/*.fos, Scripts/Json/*.fos
Critters/*.focr, Items/*.foitem, Maps/*.fomap
Dialogs/*.fodlg, Gui/*.fogui, Texts/*.fotxt
Resources/*

Pipeline:

Gui/*.fogui
  -> Tools/InterfaceEditor/generate_gui_screens.py
  -> Scripts/GuiScreens.fos

Authored sources + generated script files
  -> BakeResources / ForceBakeResources
  -> baked configs, scripts, protos, maps, dialogs, text, resource packs
  -> Binaries/ consume baked output

A file can bake successfully and still be semantically wrong. Debug content by starting from the consumer: combat code for combat data, dialog code for .fodlg demand/result failures, GUI code for .fogui callbacks, and so on.

GuiScreens.fos Pitfall

Scripts/GuiScreens.fos is generated only by Tools/InterfaceEditor/generate_gui_screens.py. The VS Code task Generate :: GuiScreens.fos is already wired to that script.

Do not use the legacy Tools/InterfaceEditor/InterfaceEditor.exe -SilentGenerate path for TLA generation; it emits an incompatible layout for this project.

AngelScript embedded in screens lives in the .fogui JSON: OnGlobalMouseDown, OnLMouseClick, GlobalScope, ClassFields, OnDraw, callbacks listed in CALLBACK_METHODS, plus CODE_KEYS in the generator. If you fix behavior inside generated screen code:

  1. Find the owning .fogui file.
  2. Apply the same edit there.
  3. Apply the same edit to Scripts/GuiScreens.fos if the baked project needs the fix immediately.
  4. Regenerate only when screen identity or non-code .fogui properties change, or when you intentionally want to refresh generated output.

Formatting And Generated Files

Debugging

Pick the boundary before reaching for a heavy interactive session:

Symptom Start with
Script compile error Compile AngelScript, then inspect TLA_ASCompiler.log / Build/_errors.txt.
Content, dialog, map, or text bake error Bake Resources, then inspect TLA_Baker.log, TLA_BakerLib.log, Build/_bake.log, Build/_errors.txt.
Native compile/link error Build the narrowest TLA_* target and inspect the first compiler error.
Server startup/runtime issue Build :: TLA_ServerHeadless or Launch :: TLA_Server [windows], then inspect TLA_ServerHeadless.log / TLA_Server.log.
Client presentation/input issue Build :: TLA_Client, run the client/server pair, then inspect TLA_Client.log.
Engine regression Check Engine upstream commits, compare H:/lf-7, then run/build TLA_UnitTests when applicable.

Commit Policy

Quick Reference