What’s new? (Upgrade Guide)

What's new, what's changed

Upgrading from 1.2.x → 1.3.0

Version 1.3.0 introduces two big features and a few quality-of-life updates:

  • NavMesh Placement Policy per Spawn Entry (Require / Prefer / Ignore)

  • Spawn Hints workflow (scene anchors + a settings asset)

  • Inspector polish, new editor menu actions, and clearer debug/warnings

  • Internal: deferred placement queue for “Require” policy, tag-aware wave spawning


What changed

🚦 NavMesh Placement Policy (per Spawn Entry)

  • Require – Only spawn if the position can be projected to the NavMesh now. If not, the request is deferred and retried until success or a retry cap.

  • Prefer (default) – Spawn immediately; if there’s no NavMesh yet, a helper will enable the NavMeshAgent when the mesh appears.

  • Ignore – Skip NavMesh projection entirely (useful for non-NavMesh actors, flying units, FX).

Spawn Hints system

  • EnemySpawnHintPoint (component): place these in the scene to steer where units appear.

    • Per-hint rules: minPlayerDist, maxPlayerDist, denyLineOfSight, requireNavMesh, optional overrideAreaMask, tags.

  • SpawnHintSettings (ScriptableObject): global knobs for search radius, LOS mask, reservation cooldown, etc.

    • Includes Hint-Only mode (skip fallback sampling when no hint qualifies).

    • Includes Ignore Global Min Distance (let close-range hints be used even if spawner’s global min is large).

  • Integrated across Global, Region, and Wave flows.

  • WaveSpawnPoint → Anchor Tags: tags can bias hints (e.g., “Flank”, “Ambush”) during waves.

Editor/Inspector improvements

  • Runtime Spawner inspector: Spawn Hints section with Create & auto-assign settings.

  • SpawnHintSettings inspector: presets, utilities, and warnings.

  • WaveSpawnPoint inspector: simple range + anchor tags UI.

  • Menu:

    • GameObject/Runtime Spawner/Create Wave Spawn Point

    • GameObject/Runtime Spawner/Add Spawn Hint (drops a hint under current selection).


Migration steps

  1. Update the package to 1.3.0.

  2. Update the Runtime Spawner Samples (from Package Manager)

  3. Review your Spawn Entries

    • Open each SpawnEntry and set Placement Policy:

      • Most existing setups should use Prefer (matches prior behavior).

      • If you need deterministic “only on NavMesh” placement at time of spawn, choose Require.

      • If the prefab doesn’t use a NavMeshAgent, choose Ignore.

    • If using Require, optionally set Max Deferred Retries.

  4. (Optional) Adopt Spawn Hints

    • In Runtime Spawner: enable Use Spawn Hints and assign a SpawnHintSettings asset (create from the button if needed).

    • Place a few EnemySpawnHintPoint per tile / encounter space (menu: Add Spawn Hint).

    • For waves, add WaveSpawnPoint children under your WaveTrigger and fill Anchor Tags to bias hint selection.

  5. Check distances

    • Make sure spawner Min Spawn Range doesn’t conflict with your hint distances.

    • If you want very close hints, enable Ignore Global Min Range in SpawnHintSettings.

  6. Test

    • Enable Debug Logs (settings) while tuning.

    • Watch for messages like:

      • “HintOnly: no hint → refusing … spawn.”

      • “No suitable hint found; falling back to sampler.” (off in Hint-Only)

      • Min/max distance conflict warnings.


Notes

  • Performance: Spawn hints use a spatial registry (cell size in settings). Smaller cells = tighter queries but more buckets.

  • Reservation: After a hint is used, it’s soft-reserved for a short cooldown to avoid dog-piling.

  • Deferred queue: With Require, spawns that can’t yet snap to the NavMesh are retried with backoff (configurable retry cap).

  • Waves + Tags: If a WaveSpawnPoint provides tags, matching hints are preferred first.


Before & After

Before (≤1.2.x)

  • All spawns tried to land on the NavMesh; timing quirks sometimes left agents disabled/inactive until mesh appeared.

  • No concept of authored “good spots”—global/region sampling only.

Now (1.3.0+)

  • Clear Require / Prefer / Ignore placement contracts per entry.

  • Author intent with Spawn Hints; optionally Hint-Only to prevent uncontrolled spawns.

  • Wave flows can target hint tags via WaveSpawnPoint anchor tags.


Troubleshooting

  • Nothing spawns with Hint-Only Likely no hint qualifies. Check:

    • Player distance vs. minPlayerDist / maxPlayerDist

    • denyLineOfSight vs. your LOS Block Mask

    • requireNavMesh + NavMesh Sample Max Dist too small

    • Global Min Spawn Range > your hint distances (enable Ignore Global Min Range if needed)

  • Agents never enable with Require Ensure your NavMesh is present/updated at runtime, increase Max Deferred Retries, and verify Area Mask (hint or spawner) includes baked areas.

  • Hints are used too often in one spot Increase Reservation Seconds in SpawnHintSettings.


FAQ

Q: Do I need Spawn Hints? No. They’re optional. Use them where placement really matters (flanks, ambushes), keep sampler fallback for the rest—or enable Hint-Only for fully curated placement.

Q: What does “Prefer scoped first” mean? Hints inside the immediate scope (e.g., wave range or region bounds) are preferred before searching the broader/global radius.

Last updated