Hi guys,
Is there a way to make a loading progress bar (with % or without, whatever easier to make) using MMF2 ?
Is there a way to make the progress bar appear as soon as the application run, to let it load ALL the content (AVI files or MP3 files) and show a progress bar as soon as the application/game run ?
Can somebody please put a file so I can see how it's done please ?
I personally put a single frame between each large chunk of loading in my game; I have a loop that needs to run about 16000 time to generate a random level, so I just have the control for generating each level on a counter incrementing due to an "always" event, rather then being inside yet another loop. That way it has to run the read/draw routine inbetween every single level thats generated; I simply put a counter object thats updated with an "always" even outside of everything else on the bottom of the screen to represent the progress.
The main thing you have to realize is; if you are using loops to load your data, MMF will not draw a frame until ALL the loops in the queue are finished. So you absolutely cannot draw a progress counter if all your progress is done inside a single frame. You need to spread it out a little. Mind, this can artificially increase the loading time, albeit at 1/50 a second per update on the bar.
Or in other words, just figure out what parts take your program the longest to load, and seperate them with 1 frame each, updating the counter inbetween.
Actually, MMF2 tends to load things fast enough that you won't even notice the bar. Even if it doesn't, some people would think you're just faking the bar. So.. I'd suggest you get a loading screen instead, no bar. It'll look nicer.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
I wouldn't be so sure of that; running entirely inside of loops, with no artificial slowdowns from counters or anything, my current project can take about 60 seconds to generate a new game file, if it renders every single level. But thats mostly because of how horribly inefficient .INI files are; especially when you are writing in excess of 1600 numbers into it at a time.
I found that before I added the progress bar, alot of people though it had simply frozen up when they started the game.
Thank you guys for your kind replys.
I have one frame for example with pretty big .AVI (codec Xvid compressed but still takes time to load) and I wonder how I can make ALL the application load at start, like if it can load all and show the progress.
Can somebody please put an example code so I can check it out ?
I will check out the message ASAP, Thanks ahead guys
use some other object instead of ini's. i use 1000 global values or 1000 global strings. i donno if they are available for mmf2 but they have the ability to create exes for storage and loading of data. so its definitely faster. ive tried saving/loading with the binary(exe) and the ini. theres a hell lot of a difference between the time they take.
Unfortunately, the way I need to tie strings, values, and command interfaces together really only works in an .INI format easily, since everything else would need to be stored in arbitrary values that I'd need to retrieve from an index, which makes it a right pain in the butt to use. Basically, an INI of mine might looks like:
Yah, all computer programs access an READ/EVALUATE/PRINT loop.
In TGF, it first READS through every single line in your event editor, feeding into into the EVALUATOR, which goes from top to bottom. When it reads a "Loop" event, it simply keeps feeding that same event into the EVALUATOR for that many repetitions. Then, when it finally reaches the very BOTTOM of your event list, it PRINTS, as in drawing the actual graphics on the frame.
What you want is a graphical effect representing the progress. This means that if all the calculations take place in a single frame, that single frame will simply take a very long time to evaluate, and will only draw a single progress bar (at 100%).
So you need to seperate your code by arbitrarily adding in points where it will wait for 1 frame and set a counter to the % value that you want. This can be most easily done by seperating the events into groups, and having them deactivated to start with, and and ALWAYS event at the top first adds to some value, then opens group #value.
Just show 'em a pretty picture.. an alternate title screen or something.. that says "please wait" while the game loads up. If it's making a game world / level from scratch, just put "please wait while the awesomeness loads!" instead. That's what I do, but it's hardly necessary my with non-VB projects. (Might be fun to do anyway one day haha).
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
17th October, 2007 at 14:31:18 -
Originally Posted by kayoto Thank you guys for your kind replys.
I have one frame for example with pretty big .AVI (codec Xvid compressed but still takes time to load) and I wonder how I can make ALL the application load at start, like if it can load all and show the progress.
Can somebody please put an example code so I can check it out ?
I will check out the message ASAP, Thanks ahead guys
You do NOT want the entire application to load in memory at the start of your game. The game will take up a massive amount of system memory if it does, especially when you want to load all movies at the start.
You do not want this anyway because MMF2 streams the files (load-as-you-play) rather than that loads it all into memory. It's the best speed/efficiency solution, anyway.