You are on page 1of 8

Implementing Automata Theory in the Design

of a Finite Virtual Reality Game


Abdul, Jemarie M. Basang, Anthony D. Bitog, Ruffred T.
Department of Department of Department of
Information Technology Information Technology Information Technology
and Computer Science and Computer Science and Computer Science
University of the University of the University of the
Cordilleras Cordilleras Cordilleras
Baguio City, Baguio City, Baguio City,
Philippines Philippines Philippines
jlaw151312@gmail.com Anthony.Basang18@gmail. fredbitog@gmail.com
com

Rey Benjamin Baquirin Julie S. Cuanso


Department of Information Technology Department of Information Technology
and Computer Science and Computer Science
University of the Cordilleras University of the Cordilleras
Baguio City, Philippines Baguio City, Philippines
reybenbaq@gmail.com

Abstract used to simulate state-based


automaton structures such as
Developing high-quality games
NFSA (Non-Deterministic Finite
require programmers and game
State Automaton) and DFSA
designers to have seamless
(Deterministic Finite State
communication for designs to be
Automaton).
coded and implemented as planned
[1]. This study is an effort to Keywords
promote the usage of automata
Automata Theory, Mealy Machine,
tools and computational theory
Virtual Reality, Unity, Game
in game design. A finite virtual
Design, Game Development
reality game entitled “Fourth
Planet” was designed and 1 Introduction
programmed applying the
principles of Automata Theory. Alan Turning, a great scientist
The game has three levels, where and father of computing has
the user needs to interact with significant contribution to
objects, collect all items and Automata Theory. Though the use
answer trivia in order to of Automata Theory is common in
proceed to the next level. The several applied areas such as
Unity Game Engine was used to text-processing, compilers, and
develop the game and JFLAP was hardware designing. It’s use in
the field of game design and differences of opinion about the
development is currently goals of simulation and methods
negligible [2]. to use for achieving a certain
Video games have been a part of goal when developing a game. For
people’s lives no matter what example, while developing an
their age is and can be played educational game, designers must
in any device such as cellphones, understand the context of games
tablets, computers, and laptops. for educational purposes and its
With the emerge of technologies feasibility to be implemented in
like Virtual Reality and code [4]. Not all game designers
Augmented Reality, video games are knowledgeable in programming
were improved; giving the users so there is a difficulty in
the sense of realism that makes translating design to actual
them immerse themselves more implementation; this is where
into the game. In addition, programmers come into picture.
video games in the current To develop a high-quality game,
digital age are not just for both parties should communicate
entertainment; they are also well to achieve certain goals. A
used as educational tools [3]. solution to bridge this gap is
Schools use video games to draw explored in this study through
their students’ interested in Automata Theory [5].
the subject. Video games now are Automata Theory is a theoretical
more advanced compared to a branch of computer science where
decade ago, ranging from virtual automatons are compost of states
toys to hyper-cinematic designed to determine if inputs
blockbuster action experience to should be accepted or rejected.
slow-paced walking simulators. For example, game designers can
These game requires users to use Mealy Machine to model their
follow instructions to designs so programmers can
successfully finish the game, deeply understand the idea and
thereby inadvertently training translate it to code rather than
the user to be more disciplined explaining verbally [6].
in real life. Players also learn Understanding the logic of games
how to face challenges and can be very difficult without
difficult situations in their properly understanding the
lives in a responsive manner. intent of game design. Software
Video games can also be a good products like JFLAP play a vital
approach in introducing new role in implementing the concept
concepts to the users. of automata in game development.
Game designers and programmers JFLAP allows one to experiment
in the gaming industry come from with construction proofs from
different areas of expertise and one form to another, such as
learned about gaming largely converting an NFA to a DFA to a
through their own experience. As minimal state DFA to a regular
a result, there are expected expression or regular grammar.
Traditional game development
uses a production methodology
2 Literature Review that spends a lot of front-end
Virtual Reality has been thought time, defining intended
as the ultimate gaming accessory. functionality, often with
As an e-learning tool it changes implementation of important
the way student learn. Students elements such as mechanics and
are fascinated by different levels waiting around until the
devices like cellphones and mad scramble until the end [10].
tablets which makes it hard to Software development tools for
motivate them. With the use of game development like Extreme
virtual reality that motivation Programming and SCRUM often uses
can be altered [7]. Immersing different phases to finish the
the class with virtual reality development of the game [11].
is a best way to instigate Unlike diagrams and software
learning and stimulate the development tools, automata
student’s interest. Not only theory is much efficient.
that student will be engaged in Diagrams like flow chart, class
the material that they have been diagram and sequence diagram
working on but they have to put uses a lot of symbols which
more effort into their assigned causes a confusion while
tasks [8]. automata theory does not as
In developing games that uses automaton only contains states
virtual reality, Automata Theory and arrows that shows the flow
is an efficient way. An from the starting state to the
automaton which is a construct final state. It is easier to
made of states designed to follow the flow and logic of the
determine if the input should be game helping the programmers
accepted or rejected and runs program the game efficiently.
when it is given a sequence of
inputs in discrete time steps or 3 Methodology
steps. When the automaton Deterministic finite state
receives new input it moves to automaton (DFSA) and Non-
another state based on a deterministic finite state
function that takes the current automaton (NFSA)are also used
state and symbol as parameters. primarily in various levels of
This function is called designing the game. Using JFLAP,
the transition function. The this study applied the Theory of
automaton reads the symbols of Automata in designing a virtual
the input and transitions from reality game; presenting game
state to state according to the design with the use of Mealy
transition function. Once the Machines.
input has been read, the
automaton is said to have 3.1 The Designed Game with
stopped [9]. Automata Theory
A Virtual Reality Game entitled (Game Over), GE (Game Exit), Mm
“Fourth Planet” is a finite game (Mission Menu), Mc (Mission
where player needs to interact Complete), Oc (Object Collected),
on objects to execute base, and Tric (Trivia Collected), Fall
must collect all items and (Player when fell), Ex ( Player
trivia’s in order to proceed in Explore),Tr (Player Travel).
next level. Avoid falling on
C. Game States
destined map in to prevent Game
Over. The researchers used The table below shows the game
automata theory to design the state used in the automaton.
game more efficiently and easier
to program. Table 1: Important states of the
game
A. Defining Input Alphabet
States Descriptions
∑ Player Movement = {Forward,
Start Game Where object will
Backward, Right, Left, run according to
Forward_Right, Forward_Left, their job
Backward_Right,
Main Menu Options to play the
Backward_Left}.
game
∑ Action = {c, i}
End Game If all level is
∑Game = {GO, GE, Mm, Mc, Oc, finished
Tric Fall, Ex, Tr} Laboratory Where combining
elements happen
B. Description of Input Alphabet
Vehicle Use to travel
1.) ∑ Player movement: defines through levels
movements of player in frame per
seconds [Forward (25f), Running Where the player
Backward(-25f), Right(25f), explores the levels
Left(-25f), Forward_Right(25f),
Figure 1 below shows the
Forward_Left(-25f),
automaton of the overall game
Backward_Right(25f),
design. When game start, the
Backward_Left(-25f)].
user will be prompt to the main
menu where the user can select
“play” to go to the level 1. If
the user completed the task
needed, the user will advance to
next level same with the level 3.
If user fell then the user will
2.) ∑ Player`s Actions: defines be prompt back into the game.
the action of player, c (Collect Figure 1: Macro level automaton
Item), i (Interact Object). of Overall Game Design

3.) ∑ Game: defines different


state conditions of game; GO
and use the vehicle to travel
back into the level 1. If the
user completed the task assigned
in the level 2, then the user
will advance in the level 3.

Figure 3: Level 2 Automaton

Figure 2 below shows the


automaton of level 1. The
automaton has 6 states. When the
game started in level one the
user can select “ana” which
means analyze in the game to
access the laboratory. From the
laboratory the user can also
select “b1” which will let the
Figure 4 shows the automaton of
user return into the level 1
the last level of the game. In
environment from the laboratory.
level 3 the user can select “b1”
Also, for the user to explore
to return to the level 1 and
the environment faster, the user
“b2” to return in the level 2.
can select “tr” which stands for
The user will also explore the
travel using the vehicle. If the
environment, finishing the last
user successfully collected all
task to end the game.
the items in level 1, the user
will advance in the next game. Figure 4: Level 3 Automaton

Figure 2: Level 1 Automaton

The next figure also shows the The figure 5 below shows the
automaton of level 2. From level automaton of the laboratory in
1, the user can access level 2 the game. Once the user enters
using the vehicle. It has the the laboratory the user can
same state as the level 1, the select “ch_obj” to choose an
only difference is if the user object in the inventory. The
have to use the laboratory the user will analyze the object
user will have to select “b1” with the data analyzer and after
that the data analyzer will show The model has been tested by
the information of the object in giving possible input. Figure
the computer and combine the below shows the finished game
objects to create chemical based on the automaton.
reaction in the reactor.
Figure 7: Gameplay
Figure 5: Laboratory Automaton

4 Results and Discussions

The game has been successfully


programmed with the automatons
used to design the game.

Figure below illustrates game


scenario; the states, possible
input, and their corresponding
output using Mealy Machine as
design model.

Figure 6: Trace of Valid Inputs


[3] Griffiths, M. (2002). The
educational benefits of
videogames.
https://sheu.org.uk/sheux/EH/e
h203mg.pdf
[4] Almanasra, S., Suwais, K.,
and Mohd Arshad, M. (2013).
The Applications of Automata
in Game Theory. 204 - 217.
10.4018/978-1-4666-4038-
5 Conclusion 2.ch011.
[5] Anitha, E. (2014).
The study show that JFLAP is an Applications of Automata in
effective experimental tool to Electronic Machines and
stimulate the automaton. Mealy Android Games (Finite
machine is used here because it Automata).
is easy to understand than other http://www.academia.edu/776327
0/Applications_of_Automata_in_
machines like Moore and Turning. Electronic_Machines_and_Androi
Also, Mealy machine is a finite d_Games_Finite_Automata
state machine whose outputs are [6] Jamil, A., Ullah, A., and
determined only by its current Rehman, M. (2016). An infinite
state and has less state to make runner game design using
it understandable and fast. automata theory.
http://ijcsse.org/published/vo
Game design based on automation
lume5/issue7/p1-V5I7.pdf
has a very fewer bugs as
compared to any other game
design strategy. This approach [7] Lynch M. (2017). Virtual
eliminates need of case diagrams Reality could Change the Way
and software engineering Students Learn.
principles and most importantly https://www.thetechedvocate.or
g/virtual-reality-change-way-
all invalid input is taken care
students-learn
of at the design phase. [8] Brown, L. (2017). How
Virtual Reality Will Change
REFERENCES Education.
https://filmora.wondershare.co
[1] Alexander, L. (2011). m/virtual-reality/5-ways-vr-
Practice: Do Designers Need to change-education.html
be Programmers.
[9] Anand Sharma, “Theory of
https://www.gamasutra.com/view
Automata and Formal Languages”.
/news/127717/PRACTICE_Do_Desig
Second edition, Ch-2,
ners_Need_To_Be_Programmers.ph
PP.17,87-114, Bulandshahr
p
(U.P), India
[2] Norman Qureshi, “Computing
[10] Claypool, Kaval, and
Game Design with Automata
Claypool, M. "Teaching
Theory”, Engineering
software engineering through
University of Engineering &
Technology, Lahore 2012 game design." ACM SIGCSE
Bulletin 37.3 (2005): 123-127
[11] Rory McGuire (June 28, 2006)
Paper Burns: Game Design with
Agile Methodologies
www.gamasura.com/view/feature/
131151/paper_burns_with_game_d
esign_with.php

You might also like