DiplomacySAGAJohn Newbury 21 April 2013 |
Home > Diplomacy > DEMO > SAGA
AI in the Game of Diplomacy: SAGA
SAGA (Samples of Acquired Game Attributes) is a database of results of Diplomacy games, run by MARS (previously by DTDT). For convenience, it currently also holds records that define the current mission for series (games) selected by MARS, analyses are shown in the ARENA.
SAGA is currently a Microsoft Access 2000 database.
The latest published snapshot, up to the end of 2011-10-08, is available in the old format (1.0) and the extended and optimized new format (2.0) so you can do additional analyses of your own; the latter is suitable for MARS.
The database schema is subject to change; mainly additions; sometimes entailing reorganization of the existing data, but the intention is that existing game data (rows and columns) should always be extractable, albeit may then require an SQL query. Where certain SQL queries would be impossible, difficult, or unduly inefficient, contrary to SQL dogma, some columns are included that strictly duplicate data that could be derived from other data.
See DEMO for an overview of the terminology and concepts.
Each of following tables specify the columns in an new-format SAGA table.
SAGA_Client {table defining each client} |
||
---|---|---|
ClientId | AutoNumber | Id of Client (bot, human or team of these). |
Family | Text | Standardized name for set of such Clients, for formal use. Normally derived from Name. For sanity: no spaces or other problematic chars; never changed by Contestant. |
Release | Text | Standardized name for specific Client of given Family, for formal use. Normally derived from Version. For sanity: no spaces or other problematic chars; no redundant "v" and " 0"s. |
Name | Text | Name as reported to, and displayed by, Server. May contain <n> for nth Contestant Option. |
Version | Text | Version as reported to, and displayed by, Server. May contain <n> for nth Contestant Option. |
Command | Text | Command to run the client, with variables in the form <x>. Must include <home> (path of home dir of the Client; typically, but not necessarily, the working dir), <host> and <port> of Server, and <n> for nth Contestant Option. |
WorkingDir | Text | Initial working directory, as a suffix to <home>. Typically, but not necessarily, where the Client resides. |
Lazy | Boolean | True iff the Client does not finish after receipt of OFF; iff so, MARS sends it a WM_QUIT after Contestant FinishTime. |
Superseded | Boolean | True iff superseded by a new version, so is not normally worth including in future games. Advisory only: overridden by the value in its Contestants. |
Obsolete | Boolean | True iff no longer considered viable for future games, due to frequent failure or causing undue waste of time. Advisory only: overridden by the value in its Contestants. |
Notes | Text | Miscellaneous. |
SAGA_ClientVariant {table defining each non-default client-variant pairs} |
||
---|---|---|
ClientId | Integer | Id of Client. |
VariantId | Integer | Id of Variant. |
AutoInhibit | Boolean | True if the Client has been inhibited by MARS, due to timeout while trying to connect. |
SAGA_Contestant {table defining each contestant} |
||
---|---|---|
ContestantId | AutoNumber | Id of the Contestant. |
ClientId | Integer | Id of Client. |
Personality | Text | Name of specific param setting of the Client for the Contestant. No spaces. Normally empty iff no options possible. Append to Title of Client, with"~" separator (even if empty) to give Title of the Contestant; omit version and "^" to mean all versions. |
Options | Text | Contestant-specific options, each terminated by "#", to substitute for <n> in Client.Command; maybe in Name and/or Verison too; where n is option number, <1> being 1st. Each option, directly or indirectly, specifies >= 0 Client-specific parameters. |
PlatformId | Integer | Id of Platform required by the Contestant. Null means no restriction: the default Platform of the current Game. |
FinishTime | Integer | Time (ms) to wait after game has finished for Contestant to finish, after which WM_QUIT is sent if applicable (see SAGA_Client.Lazy). (MARS then terminates any of its sub-processes that remain after a further delay.) |
Throttle | Real | CPU allocation relative to other players in a game; fraction of the time the CPU priority of the Contestant is low rather than lowest. Absolute allocation also depends on demand from other players, other contemporaneous load, and Platform. |
Superseded | Boolean | True iff superseded by a newer Contestant, so is not normally worth including in future games. Overrides the value in its Entity. |
Obsolete | Boolean | True iff no longer considered viable for future games, due to frequent failure or causing undue waste of time. Overrides the value in its Entity. |
Notes | Text | Miscellaneous. |
SAGA_Game {table defining each game played} | ||
---|---|---|
GameId | AutoNumber | Id of the Game. |
SeriesId | Integer | Id of the Series. |
SettingId | Integer | Id of the Setting. |
Finished | Date/Time | Time when the Game finished. |
SetupTime | Real | Time (secs) taken to set up the Game. |
PlayTime | Real | Time (secs) taken to play the Game itself. |
TotalTime | Real | Time (secs) taken to set up and play the Game, plus time taken by any stalled and aborted earlier attempts with the same parameters. |
Termination | Integer | Reason for termination: 1=Solo, 2=Partial Draw, 3=Agreed DAIS, 4=Stasis DIAS, 5=Impasse DIAS, 6=Frozen DIAS. |
Years | Integer | Number of years until the Game finished. |
Survivors | Integer | Number of Powers that survived. |
Leaders | Integer | Number of Powers that finally had at least as many supply centres as any other Power. |
Winners | Integer | Number of Powers that shared the win. |
MaxSupplies | Integer | Maximum numer of supply centres finally owned by any Power. |
SAGA_Platform {table defining each platform} |
||
---|---|---|
PlatformId | AutoNumber | Id of the Platform. |
Name | Text | Name of the Platform. |
Fraction | Real | Fraction of the time the CPU priority of the top process of each bot in a given Game is set Normal; else Low. Limits load due to the game, albeit spare time can be used if available. Typically a bot uses <1 CPU on average; but could be more. |
Quality | Integer | Quality of service. Reduced by variable load (usually CPU), external to the current game. 1=Low (significant interference), 2=Medium (modest interference), 3=High (dedicated; minimal interference). |
Notes | Text | Miscellaneous |
SAGA_Player {table defining each player in a game} |
||
---|---|---|
GameId | Integer | Id of the Game. |
PowerId | Integer | Id of the Power. |
ContestantId | Integer | Id of the Contestant. |
Supplies | Integer | Final number of supply centres. |
Elimination | Integer | Years after 1st year of Game when eliminated; null if never eliminated. |
Disorder | Integer | Turns after 1st turn of Game when in civil disorder, due to any problem; null if undefined (Problem= 0 or null). |
Problem | Integer | Problem: 0=No problem, 1=Late submitting an order, 2=Disconnected, null=unknown. |
Winner | Integer | True iff a winner, possibly joint. |
Grade | Integer | Final number of supply centres if >0; else minus number of years before last year when eliminated. |
Rank | Integer | Rank of Grade (number of players with hgiher Grade+1). |
Cpu | Real | Total CPU time (kernel+user) used. |
SAGA_Power {table defining each power in a variant} |
||
---|---|---|
PowerId | AutoNumber | Id of the Power. |
VariantId | Integer | Id of the Variant to which the Power belongs. |
Code | Text | Token name. |
Name | Text | Power name. |
Notes | Text | Miscellaneous. |
SAGA_Series {table defining each series} |
||
---|---|---|
SeriesId | AutoNumber | Id of the Series. Unless noted otherwise, normally nothing relating to a Seriesshould be changed once any of its games have been started, so that the parameters of the Series well defined, and any analyses remain valid. |
Name | Text | Name of the Series. Finite formally-documented ones are normally called "Tournament <n>" when closed. |
State | Integer | Name of the Series. Finite formally-documented ones are normally called "Tournament <n>" when closed. |
Weight | Real | Relative probability for running the Series (where possible). 0 inhibits any new game, even if all are 0. But set State >= 2 (complete) to permanently inhibit. Update at any any time. |
Pure | Boolean | True iff choice of next game depends only on a complete prior games and/or earlier games in this Series. |
GameLim | Integer | Max # games to play. |
Selector | Text | Selector args used for selecting new games for the Series. Preceded by "~" iff no such implementation available at present. |
Notes | Text | Miscellaneous |
SAGA_SeriesContestant {table defining each non-default series-contestant pair} |
||
---|---|---|
SeriesId | Integer | Id of Series. |
ContestantId | Integer | Id of Contestant. |
Weight | Real | Relative weight for selecting the Contestant for the Series, within Selector criteria. |
Notes | Text | Miscellaneous. |
SAGA_SeriesSetting {table defining each non-default series-contestant pair} |
||
---|---|---|
SeriesId | Integer | Id of Series. |
SettingId | Integer | Id of Setting. |
Weight | Real | Relative weight for selecting the Setting for the Series, within Selector criteria. |
Notes | Text | Miscellaneous. |
SAGA_Setting {table defining each setting} |
||
---|---|---|
SettingId | AutoNumber | Id of the Setting. Other fields are supplied as arguments to AiServer, to constrain play. |
PlatformId | Integer | IId of the Platform. |
VariantId | Integer | Id of the Variant. |
Obsolete | Boolean | True iff obsolete. |
Level | Integer | Level of press allowed. |
SL | Integer | Stasis Limit: Number of years of stasis (unchanged supply centre counts) before a DIAS draw is declared; null = no limit. |
IL | Integer | Impasse Limit: Number of years of impasse (no power elimination) before a DIAS draw is declared; null = no limit. |
PTL | Integer | Press-free time limit (secs). |
MTL | Integer | Movement phase time limit (secs); null = no limit. |
RTL | Integer | Retreat phase time limit (sec); null = no limit. |
BTL | Integer | Build (adjustment) phase time limit (secs); null = no limit. |
AOA | Boolean | Any orders allowed. |
PDA | Boolean | Partial draws allowed. |
NPR | Boolean | No press allowed during retreat phase. |
NPB | Boolean | No press allowed during build (adjustment) phase. |
Notes | Text | Miscellaneous. |
SAGA_Variant {table defining each variant} |
||
---|---|---|
VariantId | AutoNumber | Id of the Variant. |
Name | Text | Name of the Variant. |
Powers | Integer | Number of Powers. |
Supplies | Integer | Number of supply centres. |
FirstYear | Integer | First year. |
FirstSeason | Text | First season. |
Notes | Text | Miscellaneous. |
See DEMO for an overview of the terminology and concepts.
Each of following tables specify the columns in an old-format SAGA table.
Dip_Bot {table defining each bot} |
||
---|---|---|
Id | AutoNumber | Identifier; primary key. |
Name | Text | Text name (with version where important), for reports. |
Title | Text | Text of name and version, separated by a space, as sent by NME message, and displayed by Server. |
Dip_Game {table defining each game played} | ||
---|---|---|
Id | AutoNumber | Identifier; primary key. |
Tournament | Text | Identifies the tournament, or other related set of games. |
Finished | Date/time | When the game finished. |
SetupTime | Real | Seconds taken to start the game. |
PlayTime | Real | Seconds playing the game. |
TotalTime | Real | Seconds in total, including setup, play, and any earlier games that were aborted due to a problem. |
Years | Integer | Game-years of play. |
Survivors | Integer | Powers that survived until the finish (even if finally beaten by a solo). |
Leaders | Integer | Powers that had equal highest score. |
Winners | Integer | Powers that gained any score (in a draw or solo). |
MaxSC | Integer | Supply centres. |
Variant | Integer | Id in Dip_Variant table. |
Level | Integer | Press level. |
Kill | Integer | Server Kill parameter. |
PTL | Integer | Server PTL parameter (Press Time Limit). |
MTL | Integer | Server MTL parameter (Movement Time Limit) |
RTL | Integer | Server RTL parameter (Retreat Time Limit). |
BTL | Integer | Server BTL parameter (Build [adjustment] Time Limit). |
AOA | Boolean | Server AOA parameter (Any Orders Accepted). |
NPR | Boolean | Server NPR parameter (No Press during Repeats). |
NPB | Boolean | Server NPB parameter (No Press during Builds [adjustments]). |
Dip_Player {table defining each player in a game} |
||
---|---|---|
Game | Integer | Id of Dip_Game table; primary key #1. |
Power | Integer | Id of Dip_Power table; primary key #2. |
Bot | Integer | Id of Dip_Bot table. |
SC | Integer | Number of supply centres at game finish. |
Years | Integer | Number of years that the power played before being eliminated; null if never eliminated. |
Strength | Real | Moving average ability to be a Leader, within Tournament. |
Tenacity | Real | Moving average ability to be a Survivor, within Tournament. |
Fitness | Real | Moving average ability to be a Winner, within Tournament. |
Dip_Power {table defining each power in a variant} |
||
---|---|---|
Id | AutoNumber | Identifier; primary key. |
Variant | Integer | Id of Dip_Variant table. |
Code | Text | Upper case token name of power. |
Dip_Variant {table defining each variant} |
||
---|---|---|
Id | AutoNumber | Identifier; primary key. |
Name | Text | Name of variant. |
Powers | Integer | Number of powers. |
SC | Integer | Number of supply centres. |
Year0 | Integer | Game-year of first turn. |
Season0 | Text | Token name of first season. |
No SQL queries are included at present in any release of SAGA. (Those used in production of ARENA analyses are often somewhat ad hoc!)
In the SAGA_1 schema, to determine the score of a player (such that the sum of points in any game is zero): SQL JOIN the Dip_Games and Dip_Players tables. A game is a solo if Winners = 1; else a draw. Each player pays (loses) a point for entering a game, but if he is a winner (the soloist, or in a survivor in a draw) he regains the sum of the points paid (1 per power) divided by the number of Winners. A player is a soloist if his SC > MaxSC/2; else a survivor in a draw if his Years is Null; else a loser.
In the SAGA_2.0 schema the SAGA_Player table has new explicit fields for Winner, Grade and Rank and Cpu.