Do Overlap checks require Collisions enabled?

Get help using Construct 2

Post » Wed Jan 13, 2016 10:32 pm

I've read that performance can be noticeably improved by disabling Collisions on all sprites that don't use them. My game doesn't have any "on collision with" checks, but it does have a whole lot of overlapping checks. Do those checks require collisions to work, or can I go ahead and disable absolutely all collisions? :D

My games runs at 60fps on my PC normally, 30fps in debug mode (making that mode confusingly pointless for usual performance measurement?), 25fps on my Galaxy S6, and 2fps on my third gen iPad. I'm aiming for 60fps on modern phones, and 20-30fps on my old iPad.

Bonus Question:
I'm resizing images where I can. If I have a sprite and image sized at 1024x256, resize the image to 512x128, but keep the sprite sized at 1024x256 (so slightly blurred image quality) would that improve performance because the image is now much smaller, or make no difference to performance since the sprite is the same size as it was before?
B
15
S
7
G
7
Posts: 255
Reputation: 5,313

Post » Thu Jan 14, 2016 5:53 am

I wasn't aware there was a way to disable collisions. An "on collision" is basically a "is overlapping" with a trigger once. Collisions are only detected with a object if it either has the solid behavior or you use one of those events.

The image size doesn't affect the performance. It just reduces the amount of vram used which can be important for mobile devices.
B
85
S
27
G
85
Posts: 5,066
Reputation: 57,866

Post » Thu Jan 14, 2016 6:42 am

I was wondering about overlapping using collisions as well, so I took a simple project that has overlapping triggers and disabled collisions to see, those triggers didn't fire anymore. So I'm willing to bet "is overlapping" uses the collision mesh.

There might be a trick with selectively enabling the collision, like in my case, I only really check for an overlap after dragging and dropping, maybe it would be worth enabling collision only then and then disabling it again.

But short answer, overlap checks require collision be enabled.
B
8
S
1
Posts: 32
Reputation: 470

Post » Thu Jan 14, 2016 10:49 am

And what about disabling all the collisions? Does the game run faster after this? Isn't it pointless to create events to disable collisions?
Image
B
15
S
2
Posts: 58
Reputation: 805

Post » Thu Jan 14, 2016 3:31 pm

Thanks for the replies!

You can disable collisions for sprites in their Properties window. It's not like I'm creating events to disable them at run time. There are a few threads I found through the search function that claim disabling collisions on sprites that are only used for decoration improves performance.

And thanks for the clarification that overlap checks do indeed require collisions enabled. I've disabled collisions for all sprites that don't use overlap checks (still almost half of them) so hopefully that helps performance in some small way :)

R0J0hound wrote:The image size doesn't affect the performance. It just reduces the amount of vram used which can be important for mobile devices.

Awesome, thanks. I'm hoping to release this game on mobile too, but PC is my primary focus for now. Still, even if it only affects VRAM, am I correct in thinking that it's the image size that matters, not the sprite size? So a foggy mist sprite sized 512x512 using an image size of 256x256 has no noticeable (or any) performance/VRAM difference over a 256x256 sprite using a 256x256 image?
B
15
S
7
G
7
Posts: 255
Reputation: 5,313

Post » Thu Jan 14, 2016 8:32 pm

If you're not checking for performance with the sprite then disabling the collisions won't matter.

Yeah, only the image size affects the amount of vram used. The size of the sprite doesn't matter. Also, there is no performance difference.
B
85
S
27
G
85
Posts: 5,066
Reputation: 57,866


Return to How do I....?

Who is online

Users browsing this forum: Aquanex2, jhjconstruct, kiko2015, Tuiii and 9 guests