Modular routers activator module causing some sort of occultism based lag
Vashal0 opened this issue · 8 comments
Modpack Version
1.3.0
Describe your issue.
If a modular router with an activator module right clicks, and doesn't accomplish anything(no item and right clicking nothing, trying to put a potion into a full potion jar, etc) Its causing a small amount of lag which spark traced back to something with occultism.
https://spark.lucko.me/Tv48lyBRoY here is a spark profile from my mostly fresh superflat test world, with 20 activator module routers, with 9x speed upgrades in each and nothing else in the world. That was the limit before I would slightly dip below 20 tps, more than that and I dip harder.
If the routers get a job, like activating a lever or something, It all goes away instantly.
incase the spark profile expires or something, here is a picture
Crash Report
No response
Latest Log
No response
Have you modified the modpack?
No
User Modifications
No response
Did the issue happen in singleplayer or on a server?
Singleplayer
Occultism needs to check for a lot of stuff when you rightclick the bowl. This is just to be expected?
I don't think the Modular Routers are actually clicking a Bowl though?
I might be wrong here, but I think this eventhandler should check whether the block is a GoldenBowl before as much as possible.
https://github.com/klikli-dev/occultism/blob/version/1.19/src/main/java/com/github/klikli_dev/occultism/common/block/GoldenSacrificialBowlBlock.java#L110
A magic mod inspired by the world of Jonathan Stroud's Bartimaeus. With the help of occult rituals players can summon entities from the "Other Side" to perform magic. - occultism/Gold...
correct that the routers aren't clicking a bowl, they are clicking nothing. And no bowls actually exist in the world
Changes have been implemented. Golden Sacrificial Bowls will now subscribe to events when they begin a ritual and unsubscribe again when done. Block checks are no longer necessary, so clicks should a) only have an impact when rituals are actually running and b) even then the impact should be way way lower than before.
Ah fun. Every rightclick checks all blocks in a radius... @klikli-dev
Yeah that's not great.
Open for suggestions on how to improve that. First thought would be to only subscribe to the event when a ritual starts and unsubscribe after; or possibly store a list of active rituals and forward clicks to them.
As any item could be a "click ingredient" a limit on that end is unlikely to work.
Active Ritual approach is simplest. 99% of the time there will just not be an active ritual and you can just exit early.
Only subscribing on ritual start would be even better but more work.
You could limit it to the registered click ingredients (since they are set on world load?) but that would be way more work.