timer/hooktimer bug or user problem ?
Displaying 21-26 of 26 total.
prev 1 2
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
yhnmzwcs

That delay solution: it gets the number of times given loop processes. That is tricky as hell. I think what should be done is that whatever you were delaying with the while(timer<=100) condition should be a tiny function of a form like this:


hooktimer('so_many_centiseconds');
/* . . . later... . . . */
void so_many_seconds()
{
x+=4;
if(timer>=100)
{
/*do whatever you were waiting for.*/
unHookTimer('so_many_seconds');
}}

------
how do I add tabs to HTML?

Posted on 2005-08-04 14:27:28

Overkill

You add tabs in your post, by pasting them from a program that you can do tabs in. :D

Znigma: I'd actually recommend something along the lines of frame throttling, personally.


struct frame_type
{
int last, gap; // Used to modify the updates
int disp, num, rate, sec, speed, sum, total;
};

frame_type tframe;

void ResetThrottler()
{
tframe.last = 0;
tframe.gap = 0;
tframe.disp = 0;
tframe.num = 0;
tframe.rate = 0;
tframe.sec = 0;
tframe.speed = 0;
tframe.sum = 0;
tframe.total = 0;
}

void FrameThrottle()
{
tframe.speed++;
if (systemtime - tframe.sec > 99) // If a second has passed
{
// Update frame variables and reset counters
tframe.sec = systemtime;
tframe.disp = tframe.num;
tframe.num = 0;
tframe.rate = tframe.speed;
tframe.speed = 0;
tframe.total = tframe.sum;
tframe.sum = 0;

}
if (systemtime - tframe.last)
{
tframe.gap = systemtime - tframe.last;
tframe.last = systemtime;
// Updates the time modifiers
tframe.num++; // Counts number of updates per second
tframe.sum += tframe.gap; // Counts movement updates per second
}
else
{
tframe.gap = 0;
}
if (key[SCAN_Z])
{
PrintString(2,2,screen,0,'Framerate: '+str(tframe.rate));
PrintString(2,12,screen,0,'Framein: '+str(tframe.disp));
PrintString(2,22,screen,0,'Timer: '+str(tframe.sec));
}
}


Have FrameThrottle be hooked. And have tframe.gap to increment anything that needs to do so over time (like animation or turn gauge), where the 'gap' is in centiseconds since the last update. It works well for a lot of things, trust me.

I wouldn't recommend frame throttling for everything, but it gives pretty smooth results.

Posted on 2005-08-06 12:09:34

ExSea

thanks for the info... now i can c fps!! ^^
anyway i changed my nick to exsea, znigma was the nick i 1st used when i onlined around 97. most of my friends dont even know me by this nick.

:p

ive uploaded my game... somewhere in verge 3 games ... i removed the musicfiles, all of em. didn bother to change them to smaller files, to reduce the size.

planning on starting a new game from scratch again..
i practically started the game i uploaded from scratch..
800x600 damn i hate those death magenta glow due to anti aliasing >_<....

anyway... there u have it... not really planning on continuing it....

Posted on 2005-08-08 03:34:02

mcgrue

Interesting use of cel art in the battle system! Filfre to get me an avatar at your convenience.

Posted on 2005-08-08 08:39:23

ExSea

10x ^^
the cell pix were actually supposed to have a transparent background so i could use an image for the background. well thats what i intended to do but photoshop tends to blend stuff into the background layer... damn you magenta glow :p

Posted on 2005-08-08 09:22:49

mcgrue

Turn off anti-aliasing when you fill/flatten to get rid of the magenta glow. You may need to go over the outer edge to clean it up, though.

Posted on 2005-08-08 20:50:51


Displaying 21-26 of 26 total.
prev 1 2
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.