Jump to content

Back to dayzgame.com
Photo

Demystification of the DayZ loot spawn system [SPOILER]


89 replies to this topic

#1 insitv

insitv

    Helicopter Hunter

  • Members
  • PipPipPipPip
  • 95 posts

Posted 04 September 2012 - 03:33 PM

*
POPULAR

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.

Posted Image

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 circle
The 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 circle
The 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 circle
The 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 timer

To 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 vehicles

Players 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.

Conclusion
I 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
alicefanboy

for providing a better image!

Edited by insitv, 07 September 2012 - 09:24 AM.

  • Nimble, batcaveslimer, Solus and 279 others gave their beans

How does loot spawn in DayZ? - Demystification of the DayZ loot spawn System


#2 Scrump

Scrump

    Survivor

  • Members
  • PipPipPipPipPip
  • 160 posts
  • LocationNorthern California

Posted 04 September 2012 - 03:41 PM

Great info.

GIVE THIS MAN YOUR BEANS!!
  • SmokenScion and Whosincherno gave their beans

Patients Saved:27 Patients D.O.A.:2 K.I.A.:3 Humanity:28k+

Posted Image


#3 TolEressea

TolEressea

    Helicopter Hunter

  • Members
  • PipPipPipPip
  • 94 posts
  • LocationPik Kozlova

Posted 04 September 2012 - 03:46 PM

You explained it well, minus the picture ;) Have some beans.

#4 BioHaze

BioHaze

    Bean Haze

  • Members
  • PipPipPipPipPipPip
  • 939 posts
  • LocationNew York City

Posted 04 September 2012 - 03:52 PM

Thanks!
"A society will be judged by how it treats its weakest members." - Harry Truman

#5 TheOnlyRipper

TheOnlyRipper

    Scavenger

  • Members
  • PipPip
  • 12 posts
  • LocationGermany

Posted 04 September 2012 - 03:53 PM

sounds interresting, hope you cant edit and than get an ingame effect like the tree exploit!

#6 McLovinCR

McLovinCR

    Survivor

  • Members
  • PipPipPipPipPip
  • 264 posts

Posted 04 September 2012 - 04:10 PM

Thanks for the info!

Have some beans...
Quick question: are you referring green circle to the yellow one or to the farm itself?

Thanks!

#7 insitv

insitv

    Helicopter Hunter

  • Members
  • PipPipPipPip
  • 95 posts

Posted 04 September 2012 - 04:14 PM

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 :)
  • Vangelics gave their beans

How does loot spawn in DayZ? - Demystification of the DayZ loot spawn System


#8 kebman

kebman

    Bean King

  • Members
  • PipPipPipPipPipPip
  • 552 posts
  • LocationOslo, Norway

Posted 04 September 2012 - 04:28 PM

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.
DayZ: Jogging Simulator

#9 insitv

insitv

    Helicopter Hunter

  • Members
  • PipPipPipPip
  • 95 posts

Posted 04 September 2012 - 04:33 PM

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.

How does loot spawn in DayZ? - Demystification of the DayZ loot spawn System


#10 khalim

khalim

    Helicopter Hunter

  • Banned
  • PipPipPipPip
  • 56 posts

Posted 04 September 2012 - 04:35 PM

great info dude, beans for you.

#11 UbiquitousBadGuy

UbiquitousBadGuy

    Green Mountain Ghost

  • DayZ Forum Team
  • PipPipPipPipPipPip
  • 1232 posts
  • LocationThe Russian front

Posted 04 September 2012 - 04:44 PM

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.
Never give up.
Never surrender.
Never ALT-F4.
Die like a man.

#12 insitv

insitv

    Helicopter Hunter

  • Members
  • PipPipPipPip
  • 95 posts

Posted 04 September 2012 - 04:58 PM

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 :)

How does loot spawn in DayZ? - Demystification of the DayZ loot spawn System


#13 DR@GON

DR@GON

    Helicopter Hunter

  • Members
  • PipPipPipPip
  • 81 posts
  • LocationOregon

Posted 04 September 2012 - 04:58 PM

thanks, good to see my suspicions of how this works backed up with some proof.
***************************************************************************************************************
You got hacked in DayZ?! NO WAY! ... welcome to an exclusive club called "everybody"

#14 Hutch

Hutch

    Survivor

  • Members
  • PipPipPipPipPip
  • 217 posts
  • LocationNorthern California

Posted 04 September 2012 - 05:06 PM

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 by Hutch, 04 September 2012 - 05:15 PM.


#15 M0n3y93

M0n3y93

    Woodland Warrior

  • Members
  • PipPipPip
  • 42 posts
  • LocationBelgium

Posted 04 September 2012 - 05:18 PM

Amen to you, sir!
You can have my freshly found beans!

#16 insitv

insitv

    Helicopter Hunter

  • Members
  • PipPipPipPip
  • 95 posts

Posted 04 September 2012 - 05:19 PM

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.
  • Born to be Wild (PL) gave their beans

How does loot spawn in DayZ? - Demystification of the DayZ loot spawn System


#17 Anti

Anti

    Survivor

  • Members
  • PipPipPipPipPip
  • 381 posts

Posted 04 September 2012 - 05:24 PM

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?

#18 Hutch

Hutch

    Survivor

  • Members
  • PipPipPipPipPip
  • 217 posts
  • LocationNorthern California

Posted 04 September 2012 - 05:25 PM

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 by Hutch, 04 September 2012 - 05:28 PM.


#19 insitv

insitv

    Helicopter Hunter

  • Members
  • PipPipPipPip
  • 95 posts

Posted 04 September 2012 - 05:27 PM

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 by insitv, 04 September 2012 - 05:32 PM.

How does loot spawn in DayZ? - Demystification of the DayZ loot spawn System


#20 BazBake

BazBake

    Bean King

  • Members
  • PipPipPipPipPipPip
  • 854 posts

Posted 04 September 2012 - 06:06 PM

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.
"So wait. If I died...I'd lose all my stuff? That would ruin this game!"
  • Someone didn't get the memo.