application on prolog game

7
1 APPLICATION IN PROLOG GAME Generated by Foxit PDF Creator © Foxit Software http://www.foxitsoftware.com For evaluation only.

Upload: syed-ashik-mahmud

Post on 12-Nov-2014

1.335 views

Category:

Documents


1 download

TRANSCRIPT

1

APPLICATION IN PROLOG GAME

Generated by Foxit PDF Creator © Foxit Softwarehttp://www.foxitsoftware.com For evaluation only.

2

CONTENTS Introduction ……………………………………………………………….. 3 Application for Prolog ……………………………………………………… 3 The Prolog application in game ……………………………………………. 3 Basic game in design ……………………………………………………….. 3 Tactical games ………………………………………………………………. 4 Adventure game ……………………………………………………………... 4

1. Objectives and Evaluation …………………………………………… 4 2. Introduction ………………………………………………………….. 5

2.1 Theme …………………………………………………………… 5 2.2 Rooms ………………………………………………………… 6 2.3 Objects ………………………………………………………….. 6 2.4 Agent …………………………………………………………… 7 2.5 Health …………………………………………………………… 7 2.6 Score …………………………………………………………….. 7

3. Team …………………………………………………………………. 7 4. Reference …………………………………………………………….. 7

Generated by Foxit PDF Creator © Foxit Softwarehttp://www.foxitsoftware.com For evaluation only.

3

APPLICATION IN PROLOG GAME

Introduction:

To many computer adventures, Prolog is the magical door of programming languages. Prolog supports formal symbolic reasoning, making theoretically possible “intelligent computers” that can understand human languages diagnose medical illness as well as androids that can perform routine tasks without the need for a procedure defined by a human.

Prolog has a built-in backward chaining inference engine that can be used to partially implement some expert systems. Prolog rules are used for the knowledge representation, and the Prolog inference engine is used to derive conclusions. Other portions of the system, such as the user interface, must be coded using Prolog as a programming language.

The Prolog inference engine does simple backward chaining. Each rule has a goal and a number of sub-goals. The Prolog inference engine either proves or disproves each goal. There is no uncertainty associated with the results.

Application for Prolog: Prolog is useful for almost any application that requires formal reasoning. This includes application in

• Expert system • Natural language processing • Gaming and simulations

The Prolog application in game: 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. Basic game design: Game design is an experiment in artificial language. Prolog execution is a cyclic operation involving an predicate and three basic modules.

Generated by Foxit PDF Creator © Foxit Softwarehttp://www.foxitsoftware.com For evaluation only.

4

Start

Quit Figure: The game cycle Tactical games: 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

1 Objective and Evaluation The objective of the project is to create an interesting text adventure game. You can form teams of up to three people for this project. The project will be evaluated based on the following criteria • Originality of the game:

Invoke background event routine

Get input sentence

Parse sentence for key words

Call semantic routine

Generated by Foxit PDF Creator © Foxit Softwarehttp://www.foxitsoftware.com For evaluation only.

5

– Is the story interesting? Does the course of the game make sense, and does it motivate the player to continue? – How well are the description 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 frustrate 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. – Technical considerations include the completeness of the game implementation, correctness of the game procedure 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. Read this article about the timelessness of text-based games In principle, players have to navigate through the world to solve a puzzle. Clues and objects that may help to accomplish the task can be found at various locations. Often the players are required to collect certain objects that allow them to proceed at a later stage. Popular items to collect are keys and flash-lights which may later help to unlock doors, or enter dark spaces. Other items, such as food, can be used to strengthen the players or trade clues and other objects. The possibilities are virtually endless. Players receive a detailed description of their current situation. Often that description also includes items they have at their disposal and clues about their health, e.g. whether they feel hungry or tired. Then, they are prompted to enter a command about what they intend to do: e.g. “walk through the door”, “go west”,or “take the key”. 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. The following is a list of typical components in adventure games:

Generated by Foxit PDF Creator © Foxit Softwarehttp://www.foxitsoftware.com For evaluation only.

6

2.2 Rooms

Figure 1: Example rooms from the German Spy game (“Artificial Intelligence in a German Adventure Game: Spion in PROLOG”, Molla et. al., CALICO Journal, Volume 6 Number 19).

Figure 2: Rooms as cubes. 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.3 Objects 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.

Generated by Foxit PDF Creator © Foxit Softwarehttp://www.foxitsoftware.com For evaluation only.

7

2.4 Agents 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 extraclues. 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. 4 References • http://en.wikipedia.org/wiki/Adventure_game comprehensive article about adventure games from Wikipedia. • http://www.xyzzynews.com/xyzzy.1e.html 10 Steps to Great Game Design by C. E. Forman. • http://www.otterarchives.com/bounty2/ this is a graphic-based adventure game; the interactions are limited to a few choices; still quite fun to play. • http://www.cis.upenn.edu/~edloper/slides/cse391_games.pdf presentation of “Modelling Games with Prolog Expertsystems” by E. Loper. The second part documents the example game in Prolog. • http://www.amzi.com/articles/prolog_fun.htm a simple adventure game in Prolog.

Generated by Foxit PDF Creator © Foxit Softwarehttp://www.foxitsoftware.com For evaluation only.