Project Freezes When Loading Remote Images

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Hand-painted snowy isometric tileset that includes all the tiles and objects needed to create a magical winterland.
  • Hi everyone,

    I’m facing a problem in Construct 3 where my project freezes after loading an image using the Remote Image plugin. The game stops responding immediately after assigning the downloaded image to a remote image sprite.

    Has anyone else faced this issue? If so, how did you solve it?

    Things I’ve tried:

    ✔ Checking if the image URL is valid before loading.

    ✔ Adding a delay before assigning the image.

    ✔ Using the "On image loaded" event to prevent early assignment.

    ✔ Testing with fewer images to rule out memory issues.

    But nothing seems to fix the freezing problem. Any suggestions?

    Thanks in advance! 😊

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I spot 2 issues:

    The 1st issue may be the one causing crash, but only because 2nd issue exists (although fix both of these and all should be fine!).

    1) You call the function at start of layout, then call it again "on fetched". This would be an endless loop of running the function, causing the crash.

    2) You store the URL in the dictionary with &world_Id, but then when you load from url, you use the iid of the object, maybe they are not matching up? Maybe ideal to use UID in these cases, and not use IID. The IID can change at times, like destroying an object, whereas UID will always be the same.

    Im guessing you're loading many images at once in a loop, it should be able to work with right combination of events.

    "Wait until previous actions complete" is very useful, but, may cause an issue for this case (it may not, but just a possible warning), as it may either: wait for ALL other actions, or, may load the wrong result into the sprite. Instead, it may be preferable to "load from url" then have separate event for the septiee "on load success".

    Might be other things to consider but that's a start!

  • Thank you for your detailed response!

    I understand the issue with calling the function twice. I'll adjust the logic to prevent an infinite loop.

    I'm using IID because I'm storing the images in order (0, 1, 2, 3, 4), and I don't know another way to load them correctly. Do you have any suggestions for handling this in a structured way?

    Currently, I'm testing with only five small images, so performance isn't an issue yet. However, I want to make sure the approach works efficiently for a larger number of images.

    Would using UID instead of IID require me to change how I store and retrieve the images? If so, what would be the best way to keep track of them?

    Also, thanks for the note on "Wait until previous actions complete." I'll test loading images with separate "On load success" events to see if that improves stability.

    Appreciate your help!

  • I think the issue is with the RemoteImage plugin because I tested it with a simple code, and the same problem occurred.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)