From d6c64c206424a55f414f7d47195b79ab480ef1a8 Mon Sep 17 00:00:00 2001 From: Andrew Gilewsky Date: Wed, 29 Jan 2025 21:19:27 +0000 Subject: [PATCH] AI deprecation. --- BossMod/Autorotation/MiscAI/AutoFarm.cs | 2 +- BossMod/Autorotation/MiscAI/NormalMovement.cs | 2 +- .../Autorotation/MiscAI/StayCloseToTarget.cs | 2 +- .../Autorotation/MiscAI/StayWithinLeylines.cs | 11 ++--- BossMod/Autorotation/PlanPresetConverter.cs | 4 +- BossMod/Config/ConfigChangelog.cs | 45 ++++++++----------- BossMod/Config/ConfigConverter.cs | 2 +- 7 files changed, 28 insertions(+), 40 deletions(-) diff --git a/BossMod/Autorotation/MiscAI/AutoFarm.cs b/BossMod/Autorotation/MiscAI/AutoFarm.cs index 5e7e2b316c..74901a6d41 100644 --- a/BossMod/Autorotation/MiscAI/AutoFarm.cs +++ b/BossMod/Autorotation/MiscAI/AutoFarm.cs @@ -8,7 +8,7 @@ public enum PriorityStrategy { None, Prioritize } public static RotationModuleDefinition Definition() { - RotationModuleDefinition res = new("Misc AI: Automatic farming", "Collection of utilities to automatically target and pull mobs based on different criteria.", "Misc", "veyn", RotationModuleQuality.Basic, new(~0ul), 1000, 1, RotationModuleOrder.HighLevel); + RotationModuleDefinition res = new("Automatic targeting", "Collection of utilities to automatically target and pull mobs based on different criteria.", "AI", "veyn", RotationModuleQuality.Basic, new(~0ul), 1000, 1, RotationModuleOrder.HighLevel); res.Define(Track.General).As("General") .AddOption(GeneralStrategy.FightBack, "FightBack", "Automatically engage any mobs that are in combat with player, but don't pull new mobs", supportedTargets: ActionTargets.Hostile) diff --git a/BossMod/Autorotation/MiscAI/NormalMovement.cs b/BossMod/Autorotation/MiscAI/NormalMovement.cs index 30dd035227..9eec668d86 100644 --- a/BossMod/Autorotation/MiscAI/NormalMovement.cs +++ b/BossMod/Autorotation/MiscAI/NormalMovement.cs @@ -14,7 +14,7 @@ public enum SpecialModesStrategy { Automatic, Ignore } public static RotationModuleDefinition Definition() { - var res = new RotationModuleDefinition("Misc AI: Movement", "Automatically move character based on pathfinding or explicit coordinates.", "Movement", "veyn", RotationModuleQuality.WIP, new(~0ul), 1000, 1, RotationModuleOrder.Movement); + var res = new RotationModuleDefinition("Automatic movement", "Automatically move character based on pathfinding or explicit coordinates.", "AI", "veyn", RotationModuleQuality.WIP, new(~0ul), 1000, 1, RotationModuleOrder.Movement); res.Define(Track.Destination).As("Destination", "Destination", 30) .AddOption(DestinationStrategy.None, "None", "No automatic movement") .AddOption(DestinationStrategy.Pathfind, "Pathfind", "Use standard pathfinding to find best position") diff --git a/BossMod/Autorotation/MiscAI/StayCloseToTarget.cs b/BossMod/Autorotation/MiscAI/StayCloseToTarget.cs index 4142def1ad..a6131e3c9a 100644 --- a/BossMod/Autorotation/MiscAI/StayCloseToTarget.cs +++ b/BossMod/Autorotation/MiscAI/StayCloseToTarget.cs @@ -15,7 +15,7 @@ public enum RangeDefinition public static RotationModuleDefinition Definition() { - RotationModuleDefinition def = new("Misc AI: Stay within range of target", "Module for use by AutoDuty preset.", "Misc", "veyn", RotationModuleQuality.Basic, new(~0ul), 1000); + RotationModuleDefinition def = new("Misc AI: Stay within range of target", "Module for use by AutoDuty preset.", "AI", "veyn", RotationModuleQuality.Basic, new(~0ul), 1000); var configRef = def.Define(Tracks.Range).As("range"); diff --git a/BossMod/Autorotation/MiscAI/StayWithinLeylines.cs b/BossMod/Autorotation/MiscAI/StayWithinLeylines.cs index 16b73fdb10..2c468182e1 100644 --- a/BossMod/Autorotation/MiscAI/StayWithinLeylines.cs +++ b/BossMod/Autorotation/MiscAI/StayWithinLeylines.cs @@ -1,6 +1,4 @@ -using static BossMod.ActionQueue; - -namespace BossMod.Autorotation.MiscAI; +namespace BossMod.Autorotation.MiscAI; public sealed class StayWithinLeylines(RotationModuleManager manager, Actor player) : RotationModule(manager, player) { @@ -24,7 +22,7 @@ public enum BetweenTheLinesDefinition public static RotationModuleDefinition Definition() { - RotationModuleDefinition def = new("Misc AI: Stay within leylines when active", "Black Mage utility module.", "Misc", "Taurenkey", RotationModuleQuality.Basic, BitMask.Build(Class.BLM), 1000); + RotationModuleDefinition def = new("Misc AI: Stay within leylines when active", "Black Mage utility module.", "AI", "Taurenkey", RotationModuleQuality.Basic, BitMask.Build(Class.BLM), 1000); var retrace = def.Define(Tracks.UseRetrace).As("Use Retrace", "Use Retrace"); retrace.AddOption(RetraceDefinition.No, "No"); @@ -55,13 +53,12 @@ public override void Execute(StrategyValues strategy, ref Actor? primaryTarget, //BTL first, followed by retrace, then walk if (btlStrat == BetweenTheLinesDefinition.Yes && ActionUnlocked(btl) && btlCd.HasValue && World.Client.Cooldowns[btlCd.Value].Elapsed <= 2f && !isMoving) - Hints.ActionsToExecute.Push(btl, Player, Priority.Low, targetPos: zone.PosRot.XYZ()); + Hints.ActionsToExecute.Push(btl, Player, ActionQueue.Priority.Low, targetPos: zone.PosRot.XYZ()); else if (retraceStrat == RetraceDefinition.Yes && ActionUnlocked(retrace) && retraceCd.HasValue && World.Client.Cooldowns[retraceCd.Value].Elapsed <= 2f && !isMoving) - Hints.ActionsToExecute.Push(retrace, null, Priority.Low, targetPos: Player.PosRot.XYZ()); + Hints.ActionsToExecute.Push(retrace, null, ActionQueue.Priority.Low, targetPos: Player.PosRot.XYZ()); else Hints.GoalZones.Add(Hints.GoalSingleTarget(zone.Position, 1f)); } } - } } diff --git a/BossMod/Autorotation/PlanPresetConverter.cs b/BossMod/Autorotation/PlanPresetConverter.cs index 729e120b02..121ba710ed 100644 --- a/BossMod/Autorotation/PlanPresetConverter.cs +++ b/BossMod/Autorotation/PlanPresetConverter.cs @@ -10,8 +10,8 @@ private record class TrackChanges(Dictionary OptionRenames); private record class ModuleChanges(Dictionary TrackChanges, Dictionary TrackRenames); private record class ModuleConverter(Dictionary ModuleChanges, Dictionary ModuleRenames); - public static VersionedJSONSchema PlanSchema = BuildSchema(true); - public static VersionedJSONSchema PresetSchema = BuildSchema(false); + public static readonly VersionedJSONSchema PlanSchema = BuildSchema(true); + public static readonly VersionedJSONSchema PresetSchema = BuildSchema(false); private static VersionedJSONSchema BuildSchema(bool plan) { diff --git a/BossMod/Config/ConfigChangelog.cs b/BossMod/Config/ConfigChangelog.cs index 779cee2567..96fbb1035c 100644 --- a/BossMod/Config/ConfigChangelog.cs +++ b/BossMod/Config/ConfigChangelog.cs @@ -15,9 +15,9 @@ abstract class ChangelogNotice public abstract void Draw(); } -class AINotice1 : ChangelogNotice +class AIMigrationNotice : ChangelogNotice { - public override Version Since => new(0, 0, 0, 253); + public override Version Since => new(0, 0, 0, 289); private void Bullet(string txt) { @@ -28,31 +28,22 @@ private void Bullet(string txt) public override void Draw() { - ImGui.TextUnformatted("The following AI configuration options have been removed:"); - Bullet("AI Preset: AI mode will no longer attempt to control which preset is active, and the presence or absence of a preset will not affect targeting behavior."); - Bullet("Override positional"); - Bullet("Override follow range"); - Bullet("Follow target: This option had no effect."); - Bullet("Follow during active boss module"); - Bullet("Follow during combat"); - Bullet("Follow out of combat"); - Bullet("Show advanced options in the UI"); - ImGui.Spacing(); - ImGui.TextUnformatted("The following AI configuration options have been renamed:"); - Bullet("Forbid movement: renamed to Disable movement. Behavior is unchanged."); - Bullet("Forbid actions: renamed to Disable auto-target. Behavior is unchanged."); - } -} - -class AINotice2 : ChangelogNotice -{ - public override Version Since => new(0, 0, 0, 289); - - public override void Draw() - { - ImGui.TextUnformatted("`Automatically engage FATE mobs` AI configuration option has been removed."); - ImGui.TextUnformatted("The new way of getting this behaviour is by adding `Misc AI: Automatic farming of fates` module to your preset and configuring FATE-farming strategy track as wanted."); - ImGui.TextUnformatted("Note that this module "); + var link = "https://github.com/awgil/ffxiv_bossmod/wiki/AI-Migration-guide"; + ImGui.TextUnformatted("AI is dead, long live AI!"); + Bullet("AI feature is now deprecated and will be removed in one of the future versions."); + Bullet("The replacement is simple and much more flexible and powerful."); + Bullet($"See wiki ({link}) for details."); + if (ImGui.Button("Open wiki")) + { + try + { + System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(link) { UseShellExecute = true }); + } + catch (Exception e) + { + Service.Log($"Error opening link: {e}"); + } + } } } diff --git a/BossMod/Config/ConfigConverter.cs b/BossMod/Config/ConfigConverter.cs index 9503ea4516..f38b124a0a 100644 --- a/BossMod/Config/ConfigConverter.cs +++ b/BossMod/Config/ConfigConverter.cs @@ -6,7 +6,7 @@ namespace BossMod; public static class ConfigConverter { - public static VersionedJSONSchema Schema = BuildSchema(); + public static readonly VersionedJSONSchema Schema = BuildSchema(); private static VersionedJSONSchema BuildSchema() {