• No results found

Simplified Game Specific Description Language for Rapid Game Server Development using LDD (Language Driven Development) Framework

N/A
N/A
Protected

Academic year: 2021

Share "Simplified Game Specific Description Language for Rapid Game Server Development using LDD (Language Driven Development) Framework"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

Simplified Game Specific Description Language for

Rapid Game Server Development using LDD (Language

Driven Development) Framework

Hwan-Soo Yoo and Seong-Whan Kim

School of Computer Science, University of Seoul, 13 Siripdae-gil, Dongdaemun-gu, Seoul 130-743, Republic of Korea

[email protected], [email protected]

Abstract. Real time games require efficient and parallel processing capability for the game server, which is not easy for non-programmers and even for start-up companies. In this paper, we propose an integrated language driven development (LDD) framework for the real time game server development. Using LDD framework expert developer can make DSL language and later novice developer or non-programmer can programming with ease by using that DSL. We illustrate detailed LDD framework and give simple game server language. Even novice programmer can program during game development process, utilizing composed DSL written by expert programmer. This paper contributes to increase development productivity and ease of maintenance in game development process. Game developer can make DSL easily by using our LDD. We illustrated detailed DSL process in game development and showed real world http game server language following LDD.

Keywords: DSL, Framework, Game, Real-time network, Development process

1 Introduction

Game programmers no longer make game that only works on PCs. The number of device variety such as smart phones, smart pads, smart TVs and much more are increasing at a phenomenal rate and the focus is now shifting to those devices from traditional PCs. A lot of time is spent during requirements and implementation phase during software development. DSL (domain-specific language) [1] refer to language designed for specific are in mind, and DSL are used for the implementation phase. An advantage of using DSL is when domain’s complexity if high, development that have used DSL have high efficiency compared to development investment. If application development team is composed of both expert and novice at a particular language, then the expert implement DSL during the beginning of the development will allow the novices to use the implemented DSL which will lead to higher productivity for the team. LDD is language driven method for game development that heavily uses and integrates DSL with game development process seamlessly. We design sophisticated framework using this method and demonstrate a simple case study. By using LDD for game development process, even non-programmer such as

(2)

game designer can do prototyping for the game during game design. Even novice programmer can shorten game development process if expert programmer make composed DSL available, thereby increasing quality by assigning time to import tasks.

After this introduction, this paper is structured as follow: Section 2 reviews related work. Section 3 explains LDD process. Section 4 shows simple game serve engine case study. Section 5 summarizes the paper and outlines future work.

2 Related Works

In this section, we review related works on various development process Firstly, we review model driven development (MDD) and domain specific language (DSL) approaches. MDD provides a methodology, in which programmers don’t need to program detailed functionality which they intend to implement; they can use a model to define the systems’ architecture and functions. Skeleton source code is generated from the graphical model and after composing rest of the source code, object allocation, method lookup, and exception handling constructs are used to complete the program from the scratch code [2]. Bernardi [3] focused on research of applying model driven engineering (MDE) technologies to build production of a working prototype of web applications using design model and transformation technologies for different uses and domains which include XML/XSLT [4]-based languages, OMG standards based languages, ATL (ATLAS transformation languages ) [5], and many others. MOFM2T (MOF Model to Text) [6] specification defines transforming MOF models into text. Xpand framework under eclipse provides MOFM2T functionality. MDD of web applications [7] is ubiquitous web application [8] approach utilizes various models at several layers transforming into source code to arrive at final web applications.

DSL is a language that defines the jargon of a particular class of problem domains or set of domain aspects. Executable DSLs hide software implementation [13]. DSL is referred to as either domain specific language in an academic way or just simply domain language. It is a limited language that is concentrated to specific problem domains by appropriate abstraction and notations. It is a problem-centric language [14] built for one particular task in mind. Development teams use same vocabulary to represent program module. For example, if there is a requirement for bond trading module within problem domain, same vocabulary is used during code writing [15], Ghosh [9] depicts the interface role of DSL from problem domain to solution domain. That two domain shares same vocabulary for ease of communication and domain expert can use DSL that was made by developer can solve problem domain’s question with ease by using their professional knowledge. Kramer [16] researched mobile development DSL by supporting functions such as variables, functions, widgets, and events for deployment to iPhone, Android, and Windows Mobile phones. Funk [17] proposed Xtext [18] and Xtend [19] for DSL to provide easy programming tool for non-programmers including graphic designers or content producers because image, sound, voice, and video was hard to program with existing tools. Furtado [20] have defined method on how to make games that operate under client using DSL, SPL, and FODA [21]. Maximilien [22] suggests that current web mashups provide a flourishing

(3)

and innovative web, but it also states that it raises new challenges, including that current mashups are point solutions, lacking principled approaches to architecture and design; and many similar mashups use the same APIs but share nothing else in common. So by using DSL, developers can also use mashups to solve Web integration and service composition problems. Masuch [23] integrated DSL into scenario-based game. Figure 1(a) illustrates MobDSL’s architecture. It consists of 3 tiers (1) the application, written and compiled using the DSL; (2) the DSL specific engine, and implemented libraries; (3) the running platform. Figure 1(b) depicts PULP tool chain with media and script artifacts, Figure 1(c) is an extracted feature model of ArcadEx, and Figure12(d) shows service mashups architecture. DSL engine takes a DSL-defined mashup and generates the code for a Ruby on Rails application.

(a) (b)

(c) (d)

Fig. 1. (a) MobDSL architecture, (b) PULP Scription architecture (c) ArcadEx game feature model for DSL (d) Service mashups architecture using DSL

3 LDD (Language Driven Development) for clear, concise

integration into game development

In this section, we propose LDD framework, which is a DSL approach for game development. It is an elaborative integration of DSL into game development process, and it can be said to be a development framework that combines DSL based domain modeling and game development process. Figure 2 shows the overall LDD framework. To build LDD framework for game development process, we consider following major phases: (1) language requirements, (2) reference artifacts, (3) language design and compiler, and (4) legacy engine semantics. The details are as follows.

(4)

Fig. 2. Language Driven Development Process

(1) Language requirements: it is the first phase that is divided into three parts: domain artifact for analyzing the given domain’s characteristics, general language artifact for analyzing general language characteristics, and finally language requirements that combines the previous two artifacts to form overall requirements for the language. Terminology and language found at this phase are used for DSL’s lexicon and communication in the later development and common language need to be chosen carefully. This common language is also called ubiquitous language [10].

(2) Reference artifacts: it is based on the information collected in the language requirement phase above and is composed of function and domain model.

(3) Language design and compiler: the defined function and domain model of the reference artifacts defined during language design phase are used to define lexicon definitions, abstract syntax, concrete syntax, and EBNF to be used in DSL being built. For internal DSL implementation, there is embedded method that uses smart API and Syntax tree manipulation and generative method that does meta-programming during compile-time and runtime. Appropriate parser generator and lexical analyzer should be chosen at compiler design stage by referring to the information presented above.

(4) Legacy engine semantics: output that has been generated through compiler or internal code runs. These legacy engines are engines that were being used before DSL project or engines that were chosen for the project. These legacy engines need to be utilized to broaden areas that DSL is usable and lessen development effort.

(5)

4

Implementation

In this section, we experimented with our LDD framework to develop a HTTP game server. Developers will be able to compose appropriate applications for particular domains such as web-based application, game, chatting application, real-time monitoring and so on by using our work. Figure 3 depicts simple game server output and flow at each stage of LDD framework and language artifacts.

Fig. 3. Language driven development framework and artifacts of game server language Below is the partial source code for the browser-based multi-user real-time game server engine generated by such means. First line is for assigning collection using MongoDB [11], a noSQL [12] solution as an example. Second line is for assigning port for WebSocket [13] and webserver for real-time networking and HTTP. Lines 4~11 is for providing warScence.html to users joining the room and disseminating packet to participating users in the event of shooting.

1 database collection is 'member'

2 server port is 52273 …

3 server file is 'login.html' when get '/' …

4 server file is 'warScene.html' when get '/game/:room'

(6)

6 emit 'shoot' in 'room'

7 end …

8 socket act when 'addroom' 9 add room to roomList 10 emit 'addroom' 11 end

With this language user can easily implement networking, database and web service feature. Without our language line 3 will be like below code.

app.get('/',function(request,response){

fs.readFile('login.html','utf-8',function(err,data){ response.writeHead(200, { 'Content-Type' : 'text/html'}); response.end(data);

}); });

4.1 Language requirements

Language requirements for real time game server is as follow. It must contain (1) general language requirements and (2) domain language requirements such as HTTP server, database and real-time networking.

(1) General language requirements: Basic features the language must support are source code structuralization and variable scope through variable, conditional statement, and block statement. Use ‘is’, ‘isnt’ that close to natural language for supporting expression from Conditional statement.

(2) Domain language requirements: Use server, database, and socket that takes the form of subject for defining HTTP Server, database, and real-time network.

For supporting Real-time communication and multi-user characteristics, emit, ack, disconnect, write, and send features must be provided by using easy and general language. For Database support characteristic, we provide keywords save, get, update, delete for CRUD operation.

4.2 Language design and Compiler

Word class form from natural language for subject, property, verb, preposition, and object for lexicon define rule were used and optimized and minimized lexicon definition was made. Descriptions for lexicon are as in Table 2. Abstract syntax tree was composed with CoffeeScript [14] and Jison [15] parser was used for compiler. Jison is JavaScript based parser module that is very similar to existing Bison[16] or Flex[16]. This Jison was used for language’s definition and parser.

Table 1. Language lexicon

Lexicon Description

subject server, database, socket

server property port, file, log, message, redirection, download File database property collection

preposition in, to, from

server verb response, get, post, is

(7)

database verb save, delete, update, get conditional statement when, is, isnt

block statement act, end

Partial BNF for language is as Figure 4. It shows general statement, block statement, server’s ‘when’ statement, and conditional statement.

languageΔ statement blockStatement inBlockStatement inBlockSentence whenStatement conditionStatement → statement*

→ subject verb object preposition+ whenStatement+ | block_statement inBlockStatement

→ server act whenStatement | socket act when object → inBlockSentence* end

→ response serverProperty verb object whenStatement+ | response+ verb object preposition+

whenStatement+

→ when [ get+ | post+ ] [ object | conditionStatement ] → object [ is | isnt ] object

Fig. 4. Partial BNF for language

Compiler is composed of syntactical analyzer and transcoder as in Figure 3. Syntactical analyzer is formed of (1) lexicon parser that takes the processing rule as input and processes syntax, (2) AST handler that processes semantics, (3) stack handler that processes push and pop operation statement, and (4) array handler. Transcoder is composed of skeleton generator that generates stub code necessary for the operation of server that has been made with our language, server generator for the generation of typical server element code, Web generator for HTTP and Express side generation, General code generator for general language feature, and Code aggregator that collects the codes mentioned.

4.3 Legacy engine semantics

Output that has been generated through compiler operates on top of the legacy engine. Node.js is used for server engine and Socket.IO is used for real-time networking server engine. Express for Web engine, MongoDB for database engine, and MongoJS for MongoDB and Express integration.

5 Summary and Conclusion

LDD based development provides the procedures for building DSL during game development. DSL produced from this procedure is easily usable by non-experienced in game programming and suggests convenience and reusability not realizable in the traditional development. This framework encompasses from language requirement to design, textual language compiler and deployment to legacy engines and is applicable to various domains. Examples of such domain is: Given that the task is to build widely used real-time network application server in use by existing games, game

(8)

planner or non-expert developer can easily do database handling and network communication that are difficult to handle using existing languages by using DSL that have been constructed through LDD. Also, there are a lot of demand for inter-disciplinary related works which have caused media art designer to do programming also, at which they use processing language[17] primarily for the task. Media art designer can efficiently express what they intend with little amount of code by using the DSL produced by domain experts by LDD approach instead of the aforementioned language.

References

1. Mernik, M., Heering, J., Sloane, A.M.: When and how to develop domain-specific languages. ACM Comput. Surv. CSUR. 37, 316–344 (2005).

2. Balasubramanian, K., Gokhale, A., Karsai, G., Sztipanovits, J., Neema, S.: Developing applications using model-driven design environments. Computer. 39, 33 – 40 (2006). 3. Bernardi, M.L., Di Lucca, G.A., Distante, D.: A model-driven approach for the fast

prototyping of Web applications. Web Systems Evolution (WSE), 2011 13th IEEE International Symposium on. pp. 65–74 (2011).

4. James, C.: Xsl transformations (xslt), http://www. w3. org/TR/xslt.

5. Jouault, F., Kurtev, I.: Transforming models with ATL. Satellite Events at the MoDELS 2005 Conference. pp. 128–138 (2006).

6. OMG: MOF Model to Text Transformation Language (MOFM2T), 1.0, http://www.omg.org/spec/MOFM2T/1.0/.

7. Distante, D., Pedone, P., Rossi, G., Canfora, G.: Model-driven development of web applications with UWA, MVC and JavaServer faces. Web Engineering. pp. 457–472. Springer (2007).

8. Finkelstein, A., Savigni, A., Kappel, G., Retschitzegger, W., Kimmerstorfer, E., Schwinger, W., Hofer, T., Pröll, B., Feichtner, C.: Ubiquitous web application development-a framework for understanding. 6th World Multiconference on Systemics, Cybernetics and Informatics. pp. 431–438 (2002).

9. Ghosh, D.: DSLs in action. Manning, Greenwich, Conn. (2011).

10. Fowler, M.: Domain-specific languages. Addison-Wesley, Upper Saddle River, NJ (2011).

11. Chodorow, K., Dirolf, M.: MongoDB: the definitive guide. O’Reilly, Beijing; Farnham (2010).

12. Leavitt, N.: Will NoSQL databases live up to their promise? Computer. 43, 12–14 (2010). 13. Fette, I., Melnikov, A.: The WebSocket Protocol,

http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17.

14. Burnham, T.: Coffeescript: accelerated Javascript development. Pragmatic Bookshelf, Dallas, Tex. (2011).

15. Zach, C.: Jison, http://zaach.github.io/jison/.

16. Levine, J.R.: Flex & bison. O’Reilly Media, Sebastopol, Calif. (2009).

17. Reas, C., Fry, B.: Processing: a programming handbook for visual designers and artists. MIT Press, Cambridge, Mass. (2007).

References

Related documents

For the small class intervention, results show that pupils in the middle of the achievement distribution profit the most from being assigned to a smaller class, whereas pupils at

Subject Computer Graphics is determined for the second class students of bachelor study program of discipline Applied Informatics in full-time and part-time study and for

The implementation as shown in figure(1) consists of two keys one is public key used by all users to encrypt a block of plaintext and also needed to decrypt cipher input

The adopted Wilshire Community Plan, General Plan Framework Element, Chapter 3 (Land Use) and General Plan Conservation Element each contain detailed provisions setting forth

Under National Rural Health Mission (NRHM), there is provision for additional ANM for sub center to provide delivery care and curative services. However, about 55% of the sub

Since minority households are less likely to ever buy a home—and, if they do buy, tend to do so at later ages— housing programs that help low-income and minority households

The proposed objectives of the study are: To identify the effect of IFRS adoption on earnings management by considering discretionary accruals as proxy; To examine

and Wiberg, D., Institutional Ownership and Returns on Investment, CESIS Working Paper Series in Economics and Institutions of Innovation, Paper 96; Ratio Working paper,