

Attrition
Temporarily slow the rate of mob spawning in an area the more mobs are killed.
Description
<p>Have you ever been caving in Vintage Story and wanted some rest from the unending waves of drifters? Attrition is a mod that slows mob spawning in an area the more mobs are killed, providing a temporary respite from the relentless onslaught.</p> <h2>How Does it Work?</h2> <p> </p> <p>Vintage Story's mob spawning follows in the lineage of that other block game. It constantly picks random locations in the world and tries to spawn mobs until it fills a cap. Now matter how fast or how many you kill, the spawner will always place more. Another problem with this approach is that the fewer places mobs can spawn, the more concentrated they become. If you bring a load of torches to help explore an area, the game responds by increasing the mob density in the remaining area! Attrition does a couple of things to help with this.</p> <h3>Mob Density Limits</h3> <p> </p> <p>The fundamental spawning limitation added by Attrition which is always active is a global density cap. This cap limits how many mobs can concentrate in one area. By default, the cap is set to roughly the typical densities seen in vanilla worlds in typical locations. The default value is 8 mobs in any 40 block sphere. More than that, and additional spawns in that area will not be allowed.</p> <h3>Heat</h3> <p> </p> <p>As you kill mobs in an area, Attrition injects "heat" into the area. The more mobs you kill, the more heat is generated. This is not, of course, literal heat. It's a representation of how active combat has been in the area. Your first few kills will generate very little, but as the body count rises, heat will begin rising faster and faster. The more heat a region has, the lower the density limit of the region gets, all the way to zero. If the area you are in fills to the limit, heat will be pushed to nearby "warm" areas that have not reached the limit yet, making sure your kills don't go to waste.</p> <p>After some quiet time, when combat has slowed down and no more bodies are hitting the floor, the heat will begin to decay. Very slowly at first, but after a while faster until the region returns to normal.</p> <h3>Mobs Affected (Tracked)</h3> <p> </p> <p>The default configuration targets mobs with the "rust-creature" and "mechanical" tags in the "hostile" spawning groups that are spawned naturally in the world through random spawning. This excludes, for example locusts spawned by a nest or drifters spawned by temporal storms. It also excludes all wildlife, traders, etc. All of this is configurable, but be careful. With the wrong configuration you could accidentally block player spawns!</p> <h3>Web Based Visualizer</h3> <p> </p> <p>I used a <a href="https://mrgrim.home.gr1m.org/attrition-heatmap.html">web based visualizer</a> to help me when developing this mod. It provides knobs for all of the configurable pieces and provides a top down cross section view of what the heatmap looks like and is doing. Click play to start the simulation, and click anywhere in the grid to simulate a kill at that spot. Each cell is a chunk. The number in the chunk is the heat value. The bar at the bottom is the decay delay timer, when full decay kicks in.</p> <h3>Player Stability, Storms, and Rifts</h3> <p> </p> <p>By default all of these bypass any heat restrictions. If you enter the rust world, be prepared for a fight no matter what!</p> <h2>Configuration and Tuning</h2> <p> </p> <p>This mod is compatible with <a href="https://mods.vintagestory.at/autoconfiglib">Auto Config Lib</a>. If you have it installed, all of the mods parameters will be available for you to tune.</p> <h3>Defaults</h3> <p> </p> <p>During this initial release I am very interested in feedback on how the defaults feel or how you prefer to tune it. I've tried to be quite conservative, so it may feel it doesn't change much or requires too much effort to build up heat.</p> <p>By default the global density cap is 8 mobs in a 40 block sphere. You can change both the size of the sphere and the density limit inside it. Larger spheres will decrease the density "map resolution", extending the reach of limits imposed by the heatmap. However, you may need to tweak the cap as well.</p> <p>The heatmap parameters are set so 20 kills in a single chunk are enough to max out a single chunks heat. Additional kills will help push the size of the saturated region. If kills are spread out over several chunks more will be needed as well. There is a "dissipation" mechanic that will apply heat from saturated areas to any nearby areas that already have _some_ heat but are not full. This should make expanding your "area of control" a little easier than what it took to first establish it.</p> <p>The default config will begin decaying heat after a period of 10 minutes. Once decay starts, it will take an hour for it to fully clear. The decay starts off very slowly, and often one kill is enough to bring it right back to full and reset the timer.</p> <h3>Admin Commands</h3> <p> </p> <p>A set of admin commands are available to help track the heat system:</p> <p>/attrition stats - Print out stats of the current chunk.<br />/attrition clear - Delete all world heatmaps resetting the system.<br />/attrition simkill - Simulate a kill at your current position.<br />/attrition report <interval OR off> - Send a report of your current locations heat to the chat windows every <interval> seconds, or turn the reporting off. Defaults to 5 seconds.</p> <h3>Debug Logging</h3> <p> </p> <p>There is also comprehensive debug logging to show spawn decisions and entity attributes. This can help you with tuning and let you see every spawn attempt, the heat and density at the spawn point, the spawn result, and entity metadata you can use to add or remove mobs from the heat system.</p> <p>Debugging can be heavy, so it is recommended to disable it during normal play.</p> <h2>Performance</h2> <p> </p> <p>The performance impact of this mod should be quite mini
Ratings & reviews
Sign in to leave a rating or comment.

