Overview

Overview

  • Target Platform : Android & iOS

  • Unity Version : 2019.2.20f1 (soon to be upgraded to 2019 LTS)

  • Repo URL : repository link

Rocky Rampage Coding Principles

  • Scene should be self-dependent.

    • Try our best to make scenes playable by its own.

    • Self-dependent scene makes testing and iteration much faster.

    • We are utilising App Installer to handle this.

  • Use singletons sparingly, rely on manual injections instead.

    • While singleton is extremely useful and simple in nature, it can lead to overuse and very tight dependency (see this discussion).

    • Therefore, rely on manual injections instead. If a class is depend on another class, provide the dependency when creating the instance (manual injection).

    • There are some exceptions for this, though. Support systems (AudioPlayer, etc.) typically use singletons because it is being used on so many different places.

  • All script must fall into an assembly definition.

    • We want scripts to have clear dependency, and assembly definition helps with this.

    • We are introducing usage of Unit Testing in RR, so it's mandatory for scripts to fall into assembly definition.

  • Use pure C# class, unless you need Unity's MonoBehaviour.

    • MonoBehaviour introduces some unnecessary overhead, so it's best to not overuse it for pure system class that manages data.

    • Using pure C# class also allows you to do Unit Test in Editor Mode rather than Play Mode, which is faster to setup and easier to maintain.

    • MonoBehaviours are used mostly in gameplay scripts and UI (see Project Architecture)

  • Adhere to SOLID principle and Clean Code.

    • Make classes and methods follows Single-Responsbility principle.

    • Know when to use direct reference, delegates, or events. Use them appropriately.

    • Use comments appropriately; try to make your code as readable as you can.

  • We do our best to always have a simultaneous release on our target platforms

    • Check if your code is successfully compiled on Editor and our target platforms.

    • Perform frequent tests in devices, especially when integrating native plugins.

    • Utilize build machine to help you with this.

  • We try our best to have nearly equal technical knowledge

    • For now, there's no distinct separation of roles between programmers.

    • Everyone should be able to work on every aspect of the game.

    • Team must regularly share knowledge of implementation.

Project Architecture

Last updated