SlideShare a Scribd company logo
1 of 7
Download to read offline
International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O)
Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P)
www.ijiris.com
_________________________________________________________________________________________________
© 2014, IJIRIS- All Rights Reserved Page -59
The Effectiveness of using a Historical Sequence-based
Predictor Algorithm in the First International RoShambo
Tournament
Sony E. Valdez Vitruvius John D. Barayuga Proceso L. Fernandez
Agoo Computer College, Philippines Ilocos Sur Polytechnic State College Ateneo de Manila University
Abstract— Games can be used as simulations to check the effectiveness and viability of an Artificial Intelligence
technique. In this study, a competitive RoShamBo AI is developed and its performance is measured using the first
International RoShamBo Tournament test suite. The AI stores a history of its opponent's move and checks for
repetition to predict the opponent's next play. A training program was also developed that finds the best performing
bot variant by changing the bot's behavior in terms of increasing the history's window size. The developed AI is shown
to rank high in the competition. This indicates the potential of using the core technique (of the proposed variant) as
an Artificial Intelligence bot to similarly applicable games.
Index Terms— Artificial Intelligence, Game Theory, Rock Paper Scissors, RoShamBo, First International
RoShamBo Tournament test suite
I. INTRODUCTION
In this paper, a Historical Sequence-based Predictor algorithm is presented that is used in the First International
RoShambo Programming Competition test suite.
A. Definitions
This section describes some of the important terminologies that are used in the next sections.
Move. A move is a play that has been selected by a player from among the possible options to select from [1].
Match. An instance of a game between two or more players defined by a sequence of valid moves. A match is over
when the winners and losers have been declared based on the rules of the game [1].
Turn. A turn is a moment during a match when both players each have to select a move that they believe will cause
them to achieve a victory condition [1].
Tournament. A tournament is an event where multiple players play against each other to determine their rank [1].
Predictor. A predictor is an algorithm that can predict the next symbol in a sequence of symbols as a probability
distribution over the alphabet of symbols [2].
B. RoShamBo Game
RoShamBo is a two-player game where both players pick a move that will defeat their opponent. The moves are
{Rock, Paper, and Scissors}. Each player chooses a move in secret. After a predetermined amount of time, each player
will reveal their chosen move. The winner of this turn is then determined from Table I. The game is repeated until a
predetermined condition is fulfilled (such as first-to-three wins).
C. International RoShamBo Programming Competition
The First International RoShamBo Programming Competition was conceptualized by Darse Billing on September
1999 [3]. The results have been published in the International Computer Games Association (ICGA) Journal [4].
The programming competition uses the C programming language. Each competitor creates an Artificial Intelligence
(AI) bot that returns 0, 1, or 2; representing rock, paper, and scissors. The bots are matched up with other participating
bots in a round-robin tournament. One match-up will last for 1000 turns.
1) RoShamBo Ranking System: The RoShamBo tournament uses two different rankings. The tournament results
ranks the bots on how many turns they won in total. The match results ranks the bots on how many matches they won: a
match is won if they have > 50 points, a lost if they have < -50 points, and a tie otherwise.
D. RoShamBo Test Suite AIs
The First International RoShamBo Programming Competition test suite included some AIs from the first
tournament. The following AIs are relevant to this paper:
TABLE I: RPS VICTORY CONDITIONS
P2 plays rock P2 plays paper P2 plays scissors
P1 plays rock Tie P2 wins P1 wins
P1 plays paper P1 wins Tie P2 wins
P1 plays scissors P2 wins P1 wins Tie
International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O)
Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P)
www.ijiris.com
_________________________________________________________________________________________________
© 2014, IJIRIS- All Rights Reserved Page -60
1) MegaHAL: MegaHAL is Jason Hutchens' entry to the First International RoShamBo tournament which ranked
3rd in the overall standings. It is based on his chatbot of the same name that he had entered in the 1998 Loebner Prize
Contest [5].
Hutchens has theorized that RoShamBo is susciptible to predictive algorithms [2]. To predict its opponent,
MegaHAL records the history of both players in alternating sequence. From this sequence, it tries to predict its
opponent's next play.
MegaHAL uses an infinite context Markov model [2]. It stores the frequency of the opponent's move based on past
contexts. Every turn, it updates the score that each context would have earned if it was chosen in previous turn. Once the
opponent is predicted, MegaHAL chooses the context with the highest average score. It plays the move that with the
highest expected score gain based on the prediction. In case of a tie, the longest context is used. If no prediction is found,
MegaHAL plays at random.
MegaHAL only uses the last n moves of history, where n is a predetermined number. This allows it adapt to changes
in the opponent's strategy. In the test suite, n = 200 moves.
2) Iocaine Powder: The Iocaine Powder bot is the AI that ranked highest in the first International RoShamBo
Programming Competition. At its core, it applies predictive algorithms to both its opponent and against itself. Using a
meta-strategy, it will try to predict and outplay its opponent. If it detects that the opponent is trying to predict how
Iocaine Powder plays, it'll play against itself.
A more detailed discussion of this is available in Valdez [1].
E. Research Questions
In this study, we try to answer the following questions:
1) Can we develop an AI based on direct history that can perform well in the first International RoShamBo
Tournament test suite?
2) What are the variables that can change the AI's behavior?
3) Among the different AI variants, can we identify the highest ranking variant of the bot?
II. RELATED LITERATURE
A. AI in General
Artificial Intelligence is a branch of computer science and was first coined by John McCarthy and founded at the
Dartmouth College conference [6]. They define AI as algorithms that are developed with the purpose of mimicking
human-like intelligence.
When presented with a problem, a human starts by analyzing the problem. These analysis are then used in making a
decision to solve the problem [7]. This problem solving model can be implemented in AI using a problem analysis
component and a decision-making component.
An AI can develop complex and unexpected behavior, referred to as “Emergent Behavior”. This occurs when an AI
reacts to an event in such a way that was not explicitly programmed by the AI developer [8].
B. AI in Games
Researchers have studied games such as Chess and Poker for AI development. IBM devloped a Chess AI, called
Deep Blue, that defeated then World Chess Champion Garry Kasparov [9]. Building on his RoShamBo work, Darse
Billings have also developed a testbed for Poker, to aid machine intelligence research [10].
In the video game Quake 3, a group of bots was developed that exhibit human behavior using AI technologies [11].
C. Publications in RoShamBo
In the International Computer Games Association (ICGA) Journal, the results of the First International RoShamBo
Programming Competition is published [4]. This is the basis for the work in this paper.
According to [12], there are two approaches used to produce strong RoShamBo players. The first approach uses
“purely statistical techniques” where a strategy is chosen and statistical techniques are developed to model that strategy.
The second appraoch uses the “direct history method” which analyzes for patterns.
History ...PPSRSPPSRSPPS
SequenceLength5 R S P P S
SequenceLength4 S P P S
SequenceLength3 P P S
SequenceLength2 P S
SequenceLength1 S
Fig. 1: WindowSize=5 example diagram
International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O)
Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P)
www.ijiris.com
_________________________________________________________________________________________________
© 2014, IJIRIS- All Rights Reserved Page -61
Prior to this work, the primary author of this paper has developed an AI to participate in the First International
RoShamBo Tournament. While the AI developed for this paper uses a direct history method, our previous paper uses a
statistical technique [1], [13]
III. METHODOLOGY
The main flow of this study is as follows:
1) Create an Artificial Intelligence RoShamBo bot based on the direct history strategy.
2) Create a training program for the AI bot that can modify the behavior of the AI.
3) Take a modified program returned by the training program and run the AI in the first International RoShamBo
Programming test suite1
. The rankings are recorded, the training program is re-run to create a new version, and the
process is repeated. Once new versions are determined to not improve in ranking, the best performing version of the bot
is determined.
Some parts of this proposed flow require further descriptions and are expanded in the next sections.
A. Historical Sequence-based Predictor
We based our AI on the idea that some opponents have tendencies to repeat their previous move sequences.
At the start of the match, by default, we assume that the opponent will use Rock. We do not randomize our first
move as to minimize using the shared random number generator (RNG). This is to reduce any influence on other AIs that
uses the RNG.
After the first turn, we start recording the opponent's move into a history variable.
Prior to running the test suite, a WindowSize (WS) is decided on. This controls the size of the sequence
(SequenceLength) that the AI will search in the opponent's history in each iteration.
Figure 1 shows what SequenceLength contains, given that the opponent's history is PPSRSPPSRSPPS and WS=5.
When predicting the opponent's next move, the AI will looks into the history and observes RSPPS (SequenceLength5),
SPPS (SequenceLength4), PPS (SequenceLength3), PS (SequenceLength2), and finally S (SequenceLength1). If a search
result is found, the AI does not check the next SequenceLength.
The AI grabs the last n turns from the history, where n = SequenceLength and assign it to the variable Seq. It looks
for the occurance of Seq in the history. If SequenceLength is larger than length of the history, we iterate to the next
smaller SequenceLength. If no Seq is found, we iterate the next SequenceLength.
When Seq is found, the AI adds that move to a running tally for Rock, Paper, and Scissors. It does this until it has
exhausted the entire history. When making its prediction, it returns the move that has the highest tally. In case of a tie, it
counts how many times each move has occured in the entire history and return the move with the highest count. In case
of another tie, it selects at random from among the tied moves, which will be the only time it uses the RNG. Finally, it
returns the predicted move.
Continuing our example, if PPS has multiple hits, a tally is recorded. If in the history, PPSR, PPSP and PPSP is
found at different positions, P will be its prediction, as it has the highest tally.
The program's flowchart and code listing can be found at Fig. 2 and 3, respectively.
B. Training Program
We exposed the WindowSize variable to an external program by adding to the code in the original RoShamBo test
suite. These hooks our training program to the test suite allowing it to directly change the bot's behavior. The test suite
uses C while our AI and training program uses Python.
At each training iteration, the training program replays the tournament using different values for WindowSize. The
result for each iteration are then saved in a database for analysis.
A Python script analyzer will parse the database and extract the ranking of each AI variant. The script will then
render the data into a chart.
All of the above scripts are what the training program is made of.
1 The Shofar AI in the test suite has a off-by-one bug which throws out an exception (line 3021 in the original
unmodified source code). The researchers avoided the exception by modifying the assert. But as a side-effect, some
random numbers cause Shofar to return an invalid move. But by design, the test suite will modulo any invalid move
by 3, allowing the tournament to continue as normal.
International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O)
Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P)
www.ijiris.com
_________________________________________________________________________________________________
© 2014, IJIRIS- All Rights Reserved Page -62
C. Source Code
The researchers have uploaded to an online repository the following: the source code, the results, and the tools to
analyze the results [14].
IV. RESULTS
A. Rankings
Against the 41 AIs from the First International RoShamBo Test Suite, this paper's AI best performances are 11 for
tournament ranking and 6 for match ranking.
The score of 11 in tournament ranking goes to WS=5. The score of 6 in match ranking goes to WS=9.
Figures 4 and 5 show the position of each variant in the tournament ranking system and the match ranking system,
respectively. Table II contains the results against each 41 opponents.
B. Insights and Observations
During the course of the research, we have gained insights on our AI's behavior against other AIs. We have written
up the following observations on these match-ups:
1) One-on-one against other AIs: The test suite contains dummy bots which are bots that have the most basic
algorithm developed by Darse Billings. The Historical Sequence-based Predictor AI is consistent in defeating the dummy
bots Good Ole Rock (AI only plays Rock), R-P-S 20-20-60 (AI uses the RNG to pick Rock, Paper, and Scissors with a
ratio of 20%, 20%, and 60%, respectively) and Rotate R-P-S (AI cycles between Rock, Paper, and Scissors). These two
bots have very predictable patterns and defeating them shows that our AI can predict simple patterns. It only needs WS=1
to win against these bots. We have received a perfect score against Good Ole Rock, but this can be attributed to our
default prediction of Rock at the start of the match.
Our AI has an interesting interaction against the Beat Frequent Pick dummy bot (a bot that tries to model its
opponent's frequent picks and beats it). This bot is modelling our AI and our bot is modeling the dummy bot's history.
This back and forth modelling has caused our AI to accidentally trap the BFP bot by making it play moves that are
predictable. This is an example of emergent behavior where an AI responds with behavior that is not explicitly
programmed [8], [15].
Fig. 4: Tournament results (lower is better) Fig. 5: Match results (Lower is better)
International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O)
Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P)
www.ijiris.com
_________________________________________________________________________________________________
© 2014, IJIRIS- All Rights Reserved Page -63
Fig. 2: Program flowchart
AI() function
/*currentTurn contains how many turns has passed*/
if currentTurn == 0:
call the Initialize subroutine
return 0/* Rock */
Add opponent’s move from last turn into History
Prediction =Predictor() function
/*Play the move that beats the prediction*/
Move = (Prediction + 1) %3
return Move
Initialize subroutine
WindowSize =1..29
History =[]
Predictor() function
for SequenceLength in [1..WindowSize]:
if SequenceLength >len(History): continue
prediction =CheckHistory(SequenceLength)
if prediction != -1: return prediction
return 0 /* Rock */
CheckHistory(SequenceLength) function
/*Get the last n turns from History and assign it to Seq*/
Seq =History[-SequenceLength:]
/*Search for Seq in History, excluding the last n turns */
found =History.find(Seq, 0, -SequenceLength)
if found == -1: return -1
/*If found, check the move the opponent played after the sequence
and add that to a running tally.*/
tally =[0, 0, 0]
while found != -1:
end = found + len(Seq)
move = History[end:end + 1]
tally[move] +=1
/*Keep looping until the entire history is checked.*/
found= History.find(Seq, found+ 1,-SequenceLength)
prediction =GetHighestTally(tally)
return prediction
GetHighestTally(tally) function
highest = max(tally)
if tally.count(highest) == 1:
/*Get the move with the highest tally*/
prediction =tally.index(highest)
return prediction
elif tally.count(highest) >1:
/*In case of a tie, count which move is played most often*/
MoveCount= [0, 0,0]
for move in [0, 1, 2]:
if tally[move] == highest:
MoveCount[move] = History.count(move)
highest =max(MoveCount)
if moveCount.count(highest) == 1:
return moveCount.index(highest)
/*If the above can’t find a prediction, randomly select from
the tied moves.*/
return random(tally)
Fig. 3: AI code listing
International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O)
Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P)
www.ijiris.com
_________________________________________________________________________________________________
© 2014, IJIRIS- All Rights Reserved Page -64
Our AI loses against the PI dummy bot which uses the constant PI as its source of moves. This is expected as PI has
no pattern to predict.
The dummy bot Switch A Lot, is a bot that constantly changes moves and does not use the same move twice in a
row. However, it still loses to our AI. By not using the same move twice, Switch A Lot has developed patterns that can be
predicted.
Against MegaHAL, another bot that uses the direct history method, our AI never won a match. The highest points
our AI received was from the WS=8 variant, with a positive score of 17. Although this counts as a loss (a minimum of 50
is needed to count as a win), this shows that defeating MegaHAL is possible. MegaHAL's decision making consists of
calculating which move gives the maximum expected score. Adding a more sophisticated decision making can improve
our standing against MegaHAL. Against the highest ranking bot, the Iocaine Powder AI, our AI never won. Compared to
MegaHAL, we did not receive a positive score against Iocaine Powder. Iocaine Powder has a problem analysis
component that tries to predict itself. If it detects that the opponent has predicted the Iocaine Powder algorithm, it will
play moves that will defeat its own plays.
2) Tournament performance insights: This paper's AI has a ranking of 11 for tournament ranking. One area that can
improve this ranking, is to have an algorithm designed to maximize the number of points to be won. In match ranking,
the AI has a high rank of 6. Only +50 points advantage is needed to win a match. The AI might not have won a lot of
overall points, but it can earn enough points to win individual matches. For a game that just ranks for victories in match-
ups, the Historical Sequence-based Predictor can be applied. We run our training program to look for a max of 29
sequences. We have observed that performance does not improve from WS=29 onwards for both rankings.
TABLE I I: WINDOWSI ZE ONE-ON-ONE PERFORMANCES
Best Worst
AI Opp onent WindowSize Score WindowSize Score
Good Ole Rock WS =1 1000 WS =1 1000
R-P-S 20-20-60 WS =1 404 WS =11 244
Rotate R-P-S WS =1 997 WS =1 997
Beat The Last Move WS =2 860 WS =1 -6
Always Switchin WS =15 256 WS =2 127
Beat Frequent Pick WS =10 733 WS =17 585
Pi WS =2 2 WS =4 -63
Switch A Lot WS =1 206 WS =12 106
Flat WS =2 148 WS =1 13
Anti-Flat WS =2 1000 WS =1 998
Foxtrot WS =25 427 WS =1 -45
De Bruijn WS =4 -18 WS =3 -240
Text WS =1 175 WS =11 136
Anti-rotn WS =11 61 WS =1 -18
Copy-drift WS =2 90 WS =25 -60
Add-react WS =4 102 WS =1 -2
Add-drift WS =11 55 WS =10 -24
Iocaine Powder WS =3 -318 WS =25 -815
Phasenbott WS =3 -191 WS =10 -815
MegaHAL WS =8 17 WS =2 -309
RussRocker4 WS =6 18 WS =1 -427
Biopic WS =8 -18 WS =3 -201
Simple Modeller WS =19 10 WS =1 -259
Simple Predictor WS =19 93 WS =1 -327
Robertot WS =19 53 WS =1 -263
Boom WS =19 51 WS =1 -180
Shofar WS =9 53 WS =1 -129
ACT-R Lag2 WS =19 33 WS =2 -99
Majikthise WS =8 37 WS =7 -20
Vroomfondel WS =4 39 WS =6 -73
Granite WS =9 132 WS =1 -201
Marble WS =19 154 WS =1 -159
ZQ Bot WS =11 184 WS =1 -238
Sweet Rocky WS =5 70 WS =1 -138
Piedra WS =25 65 WS =1 -204
Mixed Strategy WS =7 149 WS =1 -109
Multi-strategy WS =4 385 WS =25 158
Inocencio WS =1 791 WS =3 -10
Peterb ot WS =5 382 WS =13 24
Bugbrain WS =8 35 WS =1 -209
Knucklehead WS =4 594 WS =1 -16
International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O)
Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P)
www.ijiris.com
_________________________________________________________________________________________________
© 2014, IJIRIS- All Rights Reserved Page -65
MegaHAL and Iocaine Powder has a more sophisticated decision making component in comparison to our AI. This
causes them to be consistent in ranking high. This shows that developing a more robust decision making system will be a
good focus for improving the AI.
V. CONCLUSIONS
In this paper, we have developed an Artificial Intelligence to play in a RoShamBo tournament. We have identified the
variables that controls the behaviour of the bot and created a training program that finds the highest ranking AI variant.
The Historical Sequence-based Predictor AI has a best ranking of 11 for the tournament ranking and 6 for the match
ranking among the 41 AI participants. These are good indicators that the basic idea behind the AI can be applied in
RoShamBo AI. With more improvements, it is possible to get a better ranking.
A. Future Directions
1) Applying the AI to other games: The developed AI is a bot that reads its opponent's history and tries to predict
their next move. There are many competitive games where this approach can be used such as Chess, Poker, Pokémon,
Street Fighter, and more. It is even possible to have a database of previously played matches and use that in predicting a
specific opponent (a meta analysis).
2) Decision making component: We have developed a problem analysis algorithm to predict an opponent. The
decision making in this game is simple: using the prediction, select the move that beats it. To improve the AI, a more
sophisticated decision making component can be applied. The researchers propose a decision making component that will
play a move, taking into account the prediction, the opponent's state of mind, and the current meta will considerably
approve the AI. This is outside the scope of this paper, but the researchers are interested in studying this further.
REFERENCES
[1] S. Valdez, G. Siddayao, and P. Fernandez, “The effectiveness of using a modified “beat frequent pick” algorithm in
the first international roshambo tournament,” 2015, pp. 740–747.
[2] J. Hutchens, “Megahal roshambo.” [Online]. Available:
http://web.archive.org/web/20020802183909/http://www.amristar.com.au/~hutch/roshambo/
[3] D. Billings, The First International RoShamBo Programming Competition, Oct 1999, revised July 2000. [Online].
Available: http://webdocs.cs.ualberta.ca/~darse/rsbpc1.html
[4] D. Billings, “The first international roshambo programming competition.” ICGA Journal, Vol. 23, No. 1, 2000.
[5] J. L. Hutchens and M. D. Alder, “Introducing megahal,” in Proceedings of the Joint Conferences on New Methods
in Language Processing and Computational Natural Language Learning, ser. NeMLaP3/CoNLL ’98. Stroudsburg,
PA, USA: Association for Computational Linguistics, 1998, pp. 271–274. [Online]. Available:
http://dl.acm.org/citation.cfm?id=1603899.1603945
[6] J. McCarthy, M. L. Minsky, N. Rochester, and C. E. Shannon, “A proposal for the dartmouth summer research
project on artificial intelligence, august 31, 1955,” AI Magazine, vol. 27, no. 4, p. 12, 2006.
[7] C. Kepner and B. Tregoe, The rational manager: a systematic approach to problem solving and decision making.
[8] C. Bailey and M. Katchabaw, “An emergent framework for realistic psychosocial behaviour in non player
characters,” in Proceedings of the 2008 Conference on Future Play: Research, Play, Share. ACM, 2008, pp. 17–24.
[9] M. Campbell, A. J. Hoane Jr, and F. Hsu, “Deep blue,” Artificial intelligence, vol. 134, no. 1, pp. 57–83, 2002.
[10] D. Billings, D. Papp, J. Schaeffer, and D. Szafron, “Poker as a testbed for ai research,” in Advances in Artificial
Intelligence. Springer, 1998, pp. 228–238.
[11] J. van Waveren, The Quake III Arena Bot. University of Technology Delft, June 28th, 2001.
[12] D. Billings, “The second international roshambo programming competition report,” March 20, 2001. [Online].
Available: http://webdocs.cs.ualberta.ca/~darse/rsbpc.html#REPORT
[13] S. Valdez, G. Siddayao, and P. Fernandez, “Source code for the conference paper: The effectiveness of using a
modified “beat frequent pick” algorithm in the first international roshambo tournament,” Jun 2014. [Online].
Available: http://dx.doi.org/10.5281/zenodo.10478
[14] S. Valdez, V. J. D. Barayuga, and P. Fernandez, “Source code for the paper: The Effectiveness of using a Historical
Sequence-based Predictor Algorithm in the First International RoShambo Tournament,” Nov 2014. [Online].
Available: http://dx.doi.org/10.5281/zenodo.12617
[15] L. Steels, “A case study in the behavior-oriented design of autonomous agents,” in Proceedings of the third
international conference on Simulation of adaptive behavior: from animals to animats, vol. 3, 1994, pp. 445–452.

More Related Content

Viewers also liked

Authentic Data Exchange in Wireless Sensor Networks Ensuring Integrity and Co...
Authentic Data Exchange in Wireless Sensor Networks Ensuring Integrity and Co...Authentic Data Exchange in Wireless Sensor Networks Ensuring Integrity and Co...
Authentic Data Exchange in Wireless Sensor Networks Ensuring Integrity and Co...
AM Publications,India
 
Secure Data Encryption and Authentication using Visual Cryptography in the TS...
Secure Data Encryption and Authentication using Visual Cryptography in the TS...Secure Data Encryption and Authentication using Visual Cryptography in the TS...
Secure Data Encryption and Authentication using Visual Cryptography in the TS...
AM Publications,India
 

Viewers also liked (10)

Research on the problems and Countermeasures of China's Regional investment a...
Research on the problems and Countermeasures of China's Regional investment a...Research on the problems and Countermeasures of China's Regional investment a...
Research on the problems and Countermeasures of China's Regional investment a...
 
COORDINATE BASED ENCRYPTION PROTOCOL
COORDINATE BASED ENCRYPTION PROTOCOLCOORDINATE BASED ENCRYPTION PROTOCOL
COORDINATE BASED ENCRYPTION PROTOCOL
 
Effects of RMB Appreciation on Chinese International Trade
Effects of RMB Appreciation on Chinese International TradeEffects of RMB Appreciation on Chinese International Trade
Effects of RMB Appreciation on Chinese International Trade
 
The Status Quo of the Development of Mobile Phone Industry in China
The Status Quo of the Development of Mobile Phone Industry in ChinaThe Status Quo of the Development of Mobile Phone Industry in China
The Status Quo of the Development of Mobile Phone Industry in China
 
Challenges to Change and Innovation in Educational System
Challenges to Change and Innovation in Educational SystemChallenges to Change and Innovation in Educational System
Challenges to Change and Innovation in Educational System
 
Intelligent Network Surveillance Technology for APT Attack Detections
Intelligent Network Surveillance Technology for APT Attack DetectionsIntelligent Network Surveillance Technology for APT Attack Detections
Intelligent Network Surveillance Technology for APT Attack Detections
 
Authentic Data Exchange in Wireless Sensor Networks Ensuring Integrity and Co...
Authentic Data Exchange in Wireless Sensor Networks Ensuring Integrity and Co...Authentic Data Exchange in Wireless Sensor Networks Ensuring Integrity and Co...
Authentic Data Exchange in Wireless Sensor Networks Ensuring Integrity and Co...
 
AREA EFFICIENT ENCODING TECHNIQUE FOR REDUCING POWER IN DSRC
AREA EFFICIENT ENCODING TECHNIQUE FOR REDUCING   POWER IN DSRCAREA EFFICIENT ENCODING TECHNIQUE FOR REDUCING   POWER IN DSRC
AREA EFFICIENT ENCODING TECHNIQUE FOR REDUCING POWER IN DSRC
 
Secure Data Encryption and Authentication using Visual Cryptography in the TS...
Secure Data Encryption and Authentication using Visual Cryptography in the TS...Secure Data Encryption and Authentication using Visual Cryptography in the TS...
Secure Data Encryption and Authentication using Visual Cryptography in the TS...
 
Frequency Domain Approach of Image Steganography
Frequency Domain Approach of Image SteganographyFrequency Domain Approach of Image Steganography
Frequency Domain Approach of Image Steganography
 

Similar to The Effectiveness of using a Historical Sequence-based Predictor Algorithm in the First International RoShambo Tournament

Elg 5100 project report anurag &amp; jayanshu
Elg 5100 project report   anurag &amp; jayanshuElg 5100 project report   anurag &amp; jayanshu
Elg 5100 project report anurag &amp; jayanshu
Anurag Das
 
Dynamic Role Engine and Formation Control for Cooperating Agents with Robust ...
Dynamic Role Engine and Formation Control for Cooperating Agents with Robust ...Dynamic Role Engine and Formation Control for Cooperating Agents with Robust ...
Dynamic Role Engine and Formation Control for Cooperating Agents with Robust ...
Waqas Tariq
 
Di3211291134
Di3211291134Di3211291134
Di3211291134
IJMER
 
A survey on AI in computer games
A survey on AI in computer gamesA survey on AI in computer games
A survey on AI in computer games
RedwanIslam12
 
Genetic Algorithm Demonstation System
Genetic Algorithm Demonstation SystemGenetic Algorithm Demonstation System
Genetic Algorithm Demonstation System
Benjamin Murphy
 

Similar to The Effectiveness of using a Historical Sequence-based Predictor Algorithm in the First International RoShambo Tournament (20)

Elg 5100 project report anurag &amp; jayanshu
Elg 5100 project report   anurag &amp; jayanshuElg 5100 project report   anurag &amp; jayanshu
Elg 5100 project report anurag &amp; jayanshu
 
Cricket 2
Cricket 2Cricket 2
Cricket 2
 
Learning to Reason in Round-based Games: Multi-task Sequence Generation for P...
Learning to Reason in Round-based Games: Multi-task Sequence Generation for P...Learning to Reason in Round-based Games: Multi-task Sequence Generation for P...
Learning to Reason in Round-based Games: Multi-task Sequence Generation for P...
 
Dynamic Role Engine and Formation Control for Cooperating Agents with Robust ...
Dynamic Role Engine and Formation Control for Cooperating Agents with Robust ...Dynamic Role Engine and Formation Control for Cooperating Agents with Robust ...
Dynamic Role Engine and Formation Control for Cooperating Agents with Robust ...
 
Comparative Analysis of Machine Learning Models for Cricket Score and Win Pre...
Comparative Analysis of Machine Learning Models for Cricket Score and Win Pre...Comparative Analysis of Machine Learning Models for Cricket Score and Win Pre...
Comparative Analysis of Machine Learning Models for Cricket Score and Win Pre...
 
Cricket Score and Winning Prediction
Cricket Score and Winning PredictionCricket Score and Winning Prediction
Cricket Score and Winning Prediction
 
TIṬAL – Asynchronous multiplayer shooter with procedurally generated maps
TIṬAL – Asynchronous multiplayer shooter with procedurally generated mapsTIṬAL – Asynchronous multiplayer shooter with procedurally generated maps
TIṬAL – Asynchronous multiplayer shooter with procedurally generated maps
 
Predicting Football Match Results with Data Mining Techniques
Predicting Football Match Results with Data Mining TechniquesPredicting Football Match Results with Data Mining Techniques
Predicting Football Match Results with Data Mining Techniques
 
Di3211291134
Di3211291134Di3211291134
Di3211291134
 
A survey on AI in computer games
A survey on AI in computer gamesA survey on AI in computer games
A survey on AI in computer games
 
R.A.W - THE GAME
R.A.W - THE GAMER.A.W - THE GAME
R.A.W - THE GAME
 
Stratego
StrategoStratego
Stratego
 
IRJET- No More Third Umpires
IRJET-  	  No More Third UmpiresIRJET-  	  No More Third Umpires
IRJET- No More Third Umpires
 
An analysis of minimax search and endgame databases in evolving awale game pl...
An analysis of minimax search and endgame databases in evolving awale game pl...An analysis of minimax search and endgame databases in evolving awale game pl...
An analysis of minimax search and endgame databases in evolving awale game pl...
 
AN ANALYSIS OF MINIMAX SEARCH AND ENDGAME DATABASES IN EVOLVING AWALE GAME PL...
AN ANALYSIS OF MINIMAX SEARCH AND ENDGAME DATABASES IN EVOLVING AWALE GAME PL...AN ANALYSIS OF MINIMAX SEARCH AND ENDGAME DATABASES IN EVOLVING AWALE GAME PL...
AN ANALYSIS OF MINIMAX SEARCH AND ENDGAME DATABASES IN EVOLVING AWALE GAME PL...
 
Genetic Algorithm Demonstation System
Genetic Algorithm Demonstation SystemGenetic Algorithm Demonstation System
Genetic Algorithm Demonstation System
 
Android application - Tic Tac Toe
Android application - Tic Tac ToeAndroid application - Tic Tac Toe
Android application - Tic Tac Toe
 
Game Playing in AI Research and Education system
Game Playing in AI Research and Education systemGame Playing in AI Research and Education system
Game Playing in AI Research and Education system
 
Research Proposal
Research ProposalResearch Proposal
Research Proposal
 
Game playing in AI
Game playing in AIGame playing in AI
Game playing in AI
 

Recently uploaded

➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
amitlee9823
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
nirzagarg
 
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
amitlee9823
 
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
gajnagarg
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
amitlee9823
 
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
amitlee9823
 

Recently uploaded (20)

VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
 
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
 
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Hingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRL
Hingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRLHingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRL
Hingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRL
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
 
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
 
Lecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptxLecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptx
 
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedWhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentation
 
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service AvailableCall Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
 
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
 
Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
 
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
 
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls AgencyHire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
 

The Effectiveness of using a Historical Sequence-based Predictor Algorithm in the First International RoShambo Tournament

  • 1. International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O) Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P) www.ijiris.com _________________________________________________________________________________________________ © 2014, IJIRIS- All Rights Reserved Page -59 The Effectiveness of using a Historical Sequence-based Predictor Algorithm in the First International RoShambo Tournament Sony E. Valdez Vitruvius John D. Barayuga Proceso L. Fernandez Agoo Computer College, Philippines Ilocos Sur Polytechnic State College Ateneo de Manila University Abstract— Games can be used as simulations to check the effectiveness and viability of an Artificial Intelligence technique. In this study, a competitive RoShamBo AI is developed and its performance is measured using the first International RoShamBo Tournament test suite. The AI stores a history of its opponent's move and checks for repetition to predict the opponent's next play. A training program was also developed that finds the best performing bot variant by changing the bot's behavior in terms of increasing the history's window size. The developed AI is shown to rank high in the competition. This indicates the potential of using the core technique (of the proposed variant) as an Artificial Intelligence bot to similarly applicable games. Index Terms— Artificial Intelligence, Game Theory, Rock Paper Scissors, RoShamBo, First International RoShamBo Tournament test suite I. INTRODUCTION In this paper, a Historical Sequence-based Predictor algorithm is presented that is used in the First International RoShambo Programming Competition test suite. A. Definitions This section describes some of the important terminologies that are used in the next sections. Move. A move is a play that has been selected by a player from among the possible options to select from [1]. Match. An instance of a game between two or more players defined by a sequence of valid moves. A match is over when the winners and losers have been declared based on the rules of the game [1]. Turn. A turn is a moment during a match when both players each have to select a move that they believe will cause them to achieve a victory condition [1]. Tournament. A tournament is an event where multiple players play against each other to determine their rank [1]. Predictor. A predictor is an algorithm that can predict the next symbol in a sequence of symbols as a probability distribution over the alphabet of symbols [2]. B. RoShamBo Game RoShamBo is a two-player game where both players pick a move that will defeat their opponent. The moves are {Rock, Paper, and Scissors}. Each player chooses a move in secret. After a predetermined amount of time, each player will reveal their chosen move. The winner of this turn is then determined from Table I. The game is repeated until a predetermined condition is fulfilled (such as first-to-three wins). C. International RoShamBo Programming Competition The First International RoShamBo Programming Competition was conceptualized by Darse Billing on September 1999 [3]. The results have been published in the International Computer Games Association (ICGA) Journal [4]. The programming competition uses the C programming language. Each competitor creates an Artificial Intelligence (AI) bot that returns 0, 1, or 2; representing rock, paper, and scissors. The bots are matched up with other participating bots in a round-robin tournament. One match-up will last for 1000 turns. 1) RoShamBo Ranking System: The RoShamBo tournament uses two different rankings. The tournament results ranks the bots on how many turns they won in total. The match results ranks the bots on how many matches they won: a match is won if they have > 50 points, a lost if they have < -50 points, and a tie otherwise. D. RoShamBo Test Suite AIs The First International RoShamBo Programming Competition test suite included some AIs from the first tournament. The following AIs are relevant to this paper: TABLE I: RPS VICTORY CONDITIONS P2 plays rock P2 plays paper P2 plays scissors P1 plays rock Tie P2 wins P1 wins P1 plays paper P1 wins Tie P2 wins P1 plays scissors P2 wins P1 wins Tie
  • 2. International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O) Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P) www.ijiris.com _________________________________________________________________________________________________ © 2014, IJIRIS- All Rights Reserved Page -60 1) MegaHAL: MegaHAL is Jason Hutchens' entry to the First International RoShamBo tournament which ranked 3rd in the overall standings. It is based on his chatbot of the same name that he had entered in the 1998 Loebner Prize Contest [5]. Hutchens has theorized that RoShamBo is susciptible to predictive algorithms [2]. To predict its opponent, MegaHAL records the history of both players in alternating sequence. From this sequence, it tries to predict its opponent's next play. MegaHAL uses an infinite context Markov model [2]. It stores the frequency of the opponent's move based on past contexts. Every turn, it updates the score that each context would have earned if it was chosen in previous turn. Once the opponent is predicted, MegaHAL chooses the context with the highest average score. It plays the move that with the highest expected score gain based on the prediction. In case of a tie, the longest context is used. If no prediction is found, MegaHAL plays at random. MegaHAL only uses the last n moves of history, where n is a predetermined number. This allows it adapt to changes in the opponent's strategy. In the test suite, n = 200 moves. 2) Iocaine Powder: The Iocaine Powder bot is the AI that ranked highest in the first International RoShamBo Programming Competition. At its core, it applies predictive algorithms to both its opponent and against itself. Using a meta-strategy, it will try to predict and outplay its opponent. If it detects that the opponent is trying to predict how Iocaine Powder plays, it'll play against itself. A more detailed discussion of this is available in Valdez [1]. E. Research Questions In this study, we try to answer the following questions: 1) Can we develop an AI based on direct history that can perform well in the first International RoShamBo Tournament test suite? 2) What are the variables that can change the AI's behavior? 3) Among the different AI variants, can we identify the highest ranking variant of the bot? II. RELATED LITERATURE A. AI in General Artificial Intelligence is a branch of computer science and was first coined by John McCarthy and founded at the Dartmouth College conference [6]. They define AI as algorithms that are developed with the purpose of mimicking human-like intelligence. When presented with a problem, a human starts by analyzing the problem. These analysis are then used in making a decision to solve the problem [7]. This problem solving model can be implemented in AI using a problem analysis component and a decision-making component. An AI can develop complex and unexpected behavior, referred to as “Emergent Behavior”. This occurs when an AI reacts to an event in such a way that was not explicitly programmed by the AI developer [8]. B. AI in Games Researchers have studied games such as Chess and Poker for AI development. IBM devloped a Chess AI, called Deep Blue, that defeated then World Chess Champion Garry Kasparov [9]. Building on his RoShamBo work, Darse Billings have also developed a testbed for Poker, to aid machine intelligence research [10]. In the video game Quake 3, a group of bots was developed that exhibit human behavior using AI technologies [11]. C. Publications in RoShamBo In the International Computer Games Association (ICGA) Journal, the results of the First International RoShamBo Programming Competition is published [4]. This is the basis for the work in this paper. According to [12], there are two approaches used to produce strong RoShamBo players. The first approach uses “purely statistical techniques” where a strategy is chosen and statistical techniques are developed to model that strategy. The second appraoch uses the “direct history method” which analyzes for patterns. History ...PPSRSPPSRSPPS SequenceLength5 R S P P S SequenceLength4 S P P S SequenceLength3 P P S SequenceLength2 P S SequenceLength1 S Fig. 1: WindowSize=5 example diagram
  • 3. International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O) Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P) www.ijiris.com _________________________________________________________________________________________________ © 2014, IJIRIS- All Rights Reserved Page -61 Prior to this work, the primary author of this paper has developed an AI to participate in the First International RoShamBo Tournament. While the AI developed for this paper uses a direct history method, our previous paper uses a statistical technique [1], [13] III. METHODOLOGY The main flow of this study is as follows: 1) Create an Artificial Intelligence RoShamBo bot based on the direct history strategy. 2) Create a training program for the AI bot that can modify the behavior of the AI. 3) Take a modified program returned by the training program and run the AI in the first International RoShamBo Programming test suite1 . The rankings are recorded, the training program is re-run to create a new version, and the process is repeated. Once new versions are determined to not improve in ranking, the best performing version of the bot is determined. Some parts of this proposed flow require further descriptions and are expanded in the next sections. A. Historical Sequence-based Predictor We based our AI on the idea that some opponents have tendencies to repeat their previous move sequences. At the start of the match, by default, we assume that the opponent will use Rock. We do not randomize our first move as to minimize using the shared random number generator (RNG). This is to reduce any influence on other AIs that uses the RNG. After the first turn, we start recording the opponent's move into a history variable. Prior to running the test suite, a WindowSize (WS) is decided on. This controls the size of the sequence (SequenceLength) that the AI will search in the opponent's history in each iteration. Figure 1 shows what SequenceLength contains, given that the opponent's history is PPSRSPPSRSPPS and WS=5. When predicting the opponent's next move, the AI will looks into the history and observes RSPPS (SequenceLength5), SPPS (SequenceLength4), PPS (SequenceLength3), PS (SequenceLength2), and finally S (SequenceLength1). If a search result is found, the AI does not check the next SequenceLength. The AI grabs the last n turns from the history, where n = SequenceLength and assign it to the variable Seq. It looks for the occurance of Seq in the history. If SequenceLength is larger than length of the history, we iterate to the next smaller SequenceLength. If no Seq is found, we iterate the next SequenceLength. When Seq is found, the AI adds that move to a running tally for Rock, Paper, and Scissors. It does this until it has exhausted the entire history. When making its prediction, it returns the move that has the highest tally. In case of a tie, it counts how many times each move has occured in the entire history and return the move with the highest count. In case of another tie, it selects at random from among the tied moves, which will be the only time it uses the RNG. Finally, it returns the predicted move. Continuing our example, if PPS has multiple hits, a tally is recorded. If in the history, PPSR, PPSP and PPSP is found at different positions, P will be its prediction, as it has the highest tally. The program's flowchart and code listing can be found at Fig. 2 and 3, respectively. B. Training Program We exposed the WindowSize variable to an external program by adding to the code in the original RoShamBo test suite. These hooks our training program to the test suite allowing it to directly change the bot's behavior. The test suite uses C while our AI and training program uses Python. At each training iteration, the training program replays the tournament using different values for WindowSize. The result for each iteration are then saved in a database for analysis. A Python script analyzer will parse the database and extract the ranking of each AI variant. The script will then render the data into a chart. All of the above scripts are what the training program is made of. 1 The Shofar AI in the test suite has a off-by-one bug which throws out an exception (line 3021 in the original unmodified source code). The researchers avoided the exception by modifying the assert. But as a side-effect, some random numbers cause Shofar to return an invalid move. But by design, the test suite will modulo any invalid move by 3, allowing the tournament to continue as normal.
  • 4. International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O) Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P) www.ijiris.com _________________________________________________________________________________________________ © 2014, IJIRIS- All Rights Reserved Page -62 C. Source Code The researchers have uploaded to an online repository the following: the source code, the results, and the tools to analyze the results [14]. IV. RESULTS A. Rankings Against the 41 AIs from the First International RoShamBo Test Suite, this paper's AI best performances are 11 for tournament ranking and 6 for match ranking. The score of 11 in tournament ranking goes to WS=5. The score of 6 in match ranking goes to WS=9. Figures 4 and 5 show the position of each variant in the tournament ranking system and the match ranking system, respectively. Table II contains the results against each 41 opponents. B. Insights and Observations During the course of the research, we have gained insights on our AI's behavior against other AIs. We have written up the following observations on these match-ups: 1) One-on-one against other AIs: The test suite contains dummy bots which are bots that have the most basic algorithm developed by Darse Billings. The Historical Sequence-based Predictor AI is consistent in defeating the dummy bots Good Ole Rock (AI only plays Rock), R-P-S 20-20-60 (AI uses the RNG to pick Rock, Paper, and Scissors with a ratio of 20%, 20%, and 60%, respectively) and Rotate R-P-S (AI cycles between Rock, Paper, and Scissors). These two bots have very predictable patterns and defeating them shows that our AI can predict simple patterns. It only needs WS=1 to win against these bots. We have received a perfect score against Good Ole Rock, but this can be attributed to our default prediction of Rock at the start of the match. Our AI has an interesting interaction against the Beat Frequent Pick dummy bot (a bot that tries to model its opponent's frequent picks and beats it). This bot is modelling our AI and our bot is modeling the dummy bot's history. This back and forth modelling has caused our AI to accidentally trap the BFP bot by making it play moves that are predictable. This is an example of emergent behavior where an AI responds with behavior that is not explicitly programmed [8], [15]. Fig. 4: Tournament results (lower is better) Fig. 5: Match results (Lower is better)
  • 5. International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O) Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P) www.ijiris.com _________________________________________________________________________________________________ © 2014, IJIRIS- All Rights Reserved Page -63 Fig. 2: Program flowchart AI() function /*currentTurn contains how many turns has passed*/ if currentTurn == 0: call the Initialize subroutine return 0/* Rock */ Add opponent’s move from last turn into History Prediction =Predictor() function /*Play the move that beats the prediction*/ Move = (Prediction + 1) %3 return Move Initialize subroutine WindowSize =1..29 History =[] Predictor() function for SequenceLength in [1..WindowSize]: if SequenceLength >len(History): continue prediction =CheckHistory(SequenceLength) if prediction != -1: return prediction return 0 /* Rock */ CheckHistory(SequenceLength) function /*Get the last n turns from History and assign it to Seq*/ Seq =History[-SequenceLength:] /*Search for Seq in History, excluding the last n turns */ found =History.find(Seq, 0, -SequenceLength) if found == -1: return -1 /*If found, check the move the opponent played after the sequence and add that to a running tally.*/ tally =[0, 0, 0] while found != -1: end = found + len(Seq) move = History[end:end + 1] tally[move] +=1 /*Keep looping until the entire history is checked.*/ found= History.find(Seq, found+ 1,-SequenceLength) prediction =GetHighestTally(tally) return prediction GetHighestTally(tally) function highest = max(tally) if tally.count(highest) == 1: /*Get the move with the highest tally*/ prediction =tally.index(highest) return prediction elif tally.count(highest) >1: /*In case of a tie, count which move is played most often*/ MoveCount= [0, 0,0] for move in [0, 1, 2]: if tally[move] == highest: MoveCount[move] = History.count(move) highest =max(MoveCount) if moveCount.count(highest) == 1: return moveCount.index(highest) /*If the above can’t find a prediction, randomly select from the tied moves.*/ return random(tally) Fig. 3: AI code listing
  • 6. International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O) Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P) www.ijiris.com _________________________________________________________________________________________________ © 2014, IJIRIS- All Rights Reserved Page -64 Our AI loses against the PI dummy bot which uses the constant PI as its source of moves. This is expected as PI has no pattern to predict. The dummy bot Switch A Lot, is a bot that constantly changes moves and does not use the same move twice in a row. However, it still loses to our AI. By not using the same move twice, Switch A Lot has developed patterns that can be predicted. Against MegaHAL, another bot that uses the direct history method, our AI never won a match. The highest points our AI received was from the WS=8 variant, with a positive score of 17. Although this counts as a loss (a minimum of 50 is needed to count as a win), this shows that defeating MegaHAL is possible. MegaHAL's decision making consists of calculating which move gives the maximum expected score. Adding a more sophisticated decision making can improve our standing against MegaHAL. Against the highest ranking bot, the Iocaine Powder AI, our AI never won. Compared to MegaHAL, we did not receive a positive score against Iocaine Powder. Iocaine Powder has a problem analysis component that tries to predict itself. If it detects that the opponent has predicted the Iocaine Powder algorithm, it will play moves that will defeat its own plays. 2) Tournament performance insights: This paper's AI has a ranking of 11 for tournament ranking. One area that can improve this ranking, is to have an algorithm designed to maximize the number of points to be won. In match ranking, the AI has a high rank of 6. Only +50 points advantage is needed to win a match. The AI might not have won a lot of overall points, but it can earn enough points to win individual matches. For a game that just ranks for victories in match- ups, the Historical Sequence-based Predictor can be applied. We run our training program to look for a max of 29 sequences. We have observed that performance does not improve from WS=29 onwards for both rankings. TABLE I I: WINDOWSI ZE ONE-ON-ONE PERFORMANCES Best Worst AI Opp onent WindowSize Score WindowSize Score Good Ole Rock WS =1 1000 WS =1 1000 R-P-S 20-20-60 WS =1 404 WS =11 244 Rotate R-P-S WS =1 997 WS =1 997 Beat The Last Move WS =2 860 WS =1 -6 Always Switchin WS =15 256 WS =2 127 Beat Frequent Pick WS =10 733 WS =17 585 Pi WS =2 2 WS =4 -63 Switch A Lot WS =1 206 WS =12 106 Flat WS =2 148 WS =1 13 Anti-Flat WS =2 1000 WS =1 998 Foxtrot WS =25 427 WS =1 -45 De Bruijn WS =4 -18 WS =3 -240 Text WS =1 175 WS =11 136 Anti-rotn WS =11 61 WS =1 -18 Copy-drift WS =2 90 WS =25 -60 Add-react WS =4 102 WS =1 -2 Add-drift WS =11 55 WS =10 -24 Iocaine Powder WS =3 -318 WS =25 -815 Phasenbott WS =3 -191 WS =10 -815 MegaHAL WS =8 17 WS =2 -309 RussRocker4 WS =6 18 WS =1 -427 Biopic WS =8 -18 WS =3 -201 Simple Modeller WS =19 10 WS =1 -259 Simple Predictor WS =19 93 WS =1 -327 Robertot WS =19 53 WS =1 -263 Boom WS =19 51 WS =1 -180 Shofar WS =9 53 WS =1 -129 ACT-R Lag2 WS =19 33 WS =2 -99 Majikthise WS =8 37 WS =7 -20 Vroomfondel WS =4 39 WS =6 -73 Granite WS =9 132 WS =1 -201 Marble WS =19 154 WS =1 -159 ZQ Bot WS =11 184 WS =1 -238 Sweet Rocky WS =5 70 WS =1 -138 Piedra WS =25 65 WS =1 -204 Mixed Strategy WS =7 149 WS =1 -109 Multi-strategy WS =4 385 WS =25 158 Inocencio WS =1 791 WS =3 -10 Peterb ot WS =5 382 WS =13 24 Bugbrain WS =8 35 WS =1 -209 Knucklehead WS =4 594 WS =1 -16
  • 7. International Journal of Innovative Research in Information Security (IJIRIS) ISSN: 2349-7017(O) Volume 1 Issue 5 (November 2014) ISSN: 2349-7009(P) www.ijiris.com _________________________________________________________________________________________________ © 2014, IJIRIS- All Rights Reserved Page -65 MegaHAL and Iocaine Powder has a more sophisticated decision making component in comparison to our AI. This causes them to be consistent in ranking high. This shows that developing a more robust decision making system will be a good focus for improving the AI. V. CONCLUSIONS In this paper, we have developed an Artificial Intelligence to play in a RoShamBo tournament. We have identified the variables that controls the behaviour of the bot and created a training program that finds the highest ranking AI variant. The Historical Sequence-based Predictor AI has a best ranking of 11 for the tournament ranking and 6 for the match ranking among the 41 AI participants. These are good indicators that the basic idea behind the AI can be applied in RoShamBo AI. With more improvements, it is possible to get a better ranking. A. Future Directions 1) Applying the AI to other games: The developed AI is a bot that reads its opponent's history and tries to predict their next move. There are many competitive games where this approach can be used such as Chess, Poker, Pokémon, Street Fighter, and more. It is even possible to have a database of previously played matches and use that in predicting a specific opponent (a meta analysis). 2) Decision making component: We have developed a problem analysis algorithm to predict an opponent. The decision making in this game is simple: using the prediction, select the move that beats it. To improve the AI, a more sophisticated decision making component can be applied. The researchers propose a decision making component that will play a move, taking into account the prediction, the opponent's state of mind, and the current meta will considerably approve the AI. This is outside the scope of this paper, but the researchers are interested in studying this further. REFERENCES [1] S. Valdez, G. Siddayao, and P. Fernandez, “The effectiveness of using a modified “beat frequent pick” algorithm in the first international roshambo tournament,” 2015, pp. 740–747. [2] J. Hutchens, “Megahal roshambo.” [Online]. Available: http://web.archive.org/web/20020802183909/http://www.amristar.com.au/~hutch/roshambo/ [3] D. Billings, The First International RoShamBo Programming Competition, Oct 1999, revised July 2000. [Online]. Available: http://webdocs.cs.ualberta.ca/~darse/rsbpc1.html [4] D. Billings, “The first international roshambo programming competition.” ICGA Journal, Vol. 23, No. 1, 2000. [5] J. L. Hutchens and M. D. Alder, “Introducing megahal,” in Proceedings of the Joint Conferences on New Methods in Language Processing and Computational Natural Language Learning, ser. NeMLaP3/CoNLL ’98. Stroudsburg, PA, USA: Association for Computational Linguistics, 1998, pp. 271–274. [Online]. Available: http://dl.acm.org/citation.cfm?id=1603899.1603945 [6] J. McCarthy, M. L. Minsky, N. Rochester, and C. E. Shannon, “A proposal for the dartmouth summer research project on artificial intelligence, august 31, 1955,” AI Magazine, vol. 27, no. 4, p. 12, 2006. [7] C. Kepner and B. Tregoe, The rational manager: a systematic approach to problem solving and decision making. [8] C. Bailey and M. Katchabaw, “An emergent framework for realistic psychosocial behaviour in non player characters,” in Proceedings of the 2008 Conference on Future Play: Research, Play, Share. ACM, 2008, pp. 17–24. [9] M. Campbell, A. J. Hoane Jr, and F. Hsu, “Deep blue,” Artificial intelligence, vol. 134, no. 1, pp. 57–83, 2002. [10] D. Billings, D. Papp, J. Schaeffer, and D. Szafron, “Poker as a testbed for ai research,” in Advances in Artificial Intelligence. Springer, 1998, pp. 228–238. [11] J. van Waveren, The Quake III Arena Bot. University of Technology Delft, June 28th, 2001. [12] D. Billings, “The second international roshambo programming competition report,” March 20, 2001. [Online]. Available: http://webdocs.cs.ualberta.ca/~darse/rsbpc.html#REPORT [13] S. Valdez, G. Siddayao, and P. Fernandez, “Source code for the conference paper: The effectiveness of using a modified “beat frequent pick” algorithm in the first international roshambo tournament,” Jun 2014. [Online]. Available: http://dx.doi.org/10.5281/zenodo.10478 [14] S. Valdez, V. J. D. Barayuga, and P. Fernandez, “Source code for the paper: The Effectiveness of using a Historical Sequence-based Predictor Algorithm in the First International RoShambo Tournament,” Nov 2014. [Online]. Available: http://dx.doi.org/10.5281/zenodo.12617 [15] L. Steels, “A case study in the behavior-oriented design of autonomous agents,” in Proceedings of the third international conference on Simulation of adaptive behavior: from animals to animats, vol. 3, 1994, pp. 445–452.