# Design Patterns for Mobile Games Based on Structural Similarity
## 2 Literature Review
### Research on Design Patterns Related to Computer and Mobile Games
Figure 3: MVC architecture for Sudoku [41]. 3. Two Player Based Game: The controller interface will be changed accordingly. Additionally, a new model has to be used, or the model interface could be adjusted for a two-player game. Similar to [40], this work is another motivation for working on mobile applications especially games. Their work is concrete evidence of the advantage of using design patterns for games for small devices. The advantage is in the form of reusability and ease of modifications and extensions. However, unlike our objective of the paper, the discussed architecture and patterns consider details of board games only. Thus, they may not be generic enough to apply to other types of games. The authors focused only on J2 ME. [PERSON] [42] showed that design patterns could be effective solutions to problems arising during mobile game development. Moreover, he asserted that traditional design patterns such as Model-View-Controller and Observer are still lively and can be used for the development of modern games. To validate his argument, he developed a small game. He claimed that he was new to game programming, as the problems that arise during the development, the appropriate and useful design patterns, were selected naturally, examined and used. As a result, the code was well structured, organized, and maintainable. The four patterns used were Model-View-Controller, Observer, State Machine, and Singleton. The paper also includes a discussion of two mobile game development frameworks: Cocos2d and Unity3D. The author used them as third-party game-engines for the case-study. The author discussed these patterns elegantly mentioning advantages, disadvantages, and alternative solutions. Additionally, the work shows that said middleware game-engines implement those patterns either directly or indirectly. These frameworks support C++ and Objective C languages. Thus, the author also discusses if these languages have a built-in capability to support these patterns. The paper concludes that design patterns are still useful in mobile games development, but the essential thing is to examine and decide if the use of a certain pattern will be useful in a particular situation. This work proves only the validity of patterns in modern game programming as was its objective, but the author did not identify any new pattern. [PERSON] [43], a professional game developer, presented an online book on games programming patterns. His experience in game programming and dealing with good code practices for years resulted in a treasure for game developers especially ones who are new to this field. He asserts that twenty years old GoF patterns [12] are suitable for other disciplines of software, but they have to be revised to adapt them for games because games constitute a different discipline. [PERSON] admits the validity of twenty years old GoF design patterns and regards his book as a continuation of their work, but for the context of games. He included GoF patterns (Command, Flyweight, Observer, Prototype, Singleton, and State) in his book and explained how they are applicable for games. A substantial part of his book discusses new programming patterns that he identified in codebases of games. These are 13 patterns divided into four categories; Sequencing, Behavioral, Decoupling, and Optimization. It seems unnecessary to summarize each pattern here, but it is reasonable to discuss each group in brief along with one or two patterns from the group as an example. Sequencing patterns act as tools to implement sequences in games in such a way that everything in the game world is just correct according to the game's clock and whatever is rendered in the screen is right. Double Buffer, Game Loop and Update Method patterns belong to this group. All these patterns are of critical importance for any game. Double Buffer allows a graphics' individual pixels to be modified as desired but will be rendered on the screen atomically (as a whole). For this purpose, two separate buffers are maintained for modification and rendering.