Dynamic Entity Activation Range (DEAR) is one of the most impactful entity patches that Airplane includes, but there’s a lot of questions about what it changes. As well, the configuration is more difficult due to the numbers correlating more with the internal function of DEAR, so here we’ll explain it!
Put simply, DEAR limits how often a mob decides to do something based on how far away they are from a player. That “something” is a pathfinder goal finding for most mobs, and for newly updated mobs (piglins, villagers) it’s their behavior engine.
An example of how this works is a goal that Blazes have, where they look for a nearby player to target. If they are far away from a player, they won’t check as often for nearby players, which results in a huge performance improvement for blazes!
Paper’s current implementation of this is hard-coded to the activation range. If you have an activation range of 100 blocks, any simple entity further than 100 blocks to a player will only have their pathfinder goals ticked 1 of 4 times. Their implementation doesn’t impact other entities like Villagers or Piglins, while also being unable to optimize entities variably.
For the most part, you won’t see any breakage of vanilla mechanics with the default settings. Entities will still attempt to move and do normal actions 100% of the time (except if they’re being limited by Paper’s Activation Range), they just choose to make a decision less often if they’re further away. Given Paper’s implementation was to tick these far away entities 1/4th the time, closer entities that end up being ticked 1/2th the time function closer to vanilla on Airplane than Paper does! As well, being able to configure this setting to choose how it’s used is a unique feature offered by Airplane.
# Optimizes how entities act when # they're far away from the player [activation-range] # This value defines how often in ticks, the furthest entity # will get their pathfinders and behaviors ticked. 20 = 1s max-tick-freq = 20 # This value defines how much distance modifies an entity's # tick frequency. freq = (distanceToPlayer^2) / (2^value) # If you want further away entities to tick less often, use 8. # If you want further away entities to tick more often, try 10. activation-dist-mod = 9
activation-dist-mod
(default: 9
)This value represents how often an entity is ticked.
With the default value of 9
, ticking would look like this:
Blocks Away from Player | Ticking Frequency |
---|---|
22 or less | 1/1 |
32 | 1/2 |
39 | 1/3 |
45 | 1/4 |
64 | 1/8 |
90 | 1/16 |
101 or more | 1/20 |
If you would like entities further away to tick more often, try upping the value to 10
.
Blocks Away from Player | Ticking Frequency |
---|---|
32 or less | 1/1 |
45 | 1/2 |
55 | 1/3 |
64 | 1/4 |
90 | 1/8 |
128 | 1/16 |
143 or more | 1/20 |
If you would like entities further away to tick less often, try lowering the value to 8
.
Blocks Away from Player | Ticking Frequency |
---|---|
16 or less | 1/1 |
22 | 1/2 |
27 | 1/3 |
32 | 1/4 |
45 | 1/8 |
64 | 1/16 |
71 or more | 1/20 |
As you can see, small changes in the modifier result in huge changes to their ticking frequency.
This is why only +1 or -1 changes to the modifier are recommended.
For example, at a 7
modifier entities as close as 50 blocks get ticked only once a second!
Most servers will gain enough performance with the default settings, although with a high amount of entities an 8
may be helpful.
max-tick-freq
(default 20
)You may notice that in the tables above, anything above a certain block limit only had the entity ticking every 1/20 ticks. This is to ensure that entities update once in a while. However, if you’d like you can change this value to your liking.
4
would limit the least an entity is ticked to 1/4 ticks (5 times a second.)40
.Otherwise, the default value is advised.
If you’ve already tuned your activation-dist-mod
, then it’s unlikely you’ll get much more performance out of entity decision making.
Thanks for reading through this article! If you have any questions, join the Discord and ask our helpful community! If you need more performance, check out the other articles on our blog for more optimizations!
Legal Stuff