The Data
— introduction
— the rules
— [the data]
— faq
— the view
— the hunt —
courtesy Richard Buckland, John Shepherd, and many tutors
Introduction
The major modules in the “Fury of Dracula” need to communicate, and do so in a controlled way. Since they do not share access to a single memory space, data can’t be passed by sharing in-memory data structures. This page describes how data is transmitted between modules.
The data that needs to be communicated includes:
- the game engine gives game history data to the AIs
- the AIs pass back moves and messages to the game engine
The game engine passes the game history to the View ADTs which process it, build a game state, and then make parts of the game state available to the AIs (i.e. give a “view” of the game to the AI).
Here’s what that all looks like.
the game architecture … diagram by John Shepherd
Moves (and Messages)
Moves are communicated from an AI to the game engine via the function:
void register_best_play (char *play, player_message message);
The first argument to the function is the player’s move. Each player move is described by a two-character string, which gives the abbreviation of a location on the map. The abbreviations are given in a table below. That is all there is to each move: two characters.
Examples:
LO
= move to London,
CD
= move to Dracula’s Castle,
NS
= move onto the North Sea
(presumably en route to somewhere else), etc.
The second parameter to the function is a character string of length up to 99 characters and containing an arbitrary text message. This information can be made available to other players, but since it is plain text, may be difficult to make use of in any meaningful way.
Past Plays
The Hunter AIs use the HunterView
ADT to collect information about the
game state in order to decide on a move. The Dracula AIs use the
DraculaView
ADT to collect information about the game state in order
to decide on a move. In fact, HunterView
and DraculaView
are both
instances of a more general GameView
ADT that manages access to game
information. A GameView
contains a representation of the current state
of the game and provides an interface for interrogating the game state
in a controlled way.
The AIs set up a game state by (ultimately) invoking the function:
GameView gv_new (char *past_plays, player_message messages[]);
This function takes two argument:
past_plays
is a string containing a history of moves and actions so far,messages[]
is an array of message strings, one for each move
The most important parameter is past_plays
, which is a string
representing everything that the players have observed happening in the
game so far. It lists all the plays made in the game so far by all
players (including Dracula) from the earliest turn (at the start of the
string) to most recent turn (at the end of the string). This string is
never accessed directly by (non-cheating) AIs; they simply pass it to
the GameView
and then use the appropriate View
interface (either
HunterView
or DraculaView
) to find out about it. Note that the
past_plays
strings given to the Hunters contain slightly less
information than the past_plays
string given to Dracula.
Each play is 7 characters long (described below) and separated from any following play by a space, and represents what happened during one turn of the game. Each play begins with a single character representing the player whose turn it was:
'G'
= Lord Godalming (turns 1,6,…)'S'
= Dr. Seward (turns 2,7,…)'H'
= Van Helsing (turns 3,8,…)'M'
= Mina Harker (turns 4,9,…)'D'
= Dracula (turns 5,10,…)
For each Hunter play (starting with G, S, H, or M), the player character is immediately followed by 6 characters:
- 2 uppercase characters representing the new location of the hunter (see below for location codes)
- 4 letters representing, in order,
the Encounters that occurred:
- one
'T'
for each Trap encountered (and disarmed) 'V'
if an immature Vampire was encountered (and vanquished)'D'
if, finally, Dracula was confronted, then'.'
for the remaining 0..4 characters
- one
For each Dracula play (starting with D), the player character is immediately followed by 6 characters:
- 2 uppercase characters representing
the new location of Dracula,
which may be any valid location code
(see below) if we know Dracula’s location
(e.g., via research or confrontation),
or which, if we don’t know where he is, may be:
'C?'
= City move (unknown city)'S?'
= Sea move (unknown sea)'HI'
= Hide move, if we have discovered it was a hide move'Dn'
= Double Back move: D followed by a single character number (n) from 1-5 specifying the position in his trail to which Dracula is doubling back (e.g., 1 means staying in his most recent location, 5 means returning to his location 5 moves ago)'TP'
= Teleport to Castle Dracula
- 2 characters representing the encounter Dracula placed:
'T'
if a Trap was placed, otherwise'.'
'V'
if an immature Vampire was placed, otherwise'.'
-
1 character representing the action phase of Dracula’s turn:
'M'
if a Trap has left the trail (malfunctions due to old age), and vanishes without a trace. (yay!)'V'
if a Vampire has matured. (eek!)'.'
if nothing has occurred (e.g. early in game)
- a single ‘.’ character
The past_plays
string given to Dracula
never contains C?
or S?
,
since Dracula always knows exactly where he’s been.
It will always contains exact locations
for all players (including Dracula).
Sample past_plays
strings
After the first 5 turns (i.e. at the end of Round 0):
GBE.... SBR.... HLO.... MCA.... DC?.V..
Godalming moved to Belgrade, Seward is in Brussels, van Helsing is in London, and Mina Harker is in Cadiz. Dracula has planted an immature vampire in whatever location he currently resides.
Same game, after the 6th turn (i.e., after the first turn of Round 1):
GBE.... SBR.... HLO.... MCA.... DSJ.V..
GSJVD..
Godalming has stumbled onto Dracula’s location in Sarajevo, where he has vanquished the immature vampire, and encountered Dracula.
Below are more examples, based on real game play from 15s2.
Note that past_plays
strings can contain hundreds of moves.
Some of the past_plays
strings below contain newlines.
This is for display purposes only;
moves are always separated by
a single space character in real past_plays
strings.
Samples from Game #0:
The past_plays
string at end of round 0,
start of round 1, given to Godalming:
GMN.... SPL.... HAM.... MPA.... DC?.V..
The past_plays
string then given to Seward:
GMN.... SPL.... HAM.... MPA.... DC?.V..
GLV....
The past_plays
string then given to Van Helsing:
GMN.... SPL.... HAM.... MPA.... DC?.V..
GLV.... SLO....
The past_plays
string then given to Mina Harker:
GMN.... SPL.... HAM.... MPA.... DC?.V..
GLV.... SLO.... HNS....
The past_plays
string then given to Dracula:
GMN.... SPL.... HAM.... MPA.... DZU.V..
GLV.... SLO.... HNS.... MST....
The past_plays
string given to Godalming at the start of round 2:
GMN.... SPL.... HAM.... MPA.... DC?.V..
GLV.... SLO.... HNS.... MST.... DC?T...
The past_plays
string then given to Seward:
GMN.... SPL.... HAM.... MPA.... DC?.V..
GLV.... SLO.... HNS.... MST.... DC?T...
GIR....
Samples from Game #1:
The past_plays
string given to Mina Harker after several rounds:
GMN.... SPL.... HAM.... MPA.... DC?.V..
GLV.... SLO.... HNS.... MST.... DC?T...
GIR.... SPL.... HAO.... MZU.... DCDT...
GSW.... SLO.... HNS.... MFR.... DC?T...
GLV.... SPL.... HAO.... MZU.... DC?T...
GSW.... SLO.... HNS....
The past_plays
string given to Dracula after Mina’s move:
GMN.... SPL.... HAM.... MPA.... DGA.V..
GLV.... SLO.... HNS.... MST.... DHIT...
GIR.... SPL.... HAO.... MZU.... DCDT...
GSW.... SLO.... HNS.... MFR.... DKLT...
GLV.... SPL.... HAO.... MZU.... DBCT...
GSW.... SLO.... HNS.... MMR....
Samples from Game #2:
The past_plays
string given to Godalming after several rounds:
GED.... SGE.... HZU.... MCA.... DCF.V..
GMN.... SCFVD.. HGE.... MLS.... DBOT...
GLO.... SMR.... HCF.... MMA.... DC?T...
GPL.... SMS.... HMR.... MGR.... DBAT...
GLO.... SBATD.. HMS.... MMA.... DC?T...
GPL.... SSJ.... HBA.... MGR.... DC?T...
GPL.... SSJ.... HBA.... MGR.... DC?T...
The past_plays
string given to Dracula after all other hunters have
moved:
GED.... SGE.... HZU.... MCA.... DCF.V..
GMN.... SCFVD.. HGE.... MLS.... DBOT...
GLO.... SMR.... HCF.... MMA.... DTOT...
GPL.... SMS.... HMR.... MGR.... DBAT...
GLO.... SBATD.. HMS.... MMA.... DSRT...
GPL.... SSJ.... HBA.... MGR.... DALT...
GPL.... SSJ.... HBA.... MGR.... DMAT...
GLO.... SBE.... HMS.... MMATD..
Table of Locations
Location Name | Abbrev | Location ID | Type |
---|---|---|---|
Adriatic Sea | AS | ADRIATIC_SEA | SEA |
Alicante | AL | ALICANTE | LAND |
Amsterdam | AM | AMSTERDAM | LAND |
Athens | AT | ATHENS | LAND |
Atlantic Ocean | AO | ATLANTIC_OCEAN | SEA |
Barcelona | BA | BARCELONA | LAND |
Bari | BI | BARI | LAND |
Bay of Biscay | BB | BAY_OF_BISCAY | SEA |
Belgrade | BE | BELGRADE | LAND |
Berlin | BR | BERLIN | LAND |
Black Sea | BS | BLACK_SEA | SEA |
Bordeaux | BO | BORDEAUX | LAND |
Brussels | BU | BRUSSELS | LAND |
Bucharest | BC | BUCHAREST | LAND |
Budapest | BD | BUDAPEST | LAND |
Cadiz | CA | CADIZ | LAND |
Cagliari | CG | CAGLIARI | LAND |
Castle Dracula | CD | CASTLE_DRACULA | LAND |
Clermont-Ferrand | CF | CLERMONT_FERRAND | LAND |
Cologne | CO | COLOGNE | LAND |
Constanta | CN | CONSTANTA | LAND |
Dublin | DU | DUBLIN | LAND |
Edinburgh | ED | EDINBURGH | LAND |
English Channel | EC | ENGLISH_CHANNEL | SEA |
Florence | FL | FLORENCE | LAND |
Frankfurt | FR | FRANKFURT | LAND |
Galatz | GA | GALATZ | LAND |
Galway | GW | GALWAY | LAND |
Geneva | GE | GENEVA | LAND |
Genoa | GO | GENOA | LAND |
Granada | GR | GRANADA | LAND |
Hamburg | HA | HAMBURG | LAND |
Ionian Sea | IO | IONIAN_SEA | SEA |
Irish Sea | IR | IRISH_SEA | SEA |
Klausenburg | KL | KLAUSENBURG | LAND |
Leipzig | LI | LEIPZIG | LAND |
Le Havre | LE | LE_HAVRE | LAND |
Lisbon | LS | LISBON | LAND |
Liverpool | LV | LIVERPOOL | LAND |
London | LO | LONDON | LAND |
Madrid | MA | MADRID | LAND |
Manchester | MN | MANCHESTER | LAND |
Marseilles | MR | MARSEILLES | LAND |
Mediterranean Sea | MS | MEDITERRANEAN_SEA | SEA |
Milan | MI | MILAN | LAND |
Munich | MU | MUNICH | LAND |
Nantes | NA | NANTES | LAND |
Naples | NP | NAPLES | LAND |
North Sea | NS | NORTH_SEA | SEA |
Nuremburg | NU | NUREMBURG | LAND |
Paris | PA | PARIS | LAND |
Plymouth | PL | PLYMOUTH | LAND |
Prague | PR | PRAGUE | LAND |
Rome | RO | ROME | LAND |
Salonica | SA | SALONICA | LAND |
Santander | SN | SANTANDER | LAND |
Saragossa | SR | SARAGOSSA | LAND |
Sarajevo | SJ | SARAJEVO | LAND |
Sofia | SO | SOFIA | LAND |
St Joseph and St Marys | JM | ST_JOSEPH_AND_ST_MARYS | LAND |
Strasbourg | ST | STRASBOURG | LAND |
Swansea | SW | SWANSEA | LAND |
Szeged | SZ | SZEGED | LAND |
Toulouse | TO | TOULOUSE | LAND |
Tyrrhenian Sea | TS | TYRRHENIAN_SEA | SEA |
Valona | VA | VALONA | LAND |
Varna | VR | VARNA | LAND |
Venice | VE | VENICE | LAND |
Vienna | VI | VIENNA | LAND |
Zagreb | ZA | ZAGREB | LAND |
Zurich | ZU | ZURICH | LAND |