Implementing Game Mechanics with GoF Design Patterns

Xeni-Christina Kounoukla, Apostolos Ampatzoglou, Konstantinos Anagnostopoulos · 2016

Implementing game mechanics (i.e., game rules and logic) inherently involves high volumes of required complexity, which in turn leads to the introduction of accidental complexity (e.g., long methods, code repetition, etc.). Thus, usually games suffer from poor quality, i.e., attributes such as maintainability and flexibility are weakened. A possible solution for this shortcoming is the reuse of well-known software engineering practices, such as GoF patterns. GoF are not the only patterns that are applicable in game development: game mechanics represent recurring problems in game design and accompanying solutions. However, these patterns are rather abstract and no guidance on their implementation is provided. The aim of this study is to introduce basic instantiations of game mechanics with GoF patterns, which can potentially increase their usability in practice. To this end, nine mappings were identified and a case study on OSS games was performed to explore the applicability of the approach. Combining these two types of patterns is expected to provide various benefits: (a) the game mechanics will be accompanied with sample implementations that can be reused, to act as a starting point for source code development; (b) these implementations will obey to good design principles---therefore their maintainability will be safeguarded; and (c) the fact that game mechanics are recurring, guarantees the applicability of the proposed implementations in various games.

Read the paper · More papers on PaperTik