Analytical Perspectives in Game Design
Capability
Home ] Up ] Categories ] [ Capability ] Characteristics ] Contexts ] Environmental effects ] modelling ] The universe ]


 

A capability is the ability of an thing to perform a function.

general_game_database_gom_1.gif (4428 bytes)

  • A capability is a hierarchical mechanism for describing the ability to do something. This allows a world author to define a set of capabilities to be provided within a world and the game author to extend this set of capabilities. A capability is inherited by the "is a type of" structure.
  • A capability can be applied to a category. This type of capability describes the default set of capabilities that apply to the category.
  • A capability can be applied to a thing. This then describes the actual capabilities possessed by the thing.
  • A capability may describe a command (that can be performed on things and characteristics).
  • Capabilities inherit up the hierarchy chain. So a quill, that may be a type of fountain pen which in turn is a type of pen which in turn is a thing that can write, itself gains the ability to write.
  • Each capability has a name that is unique.
  • A capability must be assigned to either a Category or a Thing.

Example:

The following diagram shows a possible hierarchy of image-imprinters.

Capability File Formats

A capability file can point to other category files, using the "INCLUDE" tag, to make the files more manageable. This also allows the inclusion of category files created by other authors.

Capabilities are defined using the following syntax:

Capability Title

Capability: name

The capability name describes the ability to 'Do something".

Capability Attributes

subclass of [capability name]

This describes the position of this category in the inheritance hierarchy. There is a special word here none. This means that the category is the top category.

Within the game data files, the first category should always be the top category. Any categories subsequently marked as "none" will be ignored.

action = [command name]     

The attribute command describes the command to be performed by actioning this capability.

It is possible to define capabilities that do not have an action. In this case the system will traverse up the capability tree until it finds an capability with an action defined.

nounform = [noun form string]

The attribute noun form is a string that gives the noun equivalent of the verb described in the capability. This field is mandatory only if there are to be sub-forms of this capability.

For example the capability communicate has a noun form communication. It is currently my belief that all such verbs will have an equivalent noun form.

Default World Capabilities

This section describes the capabilities provided in the default world.

The tree of capabilities represents the actions (as described by verbs) that are available in the world. I have used to old Booch OO notation to show that the information is contained in data rather than code.

See also: Full list of default world data files.

Capability: Act

The default "to do" verb. This is an abstract action. It cannot actually be performed on an object. Getting to this point in the hierarchy means that the action could not be performed according to the model.

nounform = action

Capability: Communicate

This is a category for all communications between players and NPCs in the world.

subclass of action
command is ???
nounform is communication

Capability: Think

This is a category for thinking type actions...

subclass of action
command is ???
nounform is thinking

Capability: Move

This is a category for movement actions.

subclass of action
command is ???
nounform is movement

Capability: Change

This is the category for change actions.

subclass of action
command is ???
nounform is change

Capability: Begin

command is assemble

subclass of change
command is ???
nounform is communication

Capability: Harm

subclass of change
command is ???
nounform is harming

Capability: Mend

subclass of change
command is ???
nounform is mending

Capability: End

subclass is disassemble
instance of change
nounform is ending

Object Model

Capabilities are arranged into capability trees. There are many trees. Sometimes a branch may exist only to give the appearance of a different function. Each layer of branches in a tree give additional lexical meaning to the capability and refine it more for a specific instance.

gd_capability_object_model.jpg (33083 bytes)

Capabilities provide a mechanism for operating on the characteristics as represented in state machines.

The capability tree class points both "up" and "down" the class hierarchy. The pointers, down, or away from the root are provided when the class is built, as I have assumed that a person creating these trees will think in this manner. This should also help later when a authoring assist toll is used. The actual search in run time by the game is "up", the hierarchy, towards the root. I expect that at a later stage, the capability will have an associated processor. You look up the hierarchy until you find the first processor. The action is then passed through a chin of command, up the hierarchy, until a processor that can action the command is found or all the searches are exhausted.

The capabilities abstract forest is used to ensure the names a unique.

Examples:

  • A person with a push capability can open doors that require pushing (are pushable).

Code

Capability.java

CapabiliytRootList.java

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.database.Capability

java.lang.Object
   |
   +----bvyy.database.Capability

public class Capability
extends Object
implements Serializable
Make a general purpose capability model.

Intent

This is a capability class. It records the capabilities that a thing may have. These capabilities are organised into multiple trees as required by the game world builder.

Motivation

Allow the game desingers to specify capabilities that I could not have envisionaged. Maked the game customisable by a non-computer literate author with no need to write code.

Version:
0.0.2 26 October 1998
Author:
(c) 1998 Brian Voon Yee Yap

Constructor Index

 o Capability(String)
Creates a new root Capability.
 o Capability(String, Capability)
Creates a new Capability.

Method Index

 o addCapability(String)
Adds a new capability as a branch.
 o addGeneralEventListener(GeneralEventListener)
 o elements()
Returns an enumeration of the components of this vector.
 o fireReceiveEvent(GeneralEvent)
 o getCommand()
 o getName()
returns the Name for this capability.
 o getNounForm()
 o getParent()
 o getRoot()
Test if this capability is the root.
 o removeCapability(String)
removes a capability from the branches.
 o removeGeneralEventListener(GeneralEventListener)
 o setCommand(Command)
 o setName(String)
Sets the name for this capability.
 o setNounForm(String)
 o setParent(Capability)
 o setRoot(boolean)
Sets this node to be a root node.

If the parent has been set, then the paret is reset to null.

Constructors

 o Capability
 public Capability(String newName)
Creates a new root Capability.

Parameters:
newName - The name for this capability.
 o Capability
 public Capability(String newName,
                   Capability myParentCapability)
Creates a new Capability.

Parameters:
newName - The name for this capability.
myParentCapability - The name of the parent capability.

Methods

 o getRoot
 public boolean getRoot()
Test if this capability is the root.

Returns:
true if this capability is at the root.
 o setRoot
 public void setRoot(boolean newRoot)
Sets this node to be a root node.

If the parent has been set, then the paret is reset to null.

 o elements
 public synchronized Enumeration elements()
Returns an enumeration of the components of this vector.

Returns:
an enumeration of the components of this vector.
 o setName
 public synchronized void setName(String newName)
Sets the name for this capability.

 o getName
 public synchronized String getName()
returns the Name for this capability.

Returns:
the name of this capability.
 o addCapability
 public synchronized void addCapability(String newCapability)
Adds a new capability as a branch.

Parameters:
newCapability - the new capability to be added to the node.
 o removeCapability
 public synchronized boolean removeCapability(String oldCapability)
removes a capability from the branches.

Parameters:
oldCapability - the capability to be removed.
Returns:
false if the object spcified did not exist. true if it did.
 o removeGeneralEventListener
 public synchronized void removeGeneralEventListener(GeneralEventListener l)
 o addGeneralEventListener
 public synchronized void addGeneralEventListener(GeneralEventListener l)
 o fireReceiveEvent
 protected void fireReceiveEvent(GeneralEvent e)
 o setParent
 public void setParent(Capability newParent)
 o getParent
 public Capability getParent()
 o setCommand
 public void setCommand(Command newCommand)
 o getCommand
 public Command getCommand() throws NoCommandAssignedException
 o setNounForm
 public void setNounForm(String newNounForm)
 o getNounForm
 public String getNounForm()

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Using Capabilities

A capability represents the ability to perform an action, either by a thing or by a category.

A capability of a category would describe the general type. For instance a typical door has the capabilities of openable and closeable.

A capability of a thing overrides the capability of the type. So a specific door that has been welded shut may no-longer support the capability openable. But it may still support the capability breakable.

Capabilities represent nouns in the English language.

 

22/11/99

 


See also: [Role Playing Games] [Game Engine]
© 1998, 1999 Brian Yap. These pages are available under the GNU licence.