play.wildercraft.net

Join 11 players online!

How-To: Simple Anti-Mob Lag Plugin - A Basic Guide


Awkwardbowman
Ancient

Joined: over 5 years ago
34 topics
149 posts

by Awkwardbowman » over 3 years ago
Introduction:
Hey all! This article is intended to help explain how the Simple Anti-Mob Lag (SAML) plugin is used on the WilderCraft servers. This will be accurate for the current version of SAML (1.3.5) and with our current settings as of June 7th, 2020.


This is also used alongside of other plugins to assist with the server’s performance. The other most common plugin would be the FarmLimiter plugin. For information about that plugin, see this article.

What Is It: 
A spigot plugin designed to freeze/unfreeze lag-causing mobs dynamically based upon a server’s TPS. This is check is done against each server individually.


How it Works:
The plugin regularly takes TPS readings from the server. When certain TPS thresholds are met, the plugin will Freeze or Unfreeze mobs to compensate. For example, if TPS goes from 20 to 15, the plugin will begin looking for larger mob groups that can be frozen to improve TPS. After freezing some, TPS should improve. As it improves, the plugin will begin unfreezing the mobs slowly.

There are a number of configurable settings that can be set to determine how exactly this plugin functions, with some of the major settings being covered below.

The Core Limits:
The plugin will start taking affect anytime TPS drops below 18 TPS. Once things have been frozen, they will not automatically be unfrozen until TPS returns above 19.5. For many servers, we will ideally stay at 20 TPS and no mobs should be frozen at that time.

Keep in mind that the plugin does not use instantaneous TPS. For example, if TPS drops to 10 for a single cycle, it will not trigger the plugin. It uses statistical sampling and confidence intervals to determine if the lag is consistent before acting.

Freeze Settings: 
At 18 TPS, the plugin will begin to freeze mobs based upon grouping size and distances. It begins with a Minimum Group Size of 20 within a Maximum Group Radius of 10. This is intended to only catch large farm groups, like cows, sheep, and chickens. Unlike the FarmLimiter, this plugin is not configured to distinguish between mob types. A Group of 20 chickens and 20 cows will count as a single group of 40.


As TPS drops more, this will slowly increase, where it will eventually be able to target using a Minimum Group Size of 5 and a Maximum Group Radius of 20 at 9 TPS. This setting scales, meaning the values change proportionally to the TPS loss.
Keep in mind that the plugin looks for larger groups first, so the biggest farms will be frozen first when TPS begins to drop. If you’re looking to produce for yourself only, your farms are not likely to experience any issues. However, if your farm is massive, you may find it disabled anytime a large number of players is online.

There are certain additional settings intended to prevent certain groups of mobs from being frozen as well.
The following Mobs will only be targeted once TPS drops to 10 or below:
            Named Mobs
            “Recently” Spawned Mobs (last 30s)
            Mobs targeting a Player
The following Mobs will only be targeted once TPS drops to 5 or below:
            Tamed Mobs
            Leashed Mobs
            Mobs in “Love Mode”
            Mobs included in Pillager Raids
           
While Frozen:
While frozen, the mob essentially does not process or act. Villagers will not reset trades or spawn golems. Animals will not grow up. Sheep will not eat and regrow their wool. And of course, they will not move.


Un-Freeze Settings:
There are a number of ways Mobs can be unfrozen. The natural way is for TPS to return above 19.5 and for Mobs to be unfrozen in groups. Along side of that, there are some actions that can cause the Mob to be unfrozen sooner, although it will still be subject to being re-frozen if TPS does not improve.

A mob can be unfrozen in the following situations:
  • When they take damage (unless TPS is below 5)
  • When they are interacted with (unless TPS is below 5)
  • When the chunk they are in becomes unloaded

Conclusion:
These settings are all subject to change, especially early on as we are still tweaking all of the settings. If you are concerned about your mobs and their behavior, ask a Mod to check. They can record any issues or unexpected behavior so we can further tweak the plugin to have as little impact on your gameplay experience as possible.


Hope this helped. If you have any questions or see any discrepancies, please contact Awkwardbowman (or whoever the current Tech Mod is).

 



Last edited: over 3 years ago


Want to Reply?

Join our friendly community to get access to your profile page, apply for staff, and post a reply here!

Login or Register Account