Archived

This topic is now archived and is closed to further replies.

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

This topic is 5109 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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!

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.

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...

[edited by - sBibi on December 14, 2003 4:58:05 AM]

Share this post


Link to post
Share on other sites
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.

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.

Chris

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites