Search Unity

Assets [Design Pattern] Unity-GameSystems: A ScriptableObject way to manage game states and events

Discussion in 'Works In Progress' started by Bulwark-Studios, Feb 19, 2019.

  1. Bulwark-Studios

    Bulwark-Studios

    Joined:
    Sep 20, 2013
    Posts:
    18
    Hi!

    Unity-GameSystems is a set of tools made after the release of Warhammer 40.000: Mechanicus to fix and clean design patterns used in the game.

    Unity-GameSystems propose a way to manage your game states (GameContext), your game events (GameEvent), your libraries of prefabs or any kind of data (GameLibrary), your log system and a way to handle your UI Button.
    You can find at the bottom of the readme.md file a folder archictecture to follow to keep clean your project.

    Here is the repo: https://github.com/BulwarkStudios/Unity-GameSystems/tree/develop

    I will be happy to discuss with you about thoses patterns.

    Have a happy coding day!
     
    MrMatthias likes this.
  2. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    492
    Hi, thanks for sharing! I'm always curious to see how other unity games handle design issues. Congratulations on the positive reception of Mechanicus!

    I'm finding it hard to figure out the exact issues your system solves and how it fits together, to be honest. After a quick glance, it seems a bit like you used scriptable objects to implement singletons, e. g. for an event system. It also seems that it was done this way to enable runtime inspection?
     
  3. Bulwark-Studios

    Bulwark-Studios

    Joined:
    Sep 20, 2013
    Posts:
    18
    Thanks!

    The main objective here was to build an architecture to keep clean the codebase on a scalable project. Some design patterns are great but add too much complexity. When new employes join the team, it was hard for them to read and understand the project.
    I tried to find what was hard to understand and why. With this system a new member can know in which state the game is and what events can be triggered during runtime just by viewing the ScriptableObjects in the project. This help to find where is the relative code just by searching the context or the event name in the codebase or just by click on the references in the inspector during runtime.