5

Click here to load reader

Modelling a player’s logical actions through the game Hunt ... · Modelling a player’s logical actions through the game "Hunt The Wumpus" 0921741 January 30, 2013 Abstract The

Embed Size (px)

Citation preview

Page 1: Modelling a player’s logical actions through the game Hunt ... · Modelling a player’s logical actions through the game "Hunt The Wumpus" 0921741 January 30, 2013 Abstract The

Modelling a player’s logical actions through the

game ”Hunt The Wumpus”

0921741

January 30, 2013

Abstract

The aim of this report is to give an introduction to the ”Hunt The Wumpus” game anddiscuss observed results gained from modelling the game in JS-Eden after studying a modelalready implemented in Eden by G. Cole [1]. The game is studied for Artificial Intelligencepurposes as its complexity combined with its set environment make modelling the player’sapproach very interesting. The game environment consists of a static game map, but theplayer has little knowledge about the other agents in the game.

1 Introduction

Empirical Modelling focuses on the develop-ment of models representing situations, proce-dures, events or ideas that take place withinan environment and are based on a set of ob-servables that are connected through a set ofdependencies. Through these relationships, weare able to model how changes in some observ-ables influence others. Moreover, EM attemptsto model representation of how changes in theenvironment also affect the actions of agents.The models are taken from a wide range of re-search areas, from models assisting with educa-tional technologies, such as learning processes[4], to models of real-life events and situationssuch as a railway accident or the operation ofa machine that is dependent on the actions ofan agent [5].

2 Empirical Modelling andAgent Based environments

One of the areas Empirical Modelling is focus-ing is Artificial Intelligence in the context of

modelling the logical actions that would leadto the achievement of solving a problem. Thisis achieved through modelling games that arebased on solving a problem through logicalsteps, or modelling multi-agent environmentsin order to study the actions and strategies ofan agent’s attempt to achieve a specific goaland how they are influenced by the actions ofother agents, changes in the environment orthe amount of knowledge the agent has of thesystem which changes as the agent explores theenvironment and learns more about the envi-ronment’s observables. In this paper we willbe studying the agent’s actions in the contextof the ”Hunt The Wumpus” game, focusing onthe thought process of the player before solvingthe task at hand at each stage of the game.

3 ”Hunt The Wumpus”

The ”Hunt The Wumpus” game was firstintroduced by Gregory Yob [3] and it consistsof a grid in the shape of a kite-shaped dodec-ahedron that represents the Wumpus’s cave.The edges connecting the 20 nodes represent

1

Page 2: Modelling a player’s logical actions through the game Hunt ... · Modelling a player’s logical actions through the game "Hunt The Wumpus" 0921741 January 30, 2013 Abstract The

the paths between the nodes which representthe rooms. The goal of the game is to kill theWumpus by shooting an arrow in its room,but to achieve that the player has to overcomeother obstacles, such as the danger of fallinginto a pit or getting moved to a different roomby bats. If the player ends up in the sameroom as the Wumpus, the Wumpus will eatthem and the game is over. There is no limiton the number of moves the player has to solvethe problem in, but there are only 5 arrowsavailable.

Even though the environment of the gameis set from the start and is not subject toany changes(unless playing a version of thegame where the Wumpus is not set but canmove if you attempt to shoot it and miss),the player has very limited knowledge to startwith apart from its initial location. Furtherknowledge of the environment can be acquiredby exploration of the game map, but withthe risk of landing in the same room as oneof the game’s obstacles, due to the fact thatthe knowledge of the player will often stillnot be enough to cover all the available pathsthe player could take. However, as the gamehas to be solved in a finite number of moves,the player usually has to either determineif a room is safe by eliminating all otherpossibilities, or take some risks that couldpotential lead into losing the game but if not,they will enable them to reach the goal in asmaller number of moves and before runningout of arrows.

This game can be solved by a knowledge-basedagent that considers all the available actionsafter each iteration of the game and acts bychoosing the action that would be the mostprofitable in respect to its chosen strategyand that would assist in achieving the gamegoal. Aside from a strategy enabling theagent to act towards winning the game, the

agent will have to choose another strategy asto how to handle situations where there isnot enough knowledge to make a safe move.Through implementing a model in JS-Eden,I have attempted to address this problem bycalculating a agent’s next move if they werefollowing one of two strategies: taking risksand attempting to solve the problem fasteror choosing the safest move and acquiring asmuch information as possible when there isn’tone. This information is calculated after eachmove and is displayed to the user. However,the player can choose whether to continue byfollowing the move displayed or not, as neitherof strategies alone is guaranteed to win, butrather a combination of them would be moreideal.

First, a strategy that prioritises the safety ofthe player, calculates the next move by alwayssuggesting the safest option forward and if onedoesn’t exist, it suggests moving back to theprevious room and choosing a different option.If the player can ”smell the wumpus” fromtheir current room, it shoots arrows in all thepossible rooms before moving there. This ap-proach ensures that the player does not losefrom falling into a pit or getting eaten by theWumpus, but in some cases the player mightbe moving in loops or run out of arrows. Thesecond approach, still calculates the move thatwill be safest but attempts to get nearer tocompleting the goal, ie killing the wumpus.For example, in the case where the player cansmell the wumpus but returning to the previ-ous room will not assist in winning the game,the player chooses to move forward with therisk of getting eaten. In most cases that doesnot happen though because usually the playerwill have an idea of where obstacles are, fromdetecting them when coming from the oppo-site direction, and if that is not the case, thatstrategy is prioritised before taking a risk.

2

Page 3: Modelling a player’s logical actions through the game Hunt ... · Modelling a player’s logical actions through the game "Hunt The Wumpus" 0921741 January 30, 2013 Abstract The

4 ”Hunt The Wumpus” gamemodel by Cole

G. Cole implemented a model of the ”Hunt TheWumpus” game in the Eden environment in2005. His approach into modelling the player’sapproach of the game, was the addition ofa table of inferences which listed all the as-sumptions that can be made for each roomaccording to the knowledge acquainted aftereach move. Each move would add more infor-mation about the environment and any obsta-cles would be instantly eliminated or confirmedfor any rooms that there is enough knowledgeabout. Even though the table on inferencesis an excellent way of keeping track of infor-mation found about the game observables, theplayer is not encouraged to follow the samelogic procedure for choosing their next move,as it is easier to eliminate possible actions byjust looking at the table for the specific room,rather than choosing an action by making in-ferences after each move.

Figure 1: Table of inferneces in the Cole Model

5 Game implementations

5.1 Cole’s implementation in Eden

For implementing the model in Eden, Coleused %donald, %eden and %scout notation fordrawing the game environment and connect-ing the changes on the map and inferences ta-ble to the game observables that are subjectto change value after each move. The gamefunctions and procedures were developed with%eden. Using the %donald notation, Cole wasable to treat the game observables as sets ofobservables compiling the whole environment,which made it easier to define the dependenciesbetween them.

5.2 Implementing the game model inJS-Eden

My attempt into implementing the model inJS-Eden [2] is similar to Cole’s implementa-tion in respect to the parts developed with%eden notation. However, due to the factthat the rest of the notations aren’t available,I developed the game map and using JS-Edenpicture functions such as Circle and Line. Asa result, each component of the game map canbe treated as an observable without havingto translate it from the map to actual values.This way, each move directly influences theobservables in the model that are dependedon the user’s actions.

In order to develop a JS-Eden implementa-tion of the game, I first explored the exist-ing model by Cole, in an attempt to deter-mine the observables that would need to beincluded. I then proceeded to first draw themap of the game by starting with the shapeof a 5-sided polygon which resembles the kite-shape of the game’s grid. I then completed themap by drawing circles representing the roomsand lines representing the paths. Each circle isdrawn based on one specific point on the map,

3

Page 4: Modelling a player’s logical actions through the game Hunt ... · Modelling a player’s logical actions through the game "Hunt The Wumpus" 0921741 January 30, 2013 Abstract The

Figure 2: JS-Eden representation of the wum-pus model

which, in the game implementation, is used asthe observable referring to the room. I then la-belled the map by using the room observablesas points for the numbers. The whole of themap drawing is inter-dependent and any addi-tional information that needs to go on it as thegame progresses (such as the detection of batsand pits), is dependent on the room observ-ables. The Wumpus’s location, as well as thelocations of bats and pits, are also dependenton the room observables, and they are treatedas observables themselves as they are part ofthe environment and they influence the courseof the game.

6 Further work and other im-plementations of the game

It would be interesting to model the player’sapproach to a ”Hunt The Wumpus” game thatdoes not have the grid displayed, but ratherthe user is only aware of the paths accessiblefrom their current location. In this case, theplayer would have to calculate what the othernearby rooms are, in an attempt to determine

Figure 3: Game state after player is eaten bythe wumpus

where the positions of the game observablesand for example decide if an obstacle foundis the same one as one found earlier whentraversing through the game grid in a differentdirection.

Another possible option would be to model thegame when using a different shaped grid. Itwould be interesting to explore the strategiesmentioned previously to find out how the shapeof the game map influences the player’s deci-sions.

Acknowledgements

I wish to acknowledge the work of Cole as thepremise for adapting the existing eden modelinto the JS-Eden environment.

References

[1] G. Cole, Hunt the Wumpus: an Empiri-cal Approach, Undergraduate fourth yearmodule, 2005.

[2] T. Monks, A Definitive System For TheBrowser, 2011

4

Page 5: Modelling a player’s logical actions through the game Hunt ... · Modelling a player’s logical actions through the game "Hunt The Wumpus" 0921741 January 30, 2013 Abstract The

[3] G. Yob, Hunt The Wumpus: The Genesisof Wumpus, 1976,

[4] M. Beynon, (date unknown) EmpiricalModelling for Educational Technology.University of Warwick, Coventry.

[5] M. Beynon, (1999) Empirical Modellingand the foundations of Artificial Intelli-gence.

5