Domain-Specific Game Development”
Total Page:16
File Type:pdf, Size:1020Kb
Pós-Graduação em Ciência da Computação “Domain-Specific Game Development” Por André Wilson Brotto Furtado Tese de Doutorado Universidade Federal de Pernambuco [email protected] www.cin.ufpe.br/~posgraduacao ii Universidade Federal de Pernambuco CENTRO DE INFORMÁTICA PÓS-GRADUAÇÃO EM CIÊNCIA DA COMPUTAÇÃO ANDRÉ WILSON BROTTO FURTADO Domain-Specific Game Development ESTE TRABALHO FOI APRESENTADO À PÓS-GRADUAÇÃO EM CIÊNCIA DA COMPUTAÇÃO DO CENTRO DE INFORMÁTICA DA UNIVERSIDADE FEDERAL DE PERNAMBUCO COMO REQUISITO PARCIAL PARA OBTENÇÃO DO GRAU DE DOUTOR EM CIÊNCIA DA COMPUTAÇÃO. ORIENTADOR: André Luís de Medeiros Santos CO-ORIENTADOR: Geber Lisboa Ramalho RECIFE, Fevereiro/2012 iii Catalogação na fonte Bibliotecária Jane Souto Maior, CRB4-571 Furtado, André Wilson Brotto Domain-Specific game development / André Wilson Brotto Furtado. - Recife: O Autor, 2012. xxv, 233 p. : il., fig., tab. Orientador: André Luis de Medeiros Santos. Tese (doutorado) - Universidade Federal de Pernambuco. CIn, Ciência da Computação, 2012. Inclui bibliografia e apêndice. 1. Ciência da Computação - Engenharia de Software. 2. Linguagem de programação. 3. Jogos digitais. I. Santos, André Luis de Medeiros (orientador). II. Título. 005.12 CDD (23. ed.) MEI2012 – 034 iv “[...] a good programmer in these times does not just write programs. [...] a good programmer does language de- sign, though not from scratch, but building on the frame of a base lan- guage.” -- Guy Steele Jr “Language defines the boundary to our world: it sets what we can describe and also what we can’t.” -- Ludwig Wittgenstein "Enjoyment is not a goal; it is a feeling that accompanies important ongoing activity." -- Paul Goodman v vi To Juliana. vii viii ACKNOWLEDGEMENTS Among all of the few thousand pages I’ve probably written in the last years, this is the one I was the most looking forward to. It means a very big journey is about to reach its destination. It means it’s time to wrap up the efforts and lessons learned from a long chapter. It means it’s time to resume. Since the first words of this document have been typed, a lot has changed, from my country of residence to my civil status. Finally standing here, on the other edge, enables me to look back and realize the amount of people who made it possible for me to cross the bridge. For very real, folks: I’ll carry your encouragement and support forever! To my wife Juliana, words won’t be enough. I know this moment means as much to you as it means to me. Sorry for all the moments that did not happen. Or could have been better. Thanks for your patience, support and for simply being there. I love you! To my family overseas, thanks for the continuous incentive and support, for letting me to share this with you, be it the good, the bad or the ugly. Your will for making this moment to happen refueled my efforts, even when the sunrise reminded how hard things can be. To my friends and advisors André Santos and Geber Ramalho, thanks for opening the door and making this possible. You started it all. Without your plan, trust, knowledge and motivation, this would have never gotten beyond an “apparently interesting academic idea”. To my experiment’s subjects… wow! 14 sessions, 125 hours, 32 versions of games, a lot of pizzas and an unlimited amount of camaraderie. Angelo Ribeiro, Carlos Rodrigues, Gustavo Andrade, Gustavo Magalhães, Julio Lins, Livar Cunha, Renato Ferreira and Rodrigo Silveira: this research would have a third of its confidence and validity if it wasn’t for you. Consider your contributions a legacy to the SPL and DSL communities. Enjoy Section 5.4. To all of those from the research groups who contributed to this thesis, especially the RiSE group and UFPE’s Center of Informatics, my sincere thanks. You helped me to connect the dots when I needed the most. The network you created is very noble and invaluable to Software Engineering researchers. To my new and old friends, now spread around multiple continents, as well as my teammates: thanks for making this a lighter and happier path. You are there even when you are not here, and you know what I mean. Being connected to you all is a gift. Thanks for sharing so much energy and growth. Finally, I’d like to register a modest, humble thanks to my past self. Sorry for anything. Thanks for pursuing the goal. Thanks for believing. André Furtado December 31, 2011 ix x ABSTRACT This thesis introduces the concept of Domain-Specific Game Development, which is an ap- proach that harvests the benefits of Software Product Lines (SPLs) to create digital games belonging to a same family more effectively. The need for such an approach is justified by the fact that introducing reuse and SPL concepts into digital games development, in fact into any other domain, is not a straightforward task, due to the peculiarities of each domain. Spe- cifically for games, traditional Requirements Engineering and use cases cannot be applied as is. Business requirements are trumped by prototypes, rapid experimentation and emotion- based requirements, such as immersion and nostalgia. The so popular concept of game gen- res is nevertheless too vague and ambiguous to define the scope of a family of games from a SPL perspective. The end-user’s (player’s) experience is much more based on surprises and ruptures than the adherence to standards. And no approach aimed at improving game de- velopment can ignore game engines, which have become the state-of-the-art development resource for digital games by bringing to the area the benefits of Software Engineering and object-orientation. However, the abstraction level provided by game engines could still be made less complex to consume by means of language-based tools, the use of visual models as first-class citizens (in the same way as source code) and a better integration with devel- opment processes. With such a motivation, Domain-Specific Game Development bridges SPLs to game development, culminating with domain-specific languages (DSLs) and genera- tors streamlined for game sub-domains and aimed at automating more of the digital games development process. It focuses on employing Domain Engineering, Model-Driven Develop- ment and software reuse to encapsulate the common and best practices in game develop- ment, yet supporting variable and unforeseen behavior. In order to evaluate the proposed approach, we present exploratory and confirmatory case studies, as well as a controlled ex- periment performed with software engineers with industry experience. With a measured de- velopment effort improvement of more than five times in average, we suggest Domain- Specific Game Development as a viable alternative for same-family game development sce- narios in order to reduce the complexity of consuming game engines, to break down game development tasks into more granular and automatable chunks, to enable the creation of ex- pressive yet executable game specifications, to deliver incremental value for prioritized game sub-domains, to build effective domain-specific assets tailored to the unique characteristics of an envisioned family of games and, finally, to still provide flexibility and extensibility for game developers and designers to focus on what makes each game unique and distinct. Keywords: game development, software reuse, software product lines, domain engineering, domain-specific languages, experimental study. xi xii RESUMO Este tese apresenta o conceito de Domain-Specific Game Development, uma abordagem que emprega os benefícios de linhas de produção de software (SPLs) para criar mais eficientemente jogos digitais pertencentes a uma mesma família. A necessidade por essa abordagem é justificada pelo fato de que a introdução de conceitos de reuso e SPL em jogos digitais, na verdade em qualquer domínio, não é trivial, devido às peculiaridades de cada domínio. Especificamente para jogos, a Engenharia de Requisitos tradicional e casos de uso não podem ser aplicados como são. Prototipagem, rápida experimentação e requisitos baseados em emoção são preferidos em relação a requisitos de negócio. O tão popular conceito de motores de jogos é muito vago e ambíguo para definir o escopo de uma linha de produção de jogos. A experiência de jogadores é mais baseada em surpresas e rupturas do que na aderência a padrões. E nenhuma abordagem focada na melhoria do desenvolvimento de jogos pode ignorar motores de jogos, atual estado-da-arte no desenvolvimento de jogos digitais. Por outro lado, a abstração provida por eles poderia ser menos complexa de ser consumida, através de ferramentas baseadas em linguagens, o uso de modelos como cidadãos de primeiroa classe (assim como código fonte) e uma melhor integração com o processo de desenvolvimento. Dada essa motivação, Domain-Specific Game Development faz a ponte entre SPLs e o desenvolvimento de jogos, culminando com linguagens de domínio específico (DSLs) e geradores alinhados para sub-domínios de jogos e focados em automatizar mais o processo de desenvolvimento de jogos digitais. A abordagem emprega Engenharia de Domínio, Model-Driven Development e reuso de software para encapsular as melhores e mais comuns práticas do desenvolvimento de jogos, ainda suportando comportamento variável e imprevisto. Para avaliar a abordagem, apresentamos casos de estudo confirmatórios e exploratórios, assim como um experimento controlado realizado com engenheiros de software da indústria. Com uma melhoria de produtividade observada de mais de 5 vezes em média, sugerimos Domain-Specific Game Development como uma abordagem viável para o desenvolvimento de jogos que pertencem a uma mesma família, de modo a reduzir a complexidade no consumo de motores de jogos, quebrar tarefas de desenvolvimento em blocos mais automatizáveis, habilitar a criação de especificações expressivas porém executáveis, entregar valor incrementalmente para sub- domínios priorizados, construir artefatos de domínio específico alinhados às características únicas da família-alvo de jogos e, finalmente, prover flexibilidade e extensibilidade para que desenvolvedores e designers de jogos possam focar no que torna cada jogo único distinto.