KAMKEEL / CustomNPC-Plus

Custom Version of 1.7.10 CustomNPC with backported features and original expansions
https://www.curseforge.com/minecraft/mc-mods/customnpc-plus
Other
53 stars 34 forks source link

performance problems #92

Closed yurannado closed 1 year ago

yurannado commented 1 year ago

i spawned about 100 npcs, separated to 2 groups and made them fight, thing were normal. but when i set to gamemode 0 and tried to make them fight with me, lag happened and tps dropped very low. things got even worse when i tried to move around or flying over them quickly.their aggrorange were 64. i tried this in 1.16.5 as well, and the situation were much better in 1.16. so i'm wondering what caused this problem and how can i solve it.

KAMKEEL commented 1 year ago

It's likely 1.7.10's Minecraft's Path Finding. It's not that optimized. But, 100 NPCs are a lot to be path-finding at once. Perhaps mods like AI Improvements can help

yurannado commented 1 year ago

seems that the only way is to reduce the number of npcs. AI improvements does little help =(

yurannado commented 1 year ago

oh,wait. i tried to spawn 150 zombies and flew around them. tps did not drop to an unacceptable state. but when i tried to use 150 npcs with 32 aggrorange, tps dropped much lower. and i realised that this only happens when players are flying, simply walking around is fine.

KAMKEEL commented 1 year ago

NPCs hold far more data than a single Zombie Entity does in Minecraft. 150 NPCs -- are all consistently scanning 32 Block Radiuses from where they are. So if you unload and load in the chunks where they stand, they will have to rescan everything. You will need to profile some data with a PLUGIN or MOD like SPARK for 1.7.10 FORGE in order to give me useful information.