feat(skills): per-server aug cost settings in the Progression tab (2026.10.5.18)

Collapsible 'Cost settings for <world>' under Augmentations: five tier multipliers, a
per-aug table (base, growth %, S1..S4, cap, coins) and Reset to InfiniteLeaftide defaults.
Boxes commit on Enter or focus loss; RynthAi saves the rules for the current world.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
BlankenshipG 2026-10-07 13:24:25 -04:00
commit dae9d6ac30
3 changed files with 168 additions and 0 deletions

View file

@ -0,0 +1,34 @@
# RynthCore engine 2026.10.5.18 — Aug cost settings in the Progression tab
**Date:** 2026-10-07
**Previous release:** 2026.10.5.17 (Progression tab laid out like UB's ILT Tools)
**Branch:** `QOL-items`
**Pairs with:** RynthAi 0.5.24-legacy-ui. With an older RynthAi the editor is hidden.
## What's new
The Augmentations section has a collapsible **Cost settings for <world>** block. Its header says
whether the world is on the InfiniteLeaftide defaults or has its own (custom) rules.
- **Tier multipliers:** five boxes (Below S1, From S1, From S2, From S3, From S4). The defaults are
UB's 1 / 4 / 8 / 16 / 24, and decimals are allowed.
- **Per-aug rules:** a table with Base, Growth%, S1, S2, S3, S4, Cap (0 = no limit) and Coins per
level.
- **Reset to InfiniteLeaftide defaults:** drops this world's changes.
- A note explains the formula: level i costs (Base + (i − 1) × Base × Growth% / 100) × the
multiplier of its tier, and a tier starts at its S level.
Every box commits on Enter or when it loses focus, so a half-typed value never reaches RynthAi.
RynthAi saves the rules for the current world only, and the plan above re-prices on the next
snapshot.
## Data (`UI/Data/ProgressionData.cs`)
- `AugPlanner.Config`, of type `AugCostConfig`: World, Custom, Multipliers and Rows.
- `AugCostRule`: Key, Label, Base, Percent, Coins, S1 to S4, and Cap.
## Build
- `scripts/Publish-EngineCoreClr.ps1 -Target out\staged-2026.10.5.18 -EngineOnly -MsBuildArgs
@('-p:Version=2026.10.5.18')`. It built with no errors; the one warning was already there.
- `RynthCore.Engine.dll` FileVersion 2026.10.5.18.

View file

@ -440,6 +440,7 @@ internal sealed partial class SkillsFace
if (a.Short.Length > 0) Label(a.Short, Text);
}
Label(a.Banked, Dim);
if (a.Config != null) DrawAugCostSettings(a.Config, w);
}
finally
{
@ -447,6 +448,110 @@ internal sealed partial class SkillsFace
}
}
private static readonly string[] AugTierNames = { "Below S1", "From S1", "From S2", "From S3", "From S4" };
// Cost-settings boxes being typed in, by box id (committed on Enter / focus loss).
private readonly Dictionary<string, int> _augCfgIntEdit = new(StringComparer.Ordinal);
private readonly Dictionary<string, double> _augCfgDblEdit = new(StringComparer.Ordinal);
/// <summary>
/// Collapsible editor for this world's aug cost rules (RynthAi saves them per world). The
/// defaults are UB's InfiniteLeaftide model; Reset puts a changed world back on them.
/// </summary>
private void DrawAugCostSettings(AugCostConfig cfg, float w)
{
ImGuiNET.ImGui.Dummy(new Vector2(0, 2));
string head = $"Cost settings for {cfg.World}" + (cfg.Custom ? " (custom)" : " (InfiniteLeaftide defaults)");
if (!ImGuiNET.ImGui.CollapsingHeader(head + "##aug_cfg")) return;
ImGuiNET.ImGui.PushTextWrapPos(ImGuiNET.ImGui.GetCursorPosX() + w - 24);
Label("Level i costs (Base + (i - 1) x Base x Growth% / 100) x the multiplier of its tier. "
+ "A tier starts at its S level (UB's InfiniteLeaftide model). Changes apply to this world only.", Dim);
ImGuiNET.ImGui.PopTextWrapPos();
// Tier multipliers, one box each.
Label("Tier multipliers", Text);
for (int t = 0; t < AugTierNames.Length && t < cfg.Multipliers.Length; t++)
{
if (t > 0) ImGuiNET.ImGui.SameLine();
ImGuiNET.ImGui.BeginGroup();
Label(AugTierNames[t], Mute);
ImGuiNET.ImGui.SetNextItemWidth(62);
CfgDouble($"mult{t}", cfg.Multipliers[t], v => $"augmult {t} {v.ToString("R", CultureInfo.InvariantCulture)}");
ImGuiNET.ImGui.EndGroup();
}
// Per-aug rules.
if (ImGuiNET.ImGui.BeginTable("##aug_cfg_rows", 9, ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerV | ImGuiTableFlags.SizingStretchProp,
new Vector2(w - 16, 0)))
{
ImGuiNET.ImGui.TableSetupColumn("Aug");
ImGuiNET.ImGui.TableSetupColumn("Base", ImGuiTableColumnFlags.WidthFixed, 74);
ImGuiNET.ImGui.TableSetupColumn("Growth%", ImGuiTableColumnFlags.WidthFixed, 54);
ImGuiNET.ImGui.TableSetupColumn("S1", ImGuiTableColumnFlags.WidthFixed, 46);
ImGuiNET.ImGui.TableSetupColumn("S2", ImGuiTableColumnFlags.WidthFixed, 46);
ImGuiNET.ImGui.TableSetupColumn("S3", ImGuiTableColumnFlags.WidthFixed, 46);
ImGuiNET.ImGui.TableSetupColumn("S4", ImGuiTableColumnFlags.WidthFixed, 46);
ImGuiNET.ImGui.TableSetupColumn("Cap", ImGuiTableColumnFlags.WidthFixed, 50);
ImGuiNET.ImGui.TableSetupColumn("Coins", ImGuiTableColumnFlags.WidthFixed, 42);
ImGuiNET.ImGui.TableHeadersRow();
foreach (AugCostRule r in cfg.Rows)
{
ImGuiNET.ImGui.TableNextRow();
ImGuiNET.ImGui.TableNextColumn(); ImGuiNET.ImGui.TextUnformatted(r.Label);
ImGuiNET.ImGui.TableNextColumn(); CfgInt($"{r.Key}.base", (int)Math.Min(r.Base, int.MaxValue), $"augcfg {r.Key} base");
ImGuiNET.ImGui.TableNextColumn(); CfgDouble($"{r.Key}.pct", r.Percent, v => $"augcfg {r.Key} pct {v.ToString("R", CultureInfo.InvariantCulture)}");
ImGuiNET.ImGui.TableNextColumn(); CfgInt($"{r.Key}.s1", r.S1, $"augcfg {r.Key} s1");
ImGuiNET.ImGui.TableNextColumn(); CfgInt($"{r.Key}.s2", r.S2, $"augcfg {r.Key} s2");
ImGuiNET.ImGui.TableNextColumn(); CfgInt($"{r.Key}.s3", r.S3, $"augcfg {r.Key} s3");
ImGuiNET.ImGui.TableNextColumn(); CfgInt($"{r.Key}.s4", r.S4, $"augcfg {r.Key} s4");
ImGuiNET.ImGui.TableNextColumn(); CfgInt($"{r.Key}.cap", r.Cap, $"augcfg {r.Key} cap");
ImGuiNET.ImGui.SetItemTooltip("Highest target level; 0 = no limit.");
ImGuiNET.ImGui.TableNextColumn(); CfgInt($"{r.Key}.coins", r.Coins, $"augcfg {r.Key} coins");
ImGuiNET.ImGui.SetItemTooltip("Enlightened Coins per level.");
}
ImGuiNET.ImGui.EndTable();
}
Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
if (Button("##aug_cfg_reset", "Reset to InfiniteLeaftide defaults", p, new Vector2(230, 22), Text, BtnFill, enabled: cfg.Custom))
SendProg("augcfgreset");
ImGuiNET.ImGui.SetItemTooltip("Drops this world's changes; it goes back to UB's InfiniteLeaftide rules.");
NextLine(p, 26);
}
/// <summary>Integer box that sends "<paramref name="verb"/> value" on Enter or focus loss.</summary>
private void CfgInt(string id, int value, string verb)
{
int v = _augCfgIntEdit.TryGetValue(id, out int typing) ? typing : value;
ImGuiNET.ImGui.SetNextItemWidth(-1);
bool enter = ImGuiNET.ImGui.InputInt("##cfg_" + id, ref v, 0, 0, ImGuiInputTextFlags.EnterReturnsTrue);
bool active = ImGuiNET.ImGui.IsItemActive();
if (enter || ImGuiNET.ImGui.IsItemDeactivatedAfterEdit())
{
_augCfgIntEdit.Remove(id);
if (v != value) SendProg($"{verb} {Math.Max(0, v).ToString(CultureInfo.InvariantCulture)}");
}
else if (active) _augCfgIntEdit[id] = v;
else _augCfgIntEdit.Remove(id);
}
/// <summary>Decimal box (the caller sets its width) that sends <paramref name="command"/>(value) on Enter or focus loss.</summary>
private void CfgDouble(string id, double value, Func<double, string> command)
{
double v = _augCfgDblEdit.TryGetValue(id, out double typing) ? typing : value;
if (!id.StartsWith("mult", StringComparison.Ordinal)) ImGuiNET.ImGui.SetNextItemWidth(-1);
bool enter = ImGuiNET.ImGui.InputDouble("##cfg_" + id, ref v, 0, 0, "%.6g", ImGuiInputTextFlags.EnterReturnsTrue);
bool active = ImGuiNET.ImGui.IsItemActive();
if (enter || ImGuiNET.ImGui.IsItemDeactivatedAfterEdit())
{
_augCfgDblEdit.Remove(id);
if (Math.Abs(v - value) > 1e-9 && double.IsFinite(v)) SendProg(command(Math.Max(0, v)));
}
else if (active) _augCfgDblEdit[id] = v;
else _augCfgDblEdit.Remove(id);
}
private string? _augLpcEdit; // Lum per coin box being typed in
private readonly Dictionary<string, int> _augTargetEdit = new(StringComparer.Ordinal); // target boxes being typed in

View file

@ -105,6 +105,35 @@ internal sealed class AugPlanner
/// <summary>Ready-made clipboard texts (UB's Copy Discord / Copy In-Game).</summary>
[JsonPropertyName("copyDiscord")] public string CopyDiscord { get; set; } = "";
[JsonPropertyName("copyIngame")] public string CopyIngame { get; set; } = "";
/// <summary>This world's cost rules for the Cost settings editor (null from older RynthAi).</summary>
[JsonPropertyName("cfg")] public AugCostConfig? Config { get; set; }
}
/// <summary>Per-server aug cost rules: level i costs (Base + (i-1)*Base*Pct/100) x the multiplier of its tier.</summary>
internal sealed class AugCostConfig
{
[JsonPropertyName("world")] public string World { get; set; } = "";
/// <summary>The world has its own saved rules (false = UB / InfiniteLeaftide defaults).</summary>
[JsonPropertyName("custom")] public bool Custom { get; set; }
/// <summary>Tier multipliers: below S1, from S1, from S2, from S3, from S4.</summary>
[JsonPropertyName("mults")] public double[] Multipliers { get; set; } = Array.Empty<double>();
[JsonPropertyName("rows")] public AugCostRule[] Rows { get; set; } = Array.Empty<AugCostRule>();
}
internal sealed class AugCostRule
{
[JsonPropertyName("key")] public string Key { get; set; } = "";
[JsonPropertyName("label")] public string Label { get; set; } = "";
[JsonPropertyName("base")] public long Base { get; set; }
/// <summary>Percent of Base added per level.</summary>
[JsonPropertyName("pct")] public double Percent { get; set; }
[JsonPropertyName("coins")] public int Coins { get; set; }
[JsonPropertyName("s1")] public int S1 { get; set; }
[JsonPropertyName("s2")] public int S2 { get; set; }
[JsonPropertyName("s3")] public int S3 { get; set; }
[JsonPropertyName("s4")] public int S4 { get; set; }
/// <summary>Highest target (0 = no limit).</summary>
[JsonPropertyName("cap")] public int Cap { get; set; }
}
internal sealed class AugRow