The Daily Click ::. Forums ::. Klik Coding Help ::. Loading Progress - How to make it ?
 

Post Reply  Post Oekaki 
 

Posted By Message

kayoto



Registered
  29/08/2007
Points
  16
3rd October, 2007 at 21:13:50 -

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 ?


Thanks ahead !!!


 
www.krazykartoons.com
Because we're Krazy about Kartoons!

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
3rd October, 2007 at 22:57:11 -

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.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
3rd October, 2007 at 22:58:16 -

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.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
4th October, 2007 at 00:55:40 -

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.

Image

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
4th October, 2007 at 01:30:48 -

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.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

kayoto



Registered
  29/08/2007
Points
  16
4th October, 2007 at 02:12:30 -

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

 
www.krazykartoons.com
Because we're Krazy about Kartoons!

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
15th October, 2007 at 20:04:02 -

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.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
15th October, 2007 at 20:09:20 -

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:


[Index]
Number=11
Total=32
1=Data
2=NPCText
3=Town
4=Westfield
5=Rune Cave
6=Cellar 1
7=Cellar 2
8=Southfield
9=Oceanside
10=Graveyard
(...)

[Level1]
Name="Cave"
Back Tile=13
Path Tile=3
Path Actions=125
Path Action Length=5
Node Offset=10
Node Actions=10
Node Action Length=2
Chests=4
Monster1=10
Monster2=11
Monster3=14
NMonster1=10
NMonster2=8
NMonster3=6
Music=3
Treasure=5
Base Path Length=1
Base Node Length=1
Lights="Off"
Entrance="Town"
Exit="River of Blood 1"

[Level2]
Name="River of Blood 1"
Back Tile=11
Path Tile=3
Path Actions=100
Path Action Length=5
Node Offset=20
Node Actions=5
Node Action Length=4
Chests=6
Monster1=3
Monster2=4
Monster3=13
NMonster1=15
NMonster2=10
NMonster3=6
Music=4
Treasure=6
Base Path Length=1
Base Node Length=1
Entrance="Cave"
Exit="River of Blood 2"

[Level3]
Name="River of Blood 2"
Back Tile=11
Path Tile=3
Path Actions=100
Path Action Length=7
Node Offset=20
Node Actions=5
Node Action Length=6
Chests=6
Monster1=3
Monster2=4
Monster3=13
Monster4=7
Monster5=15
NMonster1=8
NMonster2=12
NMonster3=6
NMonster4=3
NMonster5=6
Music=4
Treasure=7
Base Path Length=1
Base Node Length=1
Entrance="River of Blood 1"
Exit="Moldorm's Lair"
[Level4]
Name=Haunted Woods
Back Tile=10
Path Tile=1
Path Actions=60
Path Action Length=5
Node Offset=20
Node Actions=5
Node Action Length=2
Chests=0
Treasure=1
Music=7
Base Path Length=1
Base Node Length=1
Entrance=Graveyard
Exit=Forest Hollow
Monster1=1
NMonster1=4
Monster2=82
NMonster2=2
Monster3=88
NMonster3=3
[Level5]
Name=Forest Hollow
Back Tile=10
Path Tile=1
Path Actions=150
Path Action Length=5
Node Offset=10
Node Actions=10
Node Action Length=3
Chests=4
Treasure=3
Music=7
Base Path Length=1
Base Node Length=1
Entrance=Haunted Woods
Exit=Royal Woods
Monster1=88
NMonster1=12
Monster2=120
NMonster2=7
Monster3=87
NMonster3=8



for example. And really, the only TGF extension that lets me write something as easy to read as that is .INI :/

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
15th October, 2007 at 23:12:19 -

Simple way to do it without a % is to make a counter starting at 0 and ending at how manyloops you run. Just add 1 to the counter on each loop.

 
Craps, I'm an old man!

Deleted User
16th October, 2007 at 00:19:21 -

Still, that'll go from 0 to x amount of loops in 1 frame. No numbers inbetween.

 

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
16th October, 2007 at 00:41:09 -

Besides, if it's an AVI he's using, there isn't any way to preload as far as I know.

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
16th October, 2007 at 18:49:35 -

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.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
17th October, 2007 at 10:17:52 -

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

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
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.

 
Old member (~2004-2007).
   

Post Reply



 



Advertisement

Worth A Click