AbyssalCraft

AbyssalCraft

20M Downloads

Statues are hard on server TPS

Hydraheads opened this issue ยท 3 comments

commented

Intro:

Statues eat a lot of TPS, and this is problematic on servers with multiple bases that have them.

Description:

On my server there are over 100 statues loaded at any given moment, because a number of players have 20 or so of them at their clan bases. I had to impose a rule of at most 20 statues, because with around 100 statues, the statues eats a solid 5-6 TPS on total, an extremely high amount. To put this in perspective, that is more than all other entities loaded on the server put together. I know the statues are complicated, but it is just too demanding.

Crash report:


Affected versions ("latest" is NOT a version):

  • Minecraft: 1.12.2
  • Forge: 14.23.5.2847
  • AbyssalCraft: 1.9.18

Latest log file for when the issue was present:

commented

Scaling anything complex up to having over 100 simultaneously doing something at all times will have a negative effect on performance. I haven't really dug that deep into where the threshold is when statues begin to put a noticeable dent into server performance, but this seems to be past that point.
Do you have any performance measuring metrics, like sampler (only one I can think of right now, but there are others), that you can share? I'd like to pinpoint where the bottleneck is, so I can look into optimizing the code.
Could you also share some pictures of their setups? Partly out of curiosity, but I could potentially point out potential design flaws that aren't really doing anyone any favors.

commented

I use this mod https://www.curseforge.com/minecraft/mc-mods/tickprofiler
and run /profile e. Everyone kind of uses their own layout I guess, between places of power, stacking like totems, etc.

Unrelated, I had to ban the omothol ghouls and remnants because they could reach unbelievably high tps usage causing all mobs to slow down, the ghouls especially.

commented

I did some profiling with tickprofiler and ran sampler, and tickprofiler seems to report some false-positives by the looks of it. I found nothing pointing towards Omothol Ghouls taking up high TPS usage.
Sure, when I spawned 100 of them and ran /profile e, tickprofiler threw a fit and reported them taking up 3.5 ticks (0.5 ticks without me spawning a bunch of them), along with 43000 calls (13000 calls without me spawning a bunch of them). Meanwhile sampler doesn't even mention Omothol Ghouls in the snapshot created after sampling (Remnant are mentioned, so there I have some data points to investigate). This could all be biased because I'm doing this in a singleplayer world, and not a server with an entire modpack, but by itself there is nothing in the Omothol Ghoul code that would cause TPS to spike up (only factor I could think of would be the size of the mob, since that can affect pathfinding, but I haven't come across anything pointing towards that).

As for the statues, sampler gave me some insight on where they are impacting performance the most (I build a setup with 100+ statues and a plethora of energy pedestals). A lot of that comes down to the calculations done when searching for nearby energy containers (which I've done alterations to in dev, but haven't profiled them).