RESEARCH ABOUT OPTIMIZATION
MY CURRENT PC SPECS.
Processor Intel(R) Core(TM) i7-7800X CPU @ 3.50GHz
Video Card NVIDIA GeForce GTX 1080
Operating System Windows 10
RAM 32 GB
HIERARCHY AND PROJECT CLEANUP
START OF IT ALL, CLEANING HIERARCHY!
After doing my research on the different methods and making my design document and plans to make it run smoother - I knew I had a big task ahead of me.. The hierarchy and my asset files! I usually clean up my hierarchy here and there, but while working on the last bits of a project I tend to get a bit sloppy and don't care as much. But after making everything nice and giving everything a name and putting things where they belong, I was onto my next task - the useless assets!
THEN.. ASSETS!
By doing my research on how to downsize the document I realized that it mainly had to do with the amount of unused assets that were in the unity asset folder. I spent quite some time purging my files, and sorting everything in the correct folder as shown down below - going from an overall size of 10GB document size to 3GB document size. I especially focused on the unused materials, models and shaders.
TESTING PHASE, WHAT CAN BE BETTER?
ISSUES WITH FPS
Considering this game was made with a tight deadline, and after making all the models myself - out of speed and time constraints I didn't optimize every model used in the scene, and this shows in the fps and the tris that are shown on screen. First, let's do a test and quickly walk through the scene and asses the damage - the insane amount of tris being rendered...
FPS: 54.5
TRIS: 17.9M
FPS: 54.5
TRIS: 17.9M
FPS: 53.4
TRIS: 17.3M
FPS: 91.2
TRIS: 4.9M
FPS: 77.4
TRIS: 11.5M
NOW, LIGHT BAKING!
LIGHT BAKING, SETTING ALL LIGHTS TO BAKED!
After doing research on the first simpler step to better optimization I researched some better lighting settings for my game, and downsized the quality and made sure to bake the lighting - and setting all the lights in my scene to static instead of dynamic lighting!
the results of light baking!
LIGHTS ARE BAKED, OFF TO DETAIL!
Considering I'm using the Unity terrain and also terrain details (grass, bushes) but never minded the detail distance (which was the main kicker of the fps... the moving grass - pretty, but tanked my fps by a lot) and did my research on how to properly load grass in in a detail mesh but keeping sure that my fps isn't tanking, I did this by drastically lowering the detail distance so the player only renders the grass they're looking at.
OCCLUSION CULLING
CULL CUL CULL!
One of the main things I really wanted to try was occlusion culling. I did this by doing research on how to get started with this first. I did this by looking at videos and at the Unity website their own explanation on how to add this into my game. Considering I'm an artist and have some technical skill this had always seemed very scary to me - but was actually really fun to do, and to see the result - which greatly improved my final fps and tri count.
MESH COMBINING
MESH COMBINING AND PREFAB CLEANING!
Considering most of the city in the game is made up by a kitbash of my own models I created for the game - that left messy frankenstein like prefabs in my project. After discussing the module with my developer friend, he recommended me the asset called mesh combining! It takes all the loose pieces and creates a single mesh from all the loose objects.
CAMERA RENDERING
YOU WONT EVEN SEE IT COMING!
One of the things I also changed was the rendering distance of the camera. It used to be 1000, and I lowered it to 200 so less objects are rendered at the same time lowering the tri count.
FINAL RESULT / CONCLUSION
FINAL BITS AND PIECES!
After piecing everything together I'm very happy with the result of both the FPS count being drastically higher, and the tri count being over 15M less in some spots. I think this is a lesson to be learned when working on my own game in the future, that I shouldn't have so many dynamic lights in my scene, and work neatly. I'm very proud of my result!
FPS: 124.1
TRIS: 3.5M
FPS: 157.7
TRIS: 350K
FPS: 147.9
TRIS: 703.0K