[8.1] Manual Loot Editing of MapGroupProto.xml - InclementDab/DayZ-Editor Wiki

The CE (central economy) of the game is a pretty complex beast. It handles all spawning of items, vehicles, animals and zombies. The mapgroupproto.xml contains all the information for loot spawns globally. This means every individual building of the same name uses the exact same tables for loot. The one exception of this is the AreaFlagsMap. The AreaFlagsMap is an overlay on the map that determines the tiers of loot that is being spawned. The basic loot tables are set up for every building through usages, they then get filtered down in to more specific loot through categories, and tags. Then finally the location of the building is used to determine the Tier of loot spawned through the AreaFlagsMap.

Group:

This is simply the class name of the building/object. Though it also has a lootmax value for the whole building/object. Whatever this lootmax is set to will not allow anymore than that number of spawns throughout all loot points for that building. Even if containers have higher numbers the max allowed will not change.

Usage:

All items in the types.xml are assigned with usage(s). All items under the same usage make a loot table the CE uses to select items to spawn. Only items under this usage can be spawned. This is the most broad loot table the CE uses. The other values used in containers, categories and tags will allow you to fine tune the loot spawns for every type of object. You can define a single, or multiple usages depending on the loot you want to spawn.

As an example.

There are 5 usages listed. This setup will allow for very diverse loot tables. But remember, usages are the most broad ranges of loot tables. And you should be fine tuning the loot by setting up container(s) category(s), and tag(s).

Usage names: Main loot types that spawn. (Total Items includes all items that are turned off or set to not spawn. ie. Pens, Opened cans of food)

Container:

Not to be confused with the category, containers.

This does not change the spawn location for any item, or change what items are spawned. Its just a way to organize the loot spawns into easily understandable groups, and defines how many loot points the "lootmax" can be populated for that specific container at anytime per building. All groups of loot points start with a container.

As an example.

This shed only has a container for "lootfloor" and a loot max of 2. The name of the container can make it easier to know what types of loot and general locations of the loot points. If you were to change the "lootmax" to 4, this would allow up to 4 spawned items to be present at anytime.

Tags:

Many items in the types.xml are assigned to a tag. These tags can be used to further limit the types of loot that spawns. Usually you add these tags to allow spawning items you would normaly find on the floor or shelves in those locations. Doing this does not change where loot spawns. It requires you to set and keep track of the groups of points you added for floor and shelves. Most if not all shoes and boots have the tag for floor. Most ammo boxes have the tag for shelves. You do not need to add tags to your containers. If no tags are present the loot will not be filtered any further than Usage and Category.

Categories:

These are pretty self explanatory. The values listed in cfglimitsdefinition.xml define the loot tables that are used to spawn loot under that specific container. Each item in the types.xml is assigned to a category depending on the type of item. You can list any number of these categories under any container to diversify loot, or force only a single category of items to spawn like weapons, or food.

As an example.

All loot points listed under the category have chances to spawn every item assigned with tools, containers, clothes. Each individual building will have different tiers of loot, this depends on the AreaFlagsMap and where each building is located on the map.

Category names: (Total Items includes all items that are turned off or set to not spawn. ie. Pens, Opened cans of food)

Example adding spawns to objects that don't have loot points.

I have set up a basic object spawn and added loot spawns to it. Double clicking will add a loot point. This is how it looks after adding loot spawns inside the Editor.

Open your servers Mapgroupproto.XML file, and at the bottom of the file paste in the data that was copied to your clipboard. It will look like this.

When you paste the information that was copied to your clipboard, you will see a very similar setup no matter the object you're setting up, or changing. Remove any doubled points you might have accidentally added. Change/remove/add any Usages you want the object to have. For now you don't need to change the lootmax, but i did because i want all 6 points to be allowed to spawn items.

At this point the spawns should be working, but they will have very diverse loot types being spawned. To filter down the items you will need to group any loot points into smaller containers, and add categories and tags. Your edited object can have as much diversity of loot as you want. But I am attempting to limit the loot down as much as possible so I can show the difference between the 4 Tiers in the AreaFlagsMap.

After you're done making changes, save the file. Go into your server init.c and add or re-enable the export function. (Add link to exporting data) Then save and start the server. Allow your server to run until you see the "[CE][MapExport] :: entity found:39234, entity valid:11758, types total:344... took 18 sec". You can now shut the server down, and find the new exported mapgrouppos. Copy that file and go back to your mission files folder where the original mapgrouppos.xml is located. Paste your exported file in and overwrite the old one.

Now that you have set up basic loot spawns. You need to know what the AreaFlags.Map does. This overlay is used to limit item spawns based on Tier(s). Each color on the map is a different Tier, found in your servers cfglimitsdefinition.xml under . Vanilla Tiers are also used to give players a sense of progression, and incentives for higher risk areas. Depending on the maps mission files there may be drastically different values inside the cfglimitsdefinition.xml. Also the AreaFlags will be different depending on the mission files.

Types.xml:

Another very important file is the types.xml file inside the db folder of your server. You can reference the types.xml to figure out what values to use for your edited building loot spawns. Each item also has a nominal value assigned to it. The CE uses this nominal value to determine if the item should be attempted to spawn. When adding buildings you need to keep in mind that you are changing the % chance of everything that is set to spawn per building. In other words. If you add 20 military tents, you have lowered the chance to find any weapon, ammo, clothing ect. So the last thing to do when editing maps is to rebalance the loot. You probably will only need to tweak guns specifically since they are the most rare things to find before adding more spawns points and making it even more rare. Vanilla Chernarus allows a max of 45 ARs spawned on the map at anytime. Ignoring the ones players have on them, in cargo, or in bases. So if you add 20 more buildings and you want to find an AR easily, you would have to increase the spawns. But to attempt to keep in line with Vanilla, you should only increase the amount from 45, up to 50 max. Even then that's probably too much. In the end its your server so do what you like with the nominals. Depending on the maps mission files there may be drastically different values inside the types.xml.

10 AKM | 10 AKS75U | 10 AK74 | 10 M4A1 | 5 AKA101

Additional CE loot server info

Changing Logging settings for full information on what the CE is doing. Your servers cfgeconomycore.xml contains many options for logging. Simply change any log_ce value to true to enable loggings for that type. The most usefull ones for loot are log_ce_lootspawn, log_ce_lootcleanup and log_ce_lootrespawn.

Extra Settings to allow servers to cycle loot at 0 population. Servers default settings are set to allow the CE to go into an idle mode. This happens when no one is on the server for more than 60 seconds. Once someone joins the server the CE will continue to run. Allowing the CE to idle reduces resource usage of the server.

You can allow your server to cycle loot while no one is playing on it. Find and open your server globals.xml. IdleModeCountdown value in seconds before the idlemode will start default (60). IdleModeStartup value change to 0 will override the normal 60 second timer to your set timer value for IdleModeCountdown.

Heli crashes and police wrecks "stacking" is due to those objects having lifetimes. This allow them to be cleaned up after their timers run out. Also because they are dynamically spawned through events. Refrain from using these 7 wrecks.