Page 1 of 1

question about created actors

PostPosted: Sat Feb 25, 2012 4:42 pm
by Fojam
i want to speed my iPhone game up as much as possible. There are many actors in the game, but not all of them are on the screen at once. does it affect speed even having the actors created at the time, or is it only if they are on the screen?

should i make them not created at startup, and have them only create themselves when i need them?

Re: question about created actors

PostPosted: Sat Feb 25, 2012 7:21 pm
by skydereign
Creating actors off screen still slows your game down. Having actors off screen slows your game down as well. If you have a lot of actors created on startup your game will take longer to load. So try to use activation regions whenever possible, only create the actors that are necessary and the usual performance increasing tips.

Re: question about created actors

PostPosted: Sun Feb 26, 2012 3:25 am
by Clokio
skydereign wrote:Creating actors off screen still slows your game down. Having actors off screen slows your game down as well. If you have a lot of actors created on startup your game will take longer to load. So try to use activation regions whenever possible, only create the actors that are necessary and the usual performance increasing tips.


That is a cool feature. :D

From the manual, see it by clicking Help (in GE), document
Or look here Add Activation Region: http://game-editor.com/docs/gettingstarted_maineditormenu.htm
Activation Regions are screen areas that are defined by a bounding box and include game Actors.
A Region, and your actors, is loaded only when the View Actor intersects it.
The Region and all actors within the Region are destroyed when the View Actor no longer intersects it.

Activation Regions allow your game to have many levels, each level in a game can be defined in a different Activation Region.
The entire game, along with all of its levels, is saved in an single game file.
Activation Regions make envisioning an entire game easy.

An Activation Region is shown within the Game Editor as a yellow rectangle. It can be moved or resized freely. The rectangle is invisible when the game is running in game mode.



Right click on the Activation Region's bounding box edge to initiate a pop-up selector that will allow the removal of the Activation Region from the game..

If an Actor moves outside of the Activation Region, it will be destroyed only when the Activation Region no longer intersects with the "View" Actor.

An Actor will be destroyed by the Activation Region when it and your ascendants are outside of the "View".

Numerous Activation Regions with overlapped regions can be defined.

All of an Activation Region's Actors load inside of the defined region. The Actor's parents, and Actor reference through script is also be loaded.

Actors created with "Create Actor" will be assigned to a visible Activation Region.

If the "View" Actor leaves a region and later it comes back, all Actors will be reloaded, except those destroyed explicitly with the "Destroy Actor" Action.

Any Actor can be loaded with "Create Actor", even if has been destroyed explicitly.

If no Activation Regions have been defined, all game Actors will be loaded when the game starts.



Below, a multilevel game with 3 Activation Regions:




Show/Hide Regions:

Show or hide Activation Regions and Region Actors

Re: question about created actors

PostPosted: Tue Feb 28, 2012 1:07 am
by Fojam
is there a way to exclude certain actors from activation regions, or to destroy an activation region? because i really dont want to have to find the exact coordinates of an area. currently im using a wireframe region to move the view there, but it wont work with an activation region.

Re: question about created actors

PostPosted: Tue Feb 28, 2012 4:11 am
by skydereign
You can't exclude actors nor can you destroy regions, but you should be able to access the default actor coordinates of actors that don't exist within the region. As long as they are unique it should work (tested as an executable just now). Have you tested your wireframe method?