Skip to content

Commit

Permalink
AI deprecation.
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Jan 29, 2025
1 parent 779c8ff commit d6c64c2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 40 deletions.
2 changes: 1 addition & 1 deletion BossMod/Autorotation/MiscAI/AutoFarm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GeneralStrategy>("General")
.AddOption(GeneralStrategy.FightBack, "FightBack", "Automatically engage any mobs that are in combat with player, but don't pull new mobs", supportedTargets: ActionTargets.Hostile)
Expand Down
2 changes: 1 addition & 1 deletion BossMod/Autorotation/MiscAI/NormalMovement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DestinationStrategy>("Destination", "Destination", 30)
.AddOption(DestinationStrategy.None, "None", "No automatic movement")
.AddOption(DestinationStrategy.Pathfind, "Pathfind", "Use standard pathfinding to find best position")
Expand Down
2 changes: 1 addition & 1 deletion BossMod/Autorotation/MiscAI/StayCloseToTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RangeDefinition>("range");

Expand Down
11 changes: 4 additions & 7 deletions BossMod/Autorotation/MiscAI/StayWithinLeylines.cs
Original file line number Diff line number Diff line change
@@ -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)
{
Expand All @@ -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<RetraceDefinition>("Use Retrace", "Use Retrace");
retrace.AddOption(RetraceDefinition.No, "No");
Expand Down Expand Up @@ -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));
}
}

}
}
4 changes: 2 additions & 2 deletions BossMod/Autorotation/PlanPresetConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ private record class TrackChanges(Dictionary<string, string> OptionRenames);
private record class ModuleChanges(Dictionary<string, TrackChanges> TrackChanges, Dictionary<string, string> TrackRenames);
private record class ModuleConverter(Dictionary<string, ModuleChanges> ModuleChanges, Dictionary<string, string> 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)
{
Expand Down
45 changes: 18 additions & 27 deletions BossMod/Config/ConfigChangelog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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}");
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion BossMod/Config/ConfigConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit d6c64c2

Please sign in to comment.