Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / how to make preloading

Author
Message
Taoie
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 26th Apr 2008 08:12
while loading something like map or model or sprite.
it will stop and load, but..
how to make preloading that show percent of loading all data

sample

LOADING ..43%
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 26th Apr 2008 18:10
this is a very interesting question...

i think you can only update the LOADING % after you load 1 file.

So if you need to load 10 files at the very start you can call you loading % routine after each file is loaded.

don't think it's possible to have a loading % updated whilst a file itself is loading.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 26th Apr 2008 19:02
You might be able to with some file formats, but there isn't any kind of "CALLBACK" built in to the DarkGDK native loading functions... so... like you said bjadams, if you have a big map stored in a DBO for example... you have to wait until it finishes.

Personally, I think the most accurate you could do would be to do more than just a percentage based on the number of files you intend to load, but instead ADD UP the FILE SIZES of each file... ahead of time or whatever... then as you load each file, you can advance the progress bar more accuately by adjusting the "Work Left" not in a file count, but in filesize like: You have loaded this much out of that much total bytes. And calculate your progress bar accordingly.

SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 27th Apr 2008 01:02
That's the best way, though I prefer to have an ambiguous screen that says nothing but 'loading.' It adds to the mystery and suspense of a game! How long until one can play? You never can be sure.

My site, for various stuff that I make.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 27th Apr 2008 01:42
I think pros of a progress bar outweigh the cons SunDawg... I think rather than having your butts bored off by watching a loading screen for an hour you can get one riled by with a progress bar and teasing messages like "Your time has come... almost...... precisely in nine seconds to be exact..." or have a pic or a video play during load... something like that...

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 27th Apr 2008 22:42
I actually LIKE BOTH of your points of view.

I do have a issue though with games that don't do the following (and for now on any games I make will do this) WHEN THE GAME FINISHES LOADING? PAUSE!!! So the player can just leisurely walk away during the load... get coffee, hit bathroom, and come back ready to play VERSUS dead or in last position in a race or something!

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 27th Apr 2008 22:47
That is an excellent idea jason... I should do that too... Except for I'm having trouble with the pause part... With dbWaitKey, if ANYTHING is pressed it comes out of pause... I want it so only the PAUSE button unpauses it...

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 27th Apr 2008 22:52
Make an image that says PAUSED on it, and make a sprite in the center of screen with that image after the game loads.. Call dbSync() twice to be sure its visible... then



Might need to add #include <windows.h> I think to get sleep to work.. sleep just allows your computer to work happily while waiting for you to return... more or less "Voluntarily Shares the CPU" until you're ready to play.

Key Press Codes? In here somewhere

jgc_common.h


Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 27th Apr 2008 23:03
How about a pause key? Like I press P to pause and then U to unpause or something like that... I tried to make an ingame pause but no luck...

~~It's not who you are underneath, but what you do that defines you.~~

Login to post a reply

Server time is: 2024-11-20 09:28:09
Your offset time is: 2024-11-20 09:28:09