Wednesday 3 June 2015

Kingdom Progress 2


Since my last progress post, my class at Central had a small playtest for other students to test out and give feedback on our developing games. The feedback for Kingdom was mostly positive with the exception of complicated controls and a few bugs. Thanks to the playtest I was able to sort out the remaining bugs and improve upon the controls to make them more user friendly.

The rest of my time has been spent fixing the lag problems that render the game unplayable on lower spec computers. I thought at first it was my scripts taking up most of the processing but after optimizing every script and removing any unnecessary update functions the lag still remained with about a 5-10 increase in fps.

I then noticed, thanks to unity's Profiler, that rendering the scene was taking up most of the processing at a whopping 80%. Some research into dynamic batching and draw calls answered all my questions. The problem was in the draw calls as I had too many objects drawing in the cameras view at a time. I managed to reduce this by mesh combining the units so that it became one mesh instead of 20+ meshes.

This greatly reduced the lag but I went a step further by downloading a very useful draw call minimizer! (Link provided below) What this amazing script does is combine any objects you decide into one mesh and create a texture atlas for the newly formed mesh, all before the game loads. For example in Kingdom I have over 500 trees each as separate objects in the scene, with this script the trees all get combined into one mesh reducing the draw calls from 500 to 1!

Link to the Draw Call Minimizer in Asset Store:
Draw Call Minimizer- Asset Store


Link to video showcasing what it can do:
https://www.youtube.com/watch?v=0eA4Afhojxc


Because of less lag I can now simulate larger battles.



Hungryum Games Developer

Hungryum Games is an Australian indie video game developer based in Perth, Western Australia. Founded in 2009, Hungryum Games has been releasing a variety of online games and is currently developing for the mobile market.

No comments:

Post a Comment