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

Atomic task that computes a flee direction away from a target. More...

#include "../../IAtomicTask.h"
+ Include dependency graph for Task_Flee.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Olympe::Task_Flee
 Moves an entity away from a 2D threat position until safe distance is reached. More...
 

Namespaces

namespace  Olympe
 < Provides AssetID and INVALID_ASSET_ID
 

Detailed Description

Atomic task that computes a flee direction away from a target.

Author
Olympe Engine
Date
2026-03-08

Task_Flee reads the entity's current position from "local:Position" and an optional threat target from "local:Target" (or the "Target" parameter). It computes the direction away from the threat, scales it by Distance, and writes the resulting flee target position to "local:FleeTarget" in the LocalBlackboard. A movement task (e.g. Task_MoveToLocation) can then be used to move the entity toward the computed flee target.

Parameters (ParameterMap): "Target" (Vector) — threat position override (optional; falls back to "local:Target" EntityID in LocalBB, then origin). "Distance" (Float) — flee distance in units (optional, default 200.0).

Returns: Success after writing the flee target. Failure if ctx.LocalBB is null.

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

Definition in file Task_Flee.h.