User Tag List

Results 1 to 2 of 2

Thread: Faster Multiple Object Instances

  1. #1
    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,665
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Faster Multiple Object Instances

    tl;dr

    To make long story short, my code lags with lots of objects and I'm looking a way to speed it up. Pleas Help as it is for my Uni project MMF2/F2.5!

    ****
    Current Source:
    http://tm2fk.pl/snail_on.png

    In short

    - Source = Planet
    - Object/Children = Satellite
    - Each Planet can have random number of Children (0-16)

    With 100 planets there can be betwen 0-1600 satellites and each follows their independent Planet on specified distance (planets can change size real time, and level also scales).

    Proposed solutions:

    1) Attempt to count only Satellites/Planets for visible (in range) but how to limit loop to only that amount, and know specifically that I refer to them?

    2) Instead of loops use array (proposed by snail) but I never used them in such scale and... I even don't know where to start

    3) Any other idea which could speed it up would be wonderful.

  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,665
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK so I run some tests on multiple variances of the moons/sattellites and below I present the results:

    ***Please take into consideration that I remade all examples provided here under MMF2 and modified them to do same operations (Set Random Scale value, instead of slow step increase/decrease as in Complex case)***

    I run several tests for each method of moon allignment (3 runs of 3) and provided average variables below (Top most Planets, Satellites/Moons and lowest most FPS during their re-scaling).

    Following methods were used:
    1) Pick One of + Variable
    2) Fast Loop + Spread ID
    3) Fast Loop + Pick One Of (No Variable!)
    4) For Each Basic (The most basic For each I gather)
    5) For Each Complex with Effects on (seperate loops for scaling down/up)
    6) For Each Complex with no Effects (seperate loops for scaling down/up)

    It seems that the most FrameRate resistant method is without any FL/FoE as objects are pick invididually so there is a little lag (you can see individual planets being rescaled) however it doesn't require lots of power so it is a good alternative for low-end platforms (Flash/Mobiles) with some extra coding could suprisingly be the most efficient method.

    It also occured that FL+Pickup is nearly as efficient as For Each Basic, which sounds as a very good alternative for me - as For Each I got is not supported under XNA, and I doubt my lecturers would be happy to see unknown to them For Each extension (lol).

    Yet For Ech Proved to be able to handle most objects with highest framerate +for ross for making it, as it works, lol.

    Pick One Fast loop FL PickUp ForEach B ForEach C ForEach N
    Planets 926,3333333 912,6666667 916 919,6666667 820,3333333 917,3333333
    Satellites 6900 6819,333333 6810,333333 6863,333333 6142,333333 6819
    Refresh 45,66666667 14 15,33333333 16 19 16,33333333

    www.tm2fk.pl/compare.png

    Comments Individual pick slow with over 5 objects - lol
    Attached files Attached files

Similar Threads

  1. Still having trouble dealing with multiple instances of one object
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 31st December 2013, 11:33 PM
  2. How do you reference multiple instances of the same active object?
    By Cybert9 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 3rd February 2012, 02:33 AM
  3. Shoot object of multiple instances
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 31st October 2011, 04:58 PM
  4. Multiple instances with platform movement object?
    By CPW in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 8th February 2009, 01:08 AM
  5. Multiple Instances of Object glitch
    By JimJam in forum File Archive
    Replies: 10
    Last Post: 5th March 2008, 12:44 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
  •