# DungeonSettlersDB - Machine-Readable Data Guide

Unofficial local database for **Dungeon Settlers** (Steam AppID 4021950), build **DS_B.0.3.26** (Steam buildid 23739108).
All data was parsed **byte-exact** from the game's pristine Unity asset tables (`sharedassets0.assets`, no TypeTrees - manual parsers with consume-all-bytes validation) on 2026-07-13. Every parser asserted `read_position == file_length` and 100% key-prefix conformity. Enum fields carry both the raw int and a resolved `<Field>Name` sibling string.

**If you are an AI agent: everything you need is in `/dbdata/*.json`. Start with `/dbdata/index.json` (manifest), then load the specific tables you need. `/dbdata/db.json` bundles everything in one file.**

## Data files (`/dbdata/`)

| File | Rows | What it is |
|---|---|---|
| `ItemTable.json` | 372 | All items. Enums: Rarity, ItemType (Misc/Resource/Equipment/Food/Consumable/Ammo), ItemSubType (101–110 weapons, 201 arrow, 301–304 armor, 401–403 accessories), EquipmentType (slot). Equipment stats: `Equipment_MaxHealthTotal/PhysicalAttackPower/MagicAttackPower`, `Equipment_AdditionalStatuses` (encoded `Stat_value`), `Equipment_OnEquipAffecters`, `Equipment_ItemDefaultSkills`, `RandomTags`+`RandomTagAmount` (random-affix jewelry), `RequiredItemsRepair`. |
| `RecipeTable.json` | 153 | Crafting. `OutputItem`, `RecipeAvailableBuildings` (BUILDING_ keys), parallel arrays `IngredientKeys`/`IngredientAmounts`, `CraftingWorkloadRequired`. |
| `BuildingTable.json` | 499 | Buildings. `ConstructionRequiredItems`, `OnDeconstructReturnedItems`, `OnGatherItemsAndDrops` (DROP_/ITEM_ refs), Type/SubType/ConstructionCategory enums, Durability, StorageCapacity. |
| `UnitTable.json` | 108 | Units/monsters. Combat stats (MaxHealthTotal, Physical/MagicAttackPower, AttackSpeed, CriticalChance, Physical/MagicResistance, MovementSpeed, VisionRange), `DefaultTraits`/`DefaultSkills` (AFFECTER_/SKILL_ keys), `OnDeathItemsAndDrops`/`FirstKillItemsAndDrops` (DROP_/ITEM_ refs), Faction/SubFaction/BehaviourType enums, `OnDeathExp`. |
| `SkillTable.json` | 234 | Skills. SkillType (Active/Passive/Item/Building), DamageType, HitType, targeting enums, `FloatValues` (magnitudes; `{n}` placeholders in localized DESC), costs/cooldowns, `PrerequisiteSkills`, `CreatureKey` (summons), `RequiredEquipment`. |
| `SkillTreeTable.json` | 92 | Skill-tree grid: 23 trees × 4 tier-rows (`SKILLTREE_<Tree>_<0-3>`), 3 columns each. |
| `AffecterTable.json` | 653 | Buffs/debuffs/traits/inscriptions ("affecters"). Type enum: None/Race/Background/Individual/Inscription/Physical/Soul (96 inscriptions). `AdjustStatsData` encoded `Stat_value`, `FloatValues` feed `{n}` in localized DESC. |
| `TraitTable.json` | 211 | Recruitment-relevant affecters (keys are also `AFFECTER_*`) with **extra fields**: authoritative `Rarity` per trait/inscription (130 Common/33 Uncommon/45 Rare/3 Legendary), race rows carry background/individual-trait pools + weights, skill-tree affinities, talent-roll min/max. 7 races incl. unreleased (Lycan/Dwarf/WhiteDemon/Tal). 3 Soul traits (taming). |
| `StatusTable.json` | 129 | Stat registry. **`IsPercentStat` is authoritative for %-vs-flat display.** Applicability flags (PlayerUnit/OtherUnit/Item/Building). |
| `StatusValueTable.json` | 84 | Stat derivation: `PlayerDefaultValue` + per-major-stat coefficients (Strength..Perception) + `NonPlayerDefaultValue`. |
| `DropTable.json` | 227 | Loot pools. 3 slots each: `DropItem{One,Two,Three}_{ItemKey,Amount,ProbabilityWeight,Percentage}`. `ItemKey` may reference another `DROP_` pool (nested - expand recursively, multiply percentages). |
| `TradePoolTable.json` | 5 | Merchant pools. Parallel arrays: `AvailableItems`, `AppearChancePers`, `Min/MaxAmounts`, `Min/MaxDiscountPers`. |
| `EventTable.json` | 95 | Dungeon/NPC events. `StartNodeID` → nodes. `StartCondition` DSL, EventType enum (Fixed/Npc/Random/Decision/Tutorial/...), cooldowns. |
| `EventNodeTable.json` | 143 | Event dialog nodes. `LinkedEventID`, `ChoiceIDs`, `IllustKey`. |
| `EventChoiceTable.json` | 190 | Choices. `OnSelectAction` verb DSL: `AddItem_<Item>_<N>`, `AddAffecter_<X>`, `ShowNextNode_<Node>_<pct>`, `StartQuest_<Q>`, `RemoveItem_...`, `SelectDecision`, ... |
| `EventNpcMappingTable.json` | 6 | NPC → their event lists (Endrossi=Endorsi, Xenon, Perion, merchants). |
| `EventRandomMappingTable.json` | 9 | Random-event weights. |
| `DecisionTable.json` / `DecisionCategoryTable.json` | 65 / 7 | Expedition-resolution decisions per clan rank, category weights. |
| `QuestTable.json` | 110 | Quests. Types: Main(9)/Sub(19)/Tutorial(17)/Decision(65). `CompleteCondition` verb DSL. Names live in TextKeys. |
| `ResearchTable.json` | 31 | Research tree. `GridX/GridY` layout, `Prerequisites`, `ResearchResult` (unlocked ITEM_/BUILDING_ keys). |
| `DungeonRoomTable.json` | 232 | Dungeon room templates by region (VeilSilence 114, FesteringBurrow 77, Abyss 26, Tutorial 10, AbandonedMine 4). RoomType enum incl. Boss/Treasure/SafeFloor/Core/Patrol. `SpawnMonster` (SPAWN_ key), `SpawnBuildingList_1..6`, `SpawnItemCategory_1..2` (DROP_ refs → chest loot). |
| `SpawnGroupTable.json` | 75 | Monster spawn pools per region/phase/room-type; `SpawnPool` lists UNIT_ keys (duplicates = count). |
| `NPCSpawnConditionTable.json` | 7 | NPC spawn gating (required/prohibited record flags, spawn room). |
| `BaseAreaTable.json` | 51 | Base-map area templates (keys `BASEAREAROOM_`). |
| `HousingRoomTable.json` | 30 | Room-recognition rules (required buildings, quality thresholds). |
| `ClanRankTable.json` | 7 | Clan ranks 1–7: rank-up CP, population increase, recruit level/race weights. |
| `CandidatePresetTable.json` | 35 | Recruit presets (keys misspelled `CADIDATEPRESET_`). Race, traits, inscriptions, talents, gear. |
| `CampaignStartingTable.json` | 25 | Scenario starting kits (units/items/buildings + spawn positions); incl. dev/test scenarios. |
| `FarmingTable.json` | 2 | Crops (Oats, DustRoot): growth stages, linked growth buildings. |
| `RecreationTable.json` | 3 | Recreation buildings (dice/card/dart), capacities, buff affecters. |
| `AlertTable.json` / `EmotionBubbleTable.json` | 56 / 19 | UI alerts and emote-bubble trigger rules. |
| `GameSystemTable.json` | 448 | **Global tuning constants** (`GAMESYSTEM_*`): XP thresholds, level caps, inscription weights, time/tick constants, spawn rates... `FloatValues` + Korean `DevComment1` explaining `{n}` slots. |
| `TextKeyTable_en.json` | 8585 | Flat `{TEXTKEY: english}` dict (1407 keys fall back to Korean where EN is empty). |
| `TextKeyTable_languages.json` | 29 | Available localization columns in the game data. |
| `curated/*.json` | - | Hand-curated: `regions.json`, `races.json`, `mechanics.json` (articles+facts), `gated_content.json`, `glossary.json`. |
| `index.json` | - | Manifest: every table with row count, key field, prefix. |
| `db.json` | - | Everything above bundled: `{tables: {...}, textkeys_en: {...}, curated: {...}, meta: {...}}`. |

## Conventions (read this before joining)

- **Sentinels:** `"NULL"`, `"NOT_USED"`, `"Dev_NotUsed"`, `"None"` mean *empty* - filter them. Empty lists are often `["NULL"]` (1-element sentinel).
- **Display names:** `TEXTKEY_<EntityKey>_NAME` in `TextKeyTable_en.json` (also `_DESC`, `_FLAVOR`, `_SUBNAME`). Example: `ITEM_IronSword` → `TEXTKEY_ITEM_IronSword_NAME` = "Iron Sword". Localized DESC strings contain `{0},{1}...` placeholders filled from the entity's `FloatValues`, and inline `[STATUS_X]`/`[AFFECTER_X]` references.
- **Amount suffix:** cross-table item refs encode amounts as `<KEY>_<int>`: `ITEM_CopperIngot_3` = 3× Copper Ingot. Applies to construction costs, drops lists on units/buildings, starting kits, repair costs.
- **Stat strings:** effects are `"<StatusKey-without-STATUS_>_<value>"`, e.g. `MaxWeightPerModifier_50`. Percent-vs-flat: look up `STATUS_<name>` in `StatusTable.IsPercentStat`. Resistances are flat: damage × 100/(100+R).
- **Drop pools:** a pool slot's `ItemKey` may be another `DROP_` key - recurse and multiply the `Percentage` values (they are authoritative dev-side percentages; `ProbabilityWeight` is the raw weight).
- **Parallel arrays:** recipes (keys/amounts), trade pools (items/chances/amounts/discounts), trait pools (traits/weights) index-correspond.
- **Enums:** every enum field `X` has a sibling `XName` with the resolved C# enum member name.
- **Dev typos preserved as-is:** `CADIDATEPRESET_` prefix, `UNITVISUAL_` prefix in UnitProfileTable, `Avaliable*` field names in TraitTable, asset object "BuildingeTable".
- **Korean text:** `DevComment*` fields are Korean developer notes (authentic data, kept verbatim).

## Join graph (common queries)

- *Where does item X come from?* `RecipeTable[OutputItem==X]` ∪ `DropTable` pools containing X (then find pool sources: `UnitTable.OnDeathItemsAndDrops`, `BuildingTable.OnGatherItemsAndDrops`, `DungeonRoomTable/BaseAreaTable.SpawnItemCategory_*`) ∪ `TradePoolTable.AvailableItems` ∪ `EventChoiceTable.OnSelectAction ~ AddItem_X_N` ∪ `CampaignStartingTable.StartingItems`.
- *What does monster Y drop?* `UnitTable[Y].OnDeathItemsAndDrops` → expand DROP_ pools.
- *Where does monster Y spawn?* `SpawnGroupTable[SpawnPool ∋ Y]` → region/phase/room-type; `DungeonRoomTable[SpawnMonster==group]` → concrete rooms.
- *What can workstation Z craft?* `RecipeTable[RecipeAvailableBuildings ∋ Z]`.
- *What unlocks Z?* `ResearchTable[ResearchResult ∋ Z]`.
- *Skill tree of skill S:* find S in `SkillTreeTable.SkillKey_Column1..3`; tree = key minus `_<row>`.
- *Inscription rarity:* `TraitTable[key].Rarity` (authoritative), not the AffecterTable row.

## Site URL patterns (HTML pages)

`/items/ITEM_X.html`, `/units/UNIT_X.html`, `/skills/SKILL_X.html`, `/traits/AFFECTER_X.html`, `/affecters/AFFECTER_X.html`, `/buildings/BUILDING_X.html`, `/events/Event_X.html`, `/loot/index.html#DROP_X`, `/quests/index.html#QUEST_X`, `/statuses/index.html#STATUS_X`, plus list pages `/{items,units,skills,traits,inscriptions,affecters,statuses,buildings,recipes,research,farming}/index.html`, `/world/{regions,rooms,spawns,baseareas,housing}.html`, `/{loot,merchants,events,decisions,quests}/index.html`, `/clan/{ranks,recruits,scenarios,recreation}.html`, `/{mechanics,gated,constants,glossary}/index.html`. Global search index: `/searchindex.json` (`{n,s,t,u,i}` = name/sub/type/url/icon).

## Icons

`/icons/{items,skills,affecters,buildings,units,portraits,emotes,stats,regions}/<KEY>.png` - filenames are canonical table keys. Pixel art: render with `image-rendering: pixelated`. Missing files = entity has no art in game assets (usually gated/unreleased content).

## Localization & translations

- `/lang/<Language>.json` - entity-name maps for all 29 game languages (`{entityKey: localizedName}`, 2,230 entities each). The site's topbar language switcher consumes these client-side.
- `/dbdata/translations_ko_en.json` - English translations of all 3,920 Korean developer strings displayed on the site (keyed by exact source string). Pages show English; original Korean is preserved in `title` tooltips and in the raw table JSON.

## Feedback

`/feedback/index.html` - bug/data-error/feature reporting form. Endpoint configured in `/assets/config.js` (anonymous form service; no email exposed).

## Provenance & caveats

- Source: pristine (unmodded) `sharedassets0.assets.stock` of Steam buildid 23739108. No runtime/save data included.
- `GAMESYSTEM_LevelUp_MaxLevel`=12 is the absolute cap; `GAMESYSTEM_LevelUp_BuildMaxLevel`=4 is the current-build cap.
- Content present in tables is not necessarily *reachable* in-game (gated tiers, empty skill trees, zero-room regions, zero-weight races). The site's "Gated" badges are computed from obtention-route absence.
- 4 duplicate TextKeys exist in raw data (last-wins in the EN dict).
