Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs
TaskSystem.h File Reference

ECS system that iterates TaskRunnerComponent entities and drives ATS Visual Script graph execution each frame. More...

#include "../ECS_Systems.h"
#include "../ECS/Components/TaskRunnerComponent.h"
#include "TaskGraphTemplate.h"
#include "../Core/AssetManager.h"
#include "LocalBlackboard.h"
#include "VSGraphExecutor.h"
+ Include dependency graph for TaskSystem.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Olympe::TaskSystem
 ECS system responsible for advancing task graph execution each frame. More...
 

Namespaces

namespace  Olympe
 < Provides AssetID and INVALID_ASSET_ID
 

Typedefs

using Olympe::TaskEditorPublishFn = void(*)(EntityID entity, int nodeIndex, const LocalBlackboard *bb)
 Signature of the editor publish callback.
 

Detailed Description

ECS system that iterates TaskRunnerComponent entities and drives ATS Visual Script graph execution each frame.

Author
Olympe Engine
Date
2026-02-22 (refactored Phase 4 - 2026-03-08)

TaskSystem inherits from ECS_System and is registered in the World alongside all other runtime systems. Each frame, Process() iterates the set of entities that own a TaskRunnerComponent, retrieves the bound TaskGraphTemplate via AssetManager, and delegates to ExecuteVSFrame() to advance Visual Script graph execution.

Execution paths (Phase 4)

AtomicTask lifecycle (Phase 2.C / Phase 4)

ExecuteNode() implements the following lifecycle for AtomicTask nodes:

  1. On first entry to a node, create the IAtomicTask instance via AtomicTaskRegistry::Create() and store it in runner.activeTask.
  2. Each tick, call runner.activeTask->ExecuteWithContext(ctx, params).
  3. Running => keep activeTask; accumulate StateTimer; return.
  4. Success/Failure => reset activeTask; set LastStatus; reset StateTimer; advance CurrentNodeID via TransitionToNextNode(). NODE_INDEX_NONE signals that the graph is complete.
  5. If runner.CurrentNodeID is set to NODE_INDEX_NONE while a task is Running, the next call to ExecuteNode() calls activeTask->Abort() before releasing the instance.

C++14 compliant - no C++17/20 features.

Definition in file TaskSystem.h.