The World/Tech Articles/System Abstract

From NexusCrossing

Jump to: navigation, search

Concept so far: The working title for most of the project so far has been libGamePieces. This is simply because, as the name implies, what I have been working on so far has been a library of components to make game development easier.

A better name will be needed of course for the game(s) itself (themselves).

What follows is an abstract description of the system. I use the term method to refer to member functions since that term is understandable to users of most object oriented languages (and most specifically Java and C++ as those are the most commonly known still).

lgp:: at the beginning of class names represents the namespace that classes are in. The non-programmers can think of it as a tag that says "This belongs to our package."

I also apologize to the non-coders, as there will be a few points where I must get technical.

Contents

[edit] lgp::Object

is the core object class/interface. In a lot of ways, this class should define the basic interface that the program elements use to communicate amongst themselves at the abstract level. i.e. How to call a method on the Object, how to send it a message, etc.


[edit] lgp::MasterObject

This object holds a list of all of the objects that exist within the world, as well as the code to dispatch a message to a given object. It will keep track of whether the objects are "local" or "remote," so that it knows if it can send messages to the object directly or must send them over the wire.

[edit] Object Requirements

At minimum, each object will have the following public methods.

  • void Object::receive_message(lgp::Message message)
  • void Object::receive_message(std::string message)
These are methods to accept messages from the outside world. They will accept messages from the outside world and add them to the object's message queue.
  • void Object::send_message(lgp::Message message)
  • void Object::send_message(std::string message)
This method will be used to send messages to other objects. It will do so by packaging a message, either in the form of a Message object, or a "packed" message string. Packed in this case basically means a string that has been formatted in a way so that the object at the other end can break it down into the pieces that it needs to function. Messages are packaged (packed) as a string in order to send them over the network to remote objects.
  • void Object::cycle(void)
This method will tell the object to do whatever it is supposed to do during a given cycle. At minimum this will be to process message(s) from the queue.
Some objects will do very little until they are sent a message to process (for instance inactive items, a mail system, etc). Others will perform processing of some sort every cycle (Objects representing creatures, NPC’s, etc).
A "cycle" is a unit of time. It is of an arbitrary length, that is hopefully measurable in milliseconds. It is basically the length of time that the system takes to go through one iteration (one turn or pass) of its main control loop. Because of the distributed nature of the system, it will not always be the same length of time for every machine in the system.


[edit] Table of Contents for The World

  • System Abstract

[edit] Off Site Links

Personal tools