跳到正文

Recipe Balancer

作者:JesseM1024

Client-side production line balancer: enter recipes and target rates, solve steady-state rates, machine counts and byproducts with linear programming. Cyclic loops supported.

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

RecipeBalancer — a steady-state balancer for production lines

RecipeBalancer is a client-side planning instrument for production lines in modded Minecraft. Press K to open GUI. Given a set of recipes and a set of target output rates, it returns the operating rate of every recipe, the number of machines required at each step, the materials that must be supplied from outside the line, and the byproducts that arise. The mod adds no items, blocks or machines; it is an analysis tool and runs entirely on the client.

Method

A production line is a system of simultaneous material constraints: the byproduct of one process feeds another, a step may consume its own output, and the target rate fixes the scale of every upstream operation. Successive substitution resolves acyclic chains and fails once a chain contains a cycle.

The line is therefore formulated as a constrained optimisation problem: one variable per recipe, denoting its operating rate, and one balance constraint per material, stating that production plus imports equals consumption plus target and byproduct output. Materials declared raw may be imported without bound; all others must be produced within the line. The objective is either the total number of machine parallels, weighted by process duration, or the total recipe activity.

The system is solved as a whole, so cyclic structures require no special treatment:

  • a cycle that returns less material than it consumes is identified as deficient, and the external supply it requires is reported;
  • a cycle that conserves material admits no steady-state start, and its minimum bootstrap inventory is computed;
  • where the optimum is not unique, one optimal solution is reported; machine counts are invariant across the optimal set.

Input

Recipes are entered through an in-game screen as inputs, outputs, duration and machine. Materials may be selected from the inventory or, where JEI is installed, transferred from its item list or from a recipe page. Duration and machine type are always specified by the user, since neither is reliably recoverable from a recipe. Targets are given as a quantity per unit time.

Work in progress is autosaved to config/recipebalancer/scenarios/autosave.json and restored on the next launch.

Output

Results are presented as a report — operating rate and machine count per recipe, external inputs, byproducts — and as a dependency-ordered flowchart, in which node colour denotes the role of a node and edge width denotes material flow. The flowchart supports panning, zooming and node dragging; its layout minimises edge crossings and node overlap.

Known limitations

  • The model is steady-state; buffers, warm-up and transient behaviour lie outside its scope.
  • Recipe data are not read from other mods’ registries. JEI is the only automated entry path, and it supplies materials rather than durations.
  • Material names are not interpreted; only the structure of a recipe is used.
  • Computation time increases with the number of recipes.

Installation

  • Client-side only: no server component, no network traffic, no modification of world state.
  • Place the jar in mods; no initial configuration is required.

Compatibility

JEI accelerates recipe encoding: ghost drag from the item list, transfer from a recipe page, and fluid or chemical ingredients, counted in buckets (500 mB = 0.5). The interface is localised in English and Chinese. Exact loader and Minecraft version per build are listed under Files.

Scope and disclosure

The mod modifies no game state and performs no network communication; all computation is local. Significant amount of code is AI generated.


中文说明

RecipeBalancer —— 产线稳态配平工具

RecipeBalancer 是面向模组化 Minecraft 产线的客户端规划工具。给定一组配方与一组目标产出速率,它给出每条配方应有的运行速率、各环节所需的机器数量、必须由产线外部供给的物料,以及目标之外的副产物。模组不新增物品、方块或机器,仅承担分析功能,全部运算在客户端完成。

方法:产线是一组联立的物料约束——某一工序的副产物是另一工序的输入,某一步可能消耗自身产出,目标速率决定全部上游工序的规模。无环链条可逐次代入,一旦成环则不再收敛。故将产线表述为约束优化问题:每条配方一个运行速率变量,每种物料一条平衡约束(产出与输入之和等于消耗与目标、副产物输出之和)。声明为原料的物料可无限输入,其余须由产线自产。目标函数为最小化按工序时长加权的机器并行总量,或最小化配方活动总量。整体求解,循环无需特殊处理:回流量小于消耗量的循环判为亏损并给出所需外部供给;物料守恒的循环没有稳态起点,工具计算其最小启动投料;最优解不唯一时只报告其中一个,机器数量在最优解集内不变。

录入:配方以原料、产物、时长、设备四项在游戏内界面录入;物料可从背包选取,装有 JEI 时亦可自其物品列表拖入或从配方页导入。时长与设备种类始终由用户填写——二者无法从配方可靠还原。目标以单位时间产量给出。未完成的工作自动保存至 config/recipebalancer/scenarios/autosave.json,下次启动恢复。

输出:结果以文本报告(各配方速率与机器数、外部输入、副产物)与按依赖关系分层的流程图呈现;节点颜色表示其在产线中的角色,连线宽度表示物料流量。流程图支持平移、缩放与节点拖动,布局以边交叉与节点重叠最少为目标。

已知限制:仅适用稳态,不涉及缓冲、预热与瞬态;不读取其它模组的配方库,JEI 是唯一的自动录入通道且只提供物料;不解析物料名称,只使用配方结构;计算耗时随配方数量增长。

安装:仅客户端,无服务端组件、无网络通信、不修改世界状态。将 jar 放入 mods 即可,无需初始配置。

兼容:装有 JEI 时可从物品列表拖 ghost、从配方页导入,流体与化学品等非物品按桶计(500 mB = 0.5);界面提供中文与英文。

常见问题

Recipe Balancer 支持哪些 Minecraft 版本?

Recipe Balancer 支持 Minecraft Java 版 1.20.1–1.21.1,共 2 个版本,可用的加载器:Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。

Recipe Balancer 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

JesseM1024 的其他作品

查看全部 →