Functional programming for video games
Länsineva, Jukka (2023-12-14)
Länsineva, Jukka
J. Länsineva
14.12.2023
© 2023 Jukka Länsineva. Ellei toisin mainita, uudelleenkäyttö on sallittu Creative Commons Attribution 4.0 International (CC-BY 4.0) -lisenssillä (https://creativecommons.org/licenses/by/4.0/). Uudelleenkäyttö on sallittua edellyttäen, että lähde mainitaan asianmukaisesti ja mahdolliset muutokset merkitään. Sellaisten osien käyttö tai jäljentäminen, jotka eivät ole tekijän tai tekijöiden omaisuutta, saattaa edellyttää lupaa suoraan asianomaisilta oikeudenhaltijoilta.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:oulu-202312153852
https://urn.fi/URN:NBN:fi:oulu-202312153852
Tiivistelmä
Functional programming has its background in the mathematical models formulated in 1940s, with the first programming language released in the 60s. Initially popular with academia, the paradigm has had a resurgence in the software development industry, for example with web development. Additionally, the characteristics common in the paradigm, such as anonymous functions among others, have been introduced to languages using imperative paradigms to form multi-paradigm languages.
In this study, the applicability of functional programming in game development context is explored. This study also aims to demonstrate how functional programming could be used to develop games. This done using a design science research process, during which three prototypes were implemented using LISP variant Clojure. These prototypes iteratively implement three components of a game – a game logic loop, an engine for rendering game content, and input handling from the player. These are composed into a playable video game prototype. Every iteration is evaluated, and results are analysed.
From the prototypes, patterns, and an architecture suitable for functional video game programming are formulated and presented as new models. The models and prototypes are released as artifacts, with an engine library developed in conjunction as another artifact, all in open source.
The prototypes demonstrate the technical point-of-view of applicability of functional paradigm to games programming, and further analysis is done for specific cases for different types of games and in relation to current video games development market. The models demonstrate how to structure a game with functional languages. With these, this study contributes to the field of functional games with a new, LISP-based approach, and contributes to the Clojure ecosystem with the release of the engine library artifact.
In this study, the applicability of functional programming in game development context is explored. This study also aims to demonstrate how functional programming could be used to develop games. This done using a design science research process, during which three prototypes were implemented using LISP variant Clojure. These prototypes iteratively implement three components of a game – a game logic loop, an engine for rendering game content, and input handling from the player. These are composed into a playable video game prototype. Every iteration is evaluated, and results are analysed.
From the prototypes, patterns, and an architecture suitable for functional video game programming are formulated and presented as new models. The models and prototypes are released as artifacts, with an engine library developed in conjunction as another artifact, all in open source.
The prototypes demonstrate the technical point-of-view of applicability of functional paradigm to games programming, and further analysis is done for specific cases for different types of games and in relation to current video games development market. The models demonstrate how to structure a game with functional languages. With these, this study contributes to the field of functional games with a new, LISP-based approach, and contributes to the Clojure ecosystem with the release of the engine library artifact.
Kokoelmat
- Avoin saatavuus [37688]