Page MenuHomeFeedback Tracker

Clarification on Restock Timer (and Possible Bug)
Assigned, NormalPublic

Description

I'm requesting clarification on how the "restock" timer works for entries in types.xml, and also point out a potential bug or unintended behavior.

Sumrak has stated on Discord with regards to the restock timer:

restock - if set to 0, CE tries to respawn type in bulks, if set to positive value, it is time in seconds before ONE item of this type is spawned again.

So for instance, if I have "GorkaHelmetVisor" set to a 600s (10m) restock:

<type name="GorkaHelmetVisor">
    <nominal>8</nominal>
    <lifetime>5600</lifetime>
    <restock>600</restock>
    <min>3</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="clothes"/>
    <tag name="shelves"/>
    <usage name="Military"/>
    <value name="Tier2"/>
    <value name="Tier3"/>
</type>

Then I should anticipate that once the minimum quantity (3) is reached, ONE "GorkaHelmetVisor" should be placed into the spawn queue every 600s (10m) until it's back to the maximum quantity (8). Correct?

However, after turning on some additional CE logging, this does not appear to be what is happening:

12:59:56 [CE][LootRespawner] (PRIDummy) :: [RESPAWN CANDIDATE] GorkaHelmetVisor missing:5 [cnt:3, nom:8, min:3]
12:59:56   Adding GorkaHelmetVisor at [4708,6652]
12:59:56   Adding GorkaHelmetVisor at [8189,8387]
12:59:56   Adding GorkaHelmetVisor at [9683,8484]
12:59:56   Adding GorkaHelmetVisor at [6080,5349]
12:59:56   Adding GorkaHelmetVisor at [6162,8183]
12:59:56   [CE][LootRespawner] (PRIDummy) :: GorkaHelmetVisor respawned:5, tests:5 missing:0

All 5 GorkaHelmetVisor spawned at the same time.

Also, it seems like this "bulk" spawning can often result in items spawning in close geographical proximity. Take this AK74 configuration:

<type name="AK74">
    <nominal>5</nominal>
    <lifetime>10800</lifetime>
    <restock>3600</restock>
    <min>2</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="1" crafted="0" deloot="0" />
    <category name="weapons" />
    <usage name="Military" />
    <usage name="Crash" />
    <value name="Tier2" />
    <value name="Tier3" />
</type>

Based on this configuration, when we reach the minimum 2 AK74 on the map, 1 AK74 should be placed into the spawn queue every 3600s (1h) until the max of 5 on the map is reached.

However, we once again see bulk spawning:

13:12:03 [CE][LootRespawner] (PRIDummy) :: [RESPAWN CANDIDATE] AK74 missing:3 [cnt:3, nom:6, min:3]
13:12:03   Adding AK74 at [5878,6701]
13:12:03   Adding AK74 at [6036,8154]
13:12:03   Adding AK74 at [5988,8105]
13:12:03   [CE][LootRespawner] (PRIDummy) :: AK74 respawned:3, tests:3 missing:0

Also, these spawns are in close geographical proximity, despite having access to Military spawn locations in all of tiers 2 and 3 (Livonia):

It seems like it's not doing a great job of randomizing the spawn points it chooses, at least not when the items spawn in "bulk" (and they always do).

All of this would seem like unintended behavior based on the explanation of the restock timer that we have. If this is working as intended, can you please clarify how this is supposed to work so we know what to expect? Otherwise, maybe this is a bug? Thanks.

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Server
Steps To Reproduce
  • Set restock timer >0 for a type configuration.
  • Enable all CE logging in cfgeconomycore.xml
  • Observe [CE][LootRespawner] behavior in your serverconsole.log
Additional Information
  • Server running version 1.08.153228
  • Livonia map
  • Vanilla mission settings

Event Timeline

Geez changed the task status from New to Assigned.Jul 13 2020, 11:09 AM

Geez, could you give a tiny update on this? It kind of messes with the whole economy / item flows by disrupting the even distribution of items over the map, instead it clusters them.

mattb added a subscriber: mattb.EditedApr 18 2021, 11:08 AM

I'd noticed this before while playing - not finding an item at all in multiple towns, then finding three in close proximity; but today on a relatively new server private, there were no less than _eight_ lunapark canopy tents in the kiosks around the ferris wheel in Cherno, and two more spawned after logging out for a while, having moved the others into a car.

Just an anecdotal example of how extreme this can be.

This comment was removed by mattb.

Has this been fixed then? Because there hasn't been an update in 2 years, and with restock timer set to 0 by default, loot still respawns in clumps, which is awful for loot distribution

mrdarn added a subscriber: mrdarn.Jul 21 2022, 12:36 AM
Thimerion added a subscriber: Geez.

@Geez any update on this please?

MarkHollis added a comment.EditedOct 19 2022, 6:04 PM

@Geez any update on this please?

I think an update is overdue. From what I can tell, the issue still persists after all this time.

sileed added a subscriber: sileed.Sep 21 2023, 11:34 PM
Automn added a subscriber: Automn.Oct 24 2023, 2:46 PM

The Same
[CE][LootRespawner] (PRIDummy) :: Mag_M14_20Rnd respawned:0, tests:0 missing:12

</type>

	 <type name="Mag_M14_10Rnd">
        <nominal>20</nominal>
        <lifetime>14400</lifetime>
        <restock>0</restock>
        <min>14</min>
        <quantmin>30</quantmin>
        <quantmax>90</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="Tier3"/>
        <value name="Tier4"/>
    </type>

[CE][LootRespawner] (PRIDummy) :: [RESPAWN CANDIDATE] AK74 missing:15 [cnt:0, nom:15, min:3]
13:38:39.421 [CE][LootRespawner] (PRIDummy) :: AK74 respawned:0, tests:0 missing:15

    </type>
    <type name="AK74">
		<nominal>15</nominal>
		<lifetime>28800</lifetime>
		<restock>1800</restock>
		<min>3</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="Tier3"/>
        <value name="Tier4"/>
    </type>