AI-Improvements
| AI-Improvements |
|---|
AI-Improvements is a mod by BuiltBrokenModding that makes small changes to the artificial intelligence of ordinary mobs, mainly to reduce the processing cost of mob AI on busy servers. It adds no items, blocks, mobs, biomes or structures. Its effects are behavioural: some animals, fish and squid stop running certain AI tasks, and mobs compute their head movement differently. A player will notice these changes only when they are enabled and the behaviour they remove is missed.
The mod is a server-side performance tool. Its removal options are the part that changes mob behaviour, and in Fear Nightfall they are all switched off, so the mod has little visible effect on play.
Overview
AI-Improvements is listed in the Technical and Library Mods group of the pack. It targets NeoForge and Minecraft 1.21, and its mod description is "Small adjustments and improvements to AI logic focusing on optimizations for increased server performance". The mod has no crafting recipes, loot or spawning, and it does not change worldgen. Every change is set through a common configuration file, which lets a server operator turn individual AI tasks on or off per mob type or per filtered list of mobs.
The pack's mob content is described on Mobs, and the full list of mods is on Mod List.
Content
The mod adds no content of its own. Its options are grouped by the vanilla mob they affect:
- General entity settings. Two switches control the whole mod: whether AI tasks may be removed from entities at runtime, and whether repeated removal calls are moved to the front of the removal list.
- All mobs. Three settings apply to every mob, optionally limited by a filter list: removal of the look-at goal, removal of the look-at-random goal, and a replacement look controller.
- Fish. Settings for fish mobs, covering swimming, panic, avoiding players, following a leader fish and puffing up. Puffing up applies to the Pufferfish.
- Squid. Settings for Squid, covering fleeing and random movement.
- Animals. Separate sections for cows, chickens, pigs and sheep, each with switches for float, panic, breeding, tempting, following a parent, and strolling. Sheep also have a switch for eating blocks, which controls the grass eating that regrows their wool.
Filter lists take mob identifiers and so can include mods that add mobs to the pack, such as the animals of Critters and Companions or the creatures of Mutant Monsters. The pack's horror mobs, such as the Dread Hound, can also be placed on a filter list.
Mechanics
The mod acts when a mob is added to a world, which happens when it spawns and when it loads from saved chunks. At that point it checks each enabled setting against the mob's type and removes the matching AI tasks from the mob's goal selector.
Each per-mob setting has a filter list and an allowlist switch. When the switch is on, the setting applies only to the mobs on the list. When it is off, the setting applies to every mob except those on the list.
The master switch disables all removals at once. When the switch is on, the mod can also bubble repeated removal calls for the same mob type to the top of its list, which is intended to improve performance during repeat mob spawning.
The look-controller replacement is a separate, performance-only change. It replaces the vanilla head-turning logic with a version that caches its trigonometry. The replacement applies only to mobs that use the standard look controller. A mod that overrides a mob's look controller keeps its own version.
Changes to vanilla
When the switches are on, the following behaviour is removed from vanilla mobs:
- Look-at goal. The mob no longer turns to face players or attack targets, or walking directions.
- Look-at-random goal. The mob does not turn its head while idle. The mod's own description says this makes mobs feel lifeless.
- Fish. Fish stop their random swimming, panic, avoidance of players, following of leader fish, and puffing up of pufferfish.
- Squid. Squid stop fleeing and stop their random movement.
- Cows, chickens, pigs and sheep. Each animal can lose its floating, panic, breeding, tempting, follow-parent and strolling tasks. Sheep can also lose their block eating, so they no longer regrow wool.
Without any removal switch on, vanilla animal, fish and squid behaviour is unchanged. The look-controller replacement is the only change that runs without a removal switch.
In Fear Nightfall
The pack runs the mod with its settings as they are on the server. The look-controller replacement is on. Every removal switch is off, and every filter list is empty, so no vanilla task is removed from any mob. The pack's change log records no changes to this mod. Its only active effect is the look-controller replacement.
The removal switches are the part of the mod that would change the pack's feel. Turning on the look-at-random removal would make idle mobs stop moving their heads, a change that could make them more unsettling. The server has not enabled it. Server operators who want to try it can add a mob to the filter list first to limit the effect, for example to a single creature type from Critters and Companions. See also Changes to Vanilla.