BOZ Redux GitHub ↗ Join Discord ↗

Contributing

For people who work on the SDK itself: how the repository is laid out and tested, how names from reverse engineering get into the game definition, and where the SDK is going.

Working on the SDK

How the SDK repository is laid out, how to run its tests, and which files are generated. For changes to the game definition (names from Ghidra), see Contributing to the game definition.

Working from Git

Players and modders use the SDK releases. To work on the SDK itself, clone it instead. This needs Python 3.11 or newer and Git:

git clone --recurse-submodules https://github.com/ZappaVinny/boz-redux-sdk.git
cd boz-redux-sdk
python3 -m pip install -e '.[desktop]'

This installs the boz-sdk and bozkit commands. You can also run the app without installing, from the checkout: ./boz-sdk. Leave out [desktop] if you only want the command line.

A checkout has no boz-navmesh helper until you build it (needs CMake and a C++ compiler):

git submodule update --init tools/navmesh/third_party/recast
cmake -S tools/navmesh -B tools/navmesh/build -DCMAKE_BUILD_TYPE=Release
cmake --build tools/navmesh/build -j

The repository

Path What it is
tools/bozkit/ The Python SDK: project compiler, game file formats, the asset library, the SDK app (bozkit.desktop). Tests in tools/bozkit/tests use synthetic data only.
blender/boz_suite/ The map editor, a Blender application template
lib/boz/ The standard library (boz.*), with its tests in lib/tests/
mods/developer/ The Developer mod, carrying a copy of the standard library
gamedef/ The game definition (boz-redux-gamedef, a submodule)
tools/ghidra/, tools/symbols/ Reverse-engineering scripts and the converters between Ghidra and the game definition
tools/stdlib/, tools/docgen/ Generators for the standard library's data and documentation
tools/navmesh/ boz-navmesh, the native Recast helper (with recastnavigation as a submodule)
tools/destin/ destin (submodule): .dz pack extraction
docs/ This documentation

The layers have a strict order: the client provides universal facilities, the standard library turns game internals into general-purpose functions, and anything specific to one mod or map lives in that mod. A feature moves down a layer only when many mods need it.

No game files are ever committed: no APK, packs, extracted assets, converted binaries or Ghidra projects. re/ (reverse-engineering output) is ignored by Git.

Tests

python3 -m unittest discover tools/bozkit/tests     # bozkit and the compiler
lua5.4 lib/tests/run.lua                            # the standard library
python3 blender/tests/run_suite_test.py             # the editor, in a background Blender

The shipped-file tools have their own headless Blender tests:

for test in headless_roundtrip texture_sampling texture_pixels; do
  ALSOFT_DRIVERS=null blender -b --factory-startup --python-exit-code 1 \
    --python blender/tests/$test.py
done

Each prints BOZ_..._OK. CI (.github/workflows/test.yml) runs the Python and Lua tests, a lint pass and the generated-file check below.

CI has no game files, so changes to the Lua API or game behaviour also need the in-game tests, run locally before you commit: bozkit test mods/developer --client <your client> and the tests of any map you changed (Testing your mod).

Generated files

These files are generated; change their sources and run the generator, never edit them by hand. CI fails when one is out of date.

File Source Generator
lib/boz/*_data.lua The game definition python3 tools/stdlib/generate_data.py
docs/game-events.md The game definition and tools/symbols/event_notes.toml python3 tools/docgen/events_doc.py
The weapon field tables in docs/weapons-and-assets.md bozkit.weapons.FIELDS python3 tools/docgen/weapons_doc.py
docs/console-reference.md The game definition and tools/symbols/console_notes.toml python3 tools/symbols/symbols.py console-doc gamedef/console/boz-1.0.11.toml tools/symbols/console_notes.toml docs/console-reference.md
mods/developer/scripts/boz/ lib/boz/ python3 tools/stdlib/sync.py (--check only compares)

The editor

tools/build_suite.py assembles the editor: the boz_suite add-on and the bozkit modules go into build/suite/ (a Blender user scripts folder), with a startup.blend generated from boz_suite/tabs.py. The SDK app rebuilds it in a checkout when the sources change. blender/README.md describes the editor's modules.

Documentation

The documentation is written by hand for a new modder, and the website's copy is the master: the SDK's docs/ mirrors it. Each file's # title is a page of the site, and ## and ### headings split it. Add new material as a section of the page it belongs to, with a code example, and start a new page only for a subject that is really different. Only document what works today. Link with relative paths and anchors (script-mods.md#client-lua-api). Write for modders first: say what a feature does and how to use it, then how it works inside, at the end of the section.

Contributing to the game definition

The game definition (boz-redux-gamedef, the gamedef/ submodule) is what mods and the standard lib use to find game functions and data by name. This section is for people who want to extend it: how to build an annotated Ghidra project from your own copy of the game, and how names get from Ghidra into the game definition.

Only knowledge is committed (names, layouts, notes), never the game's code: the Ghidra project, the converted binary and anything under re/ stay on your machine (re/ is gitignored).

Requirements

  • Ghidra 12.1 or newer (Java scripts only, no PyGhidra needed).
  • Python 3.11+.
  • The game set up by the client (boz-redux: its launcher, or scripts/setup-game.sh), linked into this repo as game (ln -s ../boz-redux game, see sdk.toml).

Build the project

  1. Convert the game image to an ELF:

    python3 tools/ghidra/s3e_to_elf.py game/assets/boz.s3e.unpacked re/boz-1.0.11.elf
    

    This also writes re/boz-1.0.11.elf.code-pointers.txt, the Thumb functions the game only reaches through stored pointers.

  2. In Ghidra: File → New Project (non-shared) in re/ghidra, then File → Import File on re/boz-1.0.11.elf with the defaults, and let auto-analysis run.

  3. Add tools/ghidra under Window → Script Manager → Manage Script Directories. The scripts then appear under Tools → BOZ.

  4. Run Seed Functions From Code Pointers (BozSeedFunctions.java). It creates about 9,700 functions analysis misses (callbacks and C++ virtual methods). Then Analysis → Auto Analyze again.

  5. Recover the C++ class map from the game's run-time type information and apply it:

    python3 tools/ghidra/rtti_classes.py game/assets/boz.s3e.unpacked re/classes.json \
        --symbols gamedef/symbols/boz-1.0.11.toml
    

    then run Repair Virtual Functions (BozRepairVirtuals.java) and Apply Class Map (ApplyBozClasses.java) on re/classes.json, then Name Component Tables (BozNameComponentTables.java) and Name Singletons (BozNameSingletons.java), which labels the instance global of each of the 65 CIsSingleton<T> systems as T::s_instance. Every C++ class (about 2,400, from game code, the Ideaworks studio layer, Marmalade, Bullet, gameswf and DemonWare) becomes a Ghidra class with typeinfo and vtable labels, and each virtual function is named Class::vf<slot> in the class that introduces it and tagged lib:<library>. Destructors (~Class, ~Class_deleting) are found by behaviour: the deleting destructor calls the slot before it and then operator_delete. That pair is usually slots 0 and 1, but not always (CIsSystemStatic<T> has it at 9 and 10). Constructors are found by the vtable pointer they store into this (Class::Class). Slots named in the database's [[vslot]] entries name every override (CMysteryBox::Init, CMysteryBox::OnEvent), including implementations reached through secondary-vtable thunks. The component tables script labels each CIsComponentTable<T> global as T::s_table and names the lookups that find an entity's component as T::FromEntity. These names are rebuilt from the game at any time, so they are not exported; rename one (for example CMysteryBox::vf24 to CMysteryBox::Update) and it is. To name a slot for every class at once, add a [[vslot]] to the database instead.

  6. Load the symbol database:

    python3 tools/symbols/symbols.py to-json gamedef/symbols/boz-1.0.11.toml re/symbols.json
    

    and run Apply Symbol Database (ApplyBozSymbols.java) on re/symbols.json.

  7. Run Export Reflection (ExportBozReflection.java) with arguments re/reflection.json structs. It reads the game's own reflection registrations (see below) and writes every reflected class, its bases and its named fields to re/reflection.json. It also creates a structure named after each class (at the class's path, where Ghidra looks for the type of this), with every field (own and inherited) at its offset, and sets __thiscall on the class's methods whose signature was never set, so decompiled methods read this->m_Health instead of raw offsets. Finally it names each class's T::GetClassInfo and T::RegisterReflection. Then refresh the SDK schema:

    python3 tools/symbols/symbols.py reflection re/reflection.json gamedef/reflection/boz-1.0.11.toml
    
  8. Name the hashes and the event bus:

    • Name Hash Globals (BozNameHashGlobals.java, argument re/hash-globals.json) labels every global caching IwHashString("name"), including the observer event ids registered through SubjectId_Register, as hash_<name>.
    • Type GOT Pointers (BozTypeGotPointers.java) types the pointer slots code reaches those globals through, so the decompiler prints PTR_hash_SUBJECT_NEW_WAVE instead of DAT_4a412eec.
    • Export Events (ExportBozEvents.java, arguments re/events.json annotate) lists who sends, subscribes to and handles each SUBJECT_* event, and notes it on each function.

    Then refresh the SDK catalog:

    python3 tools/symbols/symbols.py events re/hash-globals.json re/events.json gamedef/events/boz-1.0.11.toml
    
  9. Export Console Commands (ExportBozCommands.java, argument re/commands.json) lists every developer console command (name, id, owning class). Export Console Variables (ExportBozCvars.java, re/cvars.json) lists the cvars registered through the Cvar_Register* wrappers; Export Direct Console Variables (ExportBozDirectCvars.java, re/cvars-direct.json) adds the ones registered straight through the console's vtable and the names the code only reads. Refresh the catalog and its readable reference:

    python3 tools/symbols/symbols.py console re/cvars.json re/commands.json \
        gamedef/console/boz-1.0.11.toml --direct re/cvars-direct.json
    python3 tools/symbols/symbols.py console-doc gamedef/console/boz-1.0.11.toml \
        tools/symbols/console_notes.toml docs/console-reference.md
    

    What each variable or command does, and in-game test results, go in tools/symbols/console_notes.toml.

  10. Optional: Export Engine Boundary (ExportBozEngineBoundary.java) reports which functions call each family of engine imports. Find String References (BozFindStringRefs.java, arguments: hex addresses) lists the functions using a string or global; Ghidra's own references miss the game's ldr + add pc addressing.

How the reflection data is found

Each reflected class has a registration function that runs at start-up:

info = T::GetClassInfo();                      // static CIsClassInfo(&s_info, "T")
ClassRegistry_Add(ClassRegistry_Get(), IwHashString("T"), info);
CIsClassInfo::AddBase(info, Base::GetClassInfo(), offset);
spec = new CIsReflectPropertySpec<float>(spec, info, "m_fov", 0x40, 4, flags);
CIsClassInfo::AddProperty(info, spec);

The constructor call is often inlined, leaving stores into the 0x1c-byte spec instead: +0 vtable (which gives the field type), +8 name, +0x10 flags (2 = network property), +0x14 offset. The exporter handles both forms. Data resources (CIsReflectedResource) store their fields as a property blob in .group.bin. Serialise reads it, and slot 6 decodes it through the class info, so the schema is also the format of the game's gameplay data.

Save your work to the database

  1. Run Export Symbol Database (ExportBozSymbols.java) to re/symbols-export.json.

  2. Rewrite the database from it:

    python3 tools/symbols/symbols.py from-json re/symbols-export.json gamedef/symbols/boz-1.0.11.toml
    python3 tools/symbols/symbols.py stats gamedef/symbols/boz-1.0.11.toml
    
  3. Review git diff gamedef/symbols and commit.

Pull before you start and apply the database first, so you export on top of everyone else's work.

Conventions

  • What gets exported: functions and labels inside the game image that a person named (Ghidra source "User Defined"), plus every struct in the data type category /BOZ. Names from analysis (FUN_..., DAT_...) and the ELF import (PTR_..., the import stubs) are not.
  • Names: Subsystem_Function for functions (Weapon_Fire), g_name for globals, s_name for constant data (strings, tables), PascalCase for structs.
  • Subsystem: a function tag, one of engine runtime state entities weapons rendering ui audio saves network libc unknown. For a global, put @subsystem on the first line of its plate comment.
  • Confidence: add the function tag confirmed (or @confirmed for a global) only when the meaning is proven, by tracing the running game or by unambiguous code. Everything else is likely.
  • Notes: the function comment (plate comment above the function) for functions, the rest of the plate comment for globals. Say what it does and how you know.
  • Structs: create them in /BOZ; field names and comments are exported.
  • Coverage per subsystem is the [coverage] table in the database; update it by hand when a subsystem's mapping moves forward.

Game memory offsets in the standard library

The standard library never writes a raw offset like + 0xa8. It asks for a field by name: core.offset("CLevelManager", "player"), and core.size("Struct") for a struct's size. The name comes from the game definition: a struct in gamedef/symbols ([[struct]] entries, made in Ghidra's /BOZ category) or a reflected field. To add one, name the field in Ghidra, export it, then use the name. tools/bozkit/tests/test_stdlib_offsets.py fails when a raw offset appears, and an unknown name is an error the moment the module loads, so a typo can't slip through.

Roadmap

The SDK is becoming a Lua-first development suite for Zombies: a shared compiler, desktop project manager and Blender add-on that edit existing maps first, then create complete new maps. Dead Ops modding is not part of this work.

Mod tools roadmap

What modders can't do yet and we want them to, most important first. Each item is open to anyone who wants to pick it up.

  1. Spawning prefabs during play. Placing your own prefabs from a script, not only the game's entities.
  2. More game prefabs. Turrets first, then rides: landers, the zipline and the flinger.
  3. George on any map. Needs the level traits primitive in the client.
  4. Custom HUD. The UI / HUD tab: HUD elements in the game's own style, with icons for custom perks and power-ups.
  5. Custom characters. Player arms, characters and zombie models, with skeleton mapping.
  6. Animated map objects. Scripts can already play an animated object's states (play_animation); next is making new animations for them in the editor, as weapons can.
  7. Own weapon models at the right size. The game draws a weapon's own model bigger than the editor shows it; the editor and the build need to agree on the model's units.
  8. Faster iteration. Reloading scripts in the running game, and boz.* completions in the editor's script window (other editors have them through .luarc.json).
  9. Lighting and music. Baked lightmaps, and replacing the game's music.

Done: zones, sectors and teleporting (Zones, Sectors, Teleporter), and setting which way a player faces after a teleport. Then, for client 0.4.0: scripts in co-op, moving and turning objects, scripts reaching every object they name, ending a match, luring zombies, your own effects and projectiles, weapon animation layers and extra clips, tests, and boz.* completions in VS Code.

Architecture boundary

Layer Owns
Client Universal facilities every mod can use: loading, Lua, hooks, files, input, rendering and diagnostics
Standard library (boz.*) Safe domain APIs that combine the game's internal systems into concepts such as player, weapons and world
Mods Concrete gameplay, maps, objectives, settings and menus built from those abstractions

A missing feature moves downward only when it is reusable: mod behavior becomes a standard-library API when many mods need it; client code is added only for universal runtime infrastructure.

Changing the API

Mods depend on the client's Lua API and the standard library, so neither breaks them (see Keeping mods working):

  • Adding a function or module to the client: bump BOZ_LUA_API (include/boz_api.h) and document it under Client Lua API.
  • Changing something public in boz.*: keep the old name working, make it log one line saying what replaces it, and remove it no sooner than the next minor version.
  • Releasing the standard library: set VERSION (and CLIENT_API when it needs a newer client) in lib/boz/version.lua. The SDK writes both into every mod it builds.

Stuck, or want to show your work? Modders hang out on the Discord.

Join Discord ↗

Discord

The Discord invite hasn’t been added yet. Check GitHub for project updates.

Visit the project ↗