Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DevLiquidKnight

What happens during a "loading" screen?

This topic is 5234 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Lots of games have them those screens that say "Loading..." I know they load textures and other things. But how exactly do they do this and update a % complete control? I''ve made a few engines in direct3d and it seems like it takes forever to get the application to finish being executed after I execute it i sit there and wait about 5-10 seconds before anything even appears, which is kinda slow so I was wondering how exactly do you make one and use one in a game so that it effectively displays a screen but allows the user to know whats going on as it loads. It may be a stupid question but just wondering

Share this post


Link to post
Share on other sites
Advertisement
You''ve been duped. The only purpose of the "loading" screen is to give the player suspense - no loading is ever actually involved since loading is always instantaneous. All those screens are doing is updating the % bar with some sleeps in between inside a for loop. The really clever ones try to make you think its actually loading something by writing (which isn''t instantaneous) bits of random information to the hard drive, then deleting it just before they decide to launch into the game. The length of time a game stays in the loading screen is completely arbitrary, but most designers seem to follow a pattern of making the duration proportional to the likelyhood of the player being killed in the next screen. This adds to the suspense as the player must reload his last save game and wait excitedly during the "loading" screen.

Share this post


Link to post
Share on other sites
Hi!

Like Manip said, you could use multi-threading, but I''d do it different (in fact, I know quite alot of games that do it this way, IL-2 Sturmovik, to name one). I''d go and define steps. For example, when the world is loaded, the loading is 30% done. You then interrupt the loading and update the loading screen to 30%. Then, when the next thing is loaded (for example, the vehicles), update the loading screen to 50%, and so on.

I''ve never done that, but as I said, this is the way I''d do it. Hope it helps!

cya,
Drag0n

-----------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning..." -- Rich Cook

Share this post


Link to post
Share on other sites
i doubt professional games do what doc says
loading is not instantaneous

instead of a loop you do this

// draw loading screen with 0% bar
// load a file
// redraw bar at 2%
// load a file
// redraw bar at 8%
// etc...

so if your using d3d you would end up calling IDirect3DDevice9::Clear and IDirect3DDevice9:resent after every time you load one, two, or more files to update the bar

you could even take the total number of files needed to load and calculate the percentage that way

Share this post


Link to post
Share on other sites
What Doc is saying is complete rubbish. As a programmer you should know it might take some time to load the maps, models, textures, script actions, etc.

These aren''t loaded into memory directly by opening the file or something. They require time to be opened, loaded into memory and then parsed into the correct memory format. Or do zip files unpack instantly and the progress bar is there because the programmer of the zip app likes to waste precious time on developing an progress dialog so it can waste the time of the user? Haha, funny man!

Back to thread:
Usually during the loading screen an extra thread is fired off which reads the files into memory and parses those. For each file it writes to nPercentage = nNewPercentage. As long as the boolean "Loading" is set to true, the load screen updates itself. When the value of loading is set to false, the thread kills itself and then the load screen jumps over into the menu/game.

Toolmaker



-Earth is 98% full. Please delete anybody you can.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What I''ve done is find the size of all the files at the beginning of the load and as each file is read in I update the bar by the appropriate percentage.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If any of you did take Doc''s post seriously, the joke''s on YOU! It was quite funny, actually.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You bank account is being hacked... they just put that screen up so you don''t get suspicious.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Doc
You''ve been duped. The only purpose of the "loading" screen is to give the player suspense - no loading is ever actually involved since loading is always instantaneous. All those screens are doing is updating the % bar with some sleeps in between inside a for loop. The really clever ones try to make you think its actually loading something by writing (which isn''t instantaneous) bits of random information to the hard drive, then deleting it just before they decide to launch into the game. The length of time a game stays in the loading screen is completely arbitrary, but most designers seem to follow a pattern of making the duration proportional to the likelyhood of the player being killed in the next screen. This adds to the suspense as the player must reload his last save game and wait excitedly during the "loading" screen.


This is True! RTCW ''accidently'' forgot to do the load time for the save games and the game loaded instantaneously!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!