PDA

View Full Version : Need for speed!



zetwal
09-15-2002, 04:36 AM
Hi

I'm designing a sort of football game (soccer). I have a field, 22 players and a ball moving around. The problem is that the game is too slow, the ball moves too slowly. Can anyone suggest some ways to speed up the game.

P.S. I've noticed that when the players r rendered outside the field, the ball moves faster. Is there a reason for that?

Thanks

jwatte
09-15-2002, 07:09 AM
Here's where you turn on the profiler that came with your development environment, and figure out what part of your program is slow, and start optimizing that part. You could start making sure that you're in hardware accelerated rendering (glGetString(GL_VENDOR) shouldn't return anything comtaining "Microsoft").

Repeat until satisfied.

A profiler that costs extra, but is very good, is Intel's VTune. There's a free 30-day demo downloadable from their site. However, it won't give you hierarchical info ("this is slow because it calls that a lot") so it requires some analysis skill to be effective.

If you're on an AMD chip, AMD has a very similar tool called CodeAnalyst available for free download.

V-man
09-15-2002, 01:57 PM
For optimizing your graphics, your gone need to use tricks to cull out nonvisible objects.

Frustum culling, spatial technics (BSP, quadtree, octree), reducing GL state changes, using special extensions, being careful so that you dont run into software mode, ...

the list goes on.

V-man

Robbo
09-16-2002, 02:20 AM
Well I think in this scenario frustum culling won't help too much - if this is the bottleneck - he'll get an uneven framerate (striker 1v1 with keeper will be really quick - all 10 behind the ball will be really slow).

knackered
09-16-2002, 03:28 AM
how many polys are in your players?!

V-man
09-16-2002, 08:07 AM
Originally posted by Robbo:

Well I think in this scenario frustum culling won't help too much - if this is the bottleneck - he'll get an uneven framerate (striker 1v1 with keeper will be really quick - all 10 behind the ball will be really slow).



Uneven frame number? That's normal in many games. What would you do if in some cases your FPS goes down to 20FPS with all the optimization turned on?


V-man

zetwal
09-18-2002, 01:09 AM
The players have many polygons. They have been drawn in milkshape.

I think that for a start, I'll try not to render what is not visible on the screen. If that fails, then I'll use octrees.

Fredz
09-18-2002, 01:37 AM
I suppose the bottleneck comes from displaying the players, since there are 22 of them and they use many polygons as you said. I think that most of the time, at least half of the players will be visible, so the most obvious optimization IMHO would be to use LOD for players. An easy way to do that would be to store say 3 level of details of your players and then choose which model to display depending on its distance to eyepoint.

MrShoe
09-18-2002, 01:56 AM
dude, octrees arent gonna really speed things up on a flat pitch... unless your using a terrain engine, which i doubt you are for a soccer game, octrees arent really gonna help alot and are just going to slow down the CPU. Use things like CVA's, display lists, and whatnot.

Fredz
09-18-2002, 03:35 PM
If he is trying to render realistic stadiums, I think octrees will help a lot. They are static, can be really huge, and you see only a small part of them in typical soccer games.

The players, ball and referees can be rendered with simple sphere or box culling since there are not many of them (less than 30 models).

And as I said before, I think LOD for models will help.

zetwal
09-19-2002, 02:47 AM
What is "LOD"?

Fredz
09-19-2002, 10:50 AM
LOD == Level Of Detail

knackered
09-19-2002, 10:55 AM
Level Of Detail == progressively using less polygons/shader tricks/smaller textures the further away (or smaller, or less important) an object is.