How do I performance optimisation !!!

Get help using Construct 2

Post » Fri May 02, 2014 1:22 pm

Also destroy outside.layout saves memory by removing objects no longer in pay. Make sure all you collision check objects are on layers with the same parallax values or it breaks the collision checks. I also disable collisions for objects that are not on those layers such as the UI etc....
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603

Post » Fri May 02, 2014 2:39 pm

BluePhaze wrote:Also destroy outside.layout saves memory by removing objects no longer in pay. Make sure all you collision check objects are on layers with the same parallax values or it breaks the collision checks. I also disable collisions for objects that are not on those layers such as the UI etc....


mmm good idea

is that mean that we have to add another condition to collisions object with another object ?

for example : if object A (player) is on collision with B (ennemy) (and another condition if object B is on screen ? or on layout ) ?
yes , no ?
B
46
S
16
G
8
Posts: 802
Reputation: 8,351

Post » Fri May 02, 2014 3:21 pm

nimos100 wrote:
Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little),

What do you mean with that they are normally checked if outside layout, its standard that they are excluded if outside layout, or do you mean something else?


I meant that even if they are outside the layout, they still exist, and C2 still register collisions with them from my experience. Which is normal, not every game can satisfy itself with a predefined layout size.(however, most likely the collision cells will filter that out).
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150

Post » Fri May 02, 2014 4:39 pm

Aphrodite wrote:
nimos100 wrote:
Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little),

What do you mean with that they are normally checked if outside layout, its standard that they are excluded if outside layout, or do you mean something else?


I meant that even if they are outside the layout, they still exist, and C2 still register collisions with them from my experience. Which is normal, not every game can satisfy itself with a predefined layout size.(however, most likely the collision cells will filter that out).


yes
and if thats like you said better add condition to collisions script
for example like i said
if object A (player) is on collisions with object B (ennemy)
and if object B is on screen

this will tel to construct engine to calculate colissions only if object B is on screen

??? am i logic ?
B
46
S
16
G
8
Posts: 802
Reputation: 8,351

Post » Fri May 02, 2014 4:48 pm

yes
and if thats like you said better add condition to collisions script
for example like i said
if object A (player) is on collisions with object B (ennemy)
and if object B is on screen

this will tel to construct engine to calculate colissions only if object B is on screen

??? am i logic ?

I would still say no, I don't see any evidence that it should matter in regards to collision checks. As you can test it pretty easy. Make 2 sprites and put them on the layout.

In the code you write "On collision object 1 with object 2" that would give you 60 collisions checks, if you move one of the objects out of the layout you get 0 collision checks. So to check if its on layout doesn't matter.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Fri May 02, 2014 5:28 pm

nimos100 wrote:
yes
and if thats like you said better add condition to collisions script
for example like i said
if object A (player) is on collisions with object B (ennemy)
and if object B is on screen

this will tel to construct engine to calculate colissions only if object B is on screen

??? am i logic ?

I would still say no, I don't see any evidence that it should matter in regards to collision checks. As you can test it pretty easy. Make 2 sprites and put them on the layout.

In the code you write "On collision object 1 with object 2" that would give you 60 collisions checks, if you move one of the objects out of the layout you get 0 collision checks. So to check if its on layout doesn't matter.


yes you get reason
is on layout or on screen it will still calculate same collisions BUT if we destroy the object it will reduce ...
B
46
S
16
G
8
Posts: 802
Reputation: 8,351

Post » Fri May 02, 2014 5:44 pm

yes you get reason
is on layout or on screen it will still calculate same collisions BUT if we destroy the object it will reduce ...

No, even if you destroy the object it wont have any effect on the collisions. You will save some memory etc as someone else mentioned.

You can do the is on screen that would help, sorry missed that part. But then you might as well use a distance check as you can then make it smaller than the screen size.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Fri May 02, 2014 6:14 pm

i just try it now ...
when i use on screnn condition with collisions
it still calculate collisions even when object is outside screen
and if destroy the object it will calculate 0 collisions

try an example ...
B
46
S
16
G
8
Posts: 802
Reputation: 8,351

Post » Fri May 02, 2014 6:40 pm

i just try it now ...
when i use on screnn condition with collisions
it still calculate collisions even when object is outside screen
and if destroy the object it will calculate 0 collisions

try an example ...

What I wrote above doesn't really make sense, so let me try again, using on screen doesn't make much sense. Because if you want to be able to scroll it wont work, and if it aint possible then you don't need a big layout either, so distance check make sense to use and not really "On screen" unless its not a normal layout for some reason.

The reason yours doesn't work is probably because you use "On collision"?
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Mon May 05, 2014 2:29 am

yes i use on collisions
B
46
S
16
G
8
Posts: 802
Reputation: 8,351

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: EuropaMin3r, maddy467, work3 and 6 guests