AI Improvements

Akliz Sponsorship

About

This mod is focused on improving CPU clock times by reducing AI usage. While also allowing more control over AI functionality through simple customizations.

Story

AI Improvements was born out of the need to improve server performance for large heavily modded servers. As any experienced server owner will know a server's CPU clock time is eaten away by mods all trying to fight over resources. Most server owners and developers will try to attack this problem by trimming mods. Rather than going after the mods installed I started to look at Minecraft's core code.

 

I found that as a server's population grows so does the amount of entities and other resources. At first, I thought "lets reduce the spawn rate of mobs on the server" this lead to a complaint about mob farming. Even with testing, it didn't show a major solution to the problem. So rather than taking that approach, I decided to improve how the AI's function. This resulted in a lot of resource and insight into different areas. After many hours, I found my solution and created this mod.

 

FAQ 

Can this be installed on the server only?

Yes, the mod is coded to function without it being client side

 

Can this be installed on the client only?

Yes, though it may not do much to improve fps. 

 

Where is the config?

'.minecraft/config/bbm/AI_Improvements.cfg'

 

What will happen if i disable the EntityLookHelper replacement?

Your not going to see much of an improvement in the AI code. However, if you enabled the other disable configs it should be fine.

Current Features

Config to disable AI Watch Closest Entity

By default the config is set to false and will not do anything. When changed to true it will remove an AI segment called EntityAIWatchClosest. This AI segment handles the coded AIs use to rotate their head towards a nearby entity.Visually this will cause a few odd issues. However, for the CPU this frees up a lot of usage caused by entities. 

 

Config to disable AI look random, config is not enabled by default

By default the config is set to false and will not do anything. Setting the config to true will cause entities to no longer use the 'look idle' AI code. This can improve performance for servers will large populations. As almost every entity on the map will use this when not doing anything important. Visually this can cause the entities head to not rotate sometimes but mostly goes unnoticed.

 

Config to replace EntityLookHelper with a more efficient version, config is enabled by default

This is the main feature of the mod and can greatly improve CPU performance at a small cost to RAM. How this works is MC's look helper code is replaced with a custom version. The custom version stores some data that makes it faster to get the angle for a location. Threw some testing with VisualVM result have shown a 50% to 80% decrease in CPU usage by the AI code. For a server with 25 people on constantly this resulted in a gain from 5 to 7 tps. 

Planned Features
  • Multithreading for AI nav pathfinder
  • Mob spawning restrictions
  • Disable Visual AI code when not near players
  • Reduce wondering distance
  • Reduce wondering distance when not near players
  • Reduce how often Mobs raytrace targets
  • Config to control the amount of RAM atan2 cache uses

Modpack Policy

No need to ask for permission. However, any modpack containing the mod will need to follow BBM's modpack policy

 

It is also recommended when making modpacks to make this mod optional. As it is primarly designed for server side use and provides only a small boost to client side.

Contact

 Join us on Esper.net IRC #BuiltBroken #BuiltBrokenModding


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    233019
  • Created
    Jul 21, 2015
  • Last Released File
    Oct 24, 2017
  • Total Downloads
    427,700
  • License

Categories

Members