feat(ai): improving agents planning and memory

This commit is contained in:
2026-03-20 02:12:29 -04:00
parent f5bf7d8e3f
commit a2f66b0dca
11 changed files with 2012 additions and 445 deletions

View File

@@ -1,6 +1,6 @@
namespace SpaceGame.Api.Factions.Contracts;
public sealed record FactionGoapStateSnapshot(
public sealed record FactionPlanningStateSnapshot(
int MilitaryShipCount,
int MinerShipCount,
int TransportShipCount,
@@ -9,17 +9,134 @@ public sealed record FactionGoapStateSnapshot(
int TargetSystemCount,
bool HasShipFactory,
float OreStockpile,
float RefinedMetalsStockpile,
float RefinedMetalsProductionRate,
float HullpartsStockpile,
float HullpartsProductionRate,
float ClaytronicsStockpile,
float ClaytronicsProductionRate,
float WaterStockpile,
float WaterProductionRate,
float WaterShortageHorizonSeconds);
float RefinedMetalsAvailableStock,
float RefinedMetalsUsageRate,
float RefinedMetalsProjectedProductionRate,
float RefinedMetalsProjectedNetRate,
float RefinedMetalsLevelSeconds,
string RefinedMetalsLevel,
float HullpartsAvailableStock,
float HullpartsUsageRate,
float HullpartsProjectedProductionRate,
float HullpartsProjectedNetRate,
float HullpartsLevelSeconds,
string HullpartsLevel,
float ClaytronicsAvailableStock,
float ClaytronicsUsageRate,
float ClaytronicsProjectedProductionRate,
float ClaytronicsProjectedNetRate,
float ClaytronicsLevelSeconds,
string ClaytronicsLevel,
float WaterAvailableStock,
float WaterUsageRate,
float WaterProjectedProductionRate,
float WaterProjectedNetRate,
float WaterLevelSeconds,
string WaterLevel);
public sealed record FactionGoapPrioritySnapshot(string GoalName, float Priority);
public sealed record FactionStrategicPrioritySnapshot(string GoalName, float Priority);
public sealed record FactionCommoditySignalSnapshot(
string ItemId,
float AvailableStock,
float OnHand,
float ProductionRatePerSecond,
float CommittedProductionRatePerSecond,
float UsageRatePerSecond,
float NetRatePerSecond,
float ProjectedNetRatePerSecond,
float LevelSeconds,
string Level,
float ProjectedProductionRatePerSecond,
float BuyBacklog,
float ReservedForConstruction);
public sealed record FactionThreatSignalSnapshot(
string ScopeId,
string ScopeKind,
int EnemyShipCount,
int EnemyStationCount);
public sealed record FactionBlackboardSnapshot(
int PlanCycle,
DateTimeOffset UpdatedAtUtc,
int TargetWarshipCount,
bool HasWarIndustrySupplyChain,
bool HasShipyard,
bool HasActiveExpansionProject,
string? ActiveExpansionCommodityId,
string? ActiveExpansionModuleId,
string? ActiveExpansionSiteId,
string? ActiveExpansionSystemId,
int EnemyFactionCount,
int EnemyShipCount,
int EnemyStationCount,
int MilitaryShipCount,
int MinerShipCount,
int TransportShipCount,
int ConstructorShipCount,
int ControlledSystemCount,
IReadOnlyList<FactionCommoditySignalSnapshot> CommoditySignals,
IReadOnlyList<FactionThreatSignalSnapshot> ThreatSignals);
public sealed record FactionPlanStepSnapshot(
string Id,
string Kind,
string Status,
float Priority,
string? CommodityId,
string? ModuleId,
string? TargetFactionId,
string? TargetSiteId,
string? BlockingReason,
string? Notes,
int LastEvaluatedCycle,
IReadOnlyList<string> DependencyStepIds,
IReadOnlyList<string> RequiredFacts,
IReadOnlyList<string> ProducedFacts,
IReadOnlyList<string> AssignedAssets,
IReadOnlyList<string> IssuedTaskIds);
public sealed record FactionIssuedTaskSnapshot(
string Id,
string Kind,
string State,
string ObjectiveId,
string StepId,
float Priority,
string? ShipRole,
string? CommodityId,
string? ModuleId,
string? TargetFactionId,
string? TargetSystemId,
string? TargetSiteId,
int CreatedAtCycle,
int UpdatedAtCycle,
string? BlockingReason,
string? Notes,
IReadOnlyList<string> AssignedAssets);
public sealed record FactionObjectiveSnapshot(
string Id,
string Kind,
string State,
float Priority,
string? ParentObjectiveId,
string? TargetFactionId,
string? TargetSystemId,
string? TargetSiteId,
string? TargetRegionId,
string? CommodityId,
string? ModuleId,
int BudgetWeight,
int SlotCost,
int CreatedAtCycle,
int UpdatedAtCycle,
string? InvalidationReason,
string? BlockingReason,
IReadOnlyList<string> PrerequisiteObjectiveIds,
IReadOnlyList<string> AssignedAssets,
IReadOnlyList<FactionPlanStepSnapshot> Steps);
public sealed record FactionSnapshot(
string Id,
@@ -32,8 +149,11 @@ public sealed record FactionSnapshot(
int ShipsBuilt,
int ShipsLost,
string? DefaultPolicySetId,
FactionGoapStateSnapshot? GoapState,
IReadOnlyList<FactionGoapPrioritySnapshot>? GoapPriorities);
FactionPlanningStateSnapshot? StrategicAssessment,
IReadOnlyList<FactionStrategicPrioritySnapshot>? StrategicPriorities,
FactionBlackboardSnapshot? Blackboard,
IReadOnlyList<FactionObjectiveSnapshot>? Objectives,
IReadOnlyList<FactionIssuedTaskSnapshot>? IssuedTasks);
public sealed record FactionDelta(
string Id,
@@ -46,5 +166,8 @@ public sealed record FactionDelta(
int ShipsBuilt,
int ShipsLost,
string? DefaultPolicySetId,
FactionGoapStateSnapshot? GoapState,
IReadOnlyList<FactionGoapPrioritySnapshot>? GoapPriorities);
FactionPlanningStateSnapshot? StrategicAssessment,
IReadOnlyList<FactionStrategicPrioritySnapshot>? StrategicPriorities,
FactionBlackboardSnapshot? Blackboard,
IReadOnlyList<FactionObjectiveSnapshot>? Objectives,
IReadOnlyList<FactionIssuedTaskSnapshot>? IssuedTasks);