When I develop this mod, I made some extensive tests (although not up to the point of numerical analysis). I have some conclusions in general.
1/ The total number of entities on the ground (and on map) is directly related to UPS/FPS. Each item on ground counts as one entity. Each UNTOUCHED chests containing thousands of items also counts as one entity. An idle assembling machine also counts as one entity. This is true even BEFORE pickup towers kick in. Each tiny item on ground is still consuming your processing power, even if they are untouched!
2/ My mod uses surface.find_entities_filtered
to search for items to be handled. The processing time is related to both the area (range) and number of entities. Larger pickup range uses much more time (much more than linearly with area). More entities in the approximate vicinity (I do not know how the game the search optimized where far away entities affect much less.) uses much more time.
There is almost nothing to be improved in the code. This single command is the only one that I can use to look for all entities in a specific area.
Therefore, I can only give some general recommendations on the game-play side:
A/ Keep items on ground as few as possible at any time. That means clear the ground more frequent.
B/ For the same reason, lower loot richness in Schall Alien Loot. Do NOT be too greedy! I expect casual players to use medium richness, hardcore players use lower richness. High richness is only for newbies or no-mining scenario. This is why I provided options to adjust loot richness. The general principle is to let users to obtain enough ores in combat, while still not flooding the ground or storage system. Greed is natural behaviour, but too much greed IS problem.
C/ For the same reason, use less loot mods at the same time. Using multiple loot mods generate more types and amounts of loots, which I totally NOT expect that. Multiple loot mods are testing the limit of your computer. If you have too much excess still left on ground, you know you should either clear them ASAP or simply remove those loot mods.
D/ Split up big pickup searches into smaller searches will use less time overall, which means:
D1/ Use lower tier pickup tower when feasible. Just use those which are adequate to cover the kill area. For example, if your turrets are of range 48, then Pickup tower II (range 64) should be well enough. Even if having to cover a WIDE battlefront of width-128, using two PT II is going to be much faster than one PT IV! PT II also has much shorter interval to keep the number of entities low. Several small searches actually is better than a single big search.
D2/ Only deploy PT to where loots are generated. Idle PT (say, within the safe zone) still call for surface.find_entities_filtered
. Even for nothing to pick up, it is still a call for a search. And a lot of them can still add up.
E/ I am not sure about interaction with other mods. But if there are a lot of tile ghosts (which ARE also entities), they are going to add a lot of burden to PT searches, AND also to normal game updates (such as assigning bots to build tiles). The second part is exactly why many MP server admins will really warn and even ban players on mass-laying concrete tiles by bots!