Igrostroy: from chaotic to proper code architecture of the game

– Designed architecture of the game saves manpower, time and determines the viability of the project.

The architecture of a computer game — a system of organization program that defines the internal logic of building code, choice of structural elements and defining relationships between them. A complex system (a game usually really is) consists of several subsystems and functional modules, services, layers, subroutines, connected in a certain sequence. In this case, the developers do not get spaghetti code, but a set of friendly elements interacting according to simple rules.

Architecture design code can not be attributed to the basics, which are easy to learn by yourself. For the supporters of the self-study tutorials, forums, articles, which contains a huge amount of information. If there is no time and desire to separate the wheat from the chaff, to learn the subtleties on courses that are directly.

The signs of a good code architecture

  • It’s easy to make changes. The new fragments do not require rewriting the existing ones.
  • The system is effective. The code solves the problem and works in all conditions.
  • Development time can be reduced by increasing team. Tasks are easily crushed and divided among the developers.
  • Code snippets can be reused in other systems.

The last condition to comply with the the easiest way. Even if you are working on a Hyper exclusive lounge project without design patterns would be difficult to manage.

All of the template

Pattern or template — ready solution that is applied to the project to resolve common problems. Of course, when using templates, the developer needs to take into account the specifics of the project. Usually a pattern is not directly converted to code. He gives the skeleton construction which is modified for the task.

In the direction the templates are divided into:

  • fundamental;
  • generating;
  • structural;
  • behavioral;
  • private.

Fundamental patterns

Allow you to create an initial architecture of the project. This high-level patterns that describe the relationships between the functional components of the system. An example of a popular fundamental MVC pattern (model-view-controller). In the software paradigm “the model of graphics controller” graphics is responsible for the data that is displayed to the user, the model changes state in accordance with the commands of the controller, the controller acts on the model and causes it to change state depending on actions of the user.

Generating patterns

Designed to create objects. The system remains independent from the process of generation and types of objects. Generating patterns encapsulate information about specific classes, the system can access only the interfaces defined by abstract classes.

Structural patterns

Assemble the system based on classes and objects. Structural patterns allow you to add objects more responsibilities, group similar objects in a tree structure.

Behavioral patterns

Distribute responsibilities between objects, define methods of implementation of the interaction.

Private patterns

In this class fall into patterns that had no place in the preceding paragraphs.

Pattern — not a panacea

The use of patterns increases the development speed and reduce complexity. Templates simplify the communication between developers by unifying variants and reduce the number of potential errors.

While the development of the game should not start with thinking, what are the patterns you can apply. These are the tools that will be applied when the problem has already occurred. So carpenter takes on the planer, if the Board is not smooth enough. The pattern helps the programmer to resolve the sharp corners in the program. Conversely, the thoughtless use of patterns may unnecessarily complicate the code.

Therefore, you should not consider patterns of designer items, of which going game. First you have to learn how to write code from scratch to finish.

To master game development in any case will have on their own, the University do not teach this. If you choose courses, make sure that the quality of teachers was made by the developers of game projects. Practices have already learned on their own and others ‘ mistakes and are ready to transfer knowledge. This system of teaching is used in GeekUniversity. Teachers and mentors know a lot about game development and ready on the shortest way to guide the student through the thorns to the understanding of game design.

Igrostroy: from chaotic to proper code architecture of the game
Hi-News.ru


Date:

by