Yeah I’ve seen his set around, I gather it has some issues but now that WorldMachine is doing the heavy lifting I imagine I should just grab it. But I’m being stubborn.
As far as your AI issue – and I have no idea what your game mechanics are but – what if you build a small spawn system based on where the player is. Despawn AIs once they are out of the interest area (Interest area should be larger than visible area), chance to spawn a target number of AIs total or and/or target number of types for the given terrain type would be easy. Spawn them just on the edge of the visible area so they can wander into the scene - or unceremoniously despawn if the player goes the opposite direction.
Have each AI measure whether it’s in the interest area, use sqrMagnitude plus the maxDistance^2 (there’s no reason to run the square root for this), Or, if you will have hundreds in the scene, you could pretty easily register the AIs in your spawn manager and only check distance from the player (and any other stuff that doesn’t need to happen every frame) for one AI per frame. Register the Manager with the AI as well so it can trigger a despawn event and remove itself from the manager.
You’ll either have to cram behaviors into one class or use Interfaces if you go the managed route.