{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;} {\f16\froman\fcharset238\fprq2 Times New Roman CE;}{\f17\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f19\froman\fcharset161\fprq2 Times New Roman Greek;}{\f20\froman\fcharset162\fprq2 Times New Roman Tur;} {\f21\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f28\fmodern\fcharset238\fprq1 Courier New CE;}{\f29\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f31\fmodern\fcharset161\fprq1 Courier New Greek;}{\f32\fmodern\fcharset162\fprq1 Courier New Tur;} {\f33\fmodern\fcharset186\fprq1 Courier New Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255; \red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\widctlpar\adjustright \fs20\lang2057\cgrid \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\s15\qc\widctlpar\adjustright \b\fs36\ul\lang2057\cgrid \sbasedon0 \snext15 Title;}{\s16\qc\widctlpar\adjustright \b\fs36\ul\lang2057\cgrid \sbasedon0 \snext16 Subtitle;}{\s17\widctlpar\adjustright \f2\fs20\lang2057 \snext17 HTML Body;}{\s18\widctlpar\adjustright \b\fs20\ul\lang2057\cgrid \sbasedon0 \snext18 Body Text;}}{\info{\title The Diplomacy AI Centralisation Project}{\author David Norman}{\operator David Norman} {\creatim\yr2002\mo3\dy4\hr9\min26}{\revtim\yr2005\mo1\dy9\hr16\min47}{\version3}{\edmins4}{\nofpages3}{\nofwords810}{\nofchars4620}{\*\company }{\nofcharsws5673}{\vern113}}\paperw11906\paperh16838 \widowctrl\ftnbj\aenddoc\hyphcaps0\formshade\viewkind4\viewscale100\pgbrdrhead\pgbrdrfoot \fet0\sectd \linex0\headery709\footery709\colsx709\endnhere\sectdefaultcl {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2 \pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6 \pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \s15\qc\widctlpar\adjustright \b\fs36\ul\lang2057\cgrid {The Diplomacy AI Centralisation Project \par }\pard\plain \s16\qc\widctlpar\adjustright \b\fs36\ul\lang2057\cgrid {Frequently Asked Questions \par }\pard\plain \widctlpar\adjustright \fs20\lang2057\cgrid { \par }{\b\ul 1. Why is the Syntax Expressed using three letter tokens rather than full English Words ?}{ \par \par There are many reasons for using tokens, including : \par \par (a) It is a lot easier to write code to interpret three letter tokens than full words. \par \par (b) If you use full English words, you run into problems with plurals, tenses, etc. By using tokens, you don't have this problem. \par \par (c) If you use full English words, you will find some people start accidentally adding words (because they subconsciously try to make full English sentences). \par \par (d) If you use English, you will find some tokens expand to multiple words at which point finding the token breaks becomes a lot more difficult. \par \par (e) If you use English, you will have to decide on American English or proper English. \par \par (f) If you use English, you will make a lot more spelling mistakes, which are a pain to track down when debugging (because if you spell it wrong, you will tend to read past the spelling mistake). \par \par In general, the three letter token format is a compromise between what is easiest for the computer to deal with, and what the human can understand. \par \par }\pard\plain \s18\widctlpar\adjustright \b\fs20\ul\lang2057\cgrid {2. Why is the language transmitted as 16 bit values, rather than transmitting the three letter tokens ?}{\b0\ulnone \par \par }\pard\plain \widctlpar\adjustright \fs20\lang2057\cgrid {There are several reasons for storing the language as 16 bit values. A lot of the programming becomes much easier to write and to debug by doing it this way. The trick is to have a block at the top of your code where a symbolic name is assigned to each token value. e.g. In C : \par \par enum \par \{ \par TOKEN_ALB 34, \par TOKEN_SUB 234233, \par ... \par \}; \par \par You can then use these symbolic names throughout the code, rather than the number. Advantages of doing this include : \par \par (1) How do you determine if a token represents a province ? \par \par With text tokens : \par \par BOOL is_province = FALSE; \par String PROVINCE_NAMES[] = \{'ALB','ADR','AEG',...\}; \par \par for ( province_counter = 0 to NUMBER_OF_PROVINCES ) \par \{ \par if ( PROVINCE_NAMES[ province_counter ] == token ) \par \{ \par is_province = TRUE; \par \} \par \} \par \par With number tokens : \par \par if ( ( token >= FIRST_PROVINCE_TOKEN ) && ( token <= LAST_PROVINCE_TOKEN ) ) \par \par Because the tokens can be numbered in any order we like, we can put all the province tokens together, and then identify them by a simple range-check. \par \par (2) How do you find the nth token in the string. \par \par With text tokens : \par \par This isn't obvious. Multiplying n by 3 doesn't work, because most tokens are three letters, but some are fewer (e.g. brackets) and a few are more (e.g. years). \par \par With number tokens : \par \par token_array[n] \par \par (3) Finding problems. \par \par If you use text tokens, and have i n your code somewhere, 'ABL' (rather than 'ALB'), then you have a bug in your code which you will have to put some effort into to find (and if the effects are not serious, you may not spot it at all, you would just have an AI that isn't playing quite as w ell as it should). \par \par If you use number tokens, and have in your code somewhere, TOKEN_ABL (rather than TOKEN_ALB), then you will get a compiler error which will point me to the exact line of the problem. \par \par If you do want to program using string tokens rather than number tokens, then the DLL will provide functions to convert both number tokens (as an array of 16 bit values) to text tokens (as a string), and vice-versa. \par \par The choice to use tokens rather than text in the protocol is not for reasons of data transfer speed. Infact if transferring the data as text was faster, we would still have chosen to transfer it as tokens rather than text. \par \par }\pard\plain \s18\widctlpar\adjustright \b\fs20\ul\lang2057\cgrid {3. Why are we writing our own TCP/IP protocol, rather than using something like XML ? \par }\pard\plain \widctlpar\adjustright \fs20\lang2057\cgrid { \par XML is not a communication protocol, it is a document markup language. We are not in the business of marking up a document, we are trying to send information from A to B (and B to A). We could use XML over a communications protocol, but all the standard protocols are a lot more complex than we need, and aren\rquote t tailored to the needs of the DAIDE project. Using such a protocol would mean writing a lot of code in the clients and server to do all sorts of stuff that we don't need. \par \par Also, all the standard protocols (ftp, http, etc.) are Client-server protocols, where as we need an asynchronous protocol, so it would mean we would have to do a significant amount of hacking in order to get the protocol to do what we need. \par \par }\pard\plain \s18\widctlpar\adjustright \b\fs20\ul\lang2057\cgrid {4. Why are we writing our own server, rather than using something like the KL E-mail Judges ? \par }\pard\plain \widctlpar\adjustright \fs20\lang2057\cgrid {\b\ul \par }{Using e-mail and a traditional judge was one of the options we considered. But there are a number of good reasons for going for the TCP/IP method we have, instead. They include : \par \par (1) Using e-mail to a judge would require every AI to include SMTP or POP3 handling code. This is much more complex than the TCP/IP handling code we will need for the language we are using. \par \par (2) Playing via a judge would require all seven AIs to be connected to the internet, where as by using our own server, you can have all seven AIs and the Server on the same machine, or the same local area network, or around the internet. \par \par (3) Playing via a judge would require every AI to have its own e-mail address. If you wanted to play seven copies of the same AI against each other, it would have to have seven e-mail addresses. \par \par (4) The biggest part of the server is going to be writing an adjudicator. However, you need an adjudicator for a lot of the AI methods which will be used by people, so this needs writing anyway. \par \par (5) By using our own server, we can include a lot of functionality which is not available on the judges - such as syntax checking and level limiting our language. \par }{\b\ul \par }}