🔒 Locked
[java] applet fps
Advertisement
Original Post
The fastest i''m able to get an Applet''s paint(Graphics) method to be invoked (therefore the contents of the screen change, therefore the FPS) is 26 times a second. Is this slow for an applet? The paint method has nothing major in it to slow it down; it just increments the frame count and prints it. What is a reasonable FPS for an applet to try to achieve?
Thank you.
I find it is faster to not use the paint method, just overried paint(Graphics g) & update(Graphics g) with empty methods
and....
private Graphics gm;
public void init()
{
gm = this.getGraphics();
}
now you can draw from your main thread which is faster as paint will run concurrently to your main thread.
Hope that helps....
:-)
and....
private Graphics gm;
public void init()
{
gm = this.getGraphics();
}
now you can draw from your main thread which is faster as paint will run concurrently to your main thread.
Hope that helps....
:-)
Roughly! You gotta be kidding!
You can set frame rates much more accurately than that.
When I finally got round to finishing Nebuloids I had problems with governing it. Ran a bit fast on some PC''s and System.getCurrentMillis() is only good for 50ms grained samples.
All you have to do is have a seperate time thread that sleeps to the ms you want and increments a counter and you''re sorted!
You can set frame rates much more accurately than that.
When I finally got round to finishing Nebuloids I had problems with governing it. Ran a bit fast on some PC''s and System.getCurrentMillis() is only good for 50ms grained samples.
All you have to do is have a seperate time thread that sleeps to the ms you want and increments a counter and you''re sorted!
Perhaps, but I still can''t see the purpose in doing it, what happens if it runs on a machine that can''t manage 30 fps??? Or, if it runs on a machine that can manage twice that much then you''re not making full use of that machine. Don''t think people would be too happy if id programmed their games like that!
JJ.
www.javage.net
JJ.
www.javage.net
What I guess needs to be answered then is: How to set the actual "velocity" of the object in motion... a velocity that will be the same no matter the framerate. That way, any computer can run the game and get the same gameplay... if the framerate is 60fps or as low as 15; because the images would be moving at the same speed (pixels per second).
Frame rate vs Velocity is a good way to look at it (though I can''t be bothered coding it yet).
When you code something you always have to keep your optimal target frame rate / platform in mind.
For example my next games target plat is a celeron 500 at least 50fps. The dev tools I am coding are targeted at more high end PC''s as decient dev machines have to be grunty!
:-)
When you code something you always have to keep your optimal target frame rate / platform in mind.
For example my next games target plat is a celeron 500 at least 50fps. The dev tools I am coding are targeted at more high end PC''s as decient dev machines have to be grunty!
:-)
I''ve written an article for my (new) website at www.javage.net on how to achieve frame-rate independant movement, it''s got a simple example on how to get started.
Coincidentally I''ve also written an article covering 2D pixel-accurate collision detection, it''s not currently on my site as it''s waiting in the queue to feature here, should feature in 4/5 weeks from what I''ve been told.
JJ.
Coincidentally I''ve also written an article covering 2D pixel-accurate collision detection, it''s not currently on my site as it''s waiting in the queue to feature here, should feature in 4/5 weeks from what I''ve been told.
JJ.
I am using a special class that takes an int for ist fps. The class does its own adjustments for framrate synching. It seems to work very well and from the 400+ users that have tested my game they all seem to get the same performance. Which is the goal.
Jim, I have made a number of enhancements since your last visit there and I think you see that its much smoother.
-Soulice
Jim, I have made a number of enhancements since your last visit there and I think you see that its much smoother.
-Soulice
well i do. how many use dx5 nowadays for example? move on.
_______________________
http://mill.3dfxsweden.net
_______________________
http://mill.3dfxsweden.net
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement