Implementing game requirements using design patterns. Issue 12 (3rd November 2021) - Paschali, Maria‐Eleni; Volioti, Christina; Ampatzoglou, Apostolos; Gkagkas, Anastasios; Stamelos, Ioannis; Chatzigeorgiou, Alexander
Abstract: Game mechanics are high‐level descriptions of common game requirements; however, they do not provide any guidance on their code implementation. Nevertheless, their implementation involves high volumes of essential complexity, which in turn leads to the introduction of accidental complexity (long methods, code repetition, etc.). A possible solution to this problem is to map game mechanics to design patterns, in order to provide template instantiations that handle structural complexity. The aim of this study is twofold: (a) introduce template instantiations of game mechanics with Gang of Four (GoF) patterns and (b) evaluate such mappings in terms of extendibility and reusability. To achieve these objectives, we developed an online repository of mappings between GoF patterns and game mechanics and conducted an experiment to explore the benefits of the mapping. The results of the study suggest that the implementation of game mechanics with GoF patterns is beneficial, because the time to extent the current implementation or reuse code chunks is not prolonged, whereas the implementations are less faulty. Finally, the suggested mapping will equip game mechanics with sample implementations (that adhere to good design principles—ensuring extendibility) that can be reused, acting as a starting point for source code development. Abstract : Game mechanics do not provide any guidance on their code implementation and usually involve high volumes of complexity. We propose the mapping of game mechanics and design patterns through template instantiations; developing an online repository of such mappings. The results of the study suggest that the implementation of game mechanics with GoF patterns is beneficial, because the time to extent the current implementation or reuse code chunks is not prolonged, whereas the implementations are less faulty.