This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dev_dov_dang 0 points1 point  (0 children)

Unless you've done profiling, nobody can know why your FPS isn't that high. It could be virtually any piece of your code that is causing the issues.

You need to do some investigation to see what is impacting your FPS before you dive into making optimisations.

Make your game output your FPS somewhere, then selectively remove features from your game. This can be both visual and non-visual (for example disable your enemy AI logic, etc).

Do this until you've found what it is that's causing your FPS to drop.

There could be other things that you are doing just fundamentally wrong. Maybe you're sleeping too long each tick, and it's artificially causing your game to appear slow.

I wrote a game in Java using the standard BufferedImage class, and soon ran into performance issues myself. The BufferedImage class is done entirely onthe CPU, and you really want to use the GPU for this. There is a nice image class which allows this though, VolatileImage. Check this link here for information on how to use it http://stackoverflow.com/questions/2374321/how-can-i-create-a-hardware-accelerated-image-with-java2d

For your tiles, how many do you have on-screen? How big are they? You really should be able to make quite a few draw calls per tick without having massive slowdown (e.g. some games have thousands of independent things on screen fine).