User Tag List

Results 1 to 7 of 7

Thread: Layer Lag

  1. #1
    Clicker Fusion 2.5

    Join Date
    Jun 2006
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Layer Lag

    I've been reading a lot about how MMF2 will treat any backdrops not on Layer 1 as active objects at runtime due to how the collision masks are calculated and set up. Until now, I didn't realize this. My game is a platformer, the animated, parallax background is on layer 1 since it needs to obviously be behind everything. This means that the player and all the associated ground tiles (background objects) cannot be on layer 1, they are on layers 2 and 3. The dilemma I'm facing is when creating large levels, the layer that the player interacts with may have 2000+ objects with a majority of these being 128x128 backdrops (being converted to actives at runtime) and this creates lag. I personally do not experience an issue with this because I have a very powerful computer, however I do have people complaining that the frames that are larger are lagging for them. I cannot tell my players to just get a better computer or don't play, it's obviously not acceptable. I have to find a way to increase the performance.

    My initial thoughts were moving the player and background down to layer 1 and forgoing the organization perks that MMF2's layering system offers, however since the parallax backgrounds are animated and background system boxes do not support animation, I have no solution for this. A teammate has suggested we start combining the 128x128 tiles into larger chunks to cut down the backdrop count and thus increase performance. This is an entirely viable solution and the only one thus far that seems like it will help, but I wanted to investigate this further before committing to a certain method of dealing with the issue. The aforementioned solution will also only work so well. As level size continues to increase a wall will be invariably hit.

    Is there any way to achieve what I'm looking for here? An animated background that's behind a bunch of backdrops, all on the same layer?

    Lastly, is it even possible for CT to make the "default" layer that has the collision mask generated at the start of the frame configurable? Obviously I have no idea about the complexities that are involved in doing this and as an armchair programmer this seems like it would be easy...however I'm guessing if it was possible it would have been done already.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Sinclairian's Avatar
    Join Date
    Aug 2012
    Posts
    60
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can actually animate background system boxes although it's a bit of a nerf'd way.

    Just make several different background boxes, each having different picture for the different frames. Make a counter and make it keep adding 1. (So it's like a timer.)
    And say, when the counter is 0. Show the first background box, and hide the rest. When it's 1, hide the first, show the second, hide the rest. (If you get me?) Rinse and repeat, until all the boxes have been done.
    When the animation is complete, just reset the counter back to 0.
    (I dunno if I explained that well >.<)

    But yeah, it's a bit of a nerf'd way but it's the only way I can think of. It's handy when it comes to doing things for flash now.

  3. #3
    Clicker Fusion 2.5

    Join Date
    Jun 2006
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a clever idea. It sounds like it would work. I don't imagine it'd be that taxing resources wise either...I'll have to give it a shot.

    Outside of this, I take it this is basically the only option?

  4. #4
    Clicker Fusion 2.5iOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    A possibility is to have your collision mask on layer 1 and create a dummy objects for the player/whatever else and have the real objects on layers and link them to the dummy objects.

  5. #5
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Posts
    54
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Are you sure this actually has to do with your game being slow? I have thousands of backdrops on different layers and it doesn't slow the game down at all as long as I keep the number of Active Objects within a certain range, which is different depending on what PC I'm running the game on. Again, deleting backdrops doesn't seem to give any major performance boost. I really think you should look somewhere else cause this doesn't seem to be the problem.

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export Module

    Join Date
    Sep 2006
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Gamerdude View Post
    I've been reading a lot about how MMF2 will treat any backdrops not on Layer 1 as active objects at runtime due to how the collision masks are calculated and set up.
    I've heard this before too, but I don't know where people are reading about it. Source?

  7. #7
    Clicker Fusion 2.5

    Join Date
    Jun 2006
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SolarB View Post
    A possibility is to have your collision mask on layer 1 and create a dummy objects for the player/whatever else and have the real objects on layers and link them to the dummy objects.
    I kind of get what you're saying...I do wonder how this would perform. The backdrop count would basically double, but that doubled set wouldn't have any collisions. At that point though, I think it''d be more worth the time to combine tiles since you essentially will have to place double the amount of objects in the frame. But still, might be worth at least checking out.

    Quote Originally Posted by PkR View Post
    Are you sure this actually has to do with your game being slow? I have thousands of backdrops on different layers and it doesn't slow the game down at all as long as I keep the number of Active Objects within a certain range, which is different depending on what PC I'm running the game on. Again, deleting backdrops doesn't seem to give any major performance boost. I really think you should look somewhere else cause this doesn't seem to be the problem.
    Where are a majority of those backdrops? I'd be curious.

    I'm pretty positive. When combining the backdrops from 128x128 tiles to various other, larger sizes (like 3 128x128 tiles stuck together), across the entirety of a level frame, there is a performance increase. This is consistent, I believe, with Yves's post linked below. When this is done, we reduce the backdrop count from say, 1700 to 1200 or less. This could be a solution, but it's an additional step after level design is done, to go back and do that combination. It also makes going back to edit the level later more of a pain. Additionally, I see it as more of a bandaid fix. It works well when our backdrop count isn't terribly high and we can bring it down to a very reasonable level, but if we just have a large level it might not be enough.

    Not to say there's no room for further optimization, because I'm a believer in that something can always be optimized more. However, we've already done quite a bit such as disabling fine collisions and deactivating objects off screen when possible. Even objects, such as enemies, that we don't want to be deactivated off screen at all times (such as when the edge of the screen is approaching them), we have left them completely enabled when off screen. Whether or not an object not moving or doing anything off screen is a comparable performance gain to allowing it to be completely deactivated by MMF2, I'm not sure.

    The only thing we can't do, which I'm sure would increase performance, is turn off handling of collisions outside the window. Surely this doesn't help, but it's absolutely needed for our game.

    Quote Originally Posted by nim View Post
    I've heard this before too, but I don't know where people are reading about it. Source?
    Check this topic here: http://community.clickteam.com/showthread.php?t=41571&highlight=question%2C+%27bo ut+backdrops

    Yves specifically says
    Quote Originally Posted by Yves
    Only the backdrops on layer 1 don't slow the application. Backdrops on other layers are displayed like active objects. If possible, uncheck the "Save background" option in the layer properties, that will save some time. If you can't do that you'll have to wait for the hardware accelerated version.
    Now, I'm technically using the HWA runtime, and according to another topic I read (see below), HWA doesn't save the background already by default, so I can't try that.

    http://community.clickteam.com/showthread.php?t=66632&p=495667&viewfull=1#post495 667

    Quote Originally Posted by Looki
    HWA doesn't save the background of objects, it literally redraws the whole screen every time.

Similar Threads

  1. Layer Object: Moving X and Y of layer is very slow
    By Bipolar_Games in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 5th April 2013, 01:19 AM
  2. Creating a new Layer: Layer referrances
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 17th October 2012, 11:44 AM
  3. Position layer using Layer Object
    By Sumo in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 4th October 2012, 05:51 AM
  4. Layer Object can't move counters to specific layer
    By JoKa in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th November 2007, 11:11 AM
  5. Bug when moving a layer with layer object
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 2nd July 2006, 11:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •