File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Game Development and the fly likes frame rate slowly increases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "frame rate slowly increases" Watch "frame rate slowly increases" New topic

frame rate slowly increases

Daniel Gen Li
Ranch Hand

Joined: Jan 02, 2010
Posts: 32
I'm making a game, and I have a GamePanel class that controls the updating for the game and the screen. The method is written so that the game update rate would be kept at a constant rate, and the frame rate follows the update rate as a cap. The problem I'm having is that when the game starts, the FPS is at around 40, and the "game" updating is at 60 (and it's has been always at 60). The frame rate would slowly increase, and after about 15 seconds, it would rise to about 58FPS. Why does this happen? I'm sure it's not that My computer can't handle 60FPS... I tried changing the target UPS (which is the general Updates per second) to a hundred and the frame rate started at 80FPS, and then slowly increase to 99FPS. Why does this happen? How can I let it boost to 60FPS faster? Are all games like this? (because some games I look at do in fact start at a lower FPS, but they boost up to a higher rate much much faster).

If it helps, here's the code for the run method which does all the updating controls

David Muhar

Joined: Apr 05, 2009
Posts: 6
Here is a great little tut, about timing using java.
I recommend using the example class
I agree. Here's the link:
subject: frame rate slowly increases
It's not a secret anymore!