IMO game project. Codebase about 3000 C # files. The client is written in C #, OGRE (C ++) was used for rendering.
Fragment of client architecture The bottommost “Render” layer is the implementation of the render, along with implementations of various effects (animation scenes, particles) and scene objects with animation support (skeletal, morph). Everything related to the display in one form or another was implemented in this layer.
The “Render facade” layer was the interface (facade) to the renderer and contained all the wrappers of the native code for use in C #.
The “Scene graph” layer was a place to simulate objects and their interaction.
The “Logic” layer simulated objects and displayed logic on simulation objects.
In this fragment, other systems that were in these layers are omitted, for example, there is no UI (which was also C # wrappers for C ++).
The objects in the scene layer of the graph were the simplest objects that contained the position and orientation. Supported hierarchy as well as managing abstract animation through identifiers (roughly speaking, start and stop by id).
After the next burst of creativity, designers needed to change the colors of materials depending on the logic in runtime. The motivation was the following - “There is no time to explain, make us a change in the color of materials!”, However, in the game dev, this is a common practice (emoticon).
To add such functionality, it was necessary to disfigure object interfaces by adding such a specific thing as material and to forward through all layers. Moreover, not all objects in principle had material, for example, light sources and cameras or composite animation objects, for example, asteroid belts, etc.
Forward functionality (shown in red) There was not enough time for thinking and especially for experiments, so it was decided to temporarily arrange this functionality as an independent service. In this case, even the object interface was not affected, a certain implementation of the extension methods only in a global context.
VIP service implementation At the same time, at every stage and in every chain of service, all kinds of paranoid checks were done so that the service data did not break the operation of the system or become a source of failures.
Over time, various methods for very tricky widgets and other problem solutions appeared and disappeared in this service.
And the functionality of the materials was removed from the service after the implementation of a full-fledged animation graph with support for all aspects of visualization. And the designer pointed out the change of materials as part of the animation.