Layout pre-load

0 favourites
  • 8 posts
From the Asset Store
Progress\Loading Bar
$2.40 USD
40% off
Progress\Loading Bar. Now Load you game like a Professional.
  • I have quite a big layout, and its loading takes a long time. Is there a way to load it before a player enters it? Maybe I can make a kind of loader layout, but inside the game? Or some dynamic loading like in 3d games, when it renders only the visible part of the world? Is it possible?

  • This might work (no guarantees though - haven't tested it!):

    Create a new layer called "loader" above all the other layers.

    Add a tiled background that covers the entire window and a sprite with a loading animation to the layer.

    Add a global called lastObjectCount.

    We can now use the system expression"objectcount" to check how many objects have been loaded in:

    Every X seconds if lastObjectCount < objectcount, set lastObjectCount to objectcount

    Else set layer "loader" invisible (and start the level, activate the player character etc)

    Adjust the X seconds to find a value that doesn't trigger incorrectly.

    Like I said, just guessing so could be a load of old rubbish - apologies in advance if that's the case!

  • mekonbekon, all this actions are running before the layout starts, as I guess

    Layout will not start before all the objects are ready and all "On the start of layout" events are done

    If it takes much time, there would be just a black screen, which I'm trying to avoid

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Romalex360 ah, fair point. I'll have a think about it and let you know if I come up with a different solution.

  • Or some dynamic loading like in 3d games, when it renders only the visible part of the world? Is it possible?

    that's what you'd use different layouts for... cut up your current large layout and spread it over multiple ones that use the same event sheet. You will need something to hide the load time, but it should be a lot shorter if you make each layout more manageable. But if you want it seamless, not sure if that's the way to go.

    what is your average object count at startup? how about mem usage?

  • jobel

    Yeah, layout should be seamless

    It's a kind of top-down action game, but I use random terrain generation here, which uses a lot of CPU

    Layout size is about 5k filled by 32×32 tiles

    Algorithm also makes invisible walls on some slopes

    Well, the main problem are this calculations

    They can take a long time, it's ok, but I want the main problem is that i can't track it and hardwired to the start of thus layout

    For example, I can't fill the tilemap from another layout, because then it will reset

    So I want to make all calculations and load the layout in memory before it starts, without this long black pause on the transition

  • You can make a loader layout of sorts, I haven't tried it yet myself though.

    Sprites are kept in memory if they are in use on both the previous layout and next layout.

    You can take advantage of this by using the load from url action to preload assets gradually in an intermediate loader layout.

    This is mostly useful to prevent the "freezing" that occurs between layout when loading large amounts of sprites into memory. I'm not sure if this would help you regarding cpu use on start of layout if you're dynamically placing your terrain on start of layout.

    Are you generating the entire map in a single loop/frame? Maybe you can break it up into multiple frames by using a counter. Start by generating what can immediately be seen, and let the rest of the map generate over time.

  • oosyrag could you possibly expand on your reply? I have been trying to find a solution to this issue, but without any success. You

    can see what I tried here:

    Hope you can possibly help.

    Thanks

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