MCGOD官方交流开黑群 1058033077 如有BUG请在 意见反馈 中进行反馈

AI Improvements

AI Improvements

112964948 次下载
最近更新2 周前
为模组 AI 进行性能和逻辑升级 Performance and logic upgrades for mod AIs

注意[1]: 如果你遇到未涵盖的性能问题,欢迎提出请求。

注意[2]: 本模组并非在所有情况下都能提升性能。请务必测试结果,看看你是否需要它。

Discord: https://discord.gg/hNBXPp45Zc

关于

这是一款简化的AI修改模组,专注于性能优化以及对游戏中AI进行底层修改。它弥补了原版游戏的不足,并针对模组生态系统进行了改进。处理诸如动物数量过多、僵尸群造成的性能影响等常见问题,还能完成大型优化模组遗漏的简单移除任务。

背景故事

AI改进模组源于解决大型整合包服务器性能问题的需求。随着服务器的TPS被众多争抢资源的模组消耗殆尽,用户通常会通过删减模组和限制内容/功能来解决这个问题。我没有从模组入手,而是开始审视《我的世界》本身。专注于研究其设计原理以及它是如何导致性能问题的。

我发现,随着服务器玩家数量的增加,实体数量和地理负载需求也会相应增加。最初的想法是降低生成率并限制实体总数。然而测试表明,这样做的效果微乎其微,尤其是考虑到玩家对农场的抱怨速度之快。在尝试了其他一些无果的配置方案后,我开始研究AI功能。很快就发现游戏中的AI优化得非常糟糕。在研究了数百个分析器转储文件并测试各种理论后,我们最终推出了AI改进模组。第一个改进就是优化AI使用的数学计算。结果性能有了显著提升…… 尤其是在玩家农场方面 :D

目标

本模组始终将性能优化放在首位,底层调整次之。这是为了让模组保持小巧,便于在《我的世界》的生命周期内进行管理。对于其他功能,我们可能会发布额外的模组,但也推荐社区中一些优秀的现有模组。

https://www.curseforge.com/minecraft/mc-mods/in-control

常见问题解答

我安装了,但没有看到如承诺的大幅提升?

较新的MC版本对AI进行了修复。在过去几个版本中,除了其他修复外,还实施了旋转修复。因此,本模组的影响比旧版本要小得多。

这个模组可以只安装在服务器上吗?

可以,该模组的编码使其无需客户端即可运行。

这个模组可以只安装在客户端上吗?

可以,不过它可能对提高帧率作用不大。

配置文件在哪里?

1.12.2及以下版本:'.minecraft/config/bbm/AI_Improvements.cfg'
1.14及以上版本:'.minecraft/config/aiimprovements-common.toml'

如果我禁用EntityLookHelper替换会怎样?

你不会看到AI代码有太大的改进。不过,如果你启用了其他禁用配置,应该也没问题。

这个模组是如何修复性能问题的?

这取决于功能和《我的世界》的版本。大部分性能提升来自缓存大量计算值。这样做的结果是在以可忽略不计的内存为代价的情况下减少了CPU时间。具体情况请查看功能列表……

当前功能

禁用AI观察最近实体的配置

默认情况下,该配置设置为false,不会生效。将其更改为true时,它将移除一个名为EntityAIWatchClosest的AI片段。这个AI片段负责处理编码的AI将头部转向附近实体的操作。从视觉上看,这会导致一些奇怪的问题。然而,对于CPU来说,它释放了大量由实体造成的资源占用。

禁用AI随机观察的配置,默认未启用

默认情况下,该配置设置为false,不会生效。将配置设置为true将使实体不再使用“空闲观察”AI代码。这对于玩家数量众多的服务器可以提升性能。因为地图上几乎每个实体在不执行重要任务时都会使用这个代码。从视觉上看,这可能会导致实体的头部有时不会转动,但大多数情况下不易察觉。

用更高效的版本替换EntityLookHelper的配置,默认已启用

这是该模组的主要功能,可以在少量占用内存的情况下大幅提升CPU性能。其工作原理是将MC的观察助手代码替换为自定义版本。自定义版本存储了一些数据,使得获取某个位置的角度更快。通过使用VisualVM进行的一些测试表明,AI代码的CPU使用率降低了50%到80%。对于一个经常有25人在线的服务器,这使得TPS从5提升到了7。

整合包政策

只要下载来源是CurseForge或我们在Modrinth上的镜像,就没问题。任何外部整合包需要通过Discord请求许可。

联系我们

加入我们的Discord:https://discord.gg/kVT6dpz


Note[1]: If you have performance issues not covered feel free to make a request. 

Note[2]: It is not expected this mod improves performance in all cases. Make sure to test your results to see if you require it.

Discord: https://discord.gg/hNBXPp45Zc

About

Simplified AI modification mod focused on performance and low-level modifications to AIs in the game. Picking up the slack for the base game and improving it for a modded ecosystem. Handling common problems such as too many animals, performance hits from swarms of zombies, and simple remove tasks skipped by larger optimization mods.

Story

AI Improvements was born out of the need to solve server performance for heavily modded packs. As a server's TPS is eaten away by mods all trying to fight over resources. Users often attack this problem by trimming mods and restricting content./functionality Rather than going after the mods I started to look at Minecraft itself. Focusing down on how it was designed to work and how it lent to performance problems.

I found that as a server's population grows so does the amount of entities and geographic load requirements. First thought would be to cut down spawn rates and limit over all entity counts. Yet testing shows minimal benefit especially given how quickly users complain about farms. Eventually after a few other fruitless config solutions I took a look at AI functionality. Quickly it became clear just how poorly optimize the AIs are in the game. After exploring 100s of profiler dumps and testing theories we ended up with AI improvements. With the very first improvement being optimizing math used by AI. Seeing rather massive improvements... especially in regard to player farms :D

 

Goal

Focus of this mod will always be performance first and low level adjustments second. This is to keep the mod small and easy to manage over the life time of minecraft. For other features we may publish additional mods but recommend some of the wonderful mods already present in the community.

https://www.curseforge.com/minecraft/mc-mods/in-control

FAQ 

I installed but didn't see a large gain as promised?

Newer versions of MC implement fixes for the AI. With the last few versions, the rotation fix was implemented in addition to other fixes. Thus, the impact of this mod is much lower than in older versions.

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?

1.12.2-: '.minecraft/config/bbm/AI_Improvements.cfg'
1.14+: '.minecraft/config/aiimprovements-common.toml'

What will happen if I disable the EntityLookHelper replacement?

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

 

How does this mod work for fixing performance?

It depends on the feature and version of Minecraft. Most of the performance comes from caching heavily calculated values. This has the result of reducing CPU time at the cost of an ignorable amount of RAM. See feature list for exacts...

 

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. Through 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. 

Modpack Policy

So long as downloads come from CurseForge or our mirror on Modrinth, it is fine. Any external modpacks need to ask permission via Discord.

Contact

 Join us on Discord: https://discord.gg/kVT6dpz

本站是资源分享站,资源均来自于互联网和用户自发分享,仅供学习和交流使用。如有版权问题,请联系管理员删除。

评论区 (0)

登录 后才能发表评论

暂无评论

快来发表第一条评论吧!