@Esthlos: Freezing animations will not improve the framerate in a sprite based game like KaM. Animating is literally just using a different sprite than you did last time (so stepping the animation simply requires adding 1 to a number, the index of which sprite you are using). Either way, (freezing or stepping to next frame) you must still paint a sprite onto the screen (the entire screen must be redrawn for every frame, there's really no way around that). The only way to improve FPS like that is to skip painting something that you would normally have to paint. For example when you zoom out all of your units and houses could disappear, that would improve FPS. But it would also look really bad so we're not going to do that
You see, KaM Remake uses "ancient" version of OpenGL for compatibility purposes, but that also means it uses the most horrible, slowest way to render (I have checked the code for rendering terrain).
We support very old OpenGL drawing calls (glBegin) as well as slightly more modern techniques such as vertex buffer objects (VBOs). If your graphics card supports vertex buffer objects then terrain will be drawn that way, which IIRC gives ~20% FPS boost due to less API calls (take a look at the code again, the old OpenGL calls are only used if VBOs aren't supported). So no, we're not only using ancient OpenGL tech, but we need to keep supporting it because a significant number of people are playing KaM Remake on hardware which only supports old OpenGL versions (in the past we received lots of bug reports because we accidentally broke compatibility with OpenGL 1.5 which is ancient, but obviously still used). However, obviously in a sprite based game there's not much point using shaders or other modern tech, since we're just drawing sprites. Modern OpenGL features like shaders are not very useful in a game like KaM.
Since newer versions of OpenGL came with better and faster way to render stuff, those old methods that Remake uses got dropped from specifications and are supported by graphics cards only for the sake of compatibility. I would be surprised if someone would worry about its performance (and surprised that they are still supported anyway
).
I doubt GPU manufacturers will ever drop support for old OpenGL calls. Once something is in an API it's very hard to stop supporting it, since there's still old games that use it. It's also not hard for the driver to translate old OpenGL commands into modern commands (GPU hardware no longer contains a fixed function pipeline, it gets converted into unified pipeline instructions).
Yes, there are
"better and faster way to render stuff" if the 'stuff' is a complex 3D scene with fancy lighting/effects. But for simple sprites there's not much difference in using modern or old techniques. If you're drawing a lot of triangles then API call overhead can slow you down, hence we use VBOs for terrain (but as I said that only gave a modest FPS boost).
I made a simple test and with normal zoom, my GPU works at 24%, while with max. zoom out, only 17%, and framerate drops horribly, and I don't think that CPU has much to do which would slow it down so badly.
Firstly, we have a frametime cap of 16ms (62.5 FPS) so at normal zoom it's not at all surprising that your GPU is only getting 24% utilization. Your CPU is probably sleeping for 5ms between frames because it is achieving the desired framerate (or you have VSync on which limits it anyway). So saying that low GPU utilization means the game is inefficient is only relevant when you have VSync off and are getting significantly less than the framerate cap.
Secondly, there's an issue in r5503 where when you zoom out your FPS is lower than it should be because the CPU is Z-sorting sprites using an inefficient bubble sort. So in the next release (including r6157 beta) you'll find the FPS is slightly better when zoomed out. However, games which use 100% of your GPU cores are typically shader heavy (modern 3D games). KaM rendering does not involve heavy GPU loads because we're simply drawing sprites, not 3D scenes with complex shaders to calculate lighting, reflections, ambient brightness, etc. So if you have a modern GPU then rendering KaM will probably be CPU bound.
If we really cared about improving framerate and completely rewrote our entire renderer to use OpenGL 4 commands and shaders and minimize CPU to GPU communication, and so on, we might be able to squeeze a 20%-30% improvement in framerate. But then half of our users will be unable to play the game because their OpenGL 1.5 graphics card doesn't even support shaders, or only supports OpenGL 2.0, or something like that. And we certainly don't want to maintain 2 separate render engines just to give players with modern GPUs a slightly higher FPS. If you have a modern GPU then you probably have no FPS problems at all. I get a playable 29 FPS on a 256x256 map (Paradise Island) at maximum zoom out with the whole map visible (for terrain tiles alone that's 65536 tiles to be rendered, which is 131072 triangles which all need different texture offset/rotation), and that's on my laptop! So if anything we should be optimising rendering for the old hardware where FPS is a problem, which means we need to use old OpenGL tech anyway.
How many other RTS games with maps as big as KaM let you zoom out to see the entire map anyway? Most games limit zooming quite heavily so your FPS stays nice and stable. We could try something like that for multiplayer, or at least flash a message on their screen "warning: your FPS is low due to being zoomed out, please zoom in". But then that message will be on screenshots when people zoom out to take a screenshot, so I'm not sure that's a good idea either.