Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
ECS_Systems_AI.h
Go to the documentation of this file.
1/*
2Olympe Engine V2 - 2025
3Nicolas Chereau
4nchereau@gmail.com
5
6This file is part of Olympe Engine V2.
7
8AI Systems purpose: Define ECS systems for NPC AI behavior.
9
10*/
11
12#pragma once
13
14#include "ECS_Entity.h"
15#include "ECS_Systems.h"
16#include <set>
17
18// --- AIStimuliSystem ---
19// Consumes EventQueue domain events (Gameplay, Detection, Collision) and writes
20// relevant stimulus results into AIBlackboard_data
22{
23public:
25 virtual void Process() override;
26};
27
28// --- AIPerceptionSystem ---
29// Timesliced perception system that updates blackboard perception state
30// For now uses naive scan; structured for future spatial partition integration
32{
33public:
35 virtual void Process() override;
36
37private:
38 // Helper: Check if target is visible from entity position
39 bool IsTargetVisible(EntityID entity, EntityID target, float visionRadius, float visionAngle);
40};
41
42// --- AIStateTransitionSystem ---
43// HFSM that selects AI mode and chooses which behavior tree to run based on blackboard + state
45{
46public:
48 virtual void Process() override;
49
50private:
51 // Helper: Determine next state based on current state and blackboard
52 void UpdateAIState(EntityID entity);
53};
54
55// --- BehaviorTreeSystem ---
56// Ticks data-driven Behavior Trees loaded from JSON and writes intents (MoveIntent/AttackIntent)
57// and/or blackboard updates
59{
60public:
62 virtual void Process() override;
63};
64
65// --- AIMotionSystem ---
66// Converts intents into Movement_data (direction/velocity) and uses PhysicsBody_data speed if present
68{
69public:
71 virtual void Process() override;
72 virtual void RenderDebug() override;
73};
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
std::uint64_t EntityID
Definition ECS_Entity.h:21
virtual void Process() override
virtual void RenderDebug() override
virtual void Process() override
bool IsTargetVisible(EntityID entity, EntityID target, float visionRadius, float visionAngle)
void UpdateAIState(EntityID entity)
virtual void Process() override
virtual void Process() override
virtual void Process() override