collisions offscreen

Get help using Construct 2

Post » Fri Nov 08, 2013 4:05 pm

Hi there,
anyone got an idea how do i disable platform behavior for offscreen or distant sprites? Trying to manage that but so far without luck. thx
B
8
S
4
G
1
Posts: 191
Reputation: 1,873

Post » Fri Nov 08, 2013 6:18 pm

Put all events concerning your offscreen sprites in a group and activate the group when the x of the sprite is less than viewportright+50 and more than viewportleft-50. trigger this once while true and also do the deactivating for the opposite.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Nov 08, 2013 11:32 pm

Littlestain, is it the same as when i set the enemy family platform behavior to default: OFF and then turn it ON once the sprite is onscreen? And turn it OFF when its outside layout..

Basicaly the default is OFF for the whole family
B
8
S
4
G
1
Posts: 191
Reputation: 1,873

Post » Sat Nov 09, 2013 7:07 am

It is usually not the same when you do something completely different.

Turning of the behaviour doesn't stop the events you have set up to check for collisions.
Outside of layout probably won't work, because your family members are most likely on the layout.

Using grouped events or adding the conditions to check if your familymembers are within a certain distance from the viewport edges, would probably be your best choice.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Nov 09, 2013 11:44 am

Littlestain from my tests, the only thing that makes huge fps drop is the platform behaviour. Other collision events that i have set on the family members {checking for edgemarkers, collision with main hero etc.} are making maximum 1-2fps so far on iphone5. The platform behavior is making huge fps drop even when 5 enemies on screen.

Its very nicely visible when i have an area with no enemies or 1 enemy - it runs about 57 fps since i disabled platform behavior when family members out of screen. But from the moment when there's like 4 enemies, it goes to its knees...
B
8
S
4
G
1
Posts: 191
Reputation: 1,873

Post » Sat Nov 09, 2013 12:21 pm

Have you tried disabling ALL events in which your family members are present?
All animations, rotations, movements, collisions, etcetera?

fps drops usually have more to do with rendering the graphics than anything else.
Did you optimize your graphics? Are there many calculations required for the graphics to be rendered?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Nov 09, 2013 1:00 pm

i have made a test where i had all the family collision events enabled and only disabled the platform behavior. That made the bigest impact on fps. When i only have moving sprites with animations {without platform behavior} the game runs perfect around 60 fps. So the speed has to do with collision detection.

I also optimised ground tiles- using big blocks of tiled background as ground collisions which helped a bit.
B
8
S
4
G
1
Posts: 191
Reputation: 1,873


Return to How do I....?

Who is online

Users browsing this forum: Alvaro2 and 13 guests