These actions work better without 'is on-screen'

0 favourites
  • 2 posts
From the Asset Store
In this template the music plays without looping in your game
  • Weird

    I remember someone saying that 'is on-screen' is a good way to get better performance since it lets the engine only run calculations on objects that are on screen

    But with this set of events at about 50 objects 'is on-screen' tanks performance. It runs MUCH better with the condition simply disabled

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This doesn't make sense. "Is on screen" works fast, I tested it with 10000 objects and it didn't make any noticeable difference in performance. Definitely shouldn't matter for 50 objects.

    In your case you don't really need this check, because you are only changing a bunch of variables. It's useful when you have CPU-intensive behaviors applied on objects, like Platform or Physics. Then you can disable these behaviors when objects are off-screen and improve performance.

    I don't know why your code runs faster with this condition disabled. I'm guessing that off-screen object instances have empty values in these variables (direction, animation, lastX, lastY) and some other events don't work effectively with them.

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