RE:NODE
Browse hosting

Guides13 min read

DayZ types.xml and the loot economy: editing it safely

How DayZ loot spawns: types.xml nominal, min, lifetime and restock, usage and tiers, events.xml, custom ce folders, and editing without emptying the map.

0 readers

DayZ does not scatter loot randomly. Every item on the map is placed by the central economy, a bookkeeping system that counts what exists, compares it against a target, spawns what is missing into positions that match, and deletes what nobody has touched for long enough. types.xml is the ledger it works from: one entry per item class, with a target count, a floor, a lifetime, a restock timer and a list of the places the item is allowed to appear.

Once you know that, most loot complaints have obvious answers. A town is bare because the items that belong there are already on the map somewhere else, or because their entry never had a matching usage. A mod's guns do not spawn because the mod's items were never added to the economy at all. And a server that emptied out overnight usually did not lose its loot - it lost a closing tag, and the file stopped parsing.

This is the detailed version of a DayZ server that survives its own mod list. It covers the files, the fields, events, mod items, and a routine for editing that will not cost you a wipe.

Where the economy files live#

Everything is inside the mission folder, which for standard Chernarus is mpmissions/dayzOffline.chernarusplus/. Livonia is dayzOffline.enoch and other maps follow the same pattern; the mission in use is set by template in serverDZ.cfg.

FileWhat it holds
cfgeconomycore.xmlWhich economy files to load, including your own
db/types.xmlEvery item: counts, lifetimes, where it may spawn
db/events.xmlVehicles, helicopter crashes, dynamic spawns
db/globals.xmlGlobal limits and timers for the whole economy
db/economy.xmlWhich persistence categories load and save
db/messages.xmlTimed server broadcasts, and usually the restart
cfgspawnabletypes.xmlAttachments and cargo on spawned items
cfgrandompresets.xmlNamed cargo and attachment presets
cfgeventspawns.xmlThe coordinates each event may use
cfglimitsdefinition.xmlThe legal names for category, tag, usage and value
cfgplayerspawnpoints.xmlWhere players arrive
storage_1/Persistence: the world state that survives a restart

Two of those are more useful than their names suggest. cfglimitsdefinition.xml is the authoritative list of what you are allowed to write in a usage or value element on your map, which saves a great deal of guessing. And cfgeconomycore.xml is how you add files of your own without editing anyone else's, which is the single best habit in DayZ administration.

The economy files are read when the mission starts. Nothing here is live. Every change means a restart, and a change made while the server is running is a change made to a file the server has already finished reading.

How the central economy actually decides#

The economy runs in passes. On each pass it does roughly this:

below minnext passCleanuplifetime expiredCompareagainst min and nominalSpawn queuerestock gates rateLoot positionusage and tier matchCount on mapthe flags decide
One pass of the central economy

Three consequences follow, and they explain most of what looks like broken loot.

`nominal` is a target, not a promise. The economy will not create an item it has nowhere to put. If an item's usage list does not match any building on the map, or its value tier does not exist in any region, the nominal can be 500 and you will never see one.

Items already in the world count against the target. That is what the flags are for, and it is why a server where everyone has a full tent can have empty towns. The economy is doing exactly what you told it: the guns exist, so it is not making more.

Nothing happens instantly. restock gates how often a type may be topped up, and lifetime decides when an untouched item is cleaned away to free the slot. Raising a nominal does not fill the map in five minutes; it raises the ceiling that the next few hours of restocking will climb towards.

Reading a types.xml entry#

A full entry looks like this. Every field is optional except the name and the counts, but a well-formed entry has all of them:

db/types.xml
<type name="M4A1">    <nominal>15</nominal>    <lifetime>14400</lifetime>    <restock>1800</restock>    <min>8</min>    <quantmin>-1</quantmin>    <quantmax>-1</quantmax>    <cost>100</cost>    <flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1"           count_in_player="0" crafted="0" deloot="0"/>    <category name="weapons"/>    <usage name="Military"/>    <value name="Tier4"/></type>
FieldWhat it means
nominalThe target number on the map when the counting flags allow
minThe floor. Below this the economy starts putting more back
lifetimeSeconds an untouched item survives before cleanup
restockSeconds before this type may be topped up again, 0 for as soon as possible
quantmin / quantmaxFill percentage for anything with a quantity, -1 for the default
costSpawn priority, 0 to 100, when several candidates fit one slot
categoryBroad group: weapons, clothes, containers, explosives, food, tools

The flags decide what counts towards nominal, and they are the most under-used tool in the file:

FlagSet it to 1 when
count_in_mapItems lying loose in the world should count. Almost always 1
count_in_cargoItems inside containers on the ground should count
count_in_hoarderItems in tents, barrels and buried stashes should count
count_in_playerItems carried by players should count
craftedThe item is one players make, not one the economy places
delootThe item may appear at dynamic events such as crash sites

If a high-value item feels far too common on a long-lived server, the usual cause is count_in_hoarder and count_in_player sitting at 0. Every rifle players squirrel away is invisible to the economy, so it keeps producing replacements until there are hundreds in tents and fifteen on the map. Setting both to 1 for weapons and ammunition ties supply to what actually exists, and it is the closest thing DayZ has to a loot economy that behaves like an economy.

lifetime is the other lever people forget. A short lifetime on junk keeps positions free for things worth finding. A long one on rare items means they sit in the woods where somebody dropped them, occupying a slot that could have held a new one.

usage, value and tag: where an item may appear#

Three elements control placement, and all three are repeatable. An entry with several usage lines may appear in any of those area types.

  • `usage` names the kind of building or area: Military, Police, Medic, Firefighter, Industrial, Farm, Hunting, Office, School, Prison, Town, Village, Coast.
  • `value` names the loot tier, which is roughly how far from the coast and how dangerous the region is. Chernarus has been through several tier reworks, and newer maps have more tiers than older ones.
  • `tag` names the kind of loot position: floor, shelves, ground.

Do not take that list as gospel for your map. The names that are legal are defined in cfglimitsdefinition.xml in your own mission folder, and cfglimitsdefinitionuser.xml lets you group them under names of your own. Open both before you invent a usage. A usage or value that does not exist is not an error you will be shown; it is an item that never spawns. Bohemia's own reference for the whole system is the Central Economy mission files page, and it is the only external document worth having open.

An entry with no usage at all cannot be placed by the building loot system. That is deliberate for items that only arrive through an event or as cargo inside something else - and it is the answer when a perfectly valid entry with a healthy nominal produces nothing.

events.xml and the things that are not loot#

Vehicles, helicopter crashes, police cars, boats and the dynamic infected that come with them are not items. They are events, defined in events.xml:

db/events.xml
<event name="StaticHeliCrash">    <nominal>4</nominal>    <min>2</min>    <max>5</max>    <lifetime>1800</lifetime>    <restock>0</restock>    <saferadius>500</saferadius>    <distanceradius>500</distanceradius>    <cleanupradius>1500</cleanupradius>    <flags deletable="0" init_random="0" remove_damaged="1"/>    <position>fixed</position>    <limit>mixed</limit>    <active>1</active>    <children>        <child lootmax="0" lootmin="0" max="3" min="1" type="Wreck_UH1Y"/>    </children></event>

saferadius keeps an event from spawning on top of a player. distanceradius keeps two of the same event apart. cleanupradius is how close a player must be before the event's leftovers are removed. position is fixed for events placed at coordinates and player for ones that spawn near someone. active is the on switch. The children are the classnames the event may actually place, with how many of each.

The coordinates themselves are in cfgeventspawns.xml, one block of positions per event name. Adding more cars to a map therefore means two edits: raising nominal in events.xml, and making sure there are enough spawn points listed for it in cfgeventspawns.xml. Raising the nominal alone gets you nothing, because the economy has run out of places to put them.

Vehicles have one more wrinkle. A wreck still counts unless the event's remove_damaged flag clears it, so a server where players have destroyed every car can reach its nominal without a single drivable vehicle existing.

Custom ce folders, and mod items that never spawn#

A mod adds classnames. It does not add economy entries, and the economy will not spawn a class it has never heard of. That is the whole explanation for the most common DayZ support question: the mod is loaded, the guns are in the files, and nothing spawns them.

Most mods ship their own types file. The correct place for it is a folder of your own, registered in cfgeconomycore.xml:

cfgeconomycore.xml
<economycore>    <!-- leave the vanilla contents exactly as they are -->    <ce folder="custom">        <file name="mod_types.xml" type="types" />        <file name="mod_spawnabletypes.xml" type="spawnabletypes" />        <file name="mod_events.xml" type="events" />    </ce></economycore>

Create custom/ in the mission folder, drop the mod's files in, and list each one with the right type. The custom types file is an ordinary <types> document containing only the mod's entries.

Why bother, rather than pasting the entries into types.xml? Because a DayZ update replaces the mission files. Anything you added to types.xml is gone; anything in your own folder survives, and re-registering it is one line. Keep your own additions in your own files and you will lose an afternoon to updates instead of a weekend.

Two follow-ups when a mod item still behaves oddly:

  • It spawns empty. A rifle with no magazine and no optic needs an entry in a spawnabletypes file, which is where attachments and cargo are defined.
  • It appears everywhere. The mod author set a generous nominal and a wide usage list to make sure you would notice it. Those are your numbers to change now, and a mod's defaults are a suggestion rather than a balance decision.

Keeping the mod list and the economy in step is most of the work on a modded server, which is also the theme of keeping a modded server clean.

A routine for editing without emptying the map#

The economy has no validation step that a player will ever see. A malformed file is not an error at the join screen; it is a server that starts, runs, and contains nothing.

  1. Keep a pristine copy of the mission folder. Before the first edit, copy it somewhere off the server. This is the only thing that makes step 6 possible.
  2. Edit one file at a time, with the server stopped. The panel's in-browser editor with syntax highlighting is enough, and it will show you a tag that does not close; SFTP and the file manager covers pulling the whole folder down instead.
  3. Validate the XML before you restart. Any validator will do. Most broken DayZ economies are one missing / in a closing tag.
  4. Restart, and read the log. The server writes an .RPT file in its profiles folder at every start, and economy parse failures are in it, named by file.
  5. Give it time before judging. Restock timers and lifetimes mean a change takes hours to be visible, not minutes. Do not make a second change while waiting to see the first.
  6. If the map is empty, put the pristine copy back and redo the edit. Do not debug a live wipe.

Persistence, storage and wipes#

storage_1/ holds everything the world remembers: the .bin files that record dynamic objects, vehicles and built structures, and players.db with the characters. The economy's own state lives alongside them.

  • Deleting `storage_1` is a full wipe. Tents, vehicles, bases, characters, all of it.
  • Deleting only `players.db` resets characters and leaves the world standing, which is the "character wipe" people usually mean.
  • `storageAutoFix = 1;` in `serverDZ.cfg` lets the server repair a damaged persistence file at start instead of refusing it. Set it. The alternative to an automatic repair is not an intact file, it is a manual one.

A structural change to the economy - a new map, a mod that changes item classes, a rework of tiers - generally wants a wipe, because the old persistence refers to a world that no longer exists. A tuning change to nominals does not.

Restarts themselves are part of DayZ administration rather than an interruption to it. Most servers restart every three or four hours, both to clear accumulated state and because several economy behaviours only reset at mission start. db/messages.xml broadcasts the warnings on a timer and, in current versions, can carry the shutdown itself. The alternative is a scheduler outside the game: on RE:NODE that is the Schedules tab, where a cron expression runs ordered tasks with delays, so one schedule can send a warning, take a backup and then restart the server. Restart schedules that help covers how often is too often, and scheduled tasks worth having has the rest of the list.

Back up the mission folder and storage_1 together, because restoring one without the other gives you an economy that disagrees with the world. Backup slots on RE:NODE's DayZ plans are stored off the machine they protect and restore with a button, which is what you want at the point where the map has gone empty and nobody is sure which edit did it. Backups that actually restore is the argument for testing that before the bad day.

Troubleshooting#

The whole map is empty after an edit. The file failed to parse. Check the .RPT for the filename, or just restore your pristine copy and redo the change.

A mod's items never spawn. No economy entry. Register the mod's types file in a custom ce folder.

I raised the nominal and nothing changed. Restock timers, or no matching loot positions. Confirm the usage and value names exist in cfglimitsdefinition.xml for your map.

Towns are bare but the players have everything. Working as configured. Set count_in_hoarder and count_in_player to 1 on the item types you care about, and the economy will stop replacing what is already out there.

Military loot is everywhere it should not be. Check usage and value on those entries rather than nominal. An item with Town in its usage list will appear in towns no matter how low you set the count.

Vehicles do not come back. They are events. Check the event's nominal, whether cfgeventspawns.xml has enough positions, and whether destroyed wrecks are still counting.

The server starts but the log is full of economy warnings. Usually a duplicate type name across two files, which happens when a mod's entries were pasted into types.xml and also loaded from a custom folder. Keep each class in exactly one place.

FAQ#

What is the difference between nominal and min in types.xml?

nominal is the target number the economy aims for. min is the floor that triggers restocking. When the counted number drops below min, the economy starts adding more until it reaches nominal, subject to the restock timer.

Why does an item with a high nominal still never spawn?

Either nothing counts it, or nothing can place it. Check count_in_map is 1, then check that the usage and value names on the entry actually exist for your map in cfglimitsdefinition.xml. An entry with no usage cannot be placed as building loot at all.

Do I need to restart the server after editing types.xml?

Yes. The economy files are read once, when the mission starts. Nothing in types.xml, events.xml or cfgeconomycore.xml applies to a running server.

How do I add a mod's items to the loot economy?

Put the mod's types file in a folder of your own inside the mission, then register it in cfgeconomycore.xml with a ce block and type="types". Attachments and cargo need a spawnabletypes file registered the same way.

Will editing the economy wipe my server?

Tuning counts and lifetimes will not. Changing the map, or changes that alter which item classes exist, generally will, because the saved world refers to objects that are no longer defined. Back up storage_1 and the mission folder together before either.

How long until a loot change is visible?

Hours rather than minutes. Existing items have to reach the end of their lifetime before their slots free up, and restock timers pace how fast replacements appear. Make one change, wait a day, then judge it.


Comments

Completely anonymous: no account, no email, no cookie. We store the name you type, the text and the time - nothing else. Links are limited and markup is not rendered.

0/2000