I need to improve my graphic engine (posted in Begginers forum too, sorry)

Started by
4 comments, last by nospiramos 20 years, 4 months ago
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!
Advertisement
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.
//------------------------------------------------------------------------------------------------------The great logician Bertrand Russell once claimed that he could prove anything if given that 1+1=1. So one day, some fool asked him, "Ok. Prove that you're the Pope." He thought for a while and proclaimed, "I am one. The Pope is one. Therefore, the Pope and I are one."
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...

[edited by - sBibi on December 14, 2003 4:58:05 AM]
VC++6 *Professional* and *Enterprise* include the profiler.

There is always the chance that a "newbie in game programming" doesnt have the money to throw at those tools....

VS.NET is worse yet....only Enterprise includes the new VS.NET Analyser.

die or be died...i think
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.

Chris
die or be died...i think
quote:Original post by Qatal
VC++6 *Professional* and *Enterprise* include the profiler.

There is always the chance that a "newbie in game programming" doesnt have the money to throw at those tools....


http://www.gnu.org/manual/gprof-2.9.1/html_mono/gprof.html

but gprof is free...

[size="1"]

This topic is closed to new replies.

Advertisement