Simulasi Berkendara (Driving Simulation) – Need advise please (optimization)

Hi Guys,

I have already made a prototype game of driving simulator. And this is the video (the gameplay played on 1:30):



http://www.youtube.com/watch?v=tv5OijPnxJg



Short desc: Simulasi Berkendara 3D is 3D-based driving game simulation that aims to simulate driving a vehicle by obeying traffic regulations in Indonesia.

I have a problem with optimization. This game needs a high system requirements. I developed this game by using a laptop with specification of Intel Core I5-2430 2.4GHz, 4GB RAM, and GeForce GT540M 2GB. When i run it with 1366x768 fullscreen resolution, the FPS just only about 15-18. And when i run it using a computer with Core 2 duo 2.94GHz, RAM 2GB, GeForce 8400 specification, the FPS just 15-18 in small resolution (640x480).

Here is the optimization I have done:
1. I have put the whole city's buildings, the trees, the grass, etc in one node and I optimized it by GeometryBatchFactory.optimize.
2. I only apply the bullet physics in the cars, fence and the terrain. The fence i made is invisible and located on each side of the road so the cars can not pass through the buildings.
3. I made the lowpoly models. In making a building, the maximum vertices is 30 while the average of building in game is a box with 8 vertices.

The post effect filter i've used in the game are SSAO and DepthOfField.
So, what optimization that I can do more to increase the performance?

After reading the optimization tips on the JME documentation, it is said that the maximum vertice in a scene is 100.000. When I constructed the city in Blender, the amount of vertice is about 25.000 vertices. After I exported it to ogre, it is written in the log that there are about 65.000 vertices are exported. And after I put it to JME and run the game, it is show in statistic that there are 770.000 vertices. I don't know why the amount of vertice increased significantly.

I do really need advises from you all because my game is actually simple enough but it is high in system requirements.
I'll be very pleasure if you give me some suggestion, ideas, comments, etc to improve my game. 8)

Thank you :D

PS: Sorry for my poor poor poor english. It's hard to me to translate my own language. :cry:

If you have lights the scene is rendered once for each light, also increasing the rendered vertex count.

You defenetely should remove SSAO and bake AO with blender or other 3d software. See this:

http://hub.jmonkeyengine.org/groups/user-code-projects/forum/topic/lightmap-baker-for-blender/



SSAO kills your performance indeed.



And i’m not sure about DepthOfField too… how much is it expensive…



----

EDITED: as Normen said… use one directLight and one ambient light for entire scene.

You may actually be better off not batching quite so aggressively. If you broke the scene into slightly smaller chunks then those chunks could be culled more efficiently.



See if you can use smooth shading rather than flat shading - that drastically reduces the vertex count. (It explains the jump from 25k to 65k - the next jump to 770k though I’ve no idea!) If you look at maker’s tale though I seem to remember thetoucher saying that he had over a million vertices in those scenes and it runs fine on a range of hardware.



To be honest there isn’t a lot we can do based on the brief description. All I can suggest is doing some form of profiling and/or divide-and-conquer strategy to work out where you are losing framerate. Try turning on and off big features and see where the frame rate shoots up - then sub divide that big feature into smaller, repeating each time as you identify the thing that is causing the slow down.

That’s very nice work!!



For optimization :

  • Consider batching the buildings (see GeometryBatchFactory). It will batch all the buildings that have the same material.
  • One step further would be to make all the buildings have the same material with a texture atlas that would make batching more efficient.
  • Maybe you should batch them by block to allow efficient frustum culling.
  • batching the trees, and all other objects that have the same materials can be nice too. (by block too)
  • baking AO and shadows in a light map as @mifth suggested would work great in that kind of scene, this way only the car would have dynamic shadows and that would considerably reduce the shadow pass time.(unless your light source is moving but it seems not)
  • Consider making SSAO and DOF optional, so low config hardware users can deactivate it.



    The number of vertices does not really matters, what’s important is the object count, the lower it is the faster will be your game.