Jan 17

Please feel free to download my work for Concepts of AI assignment.

Concepts of AI - Wumpu's World (132)

How to play the game?

 First of all type in ‘start.’, this is what launches the game.

If you are ever lost during the gameplay, you can type in help or hint, which gives you all the commands.

 Basically all you have to do is to pick up the bow and arrow and proceed to “Issum Forest”. You are able to enter the forest with the knife or with the swords as well but you can’t fight the wumpu. It will fly away. To kill it, you have to use the bow and the arrow. There are two ways of completing the game. One is that you either kill the wumpu or you take the girl.

There is one secret area on the map. There is a temple in Vint Plains. That temple is not shown your map. There is a cave in Vint Plains and if you issue the correct command (look at or look hole) you will see that there is a temple called Hephaestus Temple. Then you are able to issue the command go to Hephaestus Temple. In there you will find a secret word which can be ‘said’ by the player. (Please be advised that using the “magic” word might not be the best solution :) ).

Be advised that you can pick up water and “eat” it. I did not have time to implement the “drink” command. There are many options for the player to pick up things, look at things. Whenever the player enters a particular area on the map, the items are listed.

To run this application you need to download SWI prolog.

Dec 20

Further to an earlier post:

The X represents your current location on the map.
You are on the Lymedius Plains.
| ------------------------------------------------------- |
| Issum Forest      | Vint Plains   | Ledelen Mountains   |
| ------------------------------------------------------- |
| Viwude Cave       | Lauk Desert   | Torit Swamp         |
| ------------------------------------------------------- |
| Lymedius Plains X | Lersam Lake   | Kiml Mountains      |
| ------------------------------------------------------- |

More will follow soon with code snippets as well.

Dec 04

I got permission to modify the original assessment. This is how the story looks now:

Wumpus World is a world which even the mighty warriors fear to enter but now you received an important mission. Your king’s daugther was kidnapped by the evil wumpus’ followers and you have to rescue her. The king promises that you can marry his beloved daughter if you bring her back alive.

You are on your way to rescue the king’s daugther when suddenly some soldiers appear on both side of the road. They just stare at you until you ask them what they want. ‘We will tell’ - they reply. The next thing you realise is that they start to attack you, more and more appear from the forest…

You wake up hours later, you are in pain and you realise that you have no equipment, no weapon. They took everything from you. You feel ashamed turning back so you decide to continue your journey to Wumpus World.
Soon you arrive to a plain, on your map, it’s named as the Lymedius Plains…

GAME STARTED

The Lymedius Plains are well known for their healing bushes….
You can see the following things:
rock
strawberry bush
sword
You can go to the following places:
Lersam Lake
Viwude Cave
Your health is 60%

More is coming up soon :)

Oct 08

We received our first task to be submitted till the 11th January 2008, please read it below:

Task: to develop a computer game called Wumpu’s world using Prolog. An hunter walks into the Wumpu’s world where there are a monster called Wumpu who can eat the hunter, pits that can trapped the hunter, and a heap of gold. By carefully playing this game, the hunter should avoid to be eaten by the Wumpu, avoid to fall into pits, try to pick up gold and try to explore the entire Wumpu’s world.

Now putting together the “world” is really straightforward:

1
2
3
4
5
6
7
8
9
10
11
location(hunter, r11). %start position, first row
location(breeze, r12).
location(hole, r13).
% second row
location(stench, r21).
location(glitter, r22).
location(breeze, r23).
% third row
location(wumpu, r31).
location(gold, r32).
location(hole, r33).

If we have all the fields, we can now establish the map:

1
2
nextto(r11, r12).
nextto(r11, r21).

where r11 is the start position and we have a 3×3 square so the fieldnames are r[row number][coloumn number].

Now we need to set the start position of the hunter which is:

1
here(r11).

I would like to mention one important thing. As we will move within our map we need to constantly update there here() function. As we declare here to have the value r11 it is a static declaration, therefore it cannot be updated. For example examine the following set of rules for the movement:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
% set up the movement between the locations
connect(X, Y) :- nextto(X, Y).
connect(X, Y) :- nextto(Y, X).
 
goto(Place) :-
can_go(Place),
move(Place),
look.
 
can_go(Place) :-
here(X),
connect(X, Place).
can_go(Place) :-
write('You can''t get there from here'),
nl,
fail.
 
move(Place) :-
retract(here(X)),
asserta(here(Place)).

Now if you’d try and run the following giving it the command goto(r12). would result in an error (No permission to modify static_procedure [procedure name]).

To avoid this the here procedure should be declared dynamic:

1
2
:- dynamic here/1.
here(r11).

Problem solved.

I will continue to post my updates on this assignment.