Elin
41 ratings
Optimization for too many characters on the same map
   
Award
Favorite
Favorited
Unfavorite
System: Utility
File Size
Posted
Updated
81.061 KB
23 Feb @ 3:12am
27 Feb @ 8:44pm
4 Change Notes ( view )

Subscribe to download
Optimization for too many characters on the same map

Description
When there are a large number of characters (over 1000) on the same map, Elin will experience serious CPU performance issues, leading to lag.

This mod is designed for the longest running Chara.FindNewEnemy() func.
1. Replace ToEnum() called by this function with switch which takes less time.
2. When the number of characters exceeds 200, enable a faster optimization. The general idea is to write characters that may be hostile to a specific faction into a bucket. When calling Chara.FindNewEnemy(), directly traverse the buckets of a specific faction to avoid traversing all characters every time. If the vast majority of characters in the map are allies of the player, there should be a significant optimization effect.

https://github.com/105gun/ElinOptimization
9 Comments
西兰°雨入 9 Jul @ 4:46am 
此mod可能会导致频繁闪退,有时候玩5分钟就闪退了,卸掉之后正常了,玩一整天都没闪退,【NullReferenceException: Object reference not set to an instance of an object
at DG.Tweening.Core.TweenManager.Update (DG.Tweening.Tween t, System.Single deltaTime, System.Single independentTime, System.Boolean isSingleTweenManualUpdate) [0x001b0] in <fcc0bbf6bf4e430c91d4aa05736fc5c6>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs)】
Tangent Logic 28 Feb @ 10:45pm 
Its still somewhat buggy. Ran up gains a random [Stalker] and my oarty refused to engage. I would fire spells at it, and it would move one square towards me, then forget. I did have an ally aggro and it was killed by it, but the other allies 2 squares away just stared doing nothing. Confirm not fixed just yet.
Skyfall Terminus 28 Feb @ 8:45pm 
confirm fixed, thanks a lot :LetiHeart:
105gun  [author] 28 Feb @ 8:35pm 
@Skyfall Terminus
Sorry about this, but it should be fixed in the last update (which was uploaded about 24hrs ago). maybe your steam didnt get that update. Try to stop subscribe and re-subscribe this mod and check whether the bug still exists.
Skyfall Terminus 28 Feb @ 8:43am 
somehow made monster stop aggro at player entirely :demoneye:
kinino 23 Feb @ 8:38pm 
想和作者约会,有途径吗
kinino 23 Feb @ 8:32pm 
作者你是我的神
DK 23 Feb @ 11:22am 
:yoohoo:
105gun  [author] 23 Feb @ 3:37am 
我是看了其他人的聊天记录才想着搞优化的。但我本人没有大后期的存档,用测试工具模拟出的场景可能不太符合实际情况。所以,如果你觉得打了我这个mod还是卡,或者你有其他的场景想让我看看能不能优化一下,可以把卡顿前的存档发给我,告诉我要怎么复现。