- Online Community Forums » Programming Questions » Correct Loading Display

This thread is locked; no one can reply to it. rss feed Print
Correct Loading Display
Ceagon Xylas
Member #5,495
February 2005

Okay, here's something I still haven't mastered in gaming which is pretty important: Loading screen percentages.
Lets say I have

class npc{
  int x,y,type;
  float velX,velY;

Should have to load 560,000bytes to the memory... Which may take a long while on older computers. Well, what should I do to display how far along the loading is?

Member #6,862
February 2006

Actually, the code segment you posted shouldn't take a noticable about of time to "run" on any age machine that has enough memory... all you're doing is declaring/allocating space in memory. Even if it's initialized to zero, it won't take too long to execute...

If you're refering to some routine you have that actually performs calculations and loads data into that memory location for disk, or something, then you'll have to give a little more of an example... ;)

[url]OpenLayer[/url is an OpenGL accelerated 2D library for fast and easy graphics development under Allegro

Ceagon Xylas
Member #5,495
February 2005

Hmm... Alright =]
So then, if I were, say loading alot of bitmaps... just use

BITMAP *frame1,frame2,frame3,frame4;
int percent;

void update_screen(); //draw int precent to the screen

void load() {
  percent+=25; update_screen();
  percent+=25; update_screen();
  percent+=25; update_screen();
  percent+=25; update_screen();


Kitty Cat
Member #2,815
October 2002

As long as they were of mostly similar size, and take about the same amount of time to load. If there's something more annoying than a loading screen, it's a loading screen who's load bar jumps wildly (eg. takes 30 seconds to load 30%, then 10 seconds to load up to 70, then 45 seconds to load the rest). Best to use a looping animation if you can't gaurantee proper percentage timing.

"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Go to: