Central Economy
The Central Economy (CE) is the part of a DayZ server that decides what spawns in the world: loot in buildings, vehicles, helicopter crashes, animals, infected. It is driven by a handful of XML files in the server's mission folder. This page opens such a folder, shows its loot table next to the items of the game and of your mods, lets you change values one item at a time or many at once, checks the files for mistakes, and forecasts how the economy behaves over hours of game time without starting a server. You use it when you run a server, or when you add the items of a mod to its loot. You need a mission folder (a folder that holds db/types.xml); if you have no DayZ Server installed, the page ships a small sample mission to learn with.
The screen
- Header: badges (working, reading game data, number of modified files), Undo and Redo, Reload (reads the files again from the disk), Backups (the copies made by each save) and Save.
- Mission bar: the list of missions found on this computer (recent ones, then those of DayZ Server and DayZ in every Steam library), Open folder… for any other mission, Mods (the mods your server runs, so their items are known), Import mod types…, the number of game classes read, and the tab strip.
- Tabs: Types, Spawnables, Events, Globals, economy.xml, Limits, Forecast, Issues. Each one edits one file of the mission, except Forecast and Issues, which check all of them. The Issues tab carries the number of problems; it is red when at least one is an error.
- Types tab, status filters: All items, In loot files, Not in loot files (the game or a mod has the item, no types file lists it), Not in game data (a types file lists a class the game does not know), Has problems.
- Types tab, filter row: search box (part of a class or display name, or a pattern with
*and?, Ctrl+F), filters by kind, mod, category, usage and value, list or card view, the number of rows, the sum of their nominal, and the pages (250 items each). - Types tab, bulk bar: Bulk edit… changes one value on every type the filters show; on the right, a button adds the filtered items that are not in the loot files yet.
- Types tab, table: one row per item with its icon, class name, display name, kind, mod, category, nominal, min, lifetime, restock, quantmin, quantmax, cost, usages and values. Click a column title to sort; click a row to select it; arrow keys move the selection.
- Types tab, inspector (right): the selected item's picture, file and line, its problems, the number fields (a field with a problem turns red; arrow up and down change the value, Shift for bigger steps), category, flags, usages, values (tiers), tags, Where it spawns (the buildings that take it and their loot points), and Delete type.
- Spawnables tab:
cfgspawnabletypes.xml. For each type: the damage it spawns with, whether it spawns in stashes, and the blocks of attachments and cargo it comes with (a list of items with chances, or a preset ofcfgrandompresets.xml). - Events tab:
db/events.xml. A table of events (name, kind, nominal, min, max, lifetime, position mode, number of positions incfgeventspawns.xml, children) and an inspector with every field and the list of children. - Globals tab:
db/globals.xml, the server-wide settings. Each variable shows its value, its type, the vanilla value, what it does, and a reset button. - economy.xml tab:
db/economy.xml. One row per part of the economy (loot, animals, infected, vehicles, random events, custom, buildings, players) with four switches: init, load, respawn, save. - Limits tab:
cfglimitsdefinition.xml. The categories, tags, usages and values that types may use, with how many types and buildings use each. Add, rename (everywhere at once) or remove an unused name. - Forecast tab: choose a game time (1, 6, 24 or 72 hours), click Check my economy, then read one card per kind of problem and the list of findings, each with its cause and a curve of the count over time.
- Issues tab: every problem found, with severity, code, type, message and file:line. Click a line to show the type in the Types tab.
First steps
- Open the page. If no mission is open, click Open a mission folder and choose the mission of your server (for example
mpmissions/dayzOffline.chernarusplus), or click Open the sample mission. - In the Types tab, type
AKMin the search box and click the row. - In the inspector, raise nominal from 3 to 5. The header shows "1 file modified".
- Look at the Issues tab number. Open the tab, click a problem, fix the field shown in red.
- Press Ctrl+S. The files are saved and the previous ones are copied to
.beans-ce-backups/in the mission folder. - Open the Forecast tab and click Check my economy to see whether every item can reach its nominal.
- Restart the server so that it reads the new files.
Take the tour (in the app)
Common tasks
Make an item more or less common
- Types tab: search the item and select it.
- Change nominal (how many the map should hold) and min (below this count, more spawn). Keep min at or below nominal.
- Save, then check the Forecast tab: a nominal the buildings cannot hold shows under "Below their nominal".
Change many items at once
- Filter the table (for example category
food). - Click Bulk edit…, choose the field and the operation (scale, set, add; or add and remove a usage, value, tag, flag; or set the category).
- Click Apply to N types… and confirm. Scaling nominal scales min with it. Ctrl+Z undoes the whole edit.
Add the items of a mod to the loot
- Click Mods and tick the mods your server runs: their items appear with the status "Not in loot files".
- Either click Import mod types… and choose the mod folder or its
types.xml(new types, identical ones and conflicts are listed before anything is written), - or filter the mod in the table and click Add the N filtered items not in loot files: each item copies the values of its closest relative already listed.
- Review the new rows, save.
Find out why an item never spawns
- Select it in the Types tab and read Where it spawns in the inspector. "In no building" means no building on the map has one of its usages, values, category and tags.
- Open the Forecast tab, run the check and click the Never spawn card: each line states the cause.
- Fix the usage, value or category, save, and check again: the tab says what was solved since the last check.
Restore the files of a previous save
- Click Backups in the header.
- Choose a backup by its date and click Restore. The current files are backed up first, then the mission is read again.
Change an event (vehicles, crash sites)
- Events tab: select the event.
- Change nominal, min, max, or the children (which types it spawns and how many).
- An event with the position mode
fixedneeds positions incfgeventspawns.xml; the table shows how many it has.
Start from a recipe
With no mission open, the empty state lists the recipes for this page as chips (New item, Loot crates, World event…): a click starts one in Beans Assistant, which asks a few questions, proposes a plan and works step by step with checks. All recipes opens the whole catalogue. The help panel (F1) lists them too.
Examples
- Sample mission (in the app): a small mission written for Beans Workbench (sixteen items, two events, five kinds of buildings). It is copied to
beans-examples/economy-samplein your temp folder and opened like any mission. Edit and save freely; delete the folder to get a fresh copy. - Problems in the sample (in the app): the Issues tab of the sample. Two mistakes are left in on purpose:
Matchboxhas a min above its nominal, andHuntingKnifeasks for military buildings of Tier1, while those of the sample are Tier3 and Tier4. - Forecast of the sample (in the app): the Forecast tab of the sample. Run the check and look at the "Never spawn" card (the knife), "Below their nominal" and "Often below min".
- Events of the sample (in the app): parked cars at fixed positions and a helicopter crash with event loot.
Concepts
- Mission folder: the folder of a server under
mpmissions/(for exampledayzOffline.chernarusplus). The page readsdb/types.xml,db/events.xml,db/globals.xml,db/economy.xml,cfgspawnabletypes.xml,cfgrandompresets.xml,cfglimitsdefinition.xml,cfglimitsdefinitionuser.xml,cfgeventspawns.xml,cfgeconomycore.xmland the extra types, spawnable types and events files thatcfgeconomycore.xmldeclares for mods, plusmapgroupproto.xmlandmapgrouppos.xml(the buildings). - Type: one
<type name="…">entry of a types file: one item class and the rules of its spawning. An item that has no entry is never spawned as loot. - nominal: the number of this item the economy tries to keep in the world. min: when the count falls below it, the economy spawns more, up to nominal. Min above nominal is a mistake.
- lifetime: seconds an item stays in the world untouched before it is removed. restock: seconds to wait before spawning again once the count fell below min (0: as soon as possible).
- quantmin / quantmax: for items that hold a quantity (water in a canteen, rounds in a magazine), the lowest and highest fill in percent when they spawn.
-1on both: not used. - cost: the spawn priority against other items of the same usage; 100 by default.
- flags:
count_in_map,count_in_cargo,count_in_hoarderandcount_in_playersay which copies count toward nominal: lying on the map, inside containers, in stashes, carried by players.craftedmarks an item that is only made by crafting.delootmarks event loot, spawned at events such as helicopter crashes and not in buildings. - category, usage, value, tag: where the item may spawn. A usage is a kind of building (Military, Town, Farm…). A value is an area of the map, Tier1 (coast) to Tier4 (far inland). A category (weapons, food, clothes…) and a tag (floor, shelves) pick the loot containers inside a building. The names allowed are defined in
cfglimitsdefinition.xml. - How loot spawns:
mapgroupproto.xmldescribes each building class: its usages, its values, and its containers with their categories, tags and loot points.mapgrouppos.xmllists every such building on the map. The economy counts each type; when one is below its min it looks for a building that shares a usage (and a value when both have some), a container that takes its category and tag, and a free point. A building and a container hold at most theirlootmaxitems, so types compete for the room. - Spawnable types: what an item spawns with: attachments on a weapon, cargo in a backpack, and its damage.
- Events: everything that is not building loot: vehicles, wrecks, animals, infected. An event keeps between min and max instances (nominal is the target) and spawns one of its children, at the positions of
cfgeventspawns.xmlwhen its position mode isfixed. - Forecast: a model of the economy run on the saved files: initial fill, lifetimes, restock and respawn into the buildings that take each type. It is an estimate; the "Estimate" label lists the rules it is not sure about. It needs
mapgroupproto.xmlin the mission. - Applying changes: the server reads these files when it starts, so restart it after saving. Items already in the world stay until they are taken or their lifetime ends, so the map moves toward the new numbers over hours. Wiping the server's storage (the
storage_1folder of the mission) makes it start from an empty map; it also removes bases, vehicles and everything players stored, so do it only when you mean to. - References: the Bohemia wiki page Central Economy Configuration and the vanilla mission files published at github.com/BohemiaInteractive/DayZ-Central-Economy.
Pitfalls
- Editing while the server runs. The server does not read the files again until it restarts. The page says so after your first save.
- Min above nominal, unknown usage or category, quantmin above quantmax. The Issues tab lists them and the inspector shows the field in red.
- A type that no building takes. It is valid XML and never spawns. Read "Where it spawns" in the inspector and the "Never spawn" card of the forecast.
- A nominal the map cannot hold. Raising nominal past the room in the buildings changes nothing. The forecast lists these under "Below their nominal" and offers the count the map reached.
- Forecast on unsaved edits. The forecast reads the files on disk; the tab warns you when the mission has unsaved changes.
- Renaming a usage by hand. A name must change in
cfglimitsdefinition.xml, every types file andmapgroupproto.xmltogether. The Limits tab renames it everywhere. - Another program changed the files. The page reads them again when nothing is unsaved; otherwise a banner asks. A save over a file changed on disk is refused until you choose to reload or to save anyway.
- Losing a good state. Each save keeps a copy of the files it replaces in
.beans-ce-backups/(the newest 20); Backups restores one. - Mod items shown as "Not in game data". Tick the mod in Mods so its classes are read.
For agents
- Tools of
dztthat do the same work without the window: ce_missions: list the mission folders found under DayZ Server.ce_validate: load a mission and report its problems (the Issues tab).ce_query_types: query types by search, category, usage, value, tag, flag, nominal range.ce_edit_types: bulk edit of the types matching a filter, saved with a backup;dry_runpreviews.ce_add_types: add class names with vanilla-like defaults or a template entry.ce_merge_types: import a mod's types (and its spawnable types and events) into a mission.ce_spawn_places: the buildings and containers where types can spawn ("Where it spawns").ce_limits_list,ce_limits_edit: the names ofcfglimitsdefinition.xmland their uses; add, remove, rename everywhere.sim_run: the forecast (economy twin) of a mission;sim_compare: two runs side by side;sim_log: compare with the CE lines of a server log.map_zones,map_zone_edit: event positions and other zones of a mission.- Files read: the mission files listed under Concepts, and the game and mod PBOs (read-only) for the item catalog and icons. Files written: only the mission files that changed, on Save, each backed up first under
.beans-ce-backups/<time>/in the mission folder. The sample mission is written to<temp>/beans-examples/economy-sample/. - What the page tells the assistant (its page context): the mission folder, the open tab (
types,spawnables,limits,issues,events,globals,economy.xml,forecast), the search text and the category filter, the selected type and the file it is in, whether there are unsaved changes, and the list of problems (warnings and errors, each prefixed by its type). It offers the action "Check my economy". - Elements a guide can point at (
data-guide):economy-mission,economy-mods,economy-tabs,economy-tab-types,economy-tab-events,economy-tab-forecast,economy-tab-issues,economy-empty,economy-open-sample,economy-status,economy-filters,economy-bulk,economy-table,economy-inspector,economy-issues,economy-forecast,economy-forecast-run,economy-backups,economy-save. - Never open player data in a mission's storage folders; the page only reads the files listed above.
See also
- Traders: prices and stock computed from the rarity of items in the Central Economy.
- Map: event positions and loot for the buildings you place.
- Launcher: start a local test server to try your changes.
- Beans Assistant: ask it to check the economy or explain a problem.
- Tour of the Workbench