Loading an array freezes the application

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • 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

  • 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. ;)

  • 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.

  • 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.

  • 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

  • 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! :D 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.

  • 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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!