CobbleOptimizer
一个适用于 Minecraft 1.21.1 的服务端 Fabric 模组,用于优化 Cobblemon(宝可梦模组)实体性能,其机制基于服务器负载(TPS)。它具备四大核心功能:
- 刻率节流(Tick Throttle)——降低远处/非重要宝可梦实体的刻更新频率。当服务器 TPS 下降时,远离玩家的宝可梦会减少其刻更新速率,从而节省 CPU 资源。
- AI 冻结(AI Freeze)——完全冻结远离任何玩家的宝可梦实体的 AI。如果没有人在附近观察它们,就没有必要运行其寻路和行为逻辑。
- 自适应生成(Adaptive Spawn)——根据当前服务器 TPS 动态调整宝可梦的生成速率。当服务器吃力时,生成的宝可梦数量减少;当服务器状态良好时,生成率恢复正常。
- 批量移除(Batch Despawn)——在服务器过载时批量移除多余的宝可梦实体,优先移除不重要的实体(非闪光、非传说、未被拥有、未处于战斗中)。
共享基础设施
- TPS 监控器 —— 持续跟踪服务器 TPS,为所有功能提供数据支持。
- 玩家追踪器 —— 缓存玩家与实体之间的距离,以便多个功能以较低开销检查邻近关系。
- 配置文件 —— 基于 TOML 格式的配置文件,并支持通过游戏内命令(/cobbleoptimizer)实时调整阈值。
简而言之
这是一款性能优化模组,通过在服务器负载较高时智能地缩减宝可梦实体的处理量,确保 Cobblemon 服务器流畅运行,同时保护重要宝可梦(闪光、传说、战斗中、已拥有)免受过度优化。
CobbleOptimizer
A server-side Fabric mod for Minecraft 1.21.1 that optimizes Cobblemon (the Pokemon mod) entity performance based on server load (TPS). It has 4 main
features:
- Tick Throttle — Reduces how often distant/unimportant Pokemon entities are ticked. When the server TPS drops, Pokemon far from players get their tick rate
reduced, saving CPU cycles.
- AI Freeze — Completely freezes the AI of Pokemon entities that are far from any player. If no one is nearby to observe them, there's no need to run their
pathfinding and behavior logic.
- Adaptive Spawn — Dynamically adjusts Pokemon spawn rates based on current server TPS. When the server is struggling, fewer Pokemon spawn; when it's
healthy, spawns return to normal.
- Batch Despawn — Removes excess Pokemon entities in bulk when the server is overloaded, prioritizing removal of unimportant ones (non-shiny, non-legendary,
unowned, not in battle).
Shared Infrastructure
- TPS Monitor — Continuously tracks server TPS to inform all features.
- Player Tracker — Caches player-to-entity distances so multiple features can cheaply check proximity.
- Config — TOML-based configuration with in-game commands (/cobbleoptimizer) to tweak thresholds on the fly.
In short
It's a performance optimization mod that keeps Cobblemon servers running smoothly by intelligently scaling back Pokemon entity processing when the server is
under load, while protecting important Pokemon (shinies, legendaries, battling, owned) from aggressive optimization.
评论 0
登录后参与评分
还没有评论,来抢沙发吧