In most video games engine I've used in the last decade, there was a layered notion for the different behaviour required to run the game. It's not a very hard concept, and Unity does have some running in background, but you don't have access to such things. From one engine to another, naming could differ, or no names could exist at all to classify the different layers. Let's just list the layers that are most used in the scope of a video game;


- Entity Layer; this is the only thing you have inside Unity. All your behaviour must be anchored to a GameObject at some point. In theory, it should handle the behaviour that take place on different object, such as a player, a door, a switch and so on. Sadly, in Unity, everything must be handled that way.


- World Layer; this layer should be properties or method relative to a specific world. Let's say a world is in the dark, or under water, or has specific behaviour for the player. In theory, they should not be anchored on a GameObject because there is no need for a position, orientation or everything else that is carried with the concept of a spatial GameObject.


- Universe Layer; at this point, we get behaviour and data that is game-wide. In other words, the game should be able to run on its own even if there was no level loaded. That layer should be loaded first and should persist as long as the game is in memory. In the case of Unity, the engine got a couple of internal manager and handler, such as "Input" that take that role. However, the one using Unity does not have access to create new class in that scope.


Beyond the idea of classification, there's also other advantages are putting things that way. For example, since the game can run without any level loaded, it can also work properly with any level without any need to setup new parameters. In the projects I have seen so far done on Unity, this is a designer's hassle. One could say that they could build a nice little prefab package that would hold everything needed to run a level, but in the end, it's just an unnecessary pain. Being game-wide, such data can be accessed from anywhere at anytime for edition.

While Unity doesn't provide that exact level of utility, it is not impossible to emulate the advantages by using the existing framework. It does however requires the developpers to work a little bit differently and assume a few things, but it also gives the advantage of a being a sealed system that never requires maintenance.

Write comment (0 Comments)