If no zones are in range, they'll stay as defenders or idle
This prevents the "path too long" error that caused the crash
You can adjust MAX_ATTACK_DISTANCE if needed (lower = more stable, higher = longer range attacks)
New Metrics Added:
Tracked Groups - Total number of groups being managed by the plugin (should match or be close to "Total Active Units")
Lua Memory - Current Lua script memory usage in MB
Warnings:
High memory warning if Lua memory > 500MB
High group count warning if > 200 groups
What to watch for:
Lua Memory steadily increasing over time = memory leak (groups not being cleaned up)
Tracked Groups != Total Active Units = dead groups not being removed from tracking table
Group count approaching MAX limits = might hit spawn caps
This will help you identify if memory is building up before it causes a crash. Check the F10 menu → Show System Statistics periodically during long missions to monitor these values.
✅ Units spawn in friendly zones
✅ Within 15 seconds, get orders to attack nearest enemy zone
✅ Move toward and engage enemy zones
✅ Only become defenders if there are no enemies to attack
✅ Stay focused on attacking unless their home zone is under attack
✅ Can be reassigned new targets every 600 seconds if they stop moving