reducing lag: actor mode

Introduction: 
Actors does many different things at once especially with box 2D physics. Stencyl-based developers may find the game unplayable when too much actors are added. With this, Stencyl-based developers can suspend unuseful functionalities for some actor types as they still are to be computed via actor script. 

For examples, 
Idle games do not need box 2D physics. Simple or Minimal mode will do.
HUDS does not need box 2D Physics either. 

Trade offs
Any Stencyl-based developer can compromise between functionality and computation efficiency[1]. 
 

The actor modes. It has Box 2D physics by default. 

All modes allow mouse interaction. Under all physics modes, actors can be killed. To prevent a solid actor from passing through another solid one, Both actors needs to have default actor mode. Other they will overlap one another.

Abilities
Minimal
Simple
Normal (default)
anchor to screen
no
yes
yes
regions can sense?
no
no
yes
Solid actor interaction with other solid actors.
Lets other solid actors pass through even if its solid
Lets other solid actors pass through even if its solid

Only solid actors with

“actorMode = normal”
will not pass through

Code to change physics mode:

actor.physicsMode = MINIMAL_PHYSICS
actor.physicsMode = NORMAL_PHYSICS
actor.physicsMode = SIMPLE_PHYSICS

 

 

No comments:

Post a Comment