Analytical Perspectives in Game Design
Commands
Home ] Up ] Architecture ] [ Commands ] Communication ] Lag ] Object Model ] Persistence ] Scenarios ] Source Code ] Threads ]


 

Commands have a complex relationship in the model as they effect many parts of the system.

general_game_database_gom_1.gif (4428 bytes)

  • There is an internal command set that is used to change the database and to send communications between players.
  • The commands can be customised by authors to be specific to particular worlds, down to configurable for particular things.
  • A macro command set can be generated for complex activities.

    The generic command set:

!add a miscellaneous command - wait!

!Insert should be add.!

!Explain  the following Hugo commands and how they are implemented in this system...

DoAsk, DoAskQuestion, DoClose, DoDrop, DoEat, DoEnter,

DoExit, DoGet, DoGive, DoGo, DoHit, DoInventory,

DoListen, DoLock, DoLook, DoLookAround, DoLookIn,

DoLookThrough, DoLookUnder, DoMove, DoOpen, DoPutIn,

DoShow, DoSwitchOff, DoSwitchOn, DoTakeOff, DoTalk,

DoTell, DoUnlock, DoVague, DoWait, DoWaitforChar,

DoWaitUntil, DoWear

DoBrief, DoQuit, DoRestart, DoRestore, DoSave, DoScore,

DoScriptOnOff, DoSuperbrief, DoVerbose

DoBurn, DoClimb, DoCut, DoDig, DoFollow, DoHelp, DoJump,

DoKiss, DoNo, DoPull, DoPush, DoSearch, DoSleep, DoSmell,

DoSorry, DoSwim, DoThrowAt, DoTie, DoTouch, DoUntie,

DoUse, DoWake, DoWakeCharacter, DoWave, DoWaveHands,

DoYell, DoYes!

Command Processing

Command processing consists of two main components: Generating command lists for display to the user and acting on a command from the command list as requested by the user.

One of the intentions of command processing is to hide what the commands actually mean and do from the user interface to make the interface more generic.

The command processing has the following components:

The command class allows the game to attach commands to the player controls dynamically as the player moves through the game. The command class operates on the command interfaces.

When a player enters a space the game (Applet1) builds a list of the GameThings in that space, inspects the GameThings for their state transitions possible and builds a command set for the player to use. Each command is a represented by an object that on being called will cause a specific state transition to occur, or a rearrangement of the hierarch tree of objects in the game.

When a player issues a command, via Applet1, the applet executes the command by calling the Command-Object. The Command-Object issues the command and the sends a message back to Applet1 to rebuild the command list and views as appropriate. (This last bit is a mystery to me at the moment and it is not in the diagram.)

Creating commands

There is a basic set of commands. An author can extend these commands to customise them to the whole game, or a particular part of the game or world.

Command configurations allow the world author to edit the command sets and customise them for game worlds and specific situations.

Within the game there is an internal and basic set of commands. These commands are generic and suited to the world of computer programming. To extend these commands, without actually creating any new commands, data can be provided. These extensions allow the customisation of these generic commands.

The command set can be extended in a number of ways, depending on your specific needs.

Conditional command changes

Conditional command changes allow you to make the actual command dependant on a specific set of criteria. ???

Global command changes

Global command changes allow you to change the text that is associated with a command. You may replace the command or extend the command with synonyms. For example: synonyms of attach could be tie, connect, link and join.

See also: data file formats.

The command changes belong within the tags <global command info> and </global command info>. The formats of the commands are:

[reassign] command to [new command]

[command] is a synonym of [command | new command]

[command list] are synonyms of [command | new command]

Example:

<Command>

reassign speak to talk
tie, connect, link and join are synonyms of attach
                        

Specific command changes

Specific command changes are associated with the thing in question. For example: you could define that a person should have the movement commands of crawl, walk, jog, run and sprint. These translate to a command of move at a speed.

Default Command Set

This section describes the internal commands used within the system. These commands place a limit on what can be done within the game.

There are several types of generic command that allow the user to control the world.

Communication Commands

Communication commands allow the users to interact with each other and with agents. These communications can happen as text, as voice, or as graphical displays.

body language action

This is the realm of expressive actions. To be seen they must be public and within line of site.

emote - public, visible. (sub commands - cry, laugh, dance, ...)

This is also related to emotional states.

Applicable to text and graphical.

direct communication

Direct communication is communication with some-one in the normal range of communication. For speech this is within the same context. The communication can be private or public, and hidden or visible.

Whisper - private, hidden.

Talk - private, visible.

Say - public, visible. (sub command - shout)

Announce - public, hidden.

Applicable to text, voice and graphical.

narrative communication

This is a textual communication that may describe more complex situations. In fact I have seen game worlds where the whole world was played only in the narrative.

Narrate - public, visible.

Applicable to text and voice.

remote communication

Remote communication can be the result of a technology available within the game world or as an aid to general game play. Communication can work in a point to point, single broadcast and poly-broadcast. poly broadcast is just the same as many people having access to a single channel broadcast on the same channel and does not have a separate command.

Distribute - single channel broadcast

Close - point to point

Connect - single channel broadcast

Disconnect - single channel broadcast

Open - point to point

Send - point to point

Applicable to text, voice and graphical.

Miscellaneous Commands

Miscellaneous commands allow the user to do things that do not warrant a category of their own or are game control commands.

Session control commands

list [games|worlds] [in world]

login [game] [userid] [password]

logout [game] [userid]

View commands

Passive commands allow the user to look at, but not touch the world.

look [object]

Movement Commands

Movement commands allow the movement of the player or any other thing around within the world. This includes picking things up and putting things down.

Attach [object] to [object] [using object]

insert [object a] into [object b] (also put)

pickup [object]

putdown [object] [on object]

remove [object a] from [object b] (also get)

Unattach [object] from [object]

traverse from [thing] to [thing]

Operate commands

Operate commands perform primitive actions on the databse.

Assemble Category Components Tools Capabilities

Disassemble [object]

downgrade [object x] [by removing x,[y]]

Hit [object a] with [object b] (sub commands - prod, push)

upgrade [object x] [using x,[y]] (requires parts to be present)

Default World Commands

This section describes the default world command extensions.

Object Model

The command object model describes the generic commands available within the system.

The intention here is to provide a basic set of commands, that can then be extended by the authors to create customised commands.

This general command hierarchy is mapped into the internal command object model by the command processor. The details of these mappings are below.

gd_command_object_model.jpg (80506 bytes)

Assemble command

The assemble command changes the component relationship between things.It creates a new thing out of its component things, effectively inserting a new layer in the component hierarchy and moving the component items from the containment hierarchy.

Currently the Assemble command only checks the Components, Tools and Capabilities. It should also check the player's characteristics (This would allow the author to limit assembly tasks to players with certain characteristics.) and time (to allow the specification of a time when an assembly can occur. For example: during the full moon.)

Se also: Assemble Scenario, Assemble.java

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.command.Assemble

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----bvyy.util.GeneralEvent
                   |
                   +----bvyy.command.Command
                           |
                           +----bvyy.command.Operate
                                   |
                                   +----bvyy.command.Assemble

public class Assemble
extends Operate
The Assemble command attempts to create a new object out of the component objects.

Version:
0.0.1 27 October 1998
Author:
(c)1998 Brian Voon Yee Yap
See Also:
Disassemble

Constructor Index

 o Assemble()
Creates a new Assemble command.
 o Assemble(String)
Creates a new Assemble command with a description of S.

Constructors

 o Assemble
 public Assemble()
Creates a new Assemble command.

 o Assemble
 public Assemble(String S)
Creates a new Assemble command with a description of S.

Parameters:
s - the event description.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Command.Java

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.command.Command

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----bvyy.util.GeneralEvent
                   |
                   +----bvyy.command.Command

public abstract class Command
extends GeneralEvent
All commands are types of general events. This allows them to be transported across the model using the listener interfaces in addition to the RMI and data bus transport.

As you can see the commands closely match the Java beans standard commands and those used by Sun generally inside Java. This is deliberate. There needs to be a 1:1 mapping between these commands and their implementation inside the objects and beans. This will greatly add to readability and reliability.

A command has an ordered set of argument objects. Initially these objects are sent by the user interface. Latter in the processing of the command, these objects are replaced with the actual database objects where the command action is processed.

Version:
0.0.1 27 October 1998
Author:
(c)1998 Brian Voon Yee Yap

Constructor Index

 o Command()
Creates a new command.
 o Command(String)
Creates a new command with a description of S.

Method Index

 o execute(Hashtable)
execure this command.
 o getArguments()
Returns the current command arguments list.
 o setArguments(Hashtable)
Allows replacement of the current command argument list with a new command argument list.

Constructors

 o Command
 public Command()
Creates a new command.

 o Command
 public Command(String S)
Creates a new command with a description of S.

Parameters:
s - the event description.

Methods

 o execute
 public abstract void execute(Hashtable theArguments) throws CommandCompletelyFailedException, CommandPartlyFailedException
execure this command.

Parameters:
arguments - This is a hash table of the arguments.
 o getArguments
 public Hashtable getArguments()
Returns the current command arguments list. The command arguments list is a vector and this allows modification this list using the normal vector functions.

For example: comand.getArguments.addElement(ArgumentX);

See Also:
vector
 o setArguments
 public void setArguments(Hashtable newArguments)
Allows replacement of the current command argument list with a new command argument list. All current arguments are lost.

Note: The command comes with it's own command srgument list so it will not normally be necessary to call this function.

It a null command srgument list is supplied it will be ignored.

Parameters:
newArguments - the list that replaces the current list.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Command-Completely-Failed-Exception.java

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.command.CommandCompletelyFailedException

java.lang.Object
   |
   +----java.lang.Throwable
           |
           +----java.lang.Exception
                   |
                   +----bvyy.command.CommandCompletelyFailedException

public class CommandCompletelyFailedException
extends Exception

Constructor Index

 o CommandCompletelyFailedException()
Constructs an Exception with no specified detail message.
 o CommandCompletelyFailedException(String)
Constructs an Exception with the specified detail message.

Constructors

 o CommandCompletelyFailedException
 public CommandCompletelyFailedException()
Constructs an Exception with no specified detail message.

 o CommandCompletelyFailedException
 public CommandCompletelyFailedException(String s)
Constructs an Exception with the specified detail message.

Parameters:
s - the detail message.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Command-Partly-Failed-Exception.java

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.command.CommandPartlyFailedException

java.lang.Object
   |
   +----java.lang.Throwable
           |
           +----java.lang.Exception
                   |
                   +----bvyy.command.CommandPartlyFailedException

public class CommandPartlyFailedException
extends Exception

Constructor Index

 o CommandPartlyFailedException()
Constructs an Exception with no specified detail message.
 o CommandPartlyFailedException(String)
Constructs an Exception with the specified detail message.

Constructors

 o CommandPartlyFailedException
 public CommandPartlyFailedException()
Constructs an Exception with no specified detail message.

 o CommandPartlyFailedException
 public CommandPartlyFailedException(String s)
Constructs an Exception with the specified detail message.

Parameters:
s - the detail message.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Command-Set.Java

The command set allows for sequences of commands (order is very important as is has semantic meaning) and allows command to contain commands. Command is an abstract class.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.command.CommandSet

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----bvyy.util.GeneralEvent
                   |
                   +----bvyy.command.Command
                           |
                           +----bvyy.command.CommandSet

public class CommandSet
extends Command
The command set allows for sequences of commands (order is very important as is has semantic meaning) and allows command to contain commands.

Version:
0.0.1 27 October 1998
Author:
(c)1998 Brian Voon Yee Yap

Constructor Index

 o CommandSet()
Creates an empty command set.
 o CommandSet(String)
Creates an empty command set with a description of S.

Method Index

 o getCommandList()
Returns the current command list.
 o setCommandList(Vector)
Allows replacement of the current command list with a new command list.

Constructors

 o CommandSet
 public CommandSet()
Creates an empty command set.

 o CommandSet
 public CommandSet(String s)
Creates an empty command set with a description of S.

Parameters:
s - the event description.

Methods

 o setCommandList
 public void setCommandList(Vector newCommandList)
Allows replacement of the current command list with a new command list. All current commands are lost.

Note: The command set comes with it's own command list so it will not normally be necessary to call this function.

It a null command list is supplied it will be ignored.

Parameters:
newCommandList - the list that replaces the current list.
 o getCommandList
 public Vector getCommandList()
Returns the current command list. The command list is a vector and this allows modification this list using the normal vector functions.

For example: comandSet.getCommandList.addElement(CommandX);

See Also:
vector

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Disassemble Command

This command destroys an object by reverting the object to its component parts.

See also: scenario, java source

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.command.Disassemble

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----bvyy.util.GeneralEvent
                   |
                   +----bvyy.command.Command
                           |
                           +----bvyy.command.Operate
                                   |
                                   +----bvyy.command.Disassemble

public class Disassemble
extends Operate
The Disassemble command attempts converts the selected thing back to its components.

Version:
0.0.1 6 December 1998
Author:
(c)1998 Brian Voon Yee Yap
See Also:
Assemble

Constructor Index

 o Disassemble()

Method Index

 o execute(Hashtable)
Executes this command.

Constructors

 o Disassemble
 public Disassemble()

Methods

 o execute
 public void execute(Hashtable theArguments) throws CommandCompletelyFailedException, CommandPartlyFailedException
Executes this command.

Arguments:

  1. Thing - The thing to be disassembled.
  2. Vector - A set of 0 to N tools that are to be used to disassembled the thing. Any tools marked as being consumed will be destroyed by the destruction process. The lifetime cycle of the tool will be incremented as required.
  3. Vector - A set of 0 to N capabilities that are to be used to disassembled the thing. Any temporary or permanent reductions or increases in the performance of the skills will be processed.
  4. Vector - A set of 0 to N characteristics that are to be used to disassembled the thing. Any temporary or permanent reductions or increases will be processed.

Parameters:
theArguments - the thing to be disassembled, the tools, capabilities and charcteristics to be used to disassemble the thing.
Overrides:
execute in class Command

All Packages  Class Hierarchy  This Package  Previous  Next  Index

No-Command-Assigned-Exception.Java

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.command.NoCommandAssignedException

java.lang.Object
   |
   +----java.lang.Throwable
           |
           +----java.lang.Exception
                   |
                   +----bvyy.command.NoCommandAssignedException

public class NoCommandAssignedException
extends Exception

Constructor Index

 o NoCommandAssignedException()
Constructs an Exception with no specified detail message.
 o NoCommandAssignedException(String)
Constructs an Exception with the specified detail message.

Constructors

 o NoCommandAssignedException
 public NoCommandAssignedException()
Constructs an Exception with no specified detail message.

 o NoCommandAssignedException
 public NoCommandAssignedException(String s)
Constructs an Exception with the specified detail message.

Parameters:
s - the detail message.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

No-Such-Category-Exception.java

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.command.NoSuchCategoryException

java.lang.Object
   |
   +----java.lang.Throwable
           |
           +----java.lang.Exception
                   |
                   +----bvyy.command.NoSuchCategoryException

public class NoSuchCategoryException
extends Exception

Constructor Index

 o NoSuchCategoryException()
Constructs an Exception with no specified detail message.
 o NoSuchCategoryException(String)
Constructs an Exception with the specified detail message.

Constructors

 o NoSuchCategoryException
 public NoSuchCategoryException()
Constructs an Exception with no specified detail message.

 o NoSuchCategoryException
 public NoSuchCategoryException(String s)
Constructs an Exception with the specified detail message.

Parameters:
s - the detail message.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Operate.java

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bvyy.command.Operate

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----bvyy.util.GeneralEvent
                   |
                   +----bvyy.command.Command
                           |
                           +----bvyy.command.Operate

public abstract class Operate
extends Command
The Operate command is a place holder for easy identification of operate commands.

Version:
0.0.1 27 October 1998
Author:
(c)1998 Brian Voon Yee Yap
See Also:
Assemble, Disassemble, Get, Set

Constructor Index

 o Operate()
Creates a new Operate command.
 o Operate(String)
Creates a new Operate command with a description of S.

Constructors

 o Operate
 public Operate()
Creates a new Operate command.

 o Operate
 public Operate(String S)
Creates a new Operate command with a description of S.

Parameters:
s - the event description.

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Communication Commands

This section describes the mapping of the generic commands to communication commands.

Game Database Commands

 

This section describes the mapping of the generic commands to the game database commands.

Some commands operate on the game database objects (things).

command thing operation
attach attachment relationship between things creates an attachment relationship between things (possibly using a intermediary things)
disassemble component relationship between things destroys a thing back into it's component things, effectively removing a layer in the component hierarchy and moving the component items to the containment hierarchy.
downgrade component relationship between things adds a set of components to a thing, moving the component items from the containment hierarchy.
get
insert containment relationship between a two things moves the specified object down the containment hierarchy.
move containment relationship between a two things moves the specified object across the containment hierarchy.
remove containment relationship between a two things moves the specified object up the containment hierarchy.
set
unattach attachment relationship between things destroys an attachment relationship between things.
upgrade component relationship between things remove a set of components from a thing. moving the component items to the containment hierarchy.

These commands all modify the associations between objects.

Login Database Commands

This section describes the mapping of the generic commands to the game database commands.

Command Interface

The command interface allows an object class to receive or transmit a command to another object.

The command interface implements the following methods:

Void Execute(Int New-State);

This allows the user to change the state of the state machine without the GameThing or the Application knowing anything about the state machine.

Using Commands

22/11/99

 


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