Prolog Games
Prolog Games
Prolog Games
Introduction:
Prolog is useful for almost any application that requires formal reasoning. This includes
application in:
• Expert system
• Natural language processing
• Gaming and simulations
Prolog is ideal for games. Most games employ a set of logical rules that control the play
and these are very adaptable to Prolog programming. Prolog makes it possible to test
various heuristics against a particular control strategy. Many classic games, such as
ELIZA, Towers of Hanoi, the N Queens Problem, and some version of Adventure, are
written in Prolog.
Most games have a set of formal rules that govern the play. Winning may involve luck,
skill, or a combination of both, but to win the game, the player must develop a strategy or
heuristic that will get him or her to the goal state before the opponent.
Prolog is excellent at symbolic reasoning and interference; it is an excellent language for
developing games. You can design a program to be your opponent, challenging your own
strategy and creativity. Alternatively, you can code rules into the prolog program let it tell
you what a winning strategy or heuristic would be.
With a little expertise, you can write many of the simple reasoning games- Mastermind,
Nim and Kalab – in Prolog.
Adventure Game
– Is the story interesting? Does the course of the game make sense, and does it motivate the
player to continue?
– How well are the descriptions of the environment written? Do they fuel the imagination
of the player? Do they include clues for the player?
• Complexity of the game in terms of number of rooms, objects and agents. However, the
connection between these items has to make sense. A scoring procedure, monitoring
the health of the avatar and events that are triggered by these factors also benefit the
complexity of the game.
• Implementation includes:
– How well the information is displayed to the player; does the player quickly perceive
the information and is not distracted of confused.
– How well does the system understand the player’s input; message like “I don’t
understand!” can be frustrating the player if they occur too often. Giving the player a
limited list of commands, like “north”, “south”, “pick”, “drop” etc. is less exciting than a
Natural Language interface with a decent vocabulary.
2 Introduction
Text-based adventure games come from an era long before your time when people were
constraint to text terminals or small home computers with a few kilo Bytes of RAM.
Nevertheless, text based games are a great platform to develop interesting story lines and
game plots. Even in the age of movie-like computer graphics and surround sound these
games can fascinate their audience just like a good novel1.
2.1 Theme
People usually think of adventure games as “the Lord of the Rings meets Harry Potter”.
Pick a theme that excites you. There are alternatives to the warrior lost in the forest, and
surrounded by elves. How about shopping in Manhattan, or clubbing in South Beach:
players need to stop at an Internet cafe to register for party in order to get their name on
the DJ list.
2.2 Rooms
There are two common methods to represent the topology of the world: either as a graph
with links between the rooms the players can navigate, as depicted in Figure 1, or as a
three-dimensional grid, where each room may have up to six directions to leave, as
depicted in Figure 2. Navigation commands have to implemented in accordance to the
room model: games using the graph representation usually describe the various exits;
navigation in games using the grid model follows the directions: north, east, south, west,
up, and down.
2.3Objects
Objects in the game may have specific significance for the plot. These objects may be
used to access certain rooms, defend the players from attacks, or can be used to feed or to
trade. Games usually allow actions like “examine”, “take”, “drop”, or “eat” on these
objects. Though, consequences of the actions may vary among objects. Usually players
can take objects to carry them for later use.
2.4Agents
Other characters in the game my appear at certain times and locations. Any interaction
with these agents is possible: share food, receive gifts, fight, or even engage in a dialog;
clues for the player could be included in the conversation.
2.5 Health
Introducing the health of the player as a game parameter can increase the complexity of
the game, and make it more challenging: players may have to find food and water in
regular intervals to main their health and strength. E.g. certain rooms cannot be entered
unless the player is fit enough.
2.6 Scores
Players may receive scores for the accomplishment of certain tasks, e.g. finding a
particular object, or walking a particular route. These scores may be shown on the screen
and added to the total score at the end of the game. A more subtle way could be to reward
players indirectly by letting them find more food or extra clues.
3 Teams
Teams can have up to three members. Choose your team-members wisely: of course, you
have your loyal study partners and best friends; but consider teaming up with someone
who complements your skills. This is the moment for story tellers to shine. Use the
WebCT discussion board to advertise you skill, or post a message if you need somebody
on your team.