How crippling to performance are cell counts and pins?

0 favourites
  • 5 posts
  • So I have this one level in particular that suffers from bad frame skips. It's a huge level with 3000 objects (cavestage_5 Ashley). Far from all of these are present in canvas at any given time, but the only thing I really see excelling on this layout is the object count, cell count, and objects pinned to something. Is any of these a potential CPU hog? In a previous iteration every pin action was performed at the beginning of layout, while a video was loading. I softened this out by removing the video source and being more selective with when the pin actions takes place. This improved it somewhat, but not entirely. I'm still on the fence wether I should cut this layout into several smaller ones. The layouts that performs best in Klang are the ones with a very small object count after all.


  • It's the object count versus what the objects are doing.

    You can have a lot of objects on the screen if they aren't doing anything, however 3000 is a lot, even if they are static.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On my PC I can have 10,000 objects at 60fps if they aren't doing anything... however I can have only 2,000 objects and fps is down to 30-35 if everything is doing complicated movements, etc.

    I'm not sure exactly what would be causing your issue - but I found doing some simple optimistations like having a core condition "is on-screen" made a HUGE difference to performance for doing things like rotating body parts for my characters etc. If they aren't on screen it ignores all of the IK solver chain and just uses "set X/Y" position to lighten the load.

    If you have a lot of moving stuff in the layout maybe only "move" them when they're within certain bounds of the viewport maybe, or even destroy them until the player gets closer to the position where they will be required.

    In my map layout I have literally over 300,000 objects and it runs perfectly - because it's only drawing around ~500 or so objects at any given time on the viewport - and nothing is moving.


  • The profiler tab of the debugger is the only interesting place to look for CPU measurements. Otherwise you're just guessing.

    As SoldjahBoy said object count alone has minimal impact on performance, it's what they're doing. If you're also talking about collision cells, they usually do a lot to improve performance! The count is just an indication of the memory overhead, which is usually not important.

  • Ashley That was exactly my point. You can have pretty much as many objects as you want if they are doing nothing or very little. When things start moving and calculating collisions that's when the performance begins to be affected with loads of objects.

    Another good tip to observe is (like in my case I didn't even realise at the time) to turn off collisions for objects that don't need it. For example my weather effects don't need collision calculations - but collisions were enabled for those objects. I have maybe 600-800 "rain objects" at any time when it's raining, and the fps drop was noticeable. After disabling collisions for those objects it freed up a lot of CPU usage.


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