--- title: libraries: where X4 keeps its world rules summary: Find the XML tables for economy, population, game starts and behavior. section: data kind: guide status: reference updated: 2026-10-27 tags: ["X4","modding","game","data","libraries"] sources: ["https://chemodun.github.io/x4/modding-support/anatomy-of-game-data/libraries/"] --- ## Start with the task `libraries/` holds data tables. MD consumes data and performs actions; Lua displays it in the interface. Editing a table and running a script are separate steps. This X4 9.00 map helps you choose a file to investigate first. ## File map | What to change | Start here | | --- | --- | | Prices and recipes | `wares.xml` | | Available ships and selection groups | `ships.xml`, `shipgroups.xml` | | Station plans | `constructionplans.xml`, `stationgroups.xml` | | Equipment compatibility | `equipmentcompatibilities.xml` | | Drone and consumable selection | `loadoutrules.xml` | | NPC ship replenishment | `jobs.xml` | | Initial station placement | `god.xml` | | Factions, races and relations | `factions.xml`, `races.xml`, `diplomacy.xml` | | Player starting conditions | `gamestarts.xml` | | Main-menu background scene | `startmenu.xml` | | Resource areas | `regionyields.xml`, `mapdefaults.xml` | | Dropped items | `drops.xml` | | Game-system parameters | `parameters.xml` | | Terraforming and feature unlocks | `terraforming.xml`, `unlocks.xml` | These are search pointers, not a promise that one file is enough. A new ship, for example, connects a macro, ware, indexes and text. ## Read the file you found Extract matching data with [X Catalog Tool](wiki:tool-catalog). Identify the document root, entry and ID. Check its schema where declared, then other tables using that ID. Some tables gather full extension files; other changes use diff patches. Choose the form for that particular file and a working analogue, not merely its directory name. Independent exercise: outline the dependencies of a fictional patrol. ```text wiki_patrol_job -> ship group -> ship macro -> default AI order -> quota + location ``` **Result:** a list of references to find and validate. This reasoning diagram creates no ship and prints nothing in game. ## Next steps [NPC ships and stations](wiki:jobs-and-god), [game starts and menu backgrounds](wiki:gamestarts-and-menu), [wares and prices](wiki:wares-and-prices), [resource areas](wiki:resource-areas). The source covers `people`, `stats`, `quotas` and `missiongroups` in more detail; this wiki does not yet provide complete courses on them.