|
|
| Line 1: |
Line 1: |
| This namespace houses [[ModuleSystem]]'s Actor system. Treat names as unofficial unless otherwise stated. | | This namespace houses [[ModuleSystem]]'s Actor system. Which is implemented on top of [[Shaft::baseproc]]. Treat names as unofficial unless otherwise stated. |
|
| |
|
| === ActorModule === | | === ActorModule === |
| Line 7: |
Line 7: |
|
| |
|
| === ActorMgr === | | === 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.
| | Houses a set of user callbacks for the actor system. Manages the ActorInstanceHeap which is by default responsible for most BaseProc and PreActor memory management. Maintains an array of factories for creating BaseProc class derivatives by name. |
| | |
| ==== 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 === | | === PreActorMgr === |
| Line 42: |
Line 36: |
| ==== FarDeleteGroup (TODO) ==== | | ==== FarDeleteGroup (TODO) ==== |
|
| |
|
| === IActor === | | === ActorBase === |
| 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.
| | ActorBase extends shaft::baseproc::BaseProc. It implements an active job for each of the 4 stages provided by the BaseProcMgr. These stages are named PreCalc, PostCalc, PostSensor, and FrameEndCalc. Notably, FrameStartCalc happens directly before PreCalc in the PreCalc job. The physics world for entities is calculated between PreCalc and PostCalc. The physics world for sensors is calculated between PostCalc and PostSensor. ActorBase has a single job priority value that represents only a subset of the priority range offered by BaseProcMgr and applies to each active job. |
| {| class="wikitable"
| |
| |+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#IActorComponent|engine::component]]).
| | 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 more granular pause mask for various actor behavior while the actor is active. The majority of ActorBase behavior is implemented in a set of engine provided optional components (See [[Engine::component#IActorComponent|engine::component]]). |