User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Loading an array freezes the application

  1. #1
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loading an array freezes the application

    Hi,

    I'm using the Array object to load an array from a file. While the array is loading, the application freezes and becomes unfrozen once the array has finished loading.

    I was wondering if there was a way around having to wait for the array to finish loading before allowing the application to continue?

    If there are any different array objects or someone has managed to get around this issue, your advice would be awesome and much appreciated.

    Cheers

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module

    Join Date
    Dec 2013
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Show the mfa for understending, becuse with this info I don't know how to help you.
    In my opinion array don't have the issue you describe. I use only the nromal array object and I really don't know if there are other array or similar, and the normal array can be numeric or text, you can select wich type you wont in the proprieties of the object.

  3. #3
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's an example MFA as requested, I've zipped it up to include the array file that I'm trying to load.

    And yeah it's a big array file, but that's besides the point ^^
    Attached files Attached files

  4. #4
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,631
    Mentioned
    229 Post(s)
    Tagged
    3 Thread(s)
    Loading a string array that contains 40,000 strings is slow yes, because for each string it allocates memory for it and then reads it. We could perhaps optimize it a bit but I'm not sure we would get a significant difference.

  5. #5
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Yves View Post
    Loading a string array that contains 40,000 strings is slow yes, because for each string it allocates memory for it and then reads it. We could perhaps optimize it a bit but I'm not sure we would get a significant difference.
    Yeah I can understand that the array loading will be running on the same thread as the rest of the application. I could pre-load all the arrays at the start of my application, but ideally I would like to be able to load the arrays during runtime/gameplay, whilst allowing the application to play-out as normal. I understand that's probably a bit too much to ask from CTF, but was worth a try, as I know some people have developed some amazing custom objects in the past.

    For context I'm attempting to make a server in CTF and see how viable it is (since the lacewing guy stopped supporting lacewing, and isn't compatible with the latest Python anymore). And in this server, loading arrays during runtime without any freezing is important to keep the server running smoothly.

  6. #6
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    207
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Whenever I get slowdown in my games from doing procedural generation stuff and attempting to create/destroy thousands of objects at once, I can get it to perform better by 'chunking' my level and doing it with a smaller number of objects across several frames ticks, rather than all at in the first frame tick.

    It's a different problem but could you split the array into multiple smaller arrays, load each one sequentially each frame and then merge them? That might be a more performant way of doing it

  7. #7
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,631
    Mentioned
    229 Post(s)
    Tagged
    3 Thread(s)
    I've done the optimization I was talking about for text arrays, and unlike what I thought the result is significantly better. I've sent you a PM.

  8. #8
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Yves View Post
    I've done the optimization I was talking about for text arrays, and unlike what I thought the result is significantly better. I've sent you a PM.
    After testing your optimization, the improvement is massive. There's now 0 freezing in my application, even when loading that huge array. Thank you so much! I've sent you a PM back.

    If this improvement can be added to the official Array object, I would be happy to close this thread.

  9. #9
    Clicker Android Export Module

    Join Date
    Feb 2010
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marbenx View Post
    Whenever I get slowdown in my games from doing procedural generation stuff and attempting to create/destroy thousands of objects at once, I can get it to perform better by 'chunking' my level and doing it with a smaller number of objects across several frames ticks, rather than all at in the first frame tick.

    It's a different problem but could you split the array into multiple smaller arrays, load each one sequentially each frame and then merge them? That might be a more performant way of doing it
    Thanks for your suggestion, that's given me a good idea. I think I will definitely split the array up into smaller chunks, so that stuff isn't unnecessarily loaded.

  10. #10
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,631
    Mentioned
    229 Post(s)
    Tagged
    3 Thread(s)
    Cool. The version I sent you is the next official version, unless any issue is reported with this change during the beta tests. It will be integrated in the next beta update patch.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Loading an object from array when needed (loading an array in chunks)
    By fishrod in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th March 2014, 06:01 PM
  2. Strange problem suddenly application freezes
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 6th February 2012, 04:21 PM
  3. MooSock freezes my application
    By CarlRuben in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 21st April 2007, 04:19 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
  •