DiplomacyMARSJohn Newbury 29 February 2012 |
Home > Diplomacy > DEMO > MARS
AI in the Game of Diplomacy: MARS
MARS (Manage Acquisition of Required Samples) is a program that I deals with at least the top level automated aspects of DEMO, including the main user interface. In due course MARS might, if convenient, incorporate all implemented features, being switched into different modes, at the graphical and/or command interface. However, only a small subset of the features defined DEMO are implemented; most probably never will be! See below for details of what is actually available, but consult DEMO for further background and hints of what might be done in the future by me or others.
MARS automatically selects and runs games that consistent with a specified series that is defined in the SAGA database, in which it also records results of completed games. If you wish to run MARS yourself: The program (suitable for Windows XP or later) and its C++ Windows source (in a Visual Studio 6 project) are available to download, together with an Access2000 version of database, and a slightly modified version of David Norman's AiServer which it requires. Copies of any required clients will also be needed; currently they must be runnable on Windows (XP or later), on the same physical computer that runs MARS. However, SAGA may reside elsewhere; it could be converted to another kind of database and platform, provided it has an adequate level of functionality, including ODBC compliance. From time to time, I will update the downloadable copy of SAGA with the latest results that I have obtained (or that have been sent to me), and will update ARENA with my analyses thereof.
See SAGA for details for the database schema: exactly what data is predefined and what is automatically recorded, and how it is all structured. The database is useful in its own right: it defines many attributes of released clients and game variants in a unified way – including some aspects beyond what is needed by MARS – it can also be used for analyses beyond what I have reported in ARENA. Its schema is also comprises an essential part of the documentation of MARS, and is best studied before attempting to run MARS, or understand, let alone modify, its C++ source.
All components except MARS (see below) are now ready for release, albeit all re subject to ongoing development, and are subject to change without notice.
The MARS is available to download: binary here and source here. See the included MARS Conditions of Use and MARS Release Notice for initial information.
The SAGA database is available to download here. See the included SAGA Conditions of Use and SAGA Release Notice for initial information.
The special version of AiServer required by MARS, including corrections and enhancements, and corrections to game variant files, is available to download: binary here and source here. See the included AiServer Conditions of Use and AiServer Release Notice for initial information.
The special version of AiServer required by MARS, including corrections and enhancements, and corrections to game variant files, is available to download: binary here and source here. See the included AiMapper Conditions of Use and AiMapper Release Notice for initial information.
See Bots for an outline of all those published bots, with links to where they can be download from. The common data for running each client is defined by its record in the SAGA_Clients table within the SAGA database. However, in general, each client may be configured as one or more contestants, by means of command arguments. The options specific to each contestant are specified in its records in the SAGA_Contestants table.
In due course, human players may be included too, by use of David Norman's AiMapper client. However, at present, MARS would probably timeout and reject any AiMapper connection, unless such user connected very rapidly. Furthermore, MARS would currently start AiMapper along with AiServer and all the other clients players in the same Windows session. Often this may well be impracticable to use, owing to some clients frequently popping their windows on top of those of AiMapper. (To avoid disruption to user activity in general, by AiServer and clients, MARS is normally configured to run in background session; but in that case AiMapper would not be visible at all!) Indeed, unlike bots, which are ready to run whenever MARS so commands (at least when run on the same computer), we should allow humans players, at their preferred location, to indicate when they are ready to play, together with the game settings that they are willing to accept, and then have MARS set up a suitable game between those who are ready and any appropriate bots.
Little documentation is included with the above downloads: the intention is to provide the latest information online. There are comments on detailed aspects, and some design aspects, in the source. The database schema is, to some extent, self-documenting internally; each field is also annotated by comments. Most of the available user- and high-level design documentation comprises Web pages on this site (DEMO, MARS, SAGA and ARENA), which will be updated from time to time; major changes being announced in DipAi. You are advised to take a copy of anything relevant in case this site becomes unavailable in future; likewise copies of any clients of interest, in case their sites become unavailable. Full Microsoft documentation of its C++, libraries and Visual Studio (development system) are freely available on the Web.
All DEMO components (including special versions of AiServer and AiMapper, but excluding the bot clients) are supplied in ZIP files. Extract the contents before use. No install programs are supplied or really needed (by the intended users); all components may be freely relocated, by copying, within the constraints below. Where <DAIDE> is specified, below, it is any convenient folder under which all required DAIDE material, including MARS, but not necessarily SAGA, is stored in a sub-tree. An environment variable named DAIDE (case ignored) must be defined to specify the folder used. SAGA may be installed alone, but if MARS is to be run then all required live components are required (that is, potentially all, except documentation and, the sub-tree containing the Visual Studio project, containing the source of MARS). No folders specified below are currently allowed to be links.
The SAGA file, saga_2.0.mdb, may be located anywhere convenient: folder <DAIDE>\Database\ is suggested. It may safely be renamed or copied (when closed). It may be used directly by Access, but for use by MARS, or an OBDC-compliant database or program, its must be registered as an ODBC source, using a Microsoft Access driver. (By default, only a SQL Server driver is visible in ODBC in the Control Panel on Windows 7. Instead, you need to run C:\Windows\SysWOW64\odbcad32!)
By default, when running a Release version of MARS, such as that as supplied, an ODBC source called SAGA (case ignored) must be registered. However, when running a Debug version of MARS (whether or not using the debugger), by default an ODBC source called SAGA_DEBUG (case ignored) must be registered. (Both could specify the same file, but better to create and register two separate copies, to avoid messing up the live copy with ad hoc, often faulty, results.) The content of SAGA and SAGA_DEBUG are otherwise equivalent.
Not tested, but SAGA should be usable directly, and/or convertible to later version of Access than Access 2000 with which it was created. It should even be convertible to a non-Access database program, such as OpenSQL. Any such converted forms should even be usable by MARS, provided the database can be registered as an ODBC data source (and has sufficient functionality – but MARS does not use any very sophisticated functionality).
The MARS program, mars.exe, requires no other files of its own or special installation, except for the definition of environment variable DAIDE (see above). MARS will also require installation of SAGA/SAGA_DEBUG, AiServer, optionally AiMapper, and the clients that it will run, as described in their Installation sections.
The sub-tree containing the special version of AiServer must be located at <DAIDE >\Server\AiServer.exe.
If required as an observer, the sub-tree containing the special version of AiMapper must be located at <DAIDE >\Observer\AiMapper.exe. If required as a client, a suitable version must be placed in <DAIDE >\Clients\AiMapper\AiServer^<version>, where <version> is the version of the AiMapper that displays when it runs. However, at present, AiMapper is merely intended for observing samples games during a MARS session; MARS in not currently able to deal properly with human players, even if AiMapper were declared as a Client and Contestant in SAGA. Furthermore, currently, AiMapper can only be enabled, even as an observer, by inserting ad hoc code; pending design of final user image.
Each client that MARS may select (according to its current mission, as defined in SAGA) must be located in its own folder sub-tree under its <home> folder, which is specific to each version of the client. The path of the <home> folder is <DAIDE >\Clients\<family>\<product>, where <family> is generic for all versions of the client; and <product> is specific to the version of the client. <product> has the form <family>^<release>. <family> and <release> are typically the same as the client's name and version, as reported to, and displayed by, the server. However, for tidier reporting, in some cases they are edited, for better consistency between them all, such as removing spaces and redundancy, such as "v" and unnecessary zeros in some versions. Furthermore, the name and version that are displayed in some cases (see HaAI version string) may depend on the parameter settings of a given contestant personality, but are excluded from <product>. <product> (and the <family> part, before the "^") must match that specified in the Product field of the SAGA_Clients table of the SAGA database.