Got a message over the weekend from a buddy telling me about a problem he had seen with existing HideNPeek versions. They will indeed leak internally and eventually negatively affect the server. This update fixes that as well as adding a visual mode to prevent it ever happening in the future with this mod or any other that polls the pawn list. More on that in a second.
What is HideNPeek? Well, we've all played monster servers where the monsters seem to blink in and out of sight even though they are still there. This is caused by the monsters origin point (think of it as center mass) is not in direct line of sight to you as a player. This causes the engine to think you cannot see the monster and so it stops visually rendering it to you. The effect of this is that monsters standing behind a low wall or partially obscured by a pillar or block (or behind a glass panel) can become 'invisible' until you or they move back into full sight.
HideNPeek addresses that by forcing the monsters to become relevant to you, preventing them from becoming invisible. There's a trade-off though in that doing this will affect your server bandwidth. Use with caution.
I went to a three pass system instead of the single pass I was using before. The mod now attempts to fix monsters who are actively engaging the players over monsters who are just sitting dormant and waiting. Over time this will favor the monsters you need fixed and should be a better experience.
Also I added a visual testing
mode. Enabling this will cause any monsters it adjusts to become pink and easily identifiable. This mode is only for testing and is not to be used for normal server operation. It's only purpose is to provide feedback to you as a server admin so you can see how it is working on a particular map or with increased settings. It looks like this:
This mode gives instant feedback as to which monsters are fixed and how many of them are done. Now if there is a leak in the code you will know. Feel free to use this mode code in your mod to check your adjustments as they are being made. It's very handy. I should have done this years ago.
Mod and source:
readme included, as always feel free to rip the code into your server controller (or whatever). I commented the code in case you want to see how it works.
Going back to sleep now you beautiful nerds. Have fun.
Relocating to Cherno.... Friendly! Friendly! <BLAM BLAM>....grrrr....