You are on page 1of 8

PROCEEDINGS

ICCS 2014

International
Conference
on
Computer
System

PROCEEDINGS
OF
ICCS 2014
MAKASAR

International Conference on Computer System


Makasar, Indonesia
5th December, 2014

PROGRAM COMMITTEE
Prof. Dr. Ir. Richardus Eko Indrajit, M.Sc., MBA., Mphil., MA.
Prof. Dr. Ir. Zainal Arifin Hasibuan, M.Sc., PhD.
Prof. Dr. Salama Manjang, MT.
Drs. H. Achmad Batinggi, MPA.
Drs. Suarga, M.Math., Ph.D.
Dr. Moh. Alifuddin, M.M.
Muhammad Diah Yusuf, Ph.D.
Sofyan S.Thayf, MT.

EDITOR
KETUA PENYUNTING
Dr. Eng. Armin Lawi, S.Si., M.Eng
WAKIL KETUA PENYUNTING
Dedy Triawan, S.KOM, MMSI

PUBLISHER
Asosiasi Perguruan Tinggi Komputer (APTIKOM) Wilayah IX Sulawesi

Publisher is not responsible for the content


ISSN : 2407-2567

International Conference on Computer System 2014

Developing Battle of Etam Earth Game Agent


With Finite State Machine (FSM) And Sugeno
Fuzzy
Reza Andrea1, Rufman Iman Akbar2, and Magit Fitroni3

Abstract The Battle of Etam Earth is one of the games which is


developed by Bibir Design Studio for the PC platform, Android
tablets and arcade machines. A modern rock-paper-scissors game is
packaged in a duel battle robots, where there are two players who
will hone their skill, strategy and luck to be able to come out as a
winner
AI technology is needed for this game in order to be played by one
player only. The role of rival players are replaced by the existences of
games agent. Game agents were constructed by transferring
knowledge from the master game in the form of a Finite State
Machine (FSM). The research in this game agent has attracted the
attention of researchers in the field of Artificial Intelligence (AI).
Every action-reaction that will be possibly happened toward the
games which are played, applied into a form of states which will be
the behavior of the agent game.
In this research will show us about the strategy model of the Battle
of Etam Earth, which to design the behavioral of the Agent that was
used Finite State Machine, and to determine the behavioral response
to change the conditions. So that to achieve it , we use the Sugeno
fuzzy logic. The test results through simulation battle, was concluded
that FSM and Sugeno fuzzy could be properly functioned as a pattern
of behavior as an intelligence agent game.

Artificial Intelligence (AI).


Model agent strategies that will be used on this game can be
various, for example, a strategy to strike quickly, then in
certain circumstances the behavior turns into collecting a large
force to attack. Each of agent strategy, generally has the final
goal to defeat the enemy (player). In this research will show us
about the strategy model of the Battle of Etam Earth, which to
design the behavioral of the Agent that was used Finite State
Machine, and to determine the behavioral response to change
the conditions. So that to achieve it, we use the Sugeno fuzzy
logic.
It is known that a system that uses fuzzy logical is able to
handle the uncertainty problem which the input obtained is a
value of separately right [10]. The basis of this research, fuzzy
logical was used in order to obtain the type of attack that
changes the various responses of the agents based on input
variables owned. Furthermore, in determining of changes the
Sugeno fuzzy model was used, where each output behavior of
agents were represented by fixed specified constants which
was decided on the rule.

Keywords The Battle of Etam Earth, Game Agent, Finite State


Machine, Sugeno Fuzzy

II. BASIS OF THEORIES

attle of Etam Earth is one of the games which was


developed by Bibir Design Studio for the PC platform and
Android tablets. A modern rock-paper-scissors game was
packaged in a duel battle robots, which is there are two players
who will hone their skill, strategy and luck to be able to come
out as a winner.
AI technology is needed for this game in order to be played
by one player only. The role of rival players are replaced by
the existences of games agent. Game agents were constructed
by transferring knowledge from the master game in the form of
a Finite State Machine (FSM). Research on this game agent
has attracted the attention of researchers in the field of

A. Game Agent
Game Agent is a software agent. Software Agent is a system
that the whole or the part of an environment which it can
respond it that is located and acted every time, to do its job
and to be able to effect what will be done next.
On this game, the game agent is usually called NPC (NonPlayer Character). Autonomous character is kind of
autonomous agent which is intended for the use of computer
animation and interactive media such as games and virtual
reality. These agents represent a character in a story or a game
and has the ability to improvise their actions. This is the
opposite of a character in an animated film, the action is
written in advance, and for avatar in a game or virtual reality,
action directed by the player in real time.

Reza Andrea1, the Computer Engineering Department, STMIK Widya


Cipta Dharma, 75123 Samarinda, Indonesia (e-mail: reza@bibirdesign.com).
Rufman Iman Akbar2, the Master of Computer Department, STMIK
Eresha, 12160 Jakarta, Indonesia (e-mail: rufman_ia@yahoo.com.sg).
Magit Fitroni3, the Master of Computer Department, STMIK Eresha,
12160 Jakarta, Indonesia (e-mail: fitroni@inovasisigma.co.id).

B. Finite State Machine


In designing the game for AI, a state machine is the most
widely used techniques for decision making problems and, at
the same time with scripting is widely used to design the

I. BACKGROUND

184

International Conference on Computer System 2014


system in-game decision making. State machine is widely
known as a technique for modeling the phenomenon or eventbased conditions, including dissociation, and interface design.
Finite State Machine (FSM) or also known as Finite State
Automata, regarded as a technique that is widely used in
designing the AI in the game.
On the FSM, the term state is a fundamental concept for
presenting information relating to the current state of the
system before. In a periodically time, the system is on one
state, each of state has its characteristics and behavior of
specific actions. The states are inter-connected through a
transition state, then each direct transition to the state
(condition) hereinafter as the target state. There will always be
the initial state which serves as the starting point, then the
condition of the current state which stores the previous state
information. Input events, which are externally and internally
triggered by system, functioning as a trigger, which directs the
evaluation process of the rule. If the conditions are possibly
fulfilled , then there is a transition from the current state to the
next state in accordance with the existing rules [1]. The
principle of the components are integrated on the FSM as
shown in figure 1

1. Mamdani Model
The form of rules which is used on Mamdani models as
follows:
IF (x1 is A1) o (x2 is A2) o .. o (xn is An) THEN z = k (1)

A1, ..., An, k is the linguistic values, and "x1 is A1" states
that the value of the variable x1 is a member of A fuzzy set
2. Sugeno Model
Reasoning on Sugeno method is similar to the reasoning
mamdani, but the output (consequent) system is not in the
form of fuzzy sets, but in the form of a constant or linear
equations
IF (x1 is A1) o (x2 is A2) o .. o (xn is An)
THEN z = p1.x1 + pn.xn + q

(2)

Z can be any function of the variable input whose value is


within the interval output variables.
III. CONTENT OF ANALYSIS
The Battle of Etam Earth Game has the type of game mode :
VS mode, the mode which is each of player must choose one
type of Etam robot to fight until one robot players come out
as the winner and the game ends. Each character has 4 levels
of category types of attacks, which is named as ATK Lv1
(quick attack), Lv2 ATK, LV3 ATK, and ATK Lv 4 (full
charge attack). In each level of this type of attack also has an
attack value of points of different combo attacks each type has
a move list (attack code) that is different, so that these types of
attacks can only be issued if the attacking player with the
correct code. Code move list for a combo attack consists of
some combination of the symbols rock-paper-scissors game,
that is R (rock), S (scissors), and P (Paper) refer to the table I
TABLE I
VARIETY OF ENGGANG BOTS ATTACKS

Fig. 1 Simply diagram of finite state machine on character AI

C. Logika Fuzzy
Fuzzy logical is a way to describe an input space into an
output space. Fuzzy logical is very flexible, can tolerate data
that is not appropriate. Fuzzy logical has a degree of
relationship in the range of 0 (zero) to 1 (one), in contrast to
digital logical which has only two values: 1 (one) or 0 (zero).
In understanding the fuzzy systems, its better for knowing
the fuzzy variables, fuzzy set, the universe of discourse and
domain. Fuzzy variable is a variable that will be covered in a
fuzzy system. Fuzzy Association is a group that represents a
particular condition of fuzzy variables. The Universal talk is a
whole of values that are allowed to be operated in a fuzzy
variables. Domain is the overall value allowed in the universe
of discourse and can be operated in a fuzzy set [10]. There are
many models of fuzzy rules that can be used in the inference
process but there are two models of the most commonly used
rules are:

185

ATK Lv 2
Moon Attack
ATK
Melee
damage
510
Move list

R, S

ATK Lv 3
Torpedo Rain
ATK
Range
damage
580
Move list

ATK Lv 4
Destroyer
ATK
damage
Move list

P, P, P

Range
650
S, P, S, R

International Conference on Computer System 2014


Combo attacks can occur when the player does move list
(attack code) correctly. If a player does not perform the
properly move, then the combo attacks will not happen (Lv.1
attack will happen), combo-attack would not been happened if
the player lost switched (combo broke)

the number of failures that do combo attack agents, and


ATK_Lv is the level of attacks that will be made by the agent.
The sets the number of ATK_Lv = {1, 2, 3, 4}, which is a
subset of level of attack. There are 15 rules that have been set
up as in the example rule below:

A. Design of Finite State Machine


Designing of FSM is based on the events that occur in the
activity log and the player attacks the opponent agent. Combo
attacks would be carried out by opposing players is a priority
framework of FSM state behavior of agents.

R1 : IF HLTM = Very Low AND COMB = Low THEN


ATK_ Lv = 1
R2 : IF HLTM = Very Low AND COMB = Normal THEN
ATK_ Lv = 1
R3 : IF HLTM = Very Low AND COMB = High THEN
ATK_ Lv = 1

R15 : IF HLTM = Very High AND COMB = High THEN


ATK_ Lv = 2

FSM is integrated with fuzzy logical to agents. And the


purpose is the agent can select the appropriate variation of the
attack on the right conditions anyway. FIS overall design can
be seen in Figure 3 below.

Fig. 2 Designing of FSM Agent


Remarks of Fig 2 :
1. Enemies control attack in freeze
2. Combo Lv 2 / 3 / 4 will happen
3. No combo
4. Combo Lv 3 / 4 will happen
5. No combo
6. Enemy of ATK isnt freeze
7. Enemy Combo will happen

8. No Enemy Combo
9. Level 4 attack will happen
10.No level 4 attacks
11.Level 3 attack will happen
12.No level 3 attack
13.No level 2 attack
14.Level 2 attack will happen

Fig. 3 FIS to bear the behavior of agent

IV. SYSTEM VALIDATION

FSM designed starts from state up to check the status of


enemies attack (see in Figure 2, event No. 1), which for certain
conditions, an effect of special combo attacks can make the
enemy attack into a freeze control (random and can be seen by
the other players).
This is the right conditions for agents to launch attacks.
Generally, the designing of the FSM at the agent level is
shown in figure 2
On the final stage, each of FSM behavior of the agent is a
decision that has been given by a fuzzy inference system (FIS).
When the health input FIS points (HLT) and attack enemy
agents fail to be combo. By Using Sugeno fuzzy output will be
produced four attacks which are used include ATK Lv1, Lv2,
LV3, and Lv4.

A. Design Fuzzy Calibration


The tests on Sugeno fuzzy logical designing is performed
using FIS software. In order to test the behavior of agents on
the level of the attacks, several parameters were tested to
determine the variation of the resulting behavior. Parameters
testing such are some of the health variables of enemy players
(HLTM) ranging from minimum to maximum and also some
of the variable combo break agent (COMB) ranging from
minimum to maximum.

A. Design of Sugeno Fuzzy Inference


Variation of attacks were used by the agent, which is
designed using fuzzy logical. The model is used the Sugeno
fuzzy, by considering the output of Sugeno fuzzy model is a
strict constant. The Health Point of HLTM enemies, COMB is
186

Fig. 4 Results of testing the behavior of agents by using different


variable input parameters

International Conference on Computer System 2014


From the variation of the input variables as shown in Figure
4 (left) explains the output behavior in the form of varied color
patterns, which subsequently grouped into four models of the
behavior of agents in terms of changes in the level of attack
types (ATK_Lv) based on a exactly constant value that around
Lv1, Lv2, LV3, and Lv4 as shown in Figure 4 (right).
Rounding is done due to there is nothing the type of output
levels attacks do not in the form of integer numbers, so that the
output in the form of partial numbers of ATK_Lv with the
faint color block will be rounded to the nearest rounding to
round numbers 1, 2, 3, and 4.
B. Battle Simulation
Testing in battle simulations was conducted to see the
effectiveness of FMS agent framework. Tests carried out 2
battles with the implementing agent FSM-FIS and is not
(random attack), by looking at the number of the agents wins.
Battle simulation was performed on the first agent (COM1)
against the second agent (COM2). In this test was using a
robot Enggang Bot COM1 COM2 against the using of robots
were same as in Figure 5. Where discovered both of robots
have the same power.

Tests carried out on the fight agents that implement FSM-FIS


against 10 players.
TABLE III
RESULT BATTLE AGENT VS PLAYER

Player
1
2
3
4
5
6
7
8
9
10
Total of Wins

The Result
COM1
Player
Lose
Win
Win
Lose
Lose
Win
Lose
Win
Win
Lose
Win
Lose
Win
Lose
Win
Lose
Win
Lose
Lose
Win
6
4

Table III showed that the agent won six times against a
human player. The simulation proved that agent is hard to be
defeated by the players.

V. CONCLUSION

Fig. 5 Battle stage agent against agent

Battle simulation testing performed 10 times and counted


the number victory of agents that implement FIS (COM1).
TABLE II
RESULT BATTLE AGENT VS AGENT

Bout to1
2
3
4
5
6
7
8
9
10
Total of Wins

The Result
COM1
COM2
Win
Lose
Win
Lose
Win
Lose
Lose
Win
Lose
Win
Lose
Win
Win
Lose
Win
Lose
Win
Lose
Win
Lose
7
3

From the test results of this study can be obtained several


conclusions such as:
1. To make the game Battle of Etam Earth can be played with
1 player only, then make the game agent as a second player
which implements the FSM as a pattern of thinking.
2. Implementation of Sugeno fuzzy incorporated into the
FSM starts with the identification phase to the game
environment by FSM, where the input variables are used
HLTM value (the value of the lives of the enemy) and
COMB (value of combo attacks that broken agent), then
the decision was given by the FSM processed to the rule, to
be defuzzification output process agent behavior in the
form of attacks LV 1 to 4.
3. The test results was done by the level of intelligence
agencies battle simulation. Simulation between agents
against the other agents and the agent proves that by
applying of FSM and FIS is superior than the agent that
was randomly attacked and also better than the human
player.
REFERENCES
[1]
[2]
[3]
[4]

[5]
[6]

On table II, COM1 with the same type of robot battle won 7
times. It proves COM1 is greater than COM2. Tests were also
done in the form of simulated battle against the user (player).

[7]
[8]

187

Aung Sithu Kyaw, Clifford Peters & Thet Naing Swe. Unity 4.x Game
AI Programming. Birmingham : Packt Publishing Ltd. 2013.
Battle of Etam Earth. www.bibirdesign.com
Bruce Sutherland. Beginning Android C++ Game Development.
Bruce Sutherland : New York. 2013.
David L. Poole & Alan K. Mackworth. Artificial Intelligence
Foundations of Computational Agents. New York : Cambridge
University Press. 2010.
Emanuele Feronato. Flash Game Development by Example.
Birmingham : Packt Publishing. 2011.
Kusumadewi, S., & Purnomo, H. Aplikasi Logika Fuzzy untuk
Pendukung Keputusan. Yogyakarta: Graha Ilmu. 2004.
Michael Daley. Learning iOS Game Programming. Boston : Pearson
Education, Inc. 2011.
Michael Negnevitsky. Artificial Intelligence A Guide to Intelligent
Systems Second Edition. London : Addison-Wesley. 2005.

International Conference on Computer System 2014


[9]

Russell, S. J. and Norvig, P. Artificial Intelligence A Modern Approach


Third Edition. United States of America : Pearson Education, Inc.
2011.
[10] Sri Kusumadewi. Artificial intelligence. Yogyakarta : Graha Ilmu.
2003.
[11] Sue Blackman. Beginning 3D Game Development with Unity 4: Allin-One, Multi-Platform Game Development Second Edition. New York
: Springer Science Business Media, LLC. 2013.
[12] Turban, Efraim; Aronson, Jay; Liang Peng Ting. Decision Support
Systems and Intellegent Systems. New Jersey : Pearson Education, Inc.
2005.

Reza Andrea, M.Kom earned his Bachelors degree


from Computer Science, Mulawarman University in
2012. In 2013 he was involved in a game
development project as a leader of Bibir Design
Studio (www.BibirDesign.com) and he was awarded
the best 2D game developers of Indonesia Game
Show (IGS). In 2014, Reza Andrea earned his
Masters Degree in Business Engineering from
Department of Computer Engineering, STMIK
Eresha, Jakarta, he is a lecturer at STMIK Widya
Cipta Dharma Samarinda, teaching game
programming and multimedia.
Dr. Rufman Iman Akbar E, MM., M.Kom, he is a lecturer at STMIK
Eresha Jakarta, and he is chairman of the postgraduate study program in
STMIK Eresha.
Ir. Magit Fitroni, M.Kom He is a practitioner in the company as well as the
Information Technology lecturer at several universities in Jakarta include
STMIK Eresha. Alumnus graduate informatics engineering and business
administration is very concerned with the world of IT education college.
Activity he is currently a researcher in the field of Information Technology,
trainer, advisor Financial Information System Application in several
companies and also a professor of information technology

188