Guard Villagers

Guard Villagers

30M Downloads

Guard Villager Tasks Causing TPS Buildup

DereC4 opened this issue ยท 7 comments

commented

Heyo, I've been running some metrics checks for the mods I used both for fun and to diagnose what may cause the most lag. Here's a report for Guard Villagers using Spark

image

Found out that Guard Villagers tasks use up a lot of TPS. I can see why, given that guards that need to stay on a position will constantly have to check for that spot, but I was wondering if there was any way you could optimize some of the tasks shown here. It appears the main cause of lag buildup is if one has many guards stationed at set blocks around the world, of which they will constantly check to path to that area.

image

Again, I understand it's no easy task to optimize this but could this maybe be looked at? It's a pressing issue on my servers where many players like to protect their villages with guards and station them at certain builds.

commented

I'd appreciate it if you could expand this tab here so I can clearly see which specific goals are causing this problem.

Also I feel like it should be a no-brainer that having a bunch of mobs in one area would cause some amount of lag

UPDATE: I found a way to reduce this happening when guards are patrolling, however this update will have to be for 1.20 and up because I do not support 1.19 anymore.

image

commented

Hope it helped!

commented

It is indeed, as you say, a "no brainer", I was just hoping to bring this to your attention (I have around 8 guards in the village)

commented

(I have around 8 guards in the village)

Ah, this brings things into perspective now.

I've already managed to find a fix for this issue, but as I stated previously it will only have to be for 1.20 and up. You are free to implement the new change to 1.19 soon (it's actually one line that needs to be changed lol)

commented

Yeah but I haven't pushed the commit to actually fix it yet

commented

Oh neat do I just fork and then make a PR?

commented

w