Skip to main content
gamedev.net
🔒 Locked

Timing

Started by slyterence 2 replies 550+ views
Original Post
slyterence
slyterence
Hi, I''m writing a 2D arkanoid type game, and I''ve got most aspects working so far... I have correct collision between my ball and paddle, etc., but I''m having some timing issues... Can someone please tell me where I can find a really good timing tutorial as it relates to game programming, because at the moment I''ve adapted code from here at gamedev to achieve framerate-independent movement... but it complicates collisions, etc. (because I don''t know exactly where the ball is going to be next frame). Also, I''m not sure on how often I should be doing collision and other logic checks, because if I just check at 60 times per second (which I can do), but with a framerate of 500, the ball seems to collide (and change direction) quite long before it hits the paddle... I''m struggling to understand the importance of a tick (e.g my game runs at 60 ticks per second, but there''s nothing I can do that runs smoothly at 60 fps, all my logic and display routines are running at at least 140 fps on my machine, and over 100 on a friend''s). Are ticks still important for today''s games when games can run in the 100''s of fps? Also, with the framerate independent movement code, a slight change in framerate causes the ball to lag a little, and I''d like to fix that too while i''m at it Thanks in advance $£¥ We scratch our eternal itch A twentieth century bitch We are grateful for Our Iron Lung
We scratch our eternal itchA twentieth century bitchWe are grateful forOur Iron Lung
Deyja
Deyja
Ticks are important to keep it consistent. No matter how fast it RENDERS, the physics should always be running at the same rate. Otherwise, they introduce different rounding errors and accuracy problems as the framerate fluctuates. It may still have errors, but atleast it will always have the SAME errors.
Tai-Pan
Tai-Pan
I was going to buy the same exactly thing. Ive been using other people´s code in my projects to do all the timing stuff.
I want to learn how this works, and I have spend lots of time with others people code trying to guess how this stuff works, but I cant seem to understand the topic.
I havent found any tutorial about this on this site, can anyone help us?
Thanks

"Those who follow the path of the warrior must be ready to die, to stand for their convictions, live for one´s convictions, die for one´s convictions"
Tai-Pan
Tai-Pan
please people. Ive been looking but I havent found anything, if anyone knows something(some site, tutorial) let me know.
"Those who follow the path of the warrior must be ready to die, to stand for their convictions, live for one´s convictions, die for one´s convictions"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.