How do I Make a Progress Bar For extensive event?

0 favourites
  • 6 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • I have a 100,000 tiles that get formed into ground, underground, caves ect that stops the game solid for about 10 seconds straight when the level first gets generated. How do I put some type of visual up during this process that serves as a "loading screen" because the traditional loading screen are for loading the game not heavy handed parts within the game?

    Thank you to anyone replying.

  • Maybe you could use a percentage bar:

    progress = (n / 100,000) * 100

    (In this case, if you loaded 50,000 tiles, progress is 50%)

    You could use percentage to make a Progress Bar... There are a lot of tutorials on these bars around there. But is as simple as setting the width of the Fill part to the: Maximum_Width / 100 * progress

    Hope I helped you.

  • Thanks for your reply! So you are saying simply load a visual before I begin the process and inside of my loops just update the progress bar? Wonderful Idea I didn't even think of that! I was assuming that I needed to use some special implementation that would calculate cpu usage I didn't even think of just implementing something myself. You see I am doing everything on layout start so I am looking at this initial freeze thinking hmmm how do I keep it from stopping like this. It is freezing because I am doing everything at one time and not stopping to update the user with visuals.

    Thanks again for bringing this to my attention. When you said the 50k tiles part it turned a lightbulb on.

  • ^^ I'm glad I helped, good luck!

  • I can't seem to make a progress bar work the game just freezes I don't know how to make it wait long enough to update the visual.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If updating the visuals within the generation isn't working (because the screen freezes), maybe the html/javascript system itself is just overloaded. However, if it's ok waiting a little more, you could do a natural pause while generating.

    What I mean is, for example... Minecraft.

    Minecraft generate thousand of tiles (and doesn't have a progress bar), however, the game generates in a interesting way... it loads chunk by chunk, instead of block by block... (a chunk is an area of 16x16x256 blocks) also, it generates the chunks only when needed. It doesn't generate all the blocks in the world, just the "visible" ones.

    With that, you can not to load the entire world with 100,000 tiles at once. Maybe what you need is a slower process loading on groups of tiles (a cave or a biome, etc) and on those intervals refresh the information to the user on the UI. After all, 100,000 tiles...! I can't even count on my fingers!

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