Setting time & layout scale every tick affect performance?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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?

  • 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

    No idea if it does layer, or layout scales.

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)