Wednesday, March 01, 2006

Object Handles

One of the things that I've been putting off looking at, but that now seem appropriate, is the possibility of giving objects handles or identifiers, rather than strictly identifying them by position. This will be especially important when an object occupies more than one position, or more than one object occupies a position.

Saturday, February 25, 2006

Movement possibilities

I was going to discuss the possibilities for keeping track of the possible moves of objects. Sometimes it may be easier to do this than to refigure them from the beginning. But which involves more overhead in time, memory, and programming requirements does not appear to be clear in advance. This is something I would have to experiment with.

I also wanted to mention the possibilities, when there is more than one actor in a given time step, which one moves or acts first. In two player games, these tend to alternate. It is often possible to have more than one duration of time; with some events taking place in a short period, and others in a longer period. In a chess game, this might be Move 1 white, Move 1 black. Other variants are also possible.

At this point, there are several topics I would like to discuss, but don't have time for everything. Among the more immediate possibilitys are compound objects, movement rates, and limited life.

Friday, February 24, 2006

Object Interactions

I mentioned before the possibility of having two objects occupy the same space, and that, at least for now, I'm not permitting it. However, when object attempts to move onto the space occupied by another, or when two objects are adjacent, it is possible for these two objects to interact. For instance, there is the capture of an opponent in chess, picking up an item, landing on a trap or colliding with a monster, in adventur-type games. There are any number of rules that describe what happens when objects interact, and in a virtual world, action at a distance is also allowed. Typical examples include when one or both change their state or properties, and when one or both is destroyed, or even when one is created. An important type of interaction is the collision. I'll deal with this in more detail later, but wanted to mention it along with other types of interactions.

Wednesday, February 22, 2006

Actors

Before I go much more deeply into the mechanics of world-building, I'd like to consider another element that goes into games and worlds. As I will use it, an "actor" is someone or something that is capable of originating an event. Players are considered actors. Single-player games and solitary worlds can be interesting, but games involving two or more actors are considered more so. These actors typically represent animals (such as monsters), or people. Usually, one or more of the actors is controlled by the computer and there is a set of rules determining when or how each of them acts. Some are intelligent, some not so; some have complicted behavior, others are quite simple.
The simplest form of action is autonomous: every time step, actor a (does action_1). The next is conditional: If (somecondition_1) then actor a (does something_2). More complicated conditions and more complicated actions begin to go into the subject of artificial intelligence, which I'm going to dodge for now.

Of the games I've mentioneed,

Single actor games: Pong, Lunar Lander;
Two actor games: Tic-tac-toe; Spacewar; Baseball;
Multiple actor games: Oregon Trail, Star Trek, dnd, and Dungeon.

In the history of games, I've reached 1976. Video games included Breakout, probably inspired by PONG, and Night Driver. ADVENT, sometimes called Adventure, sometimes called Colossal Cave, was the progenitor of a whole series of interactive fiction or text-adventure games.
Also in 1976, Creative Computing magazine began publication, and for a few years published a series of "The Best of Creative Computing", which include even more samples of computer games.
For the past few days, I've been reworking a classification of the games published in BASIC Computer games, (see the sidebar). All these give me enough of a variety that I'm going to set history aside and take a closer look at the different farieties, since some of them will be more closely connected to my purposes than others.

Tuesday, February 21, 2006

Distance

One of the basic quantities that's needed to work with a virtual world is some notion of the distance between two points. There are two principal variants on this. One of them ix the usual Euclidean distance, D = sqrt((x2 - x1)*(x2 - x1)+ (y2 - y1)*(y2 - y1)). Another one is called the Manhattan, taxicab, or city-block distance; D = abs(x2 - x1) + abs(y2 - y1). There are various others possible, but these are reserved for more advanced work.

Pushing the historical studies of games for a moment, I find the history continuing in 1975, with another, apparently independently developed game called Dungeon, written by Don Daglow. I find that he was also the author of Baseball, which I mentioned and passed over earlier.

Monday, February 20, 2006

Structure of space

The structure of space has to do with which points are considered adjacent or neighboring. In a square plane space, any point has 4 or 8 immediately adjacent points, depending on whether the diagonals are considered adjacent. But other structures are possible. Many games choose to employ a "Wrapping" mode, in which points at the boundaries are considered to be adjacent to those at the opposing boundary. In others, the rows or columns are offset slightly so that a point is surrounded by six others. These are typically used in maps that use hexagons rather than squares. Still others, such as Hunt the Wumpus, use a finite space in which each point, or location is numbered, and described as "adjacent to" three specified others. In the original version, these were the vertices of a dodecahedron, but any number of other spaces can be constructued and have been.

Continuing with my historical look, in 1972, PONG came out as an arcade game, and was quickly copied for computers. A couple of versions of Star Trek were also developed, and Hunt the Wumpus was written. In 1973, a game called Lunar Lander was also written for the DEC 10, but a verson without the graphics display can also be found. Although only a few of these games are mentioned in the Wikipedia history, that same year David Ahl came out with 101 BASIC Computer Games, which is a sampling of what had been written and could be found on various systems around this time. I intend to use this, or rather the 1978 version, for some source material, but hope to move beyond it. Of the games I've mentioned so far, only a version of Star Trek and Lunar Lander are found here.
In 1974, Daniel Lawrence wrote the first of the computer adventure RPG games, dnd, based on Dungeons & Dragons, which is considered the grandaddy of role-playing games. Some of its descendants are a bit easier to study, so I will consider them later.

Friday, February 17, 2006

Movement

Although there are some games and some virtual worlds where change takes place without movement, worlds become much more interesting when there is movement.
A movement is an event, in which the position of an object is changed, and is usually described by the initial position, final position, object moved, and time.

This suggests a new property for objects in addition to being removable or destructible, and non-removable or permanent. They may be either fixed or movable.

The possibilities for movement of objects also need to be considered and limited. it should not be possible to move objects outside the space, which brings up behavior at boundaries. Permanent, nonmovable object may be treated as boundaries and barriers and in effect create irregularly-shaped spaces. Whether movement is connnected (one location to an adjacent) or may take place in jumps also needs to be considered. Interactions between obects also may occur.

I've fallen behind on my design of a program that illustrates these principles I am outlining. The addition of movement makes it possible to consider games such as checkers or chess. There are several ideas I would like to explore further, including rate of movement, connectedness of space, relations among objects, and I'm not quite sure which ones I want to explore next.

As I mentioned at the beginning, this blog is not solely intended for game-playing. There are elements of scientific simulation and education involved. I believe that games should not be purely entertaining, but ought to include an element of education, and the more elements of reality a game can successfully incorporate, the better its educational vaue. Nevertheless, there is a great deal that can be learned about the creation of virtual worlds from games and game programming, so for a time, these will be a major source. I'm going to follow the history of computer games as discussed in Wikipedia, in the hope that I can borrow the best elements from old-style games into the virtual worlds I am constructing. I can't hope to compete directly with major companies that can pour hundreds of designers, artists, and programmers into MMORPGs
(Massive Multiplayer Online Role-Playing Games), so I'm not going to try...but there are some good ideas that they have overlooked.

With that in mind, I'm going to start small, with a variety of tic-tac-toe such as
OXO, first done in 1952. I'm going to skip over Tennis for Two (1958) and Spacewar (1962) for now, although I may come back to them later. Starting in 1971, there were new computer games every year. I have little interest in Baseball, either the real-life version or the computer version. Rather more to my taste are Oregon Trail and Star Trek I was playing this on the computer lab in high school around 1973. As part of my self-education in C programming, I managed to ported a later version of Star Trek from BASIC to C, sometime around 1992.