Im runing a scene with 51K vertecies and out of that 3 characters ( enemies ) with 2k vertacies each , It runs on about 10 fps on my q6600 gtx480 8gb ram . and this only the begining of first level of teh game, not even a half of it, the enemies shot their fireballs it runs on about 3-5 fps .
I cant realy make a good graphic game like that, i realy rather not to move to unity for the game making, is there any solution for this ?
Check for any sensors triggering too often.
Check if you really need that much vertices for a simple level like that. You haven’t added that much poly detail to the level compared to the original and you have ~51 000 where the original probably had under 200.
Post a wireframe image and a screenshot displaying the framerate so we can see what is kiling it.
You also mentioned somewhere you are using lots of spotlight, maybe too much.
Rather than just taking guesses, use the framerate and profiler to see where the weak parts of the game are (logic, rasterizer, animations, etc). If the Rasterizer is where most of the FPS is being lost, try joining pieces of your map together. If your game is a ‘corridor’ game, then you could just get the rooms that are on-screen / you’re in and render them (either with Python, or using an Occluder). By default, the BGE renders everything that’s on-screen, which is a waste if you can’t see most of it.
It looks like you’ve got a LOT of lights with shadows in that scene. Cut down on the number of lights, and try to have only one or two shadow lights. You can make an overhead directional light set to “shadow only”, if you wish(and parent it to your player, so it will follow them around). Also, watch your batch count. Each object in the Game Engine is a batch, and each material used within that object is another batch. Keep it down low, if possible. The fireballs are affecting your performance a lot? How are your fireballs set up? If they involve several lights, or too many particle objects, that might be a problem. Also, check the framerate and profiler to see wheat’s taking the most time. I would guess it’s the rasterizer, but it could be logic or animation. If animation is the bottleneck, try simplifying your rigs by reducing the number of bones and keyframes.
First off, as SolarLune said, you need to profile your game. It’s useless (and quite the waste of time) to just sit and guess all day. If you want to know more about what the various profile stats mean, take a look at this.
This isn’t accurate. By default, the BGE makes use of view frustum culling. So any objects outside of the view frustum (the camera bounds) are not drawn. However, if you have one single object for most of your level terrain, the whole thing will always be drawn since some part of the object is always in the view frustum. This means it helps to break up really large objects.
Now, as a guess to your performance issues, I’m going to guess that you’re spending a lot of time in physics. Near and Radar sensors are not that cheap, and you’ve got five per enemy.
Maybe I’m mistaken, but I think I said just what you said (but not as detailed) - that whatever has a bounding box that’s on-screen (and so can be seen by the camera) will be rendered…? If the object is off-screen, then the BGE will make use of frustum culling, yes. And yeah, if you have one single object for your gigantic terrain, it will be rendered, but not unless some part of it (or it’s bounding box) is on-screen…? Again, maybe I’m mistaken.
EDIT: Bah, never mind.
@Sahkan - Follow Moguri’s link to learn more about the profiler - it’s really important to game development.
You’re right except you keep stating that if something is on screen it won’t render. Basically, frustrum culling (As I suspect you’re aware, but I’ll restate anyway) checks the objects AABB from Bullet against the camera frustum. If it is not inside or intersecting with the frustum it culls is.
Guys… so much talk around the same.
Anyway, thanks for the help… best way to get more fps is to have the map/ground/levelmap in separated meshes anytime we think apropriate.
(and i was thinking in using python to put objs near the player and remove them as the player goes into a certain distance - some kind of weak LOD…)
Near and radar sensors are the biggest FPS killers I’ve ever seen. Two or three of them on my PC drops the frame-rate by 5-10FPS.
Lights is the other biggy.
Finally there is poor script design.
Are your scripts running when they don’t need to be?
My AI scripts scale based on how far from the player they are. If you are close, they run 10-20 times per second. If you are far it is 2 or 3. I do this by adjusting the frequency of an Always sensor.
Decimate ! anything high poly is a scene killer,
break everything into pieces,
look into LOD
Large objects = hard to lod
small chunks can be ->(far far away)=0 faces model “dummy” (closer-medium) zoom in/very close (high poly)
a building made with “I-beams” and “wall face sections” is easy to design to be destructible, as well as LOD etc