Entity Lifecycle – Arma Reforger

From Bohemia Interactive Community
Revision as of 18:44, 27 June 2023 by Lou Montana (talk | contribs) (Page creation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Definitions

  • Frame: every drawing frame (frame as in FPS)
  • Fixed Frame: a fixed event happening 30 times per second
  • Physics Simulation Frame: a fixed event at 60 simulations per second (frequency defined in Workbench → Options → Game Project → Modules → Physics Settings → Ticks)


Lifecycle

Note that some event methods are called only when:
  • such events were enabled through IEntity.SetEventMask()
  • some conditions are met (EOnPhysicsActive requires the entity to have valid and activated physics, etc)
Section Mode Method Description

WB Play
Game

WB Edit Entity Component
Instantiation Checked Checked Constructor
Checked Checked Constructor
Checked Checked OnPostInit
Checked Checked EOnInit
Checked Checked EOnInit
Checked _WB_SetTransform
Checked _WB_SetTransform
Checked _WB_OnInit
Checked _WB_OnInit
Checked _WBMakeVisible
Workbench

Execution loop

(World Editor)

Checked _WB_AfterWorldUpdate
Checked _WB_AfterWorldUpdate
Simulation init Checked EOnActivate
Simulation loop Checked EOnFrame
Checked EOnFrame
Checked EOnDiag
Checked EOnDiag
Checked EOnFixedFrame if 1/30s passed since the last execution
Checked EOnFixedFrame if 1/30s passed since the last execution
Checked EOnSimulate
Checked EOnSimulate
Checked EOnPostSimulate
Checked EOnPostSimulate
Checked EOnPhysicsMove if 1/60s passed since the last execution - can be executed multiple times per frame
Checked EOnPhysicsMove if 1/60s passed since the last execution - can be executed multiple times per frame
Checked EOnPostFrame
Checked EOnPostFrame
Checked EOnPostFixedFrame If EOnFixedFrame executed this frame
Checked EOnFixedPostFrame If EOnFixedFrame executed this frame
Destruction Checked Checked OnDelete
Checked Checked Destructor Do NOT delete components in an entity's destructor - this could lead to nullpointer exceptions
Checked Checked Destructor Do NOT reference the parent entity in a component's destructor - the entity is already deleted by then