Calling 'OnNpcTarget' took average Xms
Hello. Calling hook take too much time in my server. It feels really lag. I have 10 bases in the server and every base has 20 scientists. Any idea how to fix this? 
Thanks.
Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2041ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnPlayerAttack' on 'TruePVE v1.1.8' took average 1223ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2039ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnEntityTakeDamage' on 'TruePVE v1.1.8' took average 1365ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2343ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Branc[76561############] has spawned 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnEntityTakeDamage' on 'TruePVE v1.1.8' took average 1413ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2397ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[TEAM CHAT] TB[76561############] : anotherside
Scientist[5187115] was killed by FREE USA![76561############]
Calling 'OnEntityTakeDamage' on 'TruePVE v1.1.8' took average 1441ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2387ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[CHAT] IGXE.CN[76561############] : dl
Calling 'OnEntityTakeDamage' on 'TruePVE v1.1.8' took average 1397ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2279ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnEntityTakeDamage' on 'TruePVE v1.1.8' took average 1291ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

[CHAT] IGXE.CN[76561############] : dl
Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2146ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Scientist[967509] was killed by FREE USA![76561############]
Calling 'OnEntityTakeDamage' on 'TruePVE v1.1.8' took average 1182ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 1923ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Scientist[904939] was killed by FREE USA![76561############]
Calling 'OnEntityTakeDamage' on 'TruePVE v1.1.8' took average 1200ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2075ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Scientist[6013289] was killed by FREE USA![76561############]
Calling 'OnEntityTakeDamage' on 'TruePVE v1.1.8' took average 1181ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2056ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnEntityTakeDamage' on 'TruePVE v1.1.8' took average 1219ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2065ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Calling 'OnPlayerAttack' on 'TruePVE v1.1.8' took average 1194ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Scientist[1660316] was killed by FREE USA![76561############]
Calling 'OnNpcTarget' on 'RaidableBases v1.5.0' took average 2027ms 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)​
Sorry its 15 event not 10.

I only use Maintained Events and set Always Maintain Max Events to ture. At first it works good. But after about 24 hours. It's getting worse and worse.

Memory or CPU usage did not increase. There are 184,000 entities in the world. But I'm not sure how many npcs cause I also have Botspawn loaded. 
could be the result of players using fire rockets. if so, this will be fixed in the next update

otherwise, there's nothing I can do atm that I'm aware of. I've made a change in 1.5.1 that'll help, but not by much (checking entity.IsNpc first)

Merged post

the other option is to disable the HTN player hook in OnNpcTarget but this means my bots will chase down and kill HTN scientists (magenta in adminradar)
anychance you could remove the AI from the plugin totally,  I'v got the same issue as diaolingtyp server performance starts great then drops massivly over time, i've also posted previously about it - i'm also using Botspawn - it seems to clash with all plugins involving AI.

fps performance drops to (19:15:33) | 23 FPS

once i remove raidbases fps rocks back up to 130ish

Merged post

forgot to add i disabled Ai in the config but made no differnece 
nivex
could be the result of players using fire rockets. if so, this will be fixed in the next update

otherwise, there's nothing I can do atm that I'm aware of. I've made a change in 1.5.1 that'll help, but not by much (checking entity.IsNpc first)

Merged post

the other option is to disable the HTN player hook in OnNpcTarget but this means my bots will chase down and kill HTN scientists (magenta in adminradar)

I will try to disable HTN player hook. It's ok with me. I'll give you feedback. Thanks again.

some servers simply can't handle this plugin because their host machines are not good enough

that said, some big performance improvements are coming as some hooks were not optimized properly but the issue will still persist for lower end machines

also your server's fps should be limited and never be above 80. it's not a GPU