Yes, my game creates most of its collision geometry after begin play too. The plugin supports such usecases via two options:
- Infinite/Unbound Manager - This will work out-of-the-box for any conceivable dynamic usecase as it always samples collision geometry on-demand. Whether you’re subtracting collision geometry (digging caves/tunnels at run-time) or adding new collision geometry (eg: growing plants/trees in realtime like in my game), you’re covered.
However this solution is much slower than its Bound counterpart. Shipping builds (with no debug info) should still perform fine, but for a large number of A.I. bots (especially in editor/debug builds) your pathfinding queries may start timing out. You’ll need to tweak the values of MaxPathSolverIterationsPerTick (in the manager) and QueryTimeout (inside QueryParams) to find a balance between a quicker pathfinding turnaround and FPS impact that is acceptable for you.
- Bound manager - This mode requires you to manually register changes to the collision environment by calling “ScheduleDynamicCollisionUpdate” for any primitive components that have changed their transform at run-time (or been newly spawned). It uses a “lazy-loaded” cache so you don’t need to worry about registering the terrain that was created at begin play. Pure subtraction (i.e. meshes that are fully destroyed) isn’t currently handled so you may have to manually update dirty volumes based on which voxels changed while digging/etc. It’s not hard to implement this, so if performance is becoming a real issue with the Infinite manager for you might want to consider building this functionality yourself. Navigation is bound/limited to a fixed zone in this mode.
Personally I’ve switched over the Unbound manager over time as the complexity of dynamic collisions in my game became overwhelming to manage. In a micro-world game simple things like flowers blooming/closing, plants branching off with new shoots, etc all create new collision geometry that creatures need to be made aware of. Add auto HISM-instancing-deinstancing into the mix and the end-result was jaw-dropping cyclic dependencies and other strangeness that compelled me to write the “Infinite” manager.