Hey there, Gamers and Game Makers!
When it comes to playing a game, we all know there's nothing worse than a game with poor performance. The last thing you want is a sudden frame rate of 10fps to break the immersion of the game. So, when it comes to making your own game, optimisation should be top of your list when it comes to building it for various systems. I'm going to go through five tips that will help to improve the overall performance of your game and keep that frame rate up.
Tip #1 Reduce Poly Count
The first tip comes down to simple good work ethic when modeling your assets. It goes without saying that the fewer polys your models have, the better they are for performance. But what do you do when your model requires a lot of detail? Start off by making your base mesh and then creating the high poly version in your software package of choice. Once you have that high poly version, you can use a tool such as Maya to perform retopology on your model. In basic terms, retopology works by laying down a low poly mesh over your high poly mesh allowing you to bake the details from the high poly to the low poly. This will reduce your models poly count while still retaining a high level of detail.
Tip #2 A Picture Says A Thousand Words
With so many models in our game, we also have a lot of textures. If you create a texture atlas, you'll save on the number of draw calls which will in turn save on performance. A texture atlas is basically nothing more than a larger image that has all your models textures in it and the now all share the same UV island. You can set up a texture atlas using most modeling tools and even some third party Unity tools.
Tip #3 Out Of Site. Out Of Mind
Models are obviously a drain on performance when they are on screen.They are also a drain when they are off camera. So why on earth would we want models that aren't even in view to be using resources? We don't! We can use the likes of occlusion culling to disable the renderers of objects that are outside of the cameras view. Basically, if it's not in sight, don't render it.
Tip #4 Use LODs
It's one thing to not render something if it's not in view but what do you do if you can still see a model but it's very far away? There's no point in having a high poly detailed model rendering in the distance if we can't see any of that detail. We can use level of detail (LOD) meshes to produce various meshes that range from low poly to high poly depending on the distance the camera is from the object. So say we are very far away from a character model. We would have a low poly mesh appear as we can't make out detail, all we need to see is the very basic model. As we get closer, the mesh can change to another mesh of higher detail depending on our distance to the character. This way we can avoid wasting performance on details that can't even be seen.
Tip #5 bake Lighting
Lighting is a very important element of games. We use it so much to set the tone an atmosphere of certain scenes. But, if you're using a lot of lights, that can become a huge drain on resources very quickly. Think very carefully about the lighting you are using.Does every light need to be using realtime rendering? If not, you can bake the lighting detail of all lights that will not move. This will basically bake a snapshot of the lighting detail to a single txsture and make a huge saving on performance.
Until next time!