Hello everyone,
Having encountered some problems to get high quality graphic rendering for my Java app (but the game isn’t over), I have explored many Java web resources, mainly posts in this forum. Here are the important points and advices I have grabbed, hoping they will be used, proofread or completed by you:
1- work with Java 1.5 (or wait for it for mac users!)
2- use a high resolution timer (such as System.nanoTime() in 1.5 or GAGETimer for windows)
3- prefer designing in one thread
4- use active rendering with a BufferStrategy (and setIgnoreRepaint(true))
5- “let the system breath” with a Thread.yield() in your game loop
For FPS concerns :
6- avoid the fillRect(), drawString() etc. methods of Graphics2D objects, drawing images is faster
7- create accelerated images with GraphicsConfiguration.createCompatibleImage()
8- avoid translucent images if possible
9- run in full screen mode
10- stabilize your FPS rate by sleeping the right amount of time between two loops
For sight concerns :
11- don’t stay close to your screen when you’re game is displaying dozens of ugly flickering sprites.
What I am still wondering are the effects of the JFrame/Canvas choice, the RenderingHints settings, the synchronized methods use (and other time expensive operations such as casting) on the FPS rate. And I am not sure of having set everything right as I run my game at 100 FPS (it’s enough I know) when other people here obtain more than 500 FPS…
Guillaume Smoothed Denis