
theurgy:follow_projectile entity buildup
SHsuperCM opened this issue ยท 8 comments
Describe the bug
It appears that whenever the particles from machines are not in view(hidden behind blocks or when turned around) they just build up and dont despawn on the client.
Probably related to #226 except it is not resolved as expected.
To Reproduce
- Have a system with a few machines(not more than 10 machines in a small room)
- Close up the room and turn around, do something else for a bit.
- Look towards the room, the fps will drastically drop.
- If you look in the room you can see the particles that built up on the machines as they move in unison towards their target before it goes back to normal.
Expected behavior
The particles should have a max age to time out on even if not in view.
Screenshots
Entity count from spark (client profiler, not server)
System (please complete the following information):
- Theurgy Version: 1.23.1
- OS: Win10
- Minecraft Version: 1.20.1
- Modpack Link and Version, or list of mods: AllTheMods 9, v1.0.3
Ah that is a good find!
I think there is already an age via the entity class, but presumably that is updated on tick, which does not happen clientside if out of view.
As a hotfix I just used dirtyjoe to delete the onClientReceived
from MessageShowCaloricFlux
so it falls back to default implementation.
This clears up most of the lag with my machine setup but some particles still build up because the sulfuric flux emitter uses something else to spawn the blue particles and I couldnt find it at a glance.
As a note you might also want to add a config to just outright disable these particles in case other users have an issue with them.
Sorry I'm a bit confused as to how that commit solves it?
Wouldnt entities still build up until the next tick they're viewed because they are still only discarded within the ticking method? (thus still dropping fps when looking at the room's direction?)
I'll try updating and see if it does it but I worry it wont help.
If it helps reproduce the issue, do note that this is on a server and not singleplayer so it wont tick server side.
You are absolutely right, I used a wrong premise here. I'll have to find out how to integrate more tightly with the particle system to prevent spawning them in the first place if not looking to avoid the buildup
I am going to test setting the projectiles to always tick. They are client only, and very light on their tick logic, so this is probably the least invasive way to get them to update and remove themselves.
If this does not fix the lag please ping me again and I will look into hooking into the entity management (e.g. only spawning particles in ticking chunks)
Just tested with .3, still happens it appears. Not versed enough on client sided entities to know why.
I think I'll just move the theurgy setup out of my base for now..