Copyright: Copyright (c) 1997 Donald Nute


Virtual World

CONTENTS:

Introduction to Virtual World

  Strength and Damage

  Perception and Action

  Looking

  Perceiving Properties

Sample World

The Sample Agent, Bumble

The Menus

  File

  Actions

  Test

  Options

  Help

Building an Agent File

Building a World File

Introduction to Virtual World

Virtual World is a system for developing and testing

"softbots", artificial agents that can be inserted into a

simulated environment. The Virtual World driver allows the user

to load a "world file" which defines a simulated environment

and an "agent file" which defines an artificial agent or

softbot. The agent can then "run" in the world that has been

loaded. Virtual World is written in LPA WinProlog 3.1 and runs

under MicroSoft Windows95. It includes a graphic display that

allow the user to watch the agent and any other entities in a

particular world as they move about and interact with the world

and each other.

Virtual World is both spatially and temporally discrete. A

world consists of one or more levels where each level is

divided into distinct cells. Each level is 20 cells wide and 13

cells high. Each level is surrounded by an impenetrable wall of

red bricks two cells wide. Time is divided into "moves". In

each move, the agent and every other actor (animate object) on

the same level as the agent have an opportunity to perform one

action. The agent always performs its action first, and then

the actors take turns performing their actions in random order.

Strength and Damage

Agents have two important parameters called Strength and

Damage. Initially, an agent's Strength has value 100 and an

agent's Damage has value 0. The agent's Strength usually

diminishes as the agent interacts with its environment, but

certain activities increase the agent's Strength. The agent's

Damage is usually only affected when the agent interacts with

objects having specific harmful or curative properties.

An agent's Strength can never exceed a maximum value of 300. If

the agent's strength drops to 0 or less, the agent dies. An

agent's Damage can never be lower than a minimum value of 0. If

the agent's Damage reaches 100, the agent dies. When the agent

dies, its image on the display is transformed into a tombstone.

Perception and Action

Virtual World agents have limited and clearly defined abilities

to perceive their environments and to act.

An agent can perceive a 5X5 square of cells centered on the

agent. Nothing can block the agent's view of this area. The

agent can also perceive certain properties of objects. The

agent's ability to perceive qualities of objects may depend

upon the agent's Strength or Damage, upon earlier actions the

agent has taken, or upon objects the agent is carrying.

The only primitive actions an agent can perform is to move one

cell in any direction, including diagonally, or to do nothing

(sit) for one turn. However, an agent can consume or pick up

certain objects by moving into the space they occupy, or the

agent can push on objects by attempting to move into the space

they occupy. Objects behave in a variety of ways when the agent

pushes on them.

Looking

When the agent looks around, it perceives its own Strength and

Damage, the set of objects it is carrying (if any,) and the

objects occupying the 25 spaces around it. To do this, the

agent must use the prolog query

look(Strength,Damage,Inventory,

  [A,B,C,D,E],

  [F,G,H,I,J],

  [K,L,M,N,O],

  [P,Q,R,S,T],

  [U,V,W,X,Y]).

Each variable in the 5X5 grid in this pattern will become

instantiated to the type of object occupying that space. Of

course, the agent will always be in the position M in the grid,

and M will always be instantiated to the atom a. Strength and

Damage will be instantiated to integers, and Inventory will be

instantiated to a list of atoms representing whatever object

the agent is carrying.

Some standard "objects" the agent will encounter are:

w - impenetrable brick wall. Pushing against these will use up

Strength at an accelerated rate. These appear in the display as

red blocks.

o - an empty space. Technically, empty space is consumable.

Empty space is represented in the display by white space.

f - food. Food is consumable and increases the Strength of the

agent by 20 (up to the maximum value of 300.) Food is

represented in the display by red apples.

p - portal or door. Moving through a portal transports an agent

to some other location in the world. The new location may be

far away from the portal on the same level, or it may be on a

completely different level. Portals are one-way. Some portals

will only work if the agent is holding its key or has performed

some other action prior to trying to pass through the portal. The

destination reached through a portal may change depending on

what the agent is carrying or previous actions of the agent.

Portals appear in the display as doors.

b - movable blocks. These can be pushed out of the way unless

they are up against an immovable object. They appear in the

display as blue blocks.

h - hornets. These actors move about at random until they

encounter the agent. Unless the agent moves away, they will

sting, causing Damage to increase by 3. If pushed, hornets will

sting much harder, causing Damage to increase by 20. In the

display, hornets look rather like, well... hornets!

c - first-aid station. Appearing as a red cross, a first-aid

station will decrease Damage by 5 every time the agent pushes

against it until the minimum value of 0 is reached.

Perceiving Properties

All objects of the same type have similar properties. Some

basic properties that objects can have are that they can be

animate, consumable, collectable, movable, or harmful. Suppose

the agent perceives a mysterious object y(3) nearby. The agent

can test the properties of y(3) with one or all of the

following queries.

animate(y(3)) - succeeds if y(3) is an entity capable of

independent movement and action. Such actors may be harmful,

helpful, or neutral. Hornets are examples of harmful agents.

consumable(y(3)) - succeeds if y(3) is consumable. Consumable

objects will disappear if the agent moves into the space they

occupy. When consumed, and object may have either good or bad

effects.

collectable(y(3)) - succeeds if y(3) can be picked up by the

agent and added to the agent's Inventory. The agent picks up a

collectable object simply by moving into the space the object

occupies. Objects in the Inventory may be removed through

certain actions of the agent, but there is no direct action the

agent can take to drop an object once it is picked up.

movable(y(3)) - succeeds if y(3) can be pushed to a new

location by the agent. Moving an object can have various

consequences besides changing the location of the object. The

most common effect is that the agent's Strength decreases more

rapidly than if the agent simply moves into an empty space.

A Sample World

The Sample Agent, Bumble

The Menus

  File

    Load World

    Load Agent

    Save Agent

    Exit

  Actions

    Run

    Stop

    Step

  Test

  Options

    Change Icon

    Change Location

    Reset Strength

    Reset Damage

  Help

    Contents

    About

Building an Agent File

Building a World File