Skip to content

Feat/ai controller#87

Merged
GianRathgeb merged 35 commits intomainfrom
feat/AiController
Nov 14, 2025
Merged

Feat/ai controller#87
GianRathgeb merged 35 commits intomainfrom
feat/AiController

Conversation

@GianRathgeb
Copy link
Contributor

When merged this pull request will:

  • Introduces a modular AI system (AIController, AIAgent, ScenarioTaskRunner + scenes) that deterministically executes authored task chains.
  • Ingests ScenarioData.tasks and builds per-unit queues by following prev_index/next_index, normalizing task shapes.
  • Implements task semantics for Move, Defend, Patrol (cycle/ping-pong), Wait (with until_contact), SetBehaviour, and SetCombatMode.
  • Maps behaviour to movement parameters and routes ROE to CombatAdapter with hold/return/open fire, including a short return-fire window.
  • Wires AIAgent to existing sim via adapters/OrdersRouter so AI issues real game orders rather than moving nodes directly.
  • Adds mission bootstrap to register enemy units, seed initial behaviour/ROE, and start AI control on mission load.
  • Provides minimal LOS contact feed for until_contact waits and ROE “return fire” triggers.
  • Includes optional debug hooks (signals/HUD overlay notes) and makes the codebase GDScript-4.5 linter-clean with strict typing.

Issue ticket number and link

Create AI Controller
#69

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have tested my code.
  • I have documented my code in accordance with gdscript_documentation_comments.
  • I have requested a review in discord.
  • I have moved the related issues to the review section in the SCRUM Board.

Need update from main to have the first mission in this branch
This is just an optional thing but it tells the AI to cycle through the different units to refuel, and not just once
@GianRathgeb
Copy link
Contributor Author

The issues from the code review are now fixed, please review again

@GianRathgeb
Copy link
Contributor Author

the issues with the AI should now be fixed. During the fixing of the issues, I created more issues which I then had to sovle. Here is everything I did:

  • Added inspector-assigned AIController node in HQ table scene and injected adapters through exported refs so agents always find Movement/Combat/LOS/Router nodes.
  • Simplified AIAgent adapter binding and behavior/ROE initialization to prevent null movement intents.
    Normalized scenario task queues and refreshed unit-id caches before AI registration to keep return-fire logic consistent across machines.
  • Emitted engagement_reported(attacker, defender, damage) only when real damage occurs and updated all listeners to accept the new signature, stopping premature reveals.
  • Ensured calculate_damage results are treated as Variants to avoid float .get() errors.
  • Scaled LOS detection by terrain spotting multiplier plus target behavior modifiers so units can’t be spotted from unrealistic ranges.

@GianRathgeb
Copy link
Contributor Author

  • Added async triggers for AI units
  • Added default behavior for AI units if no task is defined

@GianRathgeb GianRathgeb merged commit a6ad0dc into main Nov 14, 2025
3 checks passed
@GianRathgeb GianRathgeb deleted the feat/AiController branch November 14, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants