User Tag List

Results 1 to 9 of 9

Thread: fast loops slowing game down

  1. #1
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fast loops slowing game down

    i have a fastloop going through every enemy on screen to test specific values based on their spread value. with 20 on screen there is no issue but once it starts looping through 30 the game starts to take a sharp decrease in speed and starts running at 25 frames per second. is there a way of looping through objects on screen to check a spread value to apply separate actions without slowing my game down? i want to at least be able to have 50 or 60 enemies without a decrease in speed.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look over TDC for optimisation articles. If you can avoid spread value, as well.

  3. #3
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fanotherpg View Post
    Look over TDC for optimisation articles. If you can avoid spread value, as well.
    would you happen to have a link to some articles?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #5
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You could try using For Each instead of loops.
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  6. #6
    Clicker Multimedia Fusion 2Android Export Module
    Corlen's Avatar
    Join Date
    Mar 2007
    Location
    Your House
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As a general rule of thumb, you want to avoid fastloops and ForEach loops as much as possible because they are quite intensive. I think ForEach loops are slightly less intensive though. It's OK to have something like 8 loops, but once you start getting into something like 50+ it really impacts your game's performance. Perhaps if you MUST use a loop on your enemies, maybe reduce the total number of enemies that can appear on screen at any given time.

    Also, are you sure about whether you're telling the fastloop to happen for all enemies in the level or just the ones on screen?

  7. #7
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i was trying to store values in arrays to be read out of since i needed to store more than just 26 values and i was able to share values between objects by comparing their fixed values on the y array of the table. the problem is, it doesn't seem possible to compare multiple values in the array table between specific objects on it, just the last one created, so i had to loop through them on the array table to compare the values. the framerate dropped significantly because i had to do this but it got what i needed working at least. also from my experience, this is running better than the last setup i did with the foreach object which only allowed me to loop through 20 objects before it slowed down heavily.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For Each is less intensive than fastloop because it's Fastloop with built-in spread value - for the simplest and not most correct explanation. Instead of doing several calculations like Object -> Spread Loop-> Index Loop Index -> Spread Actions. It just does Loop -> Particular Object -> Actions. Which helps with higher amount of objects.

    And Corlen MMF is OK to handle 30k loops without a hassle on PC runtime, but the problem is what actions and conditions you are using and in what order. What extensions and so on. I got my whole project based on Fast Loops, Pixelthief same. Keeping decent FrameRate is hard but is possible.

  9. #9
    Clicker Multimedia Fusion 2Android Export Module
    Corlen's Avatar
    Join Date
    Mar 2007
    Location
    Your House
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what I meant, sorry if I wasn't clear in what I wrote.

Similar Threads

  1. Fast Loops
    By Verbage in forum iOS Export Module Version 2.0
    Replies: 4
    Last Post: 12th April 2012, 03:07 PM
  2. Fast Loops vs Grouped Fast Loops vs ForEach
    By Ryan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 6th August 2010, 12:22 PM
  3. I don't get Fast Loops, please help.
    By Carlos182 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 12th September 2009, 08:43 AM
  4. Static game engines without fast loops?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 15th August 2009, 01:33 AM
  5. Fast loops?
    By BrandonC in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st March 2009, 09:04 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
  •