The DS3 Codex
The Dark Souls III Codex

How Dark Souls III works

We took FromSoftware's game apart, from its encrypted archives down to its shader constants and its enemies' Lua scripts. Then we rebuilt one area of it, Firelink Shrine and the Cemetery of Ash, in our own engine.

Every claim on these pages was read from the game's files, its executable, or captures of its frames, and each one says which. Where our engine does something its own way, the page says that too.Codex · Preface

⚠️ AI content warning

This whole project was done with Claude Code: the engine, the investigation and this write-up. Every word of these pages was generated by Claude Code, using Claude Opus 5.5.

If you're the kind of person who gets offended by "AI slop", turn back now!

This is a research and documentation project. If you're looking for the finest human-written prose, you're probably better off looking elsewhere.

What this is

This is the write-up of a hobby research project, with no connection to FromSoftware or Bandai Namco. The aim was to learn how Dark Souls III really works, and the test of whether we'd understood something was to make it work again. So we wrote a small game engine of our own (C-style C++ on SDL3, raw Vulkan and Jolt Physics) and taught it to run part of the game, using nothing but the game's own data.

Everything comes from one ordinary Steam copy of the game (build 10167187, which is patch 1.15.2). No mods, no leaked material and no help from the developers: just the files on disk, the program itself, and recordings of its frames. Nothing from the project is published except these pages.

The work splits in two. A converter we call the importer reads DS3's files and writes them out in simple file formats of our own design, and the engine reads only those. The engine itself knows nothing about Dark Souls, so everything DS3-specific lives in the importer, and in these pages.

The engine is how the findings are proved. In it you can run around the Cemetery of Ash as the Knight on DS3's own collision, with DS3's movement, root motion and animation events. You fight the hollows, which run DS3's battle AI ported from the game's scripts, and Iudex Gundyr with both his phases, his super armour and his cloth. All of it is lit by a deferred renderer built to match captures of DS3's own frames.

13,619
files in the five encrypted archives, all named
4,057
map pieces placed in Firelink's layout file
1.26 M
collision triangles in the Firelink map, each with its own material
186,508
timed events on the player's animations
15,439
lines in the player's control script, once decompiled
741
draws in one DS3 frame of the shrine's courtyard

From the install to the screen

There are three stages, and every page of this codex follows them: how DS3 stores a thing, how our importer turns it into our formats, and what our engine does with it while it runs. FromSoftware's file formats have short names (FLVER for models, MSB for map layouts, TAE for animation events, and so on). Each chapter explains the ones it uses.

Game installDataN.bdt / .bhd: RSA-encrypted indexes, AES-encrypted ranges, files named by a hash of their path · Data0.bdt: the regulation (all params) · sound/: FMOD banks · DarkSoulsIII.exe (90 MB)
our unpacker decrypts and names every file
ExtractedBND4 / BXF4 binders of FLVER models, TPF textures, Havok packfiles (collision, skeletons, spline animations, ragdolls, cloth, behaviour graphs), MSB layouts, TAE event lists, params, HKS and Lua scripts, FXR effects, FEV/FSB sound
a reader for each format, written in Python
Importer (all DS3 knowledge lives here)Mirrors DS3's left-handed space, decodes animations, maps materials, bakes poses, picks the params the engine needs
writes
Our formats.mesh .scene .col .chr .skel .anim .cloth .ragdoll .fx .sbank .params: flat little-endian files, read in place after one file read
loads
Engine30 Hz simulation, Jolt physics, GPU skinning, a deferred Vulkan renderer, FMOD-style event mixer: about 18,000 lines of C-style C++

How to read the codex

Every claim carries a tag that says where its evidence came from:

data read from the game's files exe read in the executable or its shaders capture a frame of the running game, recorded with RenderDoc ER Elden Ring's data structures as the modding community has named them (a later game on the same engine) guess fits the evidence but isn't proven open not known

Each mechanism is described twice: what DS3 does, and what our engine does. A verdict then says how close the two are:

Faithful

DS3's data and DS3's rules, verified against the game: the same numbers come out.

Close

DS3's technique and data, with a detail guessed or simplified. Says which.

Our stand-in

We did it our own way, because DS3's way isn't read yet or was out of scope. Marked so it can be replaced.

Not done

Understood (at least partly) but not in the engine.

The chapters

🗝️

Archives & containers

The encrypted Data archives, hashed names, DCX, BND4 and BXF4 binders, the regulation and its 103 params.

🗺️

Levels

The MSB: map pieces, collision "rooms", draw groups, enemies, objects, bonfires, regions, water and baked light.

🛡️

Characters & items

FLVER models, dummy polys, display masks, textures, skeletons, spline animations, TAE events, equipment, the Estus Flask, ragdolls and cloth.

🕯️

The renderer

DS3's frame pass by pass: culling, the G-buffer, lightmaps and probes, lights, shadows, SSAO, fog, sky, water, YEBIS post-processing.

🔥

Effects

FXR3 particle trees: footstep splashes and ripples, the mist, candle and torch flames, the Estus heal, and DS3's particle shader.

🏃

Movement & collision

Animation-driven movement, the Havok Script state machine, TAE flags, the character proxy, falls, jumps, ladders, bonfires.

⚔️

Combat

From an attack clip to a hit: AttackBehavior, params, hit shapes, hurt capsules, damage, stamina, poise, guard, parry, wall bounces.

💀

Enemies & AI

A hollow's anatomy, borrowed clips, the NPC script, Lua battle goals and weighted acts, perception; Iudex Gundyr's two phases.

🎵

Sound & music

FMOD Ex banks with a bit-reversed XOR, stripped Vorbis, event projects, distance curves, footstep materials, boss music.

💾

The save file

DS30000.sl2: twelve AES-encrypted, MD5-checked entries; character slots with the world's item table, stats, equipment and inventory; a copy of the regulation.

🏛️

How it was probably made

Speculation: FromSoftware's likely tools, how a level was assembled, how the collision was fitted to the art (measured), fingerprints left behind.

🔍

How it was found

Tools, Ghidra without auto-analysis, RenderDoc captures through DXVK, the dead ends, and what's still open.

Fidelity at a glance

SystemVerdictIn one line
Archives, binders, paramsFaithfulEvery file decrypted and named; every param read with its real layout.
Map layout and draw groupsFaithfulMSB placements, LODs at DS3's measured distances, draw/display groups by the floor you stand on.
Collision geometry and materialsFaithfulDS3's Havok meshes and per-triangle materials, on Jolt instead of Havok.
Character controllerCloseDS3's proxy numbers (60° slope, 0.3 m step, 1.9 × 0.4 m capsule) on Jolt's CharacterVirtual.
Movement, rolls, jumps, fallsFaithfulDS3's clips, root motion, TAE flags, script thresholds and fall-damage curves.
Player state machineCloseRewritten by hand from the decompiled player script, rather than running the script itself.
Deferred rendererCloseDS3's G-buffer, light passes and constants read from its shaders and captures; frames within a few levels of DS3's.
Sky, fog, tone map, DLAAFaithfulPorted from DS3's shaders with captured constants: the sky measures 200 against DS3's 199.
Bloom, light shafts, depth of fieldStand-inYEBIS's chain is read in outline; our scales and shapes are guessed.
WaterCloseDS3's two passes, scrolls and constants; still brighter than DS3's.
ParticlesCloseFXR3 read with community field names; DS3's unlit particle shader ported.
Attacks and hitsCloseDS3's param chain and hit shapes; the damage curve is Elden Ring's.
Poise and super armourFaithfulTraced in the exe: toughness, TAE 795 windows, super armour pools.
Enemy battle AICloseThe Lua battle goals ported act by act; FromSoft's C++ goals reconstructed.
Ragdolls and clothCloseDS3's Havok bodies, joints and cloth operators on Jolt and our own solver.
SoundFaithfulDS3's samples, events, curves and material swaps; no occlusion or reverb.

About the pictures

None of the pictures are screenshots of Dark Souls III itself. Every one comes from our side: views rendered by our engine from the game's data, plots of our sound mix, and textures decoded from the game's files. Click a picture to see it full size.