Profiles:
If you prefer a ready to go configuration, there are now default profile settings, all of them were tested to make sure no game breaking changes happen.
Profiles: LIGHT, BALANCED (default), AGGRESSIVE (giving the most perfomance), CUSTOM.
1. Unreachable target cache: a mob skips retries to a target for 20 s (10 / 30) after its A* search for it exhausts the budget and gets nowhere, and the entry clears as soon as a block changes in the target chunk so doors and bridges work instantly. (the numbers in parenthesis represent the light and agressive profiles respectively)
2. Pathfinding throttle: at most 3 path searches start per tick (4 / 2) to flatten the villager dawn rush while only searches that really run count and a mob told to wait is not treated as failed.
3. Search depth cap: A* visits at most 300 nodes (400 / 200) since failed searches burn the most CPU at 800+ nodes while village paths rarely exceed 300.
4. Path recompute at distance: mobs beyond 36 blocks (48 / 24) from every player refresh their paths at most every 5 s (3 / 8).
5. AI tick reduction at distance: far mobs run goal and target selectors and the brains of idle or resting villagers and similar mobs only every 6th tick (4th / 8th) staggered across mobs, while movement and navigation still run every tick so walking stays smooth (compatible and recommended with Entity Culling)
6. Villager bed and job site retries: vanilla retries unreachable beds and job blocks about every 12 s forever while ARLR lets the wait grow up to 60 s (40 / 120) and new ones are still claimed instantly.
7. Repeat walk searches: vanilla can search the same spot again on the next tick when a villager finds no path to its walk target and ARLR waits 2 s (1 / 5) before trying that exact spot again.
Safety:
* Mobs within the profile distance of a player keep vanilla AI and path refresh rates while everything else applies at any distance.
* Urgent mobs with an attack target or hurt in the last 10 s skip the throttle and depth cap and are never slowed or held back from walk searches.
* Mobs in water or lava always run their AI at full rate so they keep swimming and never drown.
* Brains busy with anything besides idle or rest (work, panic or modded activities) run at full rate and timed memories still expire on time.
* The throttle never denies villager bed and job site searches.
Optionally for fabric is recommended to install Forge Config API Port for in-game config options, otherwise the default profile will be BALANCED
Compatibility
- Lithium optimizes different layers (it makes each A* node evaluation cheaper; ARLR reduces how often and how deep A* runs). They can be used together.
- The goal selector hook uses MixinExtras
@WrapOperation, so other mods wrapping the same calls chain cleanly instead of conflicting. - ARLR injects into
PathNavigation.createPath,PathNavigation.recomputePath,Brain.tick,Mob.serverAiStep, andLevel.setBlock.
NOTE: ARLR (previously path finder) will continue to receive further updates, since the mod is now stable and solves one of minecraft's most expensive features, future updates will take longer and will only try to add small yet working improvements over the actual base as to not break the mod.
Q&A
Q: What are the differences between profiles if none break the game mechanics, why not pick aggressive always?
A: While the AI logic is preserved, using a profile like agressive can at max slow down many behaviors up to 2-5x times, still the change is not really perceptible to us players unless somehow you are in a place with a 100 plus villagers and need them doing something specific each tick, but for big majority of gameplay you won't even notice these changes and is why I recommend chosing the agressive profile over balanced or light.
Q: Will this break with other mods doing the same?
A: Unlikely, ARLR was built to target paths other optimization mods don't usually target to ensure compatibility, but even if such were the case, you would only have duplicated calls and performance might drop a little bit.
Credits
This mod took heavy inspiration from Pathwright

