The SimSpark monitor is responsible for rendering the current simulation. It connects to a running server instance from which it continuously receives a stream of updates that describe the simulation state either as full snapshots or as incremental updates.
The format of the data stream that the server sends to the monitor is called Monitor Format. It is a customizable language used to describe the simulation state.
Apart from describing the pure simulation state each monitor format may provide a mechanism to transfer additional game specific state. For the soccer simulation this means for example current play mode and goals scored so far.
The monitor client itself only renders the pure scene and defers the rendering of the game state to plugins. These plugins are intended to parse the game state and display it as an overlay, e.g. print out playmode and scores on screen.
The monitor can also play back recorded Log Files.
The internal monitor implementation is part of the SimSpark server. It is enabled in the simspark.rb setup script by enabling the rendering and input plugins of the server. To do so please uncomment the lines sparkSetupRendering() and sparkSetupInput(), i.e. remove the leading # comment markers.
External Monitor (rcssmonitor3d)
The external monitor implementation is called rcssmonitor3d. It either connects to a running SimSpark server instance or replays a simulation run from a log file.
The monitor accepts a number of commands by key or mouse. These commands either control the movement of the camera or send commands back to the server to control the simulation. The soccer simulation uses these commands to implement the controls for the human referee.
The default commands are given below. These short cuts are configured in the two setup scripts bindings.rb and soccerbindings.rb that the SimSpark monitor reads on start up.
|left mouse||mouse look|
|move camera up|
|move camera down|
|a, left arrow||move camera left|
|d, right arrow||move camera right|
|w, up arrow||move camera forward|
|s, down arrow||move camera backward|
|1||camera to left goal|
|2||camera to left corner|
|3||camera to middle left|
|4||camera to middle right|
|5||camera to middle|
|6||camera to right corner|
|7||camera to right goal|
|l||free kick left|
|r||free kick right|
|n||cycle selected agent|
|lctrl+s||enter numeric agent selection mode (via l or r followed by a numeric digit)|
|x||kill selected agent|
|m||move selected agent FreeKickDist meters back|
|p||pause the playback of a log file|
|f||move one step forward in the log file while paused|
|b||move one step backwards in the log file while paused|
|l||toggle forward/backward playback of log file|
The selected agent is shown by a red disc around its base.
Command Line Options
rcssmonitor3d has the following command line options.
usage: rcssmonitor3d [options] options: --help print this message. --logfile logfilename plays the log file. --server server_addr connects to the specified server.
Connecting to a Different Host
By default, rcssmonitor3d connects to the local host. Specify a remote host like this:
rcssmonitor3d --server otherhostname
Playing Log files
rcssmonitor3d can also replay recorded Log Files by specifying a file name:
rcssmonitor3d --logfile logfilename.log