Recommended Posts

Hi, i am a newbie in game programming and i made a strategic game that uses SDL libs. My problem is that i get a low frame rate and i am not sure about what can i do to improve it.
I have thought that maybe threading is a good choice (now, all the game runs in a single thread, running first the game engine and then drawing the images on the screen). I am not sure about what can happend if i run my game engine and the drawing functions into two different threads. Could it help some?? Because i need to increase fps about 50% (at least)
What do u think about that??? i am wrong??? what else can i do???
Thank u all!

0

Share this post

Link to post

Share on other sites

You could minimize what you draw to the screen. If you''re drawing a terrain, look up some algorithms like ROAM, Chunked lod, and lod in general. Check out www.vterrain.org. If you''re drawing something else, you can still find ways to shorten the number of triangles you draw to the screen.

0

Share this post

Link to post

Share on other sites

profile, don't try to optimize like a blind man, the only thing you'll achieve is to waste your time, unless you really know what you're doing...VC++6 has a built-in profiler (not sure about .net)you could start with that and once you've located the matjor bottlenecks, try to see what you can do to improve their algorithm. multithreading isn't a solution, your problem must be somewhere else...

Share this post

Link to post

Share on other sites

assuming that your game is aimed at single-processor machines, you actually wont gain anything from multithreading, except having to synchronize accesses to shared vars (which will actually slow your code down).

my advice...find ways to bail out of complex funcs early based on cheap tests,

also look at the number of texture changes you''re pulling per frame,...can it be improved by batching together primitives that use the same textures, etc....

i assume that you''re using ogl if you''re using SDL for everything else, so, you might want to look at display lists, (if not already), and minimizing state changes.