Timer minimum length

Questions, comments and discussion about the Game Editor development.

Timer minimum length

Postby lcl » Wed Dec 31, 2014 3:25 pm

Hi!

Is there any specific reason why the minimum timer length is limited to 12 milliseconds?

I'm trying to write a system that would allow making games run with the highest possible frame rate the computer can reach, up to the built-in Game Editor fps limit of 512. For this to be useful, all movement and other changing values have to be balanced to the real_fps, so that all actors movements and all variables that change over time would happen at approximately the same speed regardless of if the real_fps is 30, 152, 12, ..., anything.

So far I have it working for variables that change in a linear manner over time, like basic x += 5 movement. The problems begin when the type of movement isn't linear, like in case for velocity.
When using yvelocity ++ in draw actor, simply balancing it so that instead of adding 1 it always adds (1 * the fps rate for which to balance to, for example, the basic 30) / real_fps doesn't work correctly, since the actor's position still gets updated every frame and despite balancing the amount of yvelocity increasing per second so that the velocity changes in 1 second the same amount with every fps, the amount of times the velocity updates the actor's position is not balanced to the real_fps and thus the actor will move more with higher fps and less with lower fps.

So, I started thinking I'd get around this problem by making a system that utilizes timers for when the yvelocity should get updated, and only update it n times per second, n being the fps rate for which to balance to, for example, the basic 30, again. This would work, but that's where the minimum timer length of 12 milliseconds starts making things difficult. Let's say we're balancing the velocity to fps 30, and that our current real_fps is the maximum, 512, now, for getting the yvelocity to update only 30 times per second, the timer length should be real_fps/balanceFpsTo = 512/30 = ca. 17. All good. But if the real_fps goes to a lower value, let's say 120 (which still is a lot higher than the worst case if the game really lacks, and also a lot higher than even the basic cases, it's rare for a Game Editor game to run over 100 fps), the math would become 120/30 = 4, and because of the limit, a timer that short can't be made.

Well, most of that was not important for the question, I just explained why I'd find shorter timers useful. I'm interested in why the limit 12 was chosen in the first place.
What comes to my fps balancing system, I guess I'll have to try to find some other way around the problem, or then just to limit it to only be used in games where all movement to be balanced is linear.

Thanks for taking the time to read.
SABRE (semi-3D engine) official development topic: viewtopic.php?f=6&t=12644
A game project that utilizes SABRE: viewtopic.php?f=4&t=13297
User avatar
lcl
 
Posts: 2239
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 265 Give a positive score

Re: Timer minimum length

Postby Indess » Fri Aug 21, 2015 6:14 am

I have read the whole post but still i could not understand what you are trying to ask from the members here?
Indess
 
Posts: 1
Joined: Sat Aug 08, 2015 9:44 am
Score: 0 Give a positive score

Re: Timer minimum length

Postby knucklecrunchgames » Fri Aug 21, 2015 7:49 am

Indess wrote:I have read the whole post but still i could not understand what you are trying to ask from the members here?


Some advanced code that I'm sure only the creator knows the answer to.

P.s, welcome to the forums.
User avatar
knucklecrunchgames
 
Posts: 1124
Joined: Wed Nov 21, 2012 8:01 pm
Location: In gameEditor.exe
Score: 17 Give a positive score

Re: Timer minimum length

Postby hindax » Wed Jun 14, 2017 8:52 pm

Yes, this post was really illegible. What did you want to ask about the game editor?
I want to be a game developer so I need a lot of information about this. i think that this site will help me to find the answers
hindax
 
Posts: 1
Joined: Wed Jun 14, 2017 4:45 am
Score: 0 Give a positive score

Re: Timer minimum length

Postby lcl » Thu Jun 15, 2017 9:54 am

hindax wrote:Yes, this post was really illegible. What did you want to ask about the game editor?

Hello, and welcome to the Game Editor forum.

This is a very old topic in which I tried to ask the creator of the program why Game Editor's minimum allowed length for a timer is 12 milliseconds, as I was programming something I thought would be solved by shorter timers. But, as this is a years old topic, I think you'd figured out that the relevance of any of this is nearing 0 by now. :P
SABRE (semi-3D engine) official development topic: viewtopic.php?f=6&t=12644
A game project that utilizes SABRE: viewtopic.php?f=4&t=13297
User avatar
lcl
 
Posts: 2239
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 265 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest