Persistent Loot

I have had the Dayz Standalone since it came out and have logged in about .. oh, 20 minutes total game time. Dont like it. But my kid plays it a lot and he mentioned to me that the loot spawns like the vehicles .. its persistent over restarts. If you drop some bit of loot, its persistent over restarts. If you like to run a "survival server" like I do, that might appeal to you. Spawn loot once and first person to come to that location gets it. If you move it, thats where it stays. If you drops something, thats where it stays. When you pick something up, that location is now empty and is added to a list of "possible" spawn points on next restart.
So what would be needed to do this:

How many loot piles are required? there are several loot piles in each enterable building .. so I dont know, lets just say 5000 loot positions on the entire map for now. Not every position will actually contain something. The loot positions are already defined in the loot configs, just use those, but I dont really have any idea how many possible positions there are.

Lets assume that every position has loot for now, disregard the issues that will cause. So I come along to the fire station, pick up an ax. That ax is now removed and nothing will be at that location for the next person to enter that building. At some point, I may have too much gear so in the next building when I find a M4, I have to drop my Shotgun to carry it. So that shotgun will be there until someone else comes and picks it up.

We cant put all that loot in at once, we need to place it as players enter a city and then delete it when they leave. Basically using the spawn_loot file to pull loot from a database instead of spawning it randomly. If when the server monitor streamed in the objects from the database and it comes to a "loot item" it would instead add that to an array. So we have all the vehicles/objects in game and the loot in an array. Now spawn loot will check the location and pull loot from the array instead. When you take something, its removed from the array and destroyed in the database. When you drop an item its added to the array and updated in the database.

Ideas or thoughts?


Well-Known Member
I don't think you really need a database. If you moved loot spawning to server side, you could just track the loot details and save it as a property on the building. This is of course if you are just keeping track of it from reboot to reboot.