Engine::actor

From EPD Wiki
Jump to navigation Jump to search

This namespace houses ModuleSystem's Actor system. Treat names as unofficial unless otherwise stated.

ActorModule

The namespace's IModule.

Managers

ActorMgr

Maintains a tree of all IActors. A scheduler with 4 stages each with 8 priority levels for calculating IActors, with a customizable sleep calculate. A pool of actor relation links and an array of active actor relations, with a request queue to modify relations. Maintains request lists for changing an IActor's state. Houses the BaseProcMgr.

BaseProcMgr

Maintains BaseProcCreateAndDelete threads as well as user callbacks to create and delete IActors asynchronously via atomic request queues.

ActorInstanceMgr

Houses a set of user callbacks for the actor system. Manages the ActorInstanceHeap which is by default responsible for most IActor and PreActor memory management. Maintains an array of factories for creating IActor class derivatives by name.

PreActorMgr

Houses the PreActorRenderer. A pool of ActorSystemSettings with active settings stored in a hash map. A pool of PreActorRenderInfo. Two pools of sets of PreActors. An array of all the sets of PreActors. A PreActor allocator managed by a linked list. Houses the ActorAIGroupMgr and LinkMgr.

PreActorRenderer

Houses 2 MassModels. An array of PreActorRenderInfo currently pending load. An array of PreActors to be drawn sorted by their actor settings accompanied by an array of batch info grouping similar models together. Houses the PreActorModelComposer thread.

PreActorModelComposer (TODO)

ActorAIGroupMgr

Maintains a set of ActorAIGroup.

LinkMgr

Manages an array of links for PreActors

Units

PreActor

PreActors manage the state of an ActorBase before it's instantiation. Typically data comes from a bcett file parsed by a BancEntity. A PreActor stores a reference to it's BancEntity, a home transform, a hash of it's transform, a name, a hash to serve as a unique id, and a reference to it's ActorSystemSettings. If applicable it can contain the following. A ByamlIter to a dynamic section of data used to initialize the ActorBase's Blackboard or for user defined purposes. A ByamlIter to a set of phive specific parameters. A set of information used to initialize the ActorBase's Blackboard. A reference to the PreActor's ActorAIGroup with a set of user provided callbacks from the ActorAIGroup's ActorLogic. A reference to the PreActor's SimultaneousGroup. A reference to the PreActor's FarDeleteGroup. A handle to a set of link's in the LinkMgr. A handle to a StaticCompound referencing the PreActor's Phive PlacementID.

ActorSystemSettings (TODO)

ActorAIGroup (TODO)

SimultaneousGroup (TODO)

FarDeleteGroup (TODO)

IActor

This is the base interface of an actor that can be scheduled in the actor system. Each IActor has a heap meant for all of it's memory management, a unique id, the name of it's actor settings, a user defined name, it's current state, a set of request slots for requesting changes to it's state. A set of job slots for all 32 stage and priority combinations in the actor scheduler, with an extra sleep job slot. A tree map node for the ActorMgr. A reference to a structure used to manage the state for "hyperlinks" to an actor. A reference to a watcher for signifying state changes during asynchronous creation. A ring of references to the actor's relationships.

State
Name Enum Value Description
Uninitialized 0
InInitialize 1
PostInitialized 2
Schedulable 3
Calc 4
Paused 5
Sleeping 6
PreFinalize 7
Finalize 8
PostFinalize 9
ScheduledForDeletion 10
Deleted 11

ActorBase

ActorBase extends IActor by implementing a job for each of the 4 calc stages provided by the ActorMgr's scheduler. These calc stages are named PreCalc, PostCalc, PostSensor, and FrameEndCalc. Notably, FrameStartCalc happens directly before PreCalc in the PreCalc job. ActorBase maintains a home transform, a current transform, a request for the next transform, angular and linear velocites, an AABB, a Document reference to it's ActorParam, a reference to it's PreActor, a Transceiver, a BlackboardAccessor, an ActorBaseLink to an optional linked actor, and a pause key allocator for maintaining a pause mask for calculate stages of the actor that can be individually paused. The majority of ActorBase behavior is implemented in a set of engine provided optional components (See engine::component).