Table of Contents

APThreat build log: TCE to The Dark Mod

Copied from the build log kept by the development agent in the TC3 project (revision 13, 2026-11-21). The original doc is the reference; this page is a snapshot.

Overview

APThreat (Advanced Persistent Threat, short name apthreat) is an experiment, not a released game: a single-player stealth-tactical prototype built on The Dark Mod 2.15 engine (TDM, an idTech4 / Doom 3 derivative), using content converted from TrueCombat:Elite 0.49b (TCE, an ET mod). Multiplayer was dropped on 2026-11-21.

As of this log: 14 maps converted, the TCE soldier is the player model, 42 TCE soldier NPCs, 5 firearms, a TCE-style HUD, and the first engine changes (HUD values, sprint stamina, prone, iron sights).

What Where (project files)
Engine patch + Linux build apthreat/engine/
Asset pk4s (characters, weapons, HUD, test maps) apthreat/assets/
14 converted maps (pk4 + .map, logs) tdm-port/maps/
Converter scripts tdm-port/converter/
Screenshots tdm-port/screenshots/
ET:Legacy + TCE reference run etlegacy-tce-baseline/

Nothing has been published anywhere public. Each step below says what was done, why, the commands or scripts used, and what broke.

Step 1: TCE reference run on ET:Legacy

TCE 0.49b was run on ET:Legacy 2.86.2 first, to have a working original to compare against.

Step 2: engine choice and TDM build

The target engine went Quake3e, then plain dhewm3, then The Dark Mod 2.15. TDM was chosen because it is a maintained idTech4 engine with a full single-player stealth/AI game layer already working.

Step 3: map conversion (14 maps)

All 14 maps convert and compile with no leaks. Only obj_downs and obj_nuclear_delta ship .map sources; the other 12 were decompiled from .bsp with q3map2.

Map Source
obj_downs original .map (7,726 brushes, 771 patches, 471 lights)
obj_nuclear_delta original .map
obj_snow, obj_railhouse, obj_northport, _overkilling, obj_alcatraz_b3, obj_bahamut_final, obj_chlite, obj_dedust_final, obj_frostbite_101, obj_nbn23_se_b1, obj_oldtowne_b4, obj_town_and_metro_final decompiled .bsp

How the converter (q3_to_tdm.py) builds a TDM map:

  1. Visual geometry: the compiled BSP surfaces are exported to one OBJ, placed as a single func_static.
  2. Collision: the brushes are kept but turned into caulk (invisible, solid).
  3. Curved patches stay as visible patches.
  4. A sky hull box seals the map.
  5. Q3 shaders become TDM .mtr materials, with HD Platinum textures and _n normal maps where they exist.
  6. Decompiled maps get --force-sun --ambient 0.3, because their original lights are lost.

HD textures: the uploaded f_*.pk3 files plus f_tcetest_zzz_hd_textures.pk3 (1,148 MB) from the TrueCombat-Platinum GitHub release v0.39.7-sandbox44.

Commands: rebuild_all.sh rebuilds all 14. Per map, finish_map.sh <map> takes a spawn screenshot, packs tdm-port/maps/tce_<map>.pk4 with pack_map.py, and copies the .map and the dmap/run logs to tdm-port/logs/. Gameplay entities (spawns, objectives) are saved to gameplay/*.json but not placed yet.

Step 4: menus and fonts

The TCE menu backgrounds and logo show in the TDM main menu (FM folder fms/tce). The TCE fonts ariblk and courbd were converted to TDM font format with convert_fonts.py (as tce_ariblk, tce_courbd); the HUD uses them too.

Step 5: sky and plant fixes

Black sky patches and opaque plants are fixed, and all 14 maps were rebuilt with the fixes.

Step 6: player model

The player is the TCE soldier, converted from ET's skeletal formats to TDM md5, with a separate head entity.

  1. mdm2md5.py reads the ET mesh (.mdm v3) and animation (.mdx v2) files and writes md5mesh / md5anim. Bones are rebuilt from ET's compressed angles and parent offsets; an origin joint is added and the model raised 24 units because ET feet sit at -24.
  2. Joints are renamed to TDM's humanoid names (Hips, Spine, Neck, Head, LeftArm, RightHand, LeftUpLeg…), so TDM's AI and player code can find them.
  3. The bind pose is frame 1633 (alert_idle_2h). Walk and run anims get root motion on the origin joint.
  4. build_character.py reads each TCE .char file and resolves skins and attachments the way ET does: head on tag_head, hat on the head's tag_mouth, belts and backpack on tag_bright, tag_bleft, tag_ubelt and tag_back. These md3 parts are baked into the mesh.
  5. Each character is written three ways: full mesh (NPCs), body without head, and a one-joint head mesh. TDM's light gem needs a separate head entity or the game crashes.
  6. Player def tce:player_soldier inherits TDM's player; a map selects it with the worldspawn key player_classname. Ragdoll: af/tce_soldier.af, adapted from TDM's guard because ET's shoulders hang off the neck.

Step 7: NPCs and camo series

There are 42 TCE soldier NPCs: 14 base characters plus snow, desert and commando series. All share the ET human animations and hold a gun.

Series Entity names Count Look
Base (skin s) tce:ai_allied_<class>, tce:ai_axis_<class> 14 CT woodland, T stripes + woodland trousers
Snow (skin s2) …_<class>_snow 14 CT white snow camo + snow helmet; T city top + Russian winter trousers
Desert (skin s1) tce:ai_allied_<class>_desert 7 CT tan camo, boonie cap
Commando (skin s3) tce:ai_allied_<class>_commando 7 CT black gear, masked helmet

Classes: soldier, medic, engineer, fieldops, cvops, elite, vip. TCE has no desert or commando set for the terrorists.

Step 8: firearms

Five TCE guns are selectable and fire, each with TCE's own firing sounds, a magazine and reload.

Gun Weapon slot Magazine Start reserve Fire
MP5 3 30 240 auto
M4 4 30 240 auto
AK-47 5 30 240 auto
M3 Super 90 6 7 56 semi, several pellets
Beretta 7 15 90 semi

Step 9: HUD and first engine patch

The TCE-style HUD replaces TDM's health bar and weapon display; the light gem stays at the bottom centre.

Step 10: movement

Walk, run, lean and crouch already exist in TDM. Sprint stamina, prone and iron sights are in the engine and were tested in game on tce_test (screenshots apthreat_ironsights.png, apthreat_prone_aim.png).

Problems hit and fixes

Problem Cause Fix
Reload played but magazine stayed empty animDone() never reports true for the reload anim Reload waits on a timer (reload_time, default 1.8 s)
R did nothing TDM binds R to another action; reload is impulse 13 FM autoexec.cfg binds R to reload
Game crashed when the TCE player spawned Light gem code needs a head entity Separate body mesh + head entity
“NULL model” fatal error with NPC guns TDM's md3 model path is broken World guns converted to OBJ
Guns not selectable TDM locks weapons without ammo until its shop Ammo items + start ammo per gun
White, giant first-person gun Env-map stage used as texture; wrong model offset Use last normal stage; offset ( -3 0 -1.5 )
Missing helmet/mask textures Backslashes in md3 shader paths Paths normalized
Ragdoll errors ET shoulders are children of the neck Custom tce_soldier.af
Black sky, opaque plants See step 5 See step 5
Third-person view in batch screenshots Test setting saved into the shared config Shots retaken with pm_thirdPerson 0
Black test screenshots A stale virtual display at 1024×768 Fresh displays per run

Known issues and next steps


See also: APThreat project overview · Credits