Good coding practices for game development

We now that we need some coding guidelines and best practices for programming languages in general, but for game development we also have to take into account some other things, we have to be very careful while writing code for video games because the performance of the game and so the player experience depend on that.

All game engines have their own tools and tips for improving the performance (but all are based on general concepts that are applied in every game development of any other engine) of the games created by them; now talking specifically about Unity 3D engine, in its own documentation have many sections that talk about game performance, next there is a list of some resources that are really useful and worth of reading.

Good Coding Practices in Unity: http://unity3d.com/es/learn/tutorials/modules/intermediate/scripting/coding-practices

This is a short post from Unity official tutorials, and there describes 3 simple concepts that can be “simple” or of “common sense” at first sight but they are things that despite they are simple, we often forget to use them, for example the single responsibility (it says that “A given class should be, ideally, responsible for just one task”, and it is so true, sometimes we face scritps that have thousands of lines and when another programmer takes it, is difficult and the programmer spends a lot of time trying to figure out what is happening), also talks about dependency inversion (basically create interfaces for avoiding the strong dependency between scripts) and modularization.

10000 Update() calls: http://blogs.unity3d.com/2015/12/23/1k-update-calls/

Another official post from Unity that basically explains how Update() method works, when it is called and the time that spends in the performance, it gives another way of use this method (with a custom Update method form a general manager script) and compares the efficiency between them, really interesting and things that could save or improve performance.

50 Tips for Working with Unity: http://devmag.org.za/2012/07/12/50-tips-for-working-with-unity-best-practices/

This isn’t an official post, but it is quite interesting, it mention many points that could be really useful when working with Unity projects, like how to organize a project, tips when creating art for games, how to use the prefabs, class design, documentation, etc. It has many things that are interesting and surely are helpful for all the Unity game projects.

Mobile Game UI/UX Top 10 Best Practices: https://www.linkedin.com/pulse/mobile-game-uiux-top-10-best-practices-troy-dunniway

This is more focused for designers (and it also is not official but it is interesting), here explains some things that have to be taken into account when designing UI and UX in video games for mobile devices, it is a short post but the points are really relatable to the development, so it is worth to give it a try.

 


Leave a Reply

Your email address will not be published. Required fields are marked *