From daide
Jump to: navigation, search

History of the AI Project

In January 2002, a group of programmers got together to produce an environment in which several Diplomacy AI's could compete. This environment was named the Diplomacy AI Development Environment (DAIDE). In its purest form it consists of...

  • a communications model
  • a communications protocol
  • a language (syntax and semantics) in which diplomatic negotiations and instructions can be expressed

The following utilities are often considered part of the environment and are certainly very useful.

  • an arbitrator (like a human GM or email Judge but for computer players)
  • libraries to make writing an AI easier
  • various basic computer players (bots) for testing the environment and for testing real AIs against

See Clients for details of the current ones (where a DAIDE client is any program that communicates with a DAIDE server: bots and interfaces for human players).

A comparision of all bots published by 2006-05-15 may be found in John Newbury's automated Tournaments. For a quick summary, the Crosstabs Table in Tournament #9 shows the mean scores of the games between each pair of bot kind. Analyses of more recent games, including some more recent bots, may be found in the Arena. SAGA, a Microsoft Access database, contains of all these results, allowing anyone to do further analyses of their own. SAGA and ARENA will be updated from time to time. The program MARS may be used to perfom further trials, between any bots, using any game variants, including new ones of either.

Bot and human players should also follow the rules of Etiquette.

Having created the environment, the developers are now working on their AIs. See the news section for the latest information on how the work is progressing. If you wish to write your own AI, read on.

Writing your own Bot

If contemplating writing your own bot - great fun - the first thing you should do is join the DipAI Yahoo! group. This is where we discuss anything related to (actual, proposed and pipe-dream) Diplomacy bots, AI methods (in general, but especially related to Diplomacy), development tools, the DAIDE environment, and more. If you post a brief note saying you are interested, especially if you outline some interesting ideas (however tentative or whacky!) you can expect a warm welcome, along with some useful pointers and attempts at answers to any specific questions that you may have. However, be aware that not all languages and platforms are equally well supported, if at all, in terms of products or members' expertise. Windows, XP onwards, is currently the primary platform. Your bot need not run on the same logical or physical platform, or use the same language(s) as anything else, because all messages between bots (and other clients) are transferred by platform and language-independent TCP/IP. Nevertheless, most tools, especially AiServer and AiMapper (originally by David Norman, now updated by John Newbury) currently only run on Windows, so you will need such a platform (though perhaps a Windows emulator would suffice), at least for testing purpose - unless you are prepared first to implement at least a new server! Furthermore, bots that cannot run on Windows are currently less likely tried and tested by other members, including in tournaments that may be run by them against other bots - although, with administrative complications, you could run and connect your bot remotely from your computer.

Next check that you can reliably run at least one existing bot - even if not run on the platform that your bot will use. (You need to be familiar with running a server and its logs, and best to have at least one competitor bot that you know works OK.) Best also to become familiar with running AiMapper, which provides a graphical human interface - the map being especially useful. From here you can play as any number of powers (on separate invocations), and so control the rate of play, or merely observe play, at full speed.

The next thing you need to understand is the language syntax. You'll probably want to confine yourself to level 0 (i.e. no press) to begin with. Level 0 covers everything you need to write a bot that doesn't send any press (e.g. getting into a game, submitting orders, getting the current position, etc.). Subsequent levels deal with sending press to other powers. This should all become clear when you read the document.

If you wish to develop in C/C++ (slightly in the majority here), on Windows (probably the only platform used here, to date), then there are libraries available, which at least help you get started. Initially, download AiServer and, say, AiMapper and one of the development kits, and play with the sample bots that come with it - see John Newbury's site and David Norman's site. See Reading for further technical documentation, in case you want or need to understand a little more about the environment in which the bots compete. The reference documents, especially the Communications Model, will be particularly important if you wish to use a language or platform for which no one has written a bot before, or at least not released the source code. (This is not recommended, except for the brave, or those strongly committed to a favourite environment!)

Nearly as many bots have been written in Java, which can be run on any platform. In this case, Diplominator may be the best thing to build on, even if you only want to use its communications and other foundations. Such an language would allow you to develop your bot on your preferred platform, without restricting its use to such a platform.

If you want to use a different platform, it may be possible to transliterate some existing source code, or at least use its design. Once again, the Java Diplominator may be the best source to examine or even transliterate from - but this will be a matter of taste and familiarity with languages used in the available source. Working from the documentation alone is possible, but generally best to use both.

Whatever you do, the first major milestone should be ensure that you can compile and run a working bot. If you are not building on the AI part of an existing bot, first producing a reliable AI-free HoldBot is probably the best. (Initially, you need issue no orders! Later, issue the same orders that server uses in the case of late orders, as when the rules say civil disorder is declared.) Later, move on to a RandBot. (Issue random legal orders, to check that you can generate them correctly. Gradually replace them by ever more intelligent orders.)

Finally, please do release your bot, and any development tools that you have produced, if any good at all, on the Web, ideally with source and documentation too. (OK, you might wish to keep your very best ideas secret for a while, until your bot becomes champ!) Then announce it in the DipAI group. Ideally maintain it too, or at least continue to provide it for download from the Web for as long as possible; please give warning in the DipAI group if you cannot. Be sure to observe any licence conditions, and include due acknowledgements of any components that you have incorporated, or derived from! Happy design/coding!

The AI Project and the Real-Time (RT) Community

As it transpires, the AI Server is much better suited to RT games than the Ken-Lowe (KL) judges. As a result, a user interface has been written and RT games are now played exclusively using the AI Server and Mapper. These pages are devoted to AIs rather than RT play. That community runs its own RT Yahoo!Group.