insitv 305 Posted September 4, 2012 (edited) Ladies and Gentlemen,this post will explain how the loot spawn system in DayZ works. I will include small parts of the DayZ source code as proof for my explanations. If this is disallowed, please remove these parts from my post.For everyone who doesn't want to know how it does work, please close your browser tab. This information is kinda spoiler-ish but will make additional threads about this subject obsolete.Still here? Ok, let's get started:How does a player affect loot (and zombie) spawn?There are rumours and all kind of explanations about how loot or zombies spawn. Some say it's based on a distance the player has to a building, some say it's tied to a timer. Well, both would be correct.This image is a sketch, the distances aren't correct but you will get the picture.As seen in the image, there are three circles around a barn building. Each circle represents a different loot/zombie spawn mechanism. For this example, we pretend that you are the only player in the area.Blue circleThe blue circle represents an area with a maximum distance of 200 meters to the barn. As soon as you enter this circle zombies WILL spawn at the barn. This thread is about the loot spawn system but it's kinda tied to zombie spawns so i included it here.How can i benefit from this information?If you are more than 200 meters away from a building and there are zombies, well, you are not alone there my friend.Proof? Taken from player_spawnCheck.sqf:_position = getPosATL player;_nearby = _position nearObjects ["building",[b]200[/b]];Yellow circleThe yellow circle represents an area with a maximum distance of 120 meters to the barn. I fucked up the relations in the image, don't hang me for it.As soon as you enter this circle loot CAN spawn. "Hey, i ran to a building but there wasn't any loot." Well, that's how the timer comes into play. You see, every 10 minutes loot will generate if certain conditions are met. One of these conditions is that a player is in this yellow circle but NOT in the red one. There is an exception to this rule which i will explain later. You ran to building but there was no loot? Well, go more than 30 meters away from it and wait for a maximum of 10 minutes. After that, there WILL be loot. Run away more than 120 meters and leave the red circle and there will NO loot.Red circleThe red circle represents a kind of dead zone for loot. If you are the only player around and you are closer than 30 meters to the building, NO loot will spawn. Due to this mechanic it's impossible to camp a building for loot.Proof for red/yellow circle? Taken from player_spawnCheck.sqf:if ((_dis < 120) and (_dis > 30)) then {...}Summary: If your distance to a building is between 30 and 120 meters, loot WILL generate there. The loot generation takes place every 10 minutes.How do multiple players affect loot spawn?As i explained before, your distance to the building needs to be between 30 and 120 meters. There is a way to circumvent this:If you are in the red circle, no loot will spawn. BUT if a second player comes into the yellow circle and stays there. Well, he will generate the loot for you in the barn.How can i benefit from this information? Place one player in the building (red circle) and one player in the yellow circle with cover. Loot every item in the building and wait for 10 minutes. There will be new items to loot.How are items generated?Every building in DayZ has a number of possible loot locations. The high value barn i used in my sketch has 12 possible locations where loot can be generated. Additionally, the chance to actually generate loot is 50%. Let's say there are NO items spawned yet. After 10 minutes you entered the red circle the first "spawn wave" will occur. Statistically there will be items on 6 loot locations. There are 6 loot locations without items now. After another 10 minutes, 3 more loot locations will have generated loot.Special rule: Backpacks and ammo crates don't use up loot locations. There will still be items spawning there.How can i benefit from this information? If you clear every loot location in a building you are increasing the numbers of item spawns after every 10 minute cycle.Proof?if (_rnd < _lootChance) then {//if (true) then {_nearBy = nearestObjects [_iPos2, ["WeaponHolder","WeaponHolderBase"],1];if (count _nearBy == 0) then {private["_index","_iArray"];_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;_index = _weights call BIS_fnc_selectRandom;//diag_log ("LOOTSPAWN: _itemType:" + str(_itemType));//diag_log ("LOOTSPAWN: _index:" + str(_index));if (_index >= 0) then { _iArray = +(_itemType select _index); diag_log ("LOOTSPAWN: _iArray" + str(_iArray)); _iArray set [2,_iPos2]; _iArray set [3,0]; _iArray call spawn_loot; _iArray = [];};_item setVariable ["created",(DateToNumber date),true];};if (!_fastRun) then {sleep 0.1;};};Loot timerTo clarify some questions: The first player who comes near a building (yellow circle/120m) after a server restart will start the loot timer for that building. Every building has it's own loot timer. The loot timer is 10 minutes. Every 10 minutes new loot is generated as long as a player is in the red circle.Even if you start the loot timer and leave the building, the next player who comes near the building will generate loot (if it's more than 10 minutes after the first player left the scene).Players in vehiclesPlayers who are inside of vehicles, be it cars or choppers, WILL NOT spawn loot or zombies. It's a nice trick to play on other players as you can hide your ATV. They won't see any zombies and will think there are no players around. As soon as THEY spawn zombies, you get off the ATV and kill them.ConclusionI had two reasons for creating this thread.1) Many players know about these mechanics and use them to gain an advantage over other players. My goal is to close the gap and level the playing field. I don't exactly see it as a cheat or something but as clever use of game mechanics. Until Rocket changes the loot spawn system every player should know how it works and how to benefit from it.2) Literally dozens of threads about the subject, players asking about it etc. In the future we can simply guide them to this thread and be done with it.Questions?Thanks to alicefanboyfor providing a better image! Edited September 7, 2012 by insitv 281 Share this post Link to post Share on other sites
tad@tadshackles.com 75 Posted September 4, 2012 Great info.GIVE THIS MAN YOUR BEANS!! 2 Share this post Link to post Share on other sites
danielreid 84 Posted September 4, 2012 You explained it well, minus the picture ;) Have some beans. Share this post Link to post Share on other sites
TheOnlyRipper 2 Posted September 4, 2012 sounds interresting, hope you cant edit and than get an ingame effect like the tree exploit! Share this post Link to post Share on other sites
McLovinCR 29 Posted September 4, 2012 Thanks for the info!Have some beans...Quick question: are you referring green circle to the yellow one or to the farm itself?Thanks! Share this post Link to post Share on other sites
insitv 305 Posted September 4, 2012 Thanks for the info!Have some beans...Quick question: are you referring green circle to the yellow one or to the farm itself?Thanks!green circle = yellow circle, sry screwed that up. fixed now :) 1 Share this post Link to post Share on other sites
kebman 213 Posted September 4, 2012 So, new stuff spawns only in the spots where there hasn't spawned anything from before?If you do not loot the spawns, but go away for more than 10 minutes, does new stuff spawn in all the spots? Reason I ask: Often the same stuff spawns over and over. Yet sometimes, it does not, and this puzzles me. Share this post Link to post Share on other sites
insitv 305 Posted September 4, 2012 So, new stuff spawns only in the spots where there hasn't spawned anything from before?If you do not loot the spawns, but go away for more than 10 minutes, does new stuff spawn in all the spots? Reason I ask: Often the same stuff spawns over and over. Yet sometimes, it does not, and this puzzles me.New stuff only spawns in spots that are empty.Loot despawn IS IN THE GAME but i haven't figured out yet how much time it takes for loot to despawn. Will work on that and update the OP. Share this post Link to post Share on other sites
khalim 23 Posted September 4, 2012 great info dude, beans for you. Share this post Link to post Share on other sites
UbiquitousBadGuy 846 Posted September 4, 2012 As a point of intuitiveness, you may want to reverse the yellow and red regions as red makes more sense for the null-zone and yellow for the spawn cycles.Just my opinion. Glad to see someone take the initiative and explain a key but mostly misunderstood mechanic of the mod. Share this post Link to post Share on other sites
insitv 305 Posted September 4, 2012 As a point of intuitiveness, you may want to reverse the yellow and red regions as red makes more sense for the null-zone and yellow for the spawn cycles.Just my opinion. Glad to see someone take the initiative and explain a key but mostly misunderstood mechanic of the mod.Should have done that but i am pretty bad as a designer/graphic artist. If someone wants to make a better pic, feel free to contact me, will rep you in OP then :) Share this post Link to post Share on other sites
DR@GON (DayZ) 20 Posted September 4, 2012 thanks, good to see my suspicions of how this works backed up with some proof. Share this post Link to post Share on other sites
Hutch (DayZ) 116 Posted September 4, 2012 (edited) Is the radius measured from the building or from the loot spawn location?For example, I could be within 120 meters of a hangar building but still more than 120 meters away from the loot pile in the back of the building.Are all loot piles in a single building grouped together or are they all handled individually?Thanks for the info.Edit: From the code you posted it looks like it's measuring your distance to the buidling.I guess that's your distance to any wall of the building as indicated by the distance to "house" shown on the cross-hair cursor?So Loot spawns within buildings are handled together? Edited September 4, 2012 by Hutch Share this post Link to post Share on other sites
m0n3y 2 Posted September 4, 2012 Amen to you, sir!You can have my freshly found beans! Share this post Link to post Share on other sites
insitv 305 Posted September 4, 2012 Is the radius measured from the building or from the loot spawn location?For example, I could be within 120 meters of a hangar building but still more than 120 meters away from the loot pile in the back of the building.Are all loot piles in a single building grouped together or are they all handled individually?Thanks for the info.Edit: From the code you posted it looks like it's measuring your distance to the buidling.I guess that's your distance to any wall of the building as indicated by the distance to "house" shown on the cross-hair cursor?So Loot spawns within buildings are handled together?Yes, it's measuring the distance to the building itself.Yes again, the loot spawns are handled together, i.e. they spawn items at the same time. They don't have individual timers. 1 Share this post Link to post Share on other sites
Dayzo 182 Posted September 4, 2012 Yes again, the loot spawns are handled together, i.e. they spawn items at the same time. They don't have individual timers.Server-wide? All the loot on the server spawns together, synchronised by one ten minute timer? Share this post Link to post Share on other sites
Hutch (DayZ) 116 Posted September 4, 2012 (edited) One more question.Is that 10 minute timer global or individual for each player?Does the timer only start once you're within 120 meters? Or if it's global might trigger 30 seconds after you enter the 120 meter range?Edit: I expect it's global. I'm just looking to confirm since I know there's alot of code that runs client side but I've always assumed that loot spawn is handled server side. Edited September 4, 2012 by Hutch Share this post Link to post Share on other sites
insitv 305 Posted September 4, 2012 (edited) No, it's not server-wide. (As far as i know)The timer starts this way:The FIRST player who comes near the building after server (120m radius) will start the 10 minute timer. After that loot will spawn every 10 minutes. If the players leaves the area, the timer will stop too. It will go on after the next player enters the red area. Edited September 4, 2012 by insitv Share this post Link to post Share on other sites
bazbake 456 Posted September 4, 2012 Righteous! Thanks for sharing this. It's always good to know about the many ways the game can be exploited so that everyone is on the same page with regards to who is cheating and how.I don't exactly see it as a cheat or something but as clever use of game mechanics. Until Rocket changes the loot spawn system every player should know how it works and how to benefit from it.It's still cheating. You took apart the game code to look behind the curtain. You cheated. I'm glad that you revealed that others are also cheating, though, so beans for you.Hopefully rocket figures out a way to conceal this or a workaround to patch up this hole in his scripting. Share this post Link to post Share on other sites
Sakeoe (DayZ) 115 Posted September 4, 2012 Can server admins change these settings? Sometimes I spawn in a building and there is loot, other times I spawn in and there is no loot. It seems that on some servers there wil allways be loot if I log in.Also you should include that loot gets "saved". If you leave, loot despawns, you come back, the same loot will be there (Source: Put a shotgun we didn't need in a bag on the floor for the lulz, 2 days later it was still there). Share this post Link to post Share on other sites
kebman 213 Posted September 4, 2012 I wouldn't call this "cheating" per se. While it's not as bad as using a AS50 TWS that you found in a tent, this one's more legitimately in the gray zone - especially now that it's info everybody can use. Share this post Link to post Share on other sites
Hutch (DayZ) 116 Posted September 4, 2012 If you zone into a building and there's loot there, it's because it was there before you logged in.If you zone in and there is No Loot, that means nobody has been nearby to trigger loot spawns since the server was restarted.Loot isn't "saved", it just doesn't despawn. It stays there until someone picks it up or the server is restarted. Share this post Link to post Share on other sites
ZomboWTF 527 Posted September 4, 2012 yup, i knew that loot spawns only when moving closer to a building, never found the programmed code though, thanks for clearing that upalso: zombies spawning at 200 meters is a real issue on servers, you can basically never hide in a city or other zombie infested areas Share this post Link to post Share on other sites
schrecksekunde 9 Posted September 4, 2012 reverse engineering is imho not cheating, he just explains how mechanics in the game work (which was no big secret to some of the players but many just didnt understand the sense of it all - or why they could enter a totally empty house with no zeds around and within 30 seconds there are 50 coming after you...well, if the stuff would spawn when no one is around the lag and server load would grow heavy in some minutes to a level making the game unplayable)....thats one part of the success of linux (and the worst thing about windows). this way people able to read code and think in code can find errors and report them so they get fixed (or they can exploit that, but when you take a look at what happens with linux - there was still no virus in the wild that could affect more than a hand full of servers- it shows that about 99% are reported....and the few exploited can easily be targeted by _everyone_ to be fixed)still some things still dont make sense to me : for example rog - it is the first place i go when spawning in the east so i have a map, a compass, at least a pistol and/or a lee. but it is for sure not a place where players are running in and out. in 90% of the cases it takes me about 5 minutes to have 3 spawn refresh happening, the only thing necessary is to run to the entrance hall or the 10 meters across the field to the other tower and check that out and run back....most times a new spawn has happened which can be accelerated by taking all stuff up and dropping it outside of the tower.the rest is absolutely what i saw in the game, many people always keep telling there is no loot in the northern cities and towns but by triggering the mechanism by a quick run in - run out you find a totally full spawned building or area. and also the increase seems to make sense, i realized in some situations that when a place is looted quite regular the loot gets "better" (which means that stuff more rare will spawn after some times a house was looted). 1 Share this post Link to post Share on other sites