Implementation Overview

Components

The system is comprised of three primary components: The server, which runs standalone and communicates with the clients via TCP/IP sockets. The 'client library', which is a shared library used by clients to communicate with the server and manage object databases. And the clients themselves, which utilize the functionality provided by the client libarary to communicate with the server.

Server

The server is implemented as a standalone application that communicates with various clients via sockets. It communicates with clients via UDP datagrams for efficiency, acknowleding and re-transmitting packets only when necessary to keep bandwidth and latency to a minimum. In order to remain responsive, the server spawns two threads, one to handle mainline processing, and one to handle network communications.

Client Library

The client library encapsulates all of the functionality necessary for clients to communicate with the server and to maintain the agent database and other low-level functionality. The reason for this is twofold: First, it allows clients to be implemented without duplicating a great deal of work. Second, it guarantees that clients will interact correctly with the server by dealing with all of the low-level network communication. This library is implemented as a standard *NIX shared library. When it is ported to Windows NT, it will be implemented as a Dynamically Loaded Libary (a 'DLL', which is basically the same thing). This allows multiple client applications to run on the same machine with minimum overhead, and allows other languages (such as Java) to access the libraries.

Clients and Agents

As is discussed in the overall design, all 'dynamic objects' or 'agents' in the system are encapsulated as clients that communicate with the server via sockets. This includes both the graphical client that users will use to view and act in the world, and programmed 'agents' that act independently of human control. This simplifies the system by allowing the server to treat all agents in the same manner.

Graphical Client

The graphical client is an OpenGL based front end to the system that allows users to navigate and interact in the world. This client retrieves the resources necessary to render the world from the server. It renders the world from the viewpoint of a user-controlled agent and gathers input from the user.

Agents

Agents are controlled by stand-alone clients that communicate with the server in the same manner as the user-controlled graphical client. They can be implemented as standard 'C' programs that link with the client library, or as Java programs that use a Java Native Method encapsulation of the client library. A single client can control any number of agents, which can range in complexity from simple moveable objects such as doors to complex intelligent agents that interact with users and one-another.