IAISystem

Interface to AI system. Defines functions to control the AI system. More...

#include

Classes

class NavCapMask

Public Types

enum EGroupFlags { GROUP_ALL = 0x01, GROUP_ENABLED = 0x02, GROUP_MAX = 0x04 }
Flags used by the GetGroupCount. More...
enum ENavigationType {
NAV_UNSET = 1 << 0, NAV_TRIANGULAR = 1 << 1, NAV_WAYPOINT_HUMAN = 1 << 2, NAV_WAYPOINT_3DSURFACE = 1 << 3,
NAV_FLIGHT = 1 << 4, NAV_VOLUME = 1 << 5, NAV_ROAD = 1 << 6, NAV_SMARTOBJECT = 1 << 7,
NAV_FREE_2D = 1 << 8, NAV_CUSTOM_NAVIGATION = 1 << 9, NAV_MAX_VALUE = NAV_CUSTOM_NAVIGATION
}
enum { NAV_TYPE_COUNT = 10 }
enum { NAVMASK_SURFACE = NAV_TRIANGULAR | NAV_WAYPOINT_HUMAN | NAV_ROAD | NAV_SMARTOBJECT, NAVMASK_AIR = NAV_FLIGHT | NAV_VOLUME | NAV_SMARTOBJECT, NAVMASK_ALL = NAV_TRIANGULAR | NAV_WAYPOINT_HUMAN | NAV_WAYPOINT_3DSURFACE | NAV_ROAD | NAV_FLIGHT | NAV_VOLUME | NAV_SMARTOBJECT | NAV_FREE_2D | NAV_CUSTOM_NAVIGATION }
Two masks that summarise the basic abilities.
enum EResetReason {
RESET_INTERNAL, RESET_ENTER_GAME, RESET_EXIT_GAME, RESET_INTERNAL_LOAD,
RESET_LOAD_LEVEL, RESET_UNLOAD_LEVEL
}
typedef RayCastQueue< 41 > GlobalRayCaster
typedef IntersectionTestQueue< 43 > GlobalIntersectionTester
typedef NavCapMask tNavCapMask

Public Member Functions

virtual bool Init ()=0
virtual void Reload ()
virtual void Reset (EResetReason reason)=0
virtual void Release ()=0
virtual IAISystemCallbacks & Callbacks ()=0
virtual void SetActorProxyFactory (IAIActorProxyFactory *pFactory)=0
virtual IAIActorProxyFactory * GetActorProxyFactory () const =0
virtual void SetGroupProxyFactory (IAIGroupProxyFactory *pFactory)=0
virtual IAIGroupProxyFactory * GetGroupProxyFactory () const =0
virtual IAIGroupProxy * GetAIGroupProxy (int groupID)=0
virtual IActorLookUp * GetActorLookup ()=0
virtual IAISystem::GlobalRayCaster * GetGlobalRaycaster ()=0
virtual IAISystem::GlobalIntersectionTester * GetGlobalIntersectionTester ()=0
virtual void Enable (bool enable=true)=0
virtual bool IsEnabled () const =0
virtual void Update (CTimeValue currentTime, float frameTime)=0
virtual bool RegisterSystemComponent (IAISystemComponent *pComponent)=0
virtual bool UnregisterSystemComponent (IAISystemComponent *pComponent)=0
virtual void SendAnonymousSignal (int nSignalId, const char *szText, const Vec3 &pos, float fRadius, IAIObject *pSenderObject, IAISignalExtraData *pData=NULL)=0
virtual void SendSignal (unsigned char cFilter, int nSignalId, const char *szText, IAIObject *pSenderObject, IAISignalExtraData *pData=NULL, uint32 crcCode=0)=0
virtual void FreeSignalExtraData (IAISignalExtraData *pData) const =0
virtual IAISignalExtraData * CreateSignalExtraData () const =0
virtual void Event (int eventT, const char *)=0
virtual bool GetUpdateAllAlways () const =0
Over-ride auto-disable for distant AIs.
virtual float GetUpdateInterval () const =0
virtual int GetAITickCount ()=0
Used for profiling.
virtual void SerializeObjectIDs (TSerialize ser)=0
Save/load.
virtual void Serialize (TSerialize ser)=0
virtual void SetLevelPath (const char *sPath)=0
Set a path for the current level as working folder for level-specific metadata.
virtual void FlushSystem (bool bDeleteAll=false)=0
This called before loading (level load/serialization).
virtual void FlushSystemNavigation (bool bDeleteAll=false)=0
virtual void LayerEnabled (const char *layerName, bool enabled, bool serialized)=0
virtual void LoadLevelData (const char *szLevel, const char *szMission, const EAILoadDataFlags loadDataFlags=eAILoadDataFlag_AllSystems)=0
virtual void LoadNavigationData (const char *szLevel, const char *szMission, const EAILoadDataFlags loadDataFlags=eAILoadDataFlag_AllSystems)=0
virtual void ReadAreasFromFile (const char *fileNameAreas)=0
Reads areas from file. clears the existing areas.
virtual void OnMissionLoaded ()=0
virtual IAIDebugRenderer * GetAIDebugRenderer ()=0
virtual IAIDebugRenderer * GetAINetworkDebugRenderer ()=0
virtual void SetAIDebugRenderer (IAIDebugRenderer *pAIDebugRenderer)=0
virtual void SetAINetworkDebugRenderer (IAIDebugRenderer *pAINetworkDebugRenderer)=0
virtual void SetAgentDebugTarget (const EntityId id)=0
virtual EntityId GetAgentDebugTarget () const =0
virtual IAIBubblesSystem * GetAIBubblesSystem ()=0
virtual bool IsRecording (const IAIObject *pTarget, IAIRecordable::e_AIDbgEvent event) const =0
virtual void Record (const IAIObject *pTarget, IAIRecordable::e_AIDbgEvent event, const char *pString) const =0
virtual void GetRecorderDebugContext (SAIRecorderDebugContext *&pContext)=0
virtual void AddDebugLine (const Vec3 &start, const Vec3 &end, uint8 r, uint8 g, uint8 b, float time)=0
virtual void AddDebugSphere (const Vec3 &pos, float radius, uint8 r, uint8 g, uint8 b, float time)=0
virtual void DebugReportHitDamage (IEntity *pVictim, IEntity *pShooter, float damage, const char *material)=0
virtual void DebugReportDeath (IAIObject *pVictim)=0
virtual void Warning (const char *id, const char *format,...) const PRINTF_PARAMS(3
virtual void virtual void Error (const char *id, const char *format,...) PRINTF_PARAMS(3
virtual void virtual void virtual void LogProgress (const char *id, const char *format,...) PRINTF_PARAMS(3
virtual void virtual void virtual void virtual void LogEvent (const char *id, const char *format,...) PRINTF_PARAMS(3
virtual void virtual void virtual void virtual void virtual void LogComment (const char *id, const char *format,...) PRINTF_PARAMS(3
virtual void virtual void virtual void virtual void virtual void virtual void DebugDrawFakeTracer (const Vec3 &pos, const Vec3 &dir)=0
Draws a fake tracer around the player.
virtual void GetMemoryStatistics (ICrySizer *pSizer)=0
virtual void DebugDraw ()=0
virtual IAIObjectManager * GetAIObjectManager ()=0
virtual ISmartObjectManager * GetSmartObjectManager ()=0
virtual ITargetTrackManager * GetTargetTrackManager () const =0
virtual BehaviorTree::IBehaviorTreeManager * GetIBehaviorTreeManager () const =0
virtual ICoverSystem * GetCoverSystem () const =0
virtual INavigationSystem * GetNavigationSystem () const =0
virtual IMNMPathfinder * GetMNMPathfinder () const =0
virtual ICommunicationManager * GetCommunicationManager () const =0
virtual ITacticalPointSystem * GetTacticalPointSystem (void)=0
virtual ICentralInterestManager * GetCentralInterestManager (void)=0
virtual INavigation * GetINavigation ()=0
virtual IAIRecorder * GetIAIRecorder ()=0
virtual struct IMovementSystem * GetMovementSystem () const =0
virtual AIActionSequence::ISequenceManager * GetSequenceManager () const =0
virtual IClusterDetector * GetClusterDetector () const =0
virtual IAIActionManager * GetAIActionManager ()=0
virtual void EnumerateFormationNames (unsigned int maxNames, const char **names, unsigned int *nameCount) const =0
virtual int GetGroupCount (int nGroupID, int flags=GROUP_ALL, int type=0)=0
virtual IAIObject * GetGroupMember (int groupID, int index, int flags=GROUP_ALL, int type=0)=0
virtual int AllocGoalPipeId () const =0
virtual bool CreateNavigationShape (const SNavigationShapeParams &params)=0
virtual void DeleteNavigationShape (const char *szPathName)=0
virtual bool DoesNavigationShapeExists (const char *szName, EnumAreaType areaType, bool road=false)=0
virtual void EnableGenericShape (const char *shapeName, bool state)=0
virtual int RayOcclusionPlaneIntersection (const Vec3 &start, const Vec3 &end)=0
virtual void AssignPFPropertiesToPathType (const string &sPathType, const AgentPathfindingProperties &properties)=0
virtual const AgentPathfindingProperties * GetPFPropertiesOfPathType (const string &sPathType)=0
virtual string GetPathTypeNames ()=0
virtual void RegisterDamageRegion (const void *pID, const Sphere &sphere)=0
virtual void DummyFunctionNumberOne (void)=0
virtual void AdjustDirectionalCoverPosition (Vec3 &pos, const Vec3 &dir, float agentRadius, float testHeight)=0
virtual int GetAlertness () const =0
Current global AI alertness value (what's the most alerted puppet).
virtual int GetAlertness (const IAIAlertnessPredicate &alertnessPredicate)=0
virtual void SetPerceptionDistLookUp (float *pLookUpTable, int tableSize)=0
Look up table to be used when calculating visual time-out increment.
virtual void UpdateGlobalPerceptionScale (const float visualScale, const float audioScale, EAIFilterType filterTypeName=eAIFT_All, const char *factionName=NULL)=0
virtual float GetGlobalVisualScale (const IAIObject *pAIObject) const =0
virtual float GetGlobalAudioScale (const IAIObject *pAIObject) const =0
virtual void DisableGlobalPerceptionScaling ()=0
virtual void RegisterGlobalPerceptionListener (IAIGlobalPerceptionListener *pListner)=0
virtual void UnregisterGlobalPerceptionlistener (IAIGlobalPerceptionListener *pListner)=0
virtual unsigned int GetDangerSpots (const IAIObject *requester, float range, Vec3 *positions, unsigned int *types, unsigned int n, unsigned int flags)=0
virtual void DynOmniLightEvent (const Vec3 &pos, float radius, EAILightEventType type, EntityId shooterId, float time=5.0f)=0
virtual void DynSpotLightEvent (const Vec3 &pos, const Vec3 &dir, float radius, float fov, EAILightEventType type, EntityId shooterId, float time=5.0f)=0
virtual IAuditionMap * GetAuditionMap ()=0
virtual IVisionMap * GetVisionMap ()=0
virtual IFactionMap & GetFactionMap ()=0
virtual IAIObject * GetBeacon (unsigned short nGroupID)=0
virtual void UpdateBeacon (unsigned short nGroupID, const Vec3 &vPos, IAIObject *pOwner=0)=0
virtual bool ParseTables (int firstTable, bool parseMovementAbility, IFunctionHandler *pH, AIObjectParams &aiParams, bool &updateAlways)=0
virtual float GetFrameStartTimeSecondsVirtual () const =0
virtual void AddFrameTicks (uint64 nTicks)=0
virtual void ResetFrameTicks ()=0
Reset Ticks Counter.
virtual uint64 NumFrameTicks () const =0
Get number of Ticks accumulated over this frame.
virtual void NotifyTargetDead (IAIObject *pDeadObject)=0
virtual std::shared_ptr< IPathFollower > CreateAndReturnNewDefaultPathFollower (const PathFollowerParams &params, const IPathObstacles &pathObstacleObject)=0

Detailed Description

Interface to AI system. Defines functions to control the AI system.

Member Enumeration Documentation

◆ EGroupFlags

Flags used by the GetGroupCount.

Enumerator
GROUP_ALL

Returns all agents in the group (default).

GROUP_ENABLED

Returns only the count of enabled agents (exclusive with all).

GROUP_MAX

Returns the maximum number of agents during the game (can be combined with all or enabled).

◆ ENavigationType

Indication of (a) what a graph node represents and (b) what kind of graph node an AI entity can navigate. In the latter case it can be used as a bit mask.

◆ EResetReason

Enumerator
RESET_INTERNAL

Called by the AI system itself.

RESET_INTERNAL_LOAD

Called by the AI system itself.

Member Function Documentation

◆ AddFrameTicks()

virtual void IAISystem::AddFrameTicks ( uint64 nTicks)
pure virtual

Light frame profiler for AI support. Add nTicks to the number of Ticks spend this frame in particle functions.

◆ AdjustDirectionalCoverPosition()

virtual void IAISystem::AdjustDirectionalCoverPosition ( Vec3 & pos,
const Vec3 & dir,
float agentRadius,
float testHeight
)
pure virtual
Returns
A point which is a valid distance away from a wall in front of the point.

◆ GetUpdateInterval()

virtual float IAISystem::GetUpdateInterval ( ) const
pure virtual
Returns
The basic AI system update interval.

◆ RegisterDamageRegion()

virtual void IAISystem::RegisterDamageRegion ( const void * pID,
const Sphere & sphere
)
pure virtual

Register a spherical region that causes damage (so should be avoided in pathfinding).

Parameters
pIDa unique identifier - so if this is called multiple times with the same pID then the damage region will simply be moved. If radius <= 0 then the region is disabled.

◆ Update()

virtual void IAISystem::Update ( CTimeValue currentTime,
float frameTime
)
pure virtual

Every frame (multiple time steps per frame possible?)

Parameters
currentTimeAI time since game start in seconds (GetCurrentTime).
frameTimeAI time since last update (GetFrameTime).