Theurgy

Theurgy

15M Downloads

theurgy:follow_projectile entity buildup

SHsuperCM opened this issue ยท 8 comments

commented

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

  1. Have a system with a few machines(not more than 10 machines in a small room)
  2. Close up the room and turn around, do something else for a bit.
  3. Look towards the room, the fps will drastically drop.
  4. 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)
Image

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
commented

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.

commented

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.

commented

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.

commented

Yep, definitely still happens, updated to 1.20.1-1.23.2 both on the client and server

Image

commented

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

commented

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)

commented

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..

commented

Thanks for testing .. it is odd, because now the client should tick them unless I grossly misunderstand the code. I'll try the more invasive option