I'm currently stuck, cause my pinball game does not perform well. Frames seem to stutter, although the profiler shows about 90 FPS. The problem gets worse if I start the game as standalone (fullscreen, dual monitor setup with horizontal span => 2560 x 1024).
The scene is quite simple. According to stats window, there are 200k triangles, 131k vertices and 340 Draw Calls.
Because of high velocities, I won't like to decrease fixedDelta time (which is 0.02). I use physics for controlling flippers, the "start catapult" and for pinball-collisions.
When I disabled most of the mesh renderers, the performance was slightly better, but still stuttering.
What I did so far to enhance performance:
- use #pragma strict to force static typing (no dynamic type inference)
- Call Find and GetComponent functions only in Awake(), never per frame.
- Removed Rect object creation from OnGUI function
I'm afraid I started to enhance at the low level before really knowing where the performance drop comes from... Any ideas how to track the issue?
I'd like to use the profiler, but it drops performance even more. According to profiler, most of the time is spent in Camera.Render (in editor mode on one monitor) although the scene is quite simple, and in Physics.Simulate. I don't use any fancy Quality Settings (they are set to "Good.").
Can we trust the profiler or is it more reasonable to test timing from within my scripts only? One thing I noticed is, that whenever I hit a certain key in standalone fullscreen mode (for launching the pinball out of the "start catapult"), performance drop is worst, although barely noticeable in editor mode - according to profiler, Scripts aren't a real issue...
The machine I run the game on: Win XP, Core2Duo 2.0GHz, 2 GB RAM, GeForce 8600 GT 512MB.