Setting time & layout scale every tick affect performance?

Discussion and feedback on Construct 2

Post » Wed Jul 26, 2017 8:23 pm

Simple question. Been experiencing a big increase framerate drops over the past couple of days on mobile. My game that used to run flawless 60 FPS at all times now often experiences framerate drops down into the 40 to 30s. I haven't introduced much more complexity on the event side of it, and pretty much no art changes. However I did start using time scale and layout scale as it solves many design problems for me. I do notice the frame drops only really happens when the camera moves while the layout scale's dynamically changing. I wonder if the layout scale changing every tick combined with a dynamic camera making it hard on the renderer?

Any insight on this would be appreciated.
B
29
S
9
Posts: 356
Reputation: 2,938

Post » Wed Jul 26, 2017 9:36 pm

Yes, yes it would.
If it's for a smooth zoom, add a timer with a Boolean, and stop the scaling when the zoom is complete.
Image ImageImage
B
168
S
50
G
164
Posts: 8,227
Reputation: 105,573

Post » Wed Jul 26, 2017 9:39 pm

@newt I'll consider doing that then! You know any reason why that's the case? Anything that needs to be reset, cached or rerendered whenever the layout scale changes?
B
29
S
9
Posts: 356
Reputation: 2,938

Post » Wed Jul 26, 2017 10:00 pm

I don't know what optimizations Ashley's introduced, but figuring the width, and height of every object has to be expensive.
As far as post scale goes, I can't think of anything that would help as far as the system goes.
There's a camera plug by Linkman2004 you might check out viewtopic.php?t=74513&start=0
No idea if it does layer, or layout scales.
Image ImageImage
B
168
S
50
G
164
Posts: 8,227
Reputation: 105,573

Post » Wed Jul 26, 2017 10:48 pm

Off the top of my head, this is something you might be able to achieve with a surface shader maybe? Like, render the screen to a surface then scale that surface to zoom in and out. It would be an extra toll on the gpu for sure, but if it's the cpu that's struggling you'd be offloading that at least.

Just a thought, no idea if it would help.
B
38
S
16
G
6
Posts: 537
Reputation: 7,582

Post » Wed Jul 26, 2017 11:19 pm

Hmm changed the code to snap back to 1 when it's close enough, and stop changing every tick when at 1. It seems to have worked. It feels smooth again.
B
29
S
9
Posts: 356
Reputation: 2,938


Return to Construct 2 General

Who is online

Users browsing this forum: takamoto and 3 guests