DiplomacyAiClientRelease 8~2Release NoticeIssue 1b John Newbury 24 November 2012 |
Home > Diplomacy > Downloads > AiClient > AiClient 8~2 Release Notice
AI in the Game of Diplomacy: AiClient 8~2 Release Notice
Read the AiClient 8~2 Conditions of Use before use.
This product is called AiClient Release 8~2. As David Norman did not assign a version to his AiClient Framework, as such, the 8 here means derived from the full (common and client-specific) sources as they were when he released his then most recent client, DumbBot 8; the ~2 means my modification 2. It comprises two very similar sub-products:
AiClient Release 8~2~a – using Microsoft Foundation Class (MFC)
AiClient Release 8~2~b – not using Microsoft Foundation Class (MFC)
Each sub-product comprises David Norman's AiClient Framework and his clients that are built upon it: BaseBot (the default, a non-playing observer), DumbBot, HoldBot and RandBot – all modified by John Newbury. All the clients have the same version as their sub-release: 8~2~<x>, where <x> is a or b. Apart from essential differences due to the presence or absence of MFC, each should be very similar to develop. Despite the source differences, it is unlikely, albeit possible, that there would be any significant differences between any versions of a given client (a or b; old or new), in terms of performance or reliability, in general or in AI aspects, albeit there are minor differences in functionality and appearance in some cases.
The extra functionality and convenience of MFC may be preferred by developers that have access to it (only available in expensive editions of Visual Studio). But the non-MFC form is also usable in the (free) Express editions of Visual Studio (which lack MFC), and would require less work to convert to a non-Microsoft platform. The two forms may provide a useful comparison of the two development environments. One of these clients should provide a simple and sound basis for developing further, more advanced, kinds.
The binary of all the above clients may be downloaded from johnnewbury.me.uk/diplomacy/downloads/aiclient/aiclient-8~2~b-binary.zip .
It comprises:
aiclient-8~2-release-notice.htm
This Release Notice.
aiclient-8~2-conditions-of-use.htm
Conditions of Use.
Binary
A folder containing binary versions of each supplied client:
BaseBot.exe,
DumbBot.exe,
HoldBot.exe,
RandBot.exe.
Each was generated from the non-MFC (b) source of this release, using the free Visual Studio 10 Express edition, running under Windows 7. For precision, all display their versions as 8~2~b (on the title bar, and, unless just an observer, in AiServer's list). However, no significant differences are expected if generated from the MFC (a) source, or by another edition of Visual Studio. (The version of Windows used to generate the binary should make no difference – assuming Visual Studio can then produce it). Hence only one form of the binary of each client are released.
No further files are required, other than those already in Windows.
The full source (AiClient Framework and that specific to each client, above) may be downloaded from:
johnnewbury.me.uk/diplomacy/downloads/aiclient/aiclient-8~2~a-source.zip (MFC) or
johnnewbury.me.uk/diplomacy/downloads/aiclient/aiclient-8~2~b-source.zip (non-MFC).
Each comprises:
aiclient-8~2-release-notice.htm
This Release Notice.
aiclient-8~2-conditions-of-use.htm
Conditions of Use.
AiClient
This comprises a Microsoft Visual Studio project that contains all the (Visual C++) source and project control files ready to compile/link to generate a Debug mode version of the default (observer) client.
The MFC (a) edition has been tested on Visual Studio 6 under Windows 7. The source is probably suitable for later editions (at least up to 10), but the Visual Studio project itself would need converting or recreating.
The non-MFC (b) version has been tested on Visual Studio 6 and 10 (Express) under Windows 7. The source is probably be suitable for later editions than 6 (at least up to 10). It contains some project control files that are generated by, and are specific to, Visual Studio 6 and 10. These files safely coexist, but can be removed if not required by the edition used. (Recreate the project if unsure.)
The MFC (a) form of JPN::Socket is provided for convenience/information, as it had already been produced for Release 4~1, but should now be redundant: the non-MFC (b) form should be able to coexist with MFC if MFC is required. Nevertheless, the two forms provide a useful comparison, and may aid conversion. Likewise other differences in the two forms, which are more necessary, according to whether or not MFC is to be used.
Extras
This folder contains a folder of alternative, client-specific, files for generating each client when registered in the AiClient project:
BaseBot,
DumbBot,
HoldBot,
RandBot.
See David Norman's site and comments in the source for information about the clients themselves.
Each form of project, MFC (a) and non-MFC (b), is released ready to generate the Debug version of the basic AiClient observer client. (It will only observe and log, not play, in a game.) The details of how to use Visual Studio depend on the edition used, and are outside the scope of this document. Visual Studio 6 will automatically generate a pre-processed version of the include files specified by StdAfx.h. Visual Studio 10 seems to require this to be done manually, but this is not essential, except to speed up compilation, which should not be a problem with these small clients. If running the client outside of the project, only the .exe file (in the Debug or Release folders, as applicable) is required.
To change clients:
Optionally, to avoid confusion, especially if modifying source, and to save work if repeatedly switching between clients, copy the AiClient folder and use the copy.
Deregister (and optionally delete) any previous client-specific files from the project.
Either:
Copy all the client-specific files from the appropriate folder (from within the Extras folder that is supplied with the release) into the main folder, or
Delete any previous Bot_Type.h file from the main folder. Add the required client-specific folder to the list of include folders to be searched (in place of, or above, those of any clients previously added, to ensure the required Bot_Type.h file will be used).
Register the client-specific files in the project.
Rebuild (not just build) the project (to replace any old, but no longer applicable, object files).
Optionally, to avoid confusion, set Visual Studio to use the name of the new client as the name of the binary program that it will generate.
The following auxiliary products are also required:
Windows XP or later.
AiServer 0.38 or later; AiServer 0.38~1.1 also corrects faults in some variants.
Visual Studio 6 or later, if compiling the source.
All the above run under Microsoft Windows 7, but should all work on Windows XP onwards. The MFC (a) form has been tested in Visual Studio 6; the non-MFC version has been tested in Visual Studio 6 and 10 (Express). However, a modification to Visual Studio 6 is desirable on Windows 7, to allow the debugger to be stopped, without having to restart Visual Studio. (Replace Common/MSDev98/Bin/TLLOC.dll in the Visual Studio application folder by http://www.dr-hoiby.com/TLLOC.dll – see http://stackoverflow.com/questions/2110759/how-to-debug-with-visual-c-6-on-windows-7-x64 .
Most recent first ...
Provided in two forms: (a) MFC; (b) non-MFC.
Each has its own form of the new JPN::Socket (socket handling) and AiClient (window handling) classes. Each form of JPN::Socket is now fully independent of DAIDE (hence renamed from JPN::DAIDE::Socket).
(b) No longer uses the AiClientDlg class.
(b) Adds a new JPN::String class (independent of DAIDE), which extends std::string, albeit currently only adding the extra CString functionality used by the framework and supplied clients.
Both forms updated to be more compliant with Visual Studio 10 (which is more strict than 6 by default), with only modest suppression of specific warning messages.
The "family" and "generation" of the client are now stored centrally in Bot_Type.h, from which the window "title" and "name" and "version" displayed by server are obtained. This simplifies changing clients within the project. (Name and version are typically the same as family and generation, respectively, and the title typically comprises both, but this need not be so; exceptions already exist in other clients.)
For convenience, the updated source specific to several clients (BaseBot, DumbBot, HoldBot and RandBot) is located in the Extras folder in each form of project. This folder is not referenced by the project itself.
To establish a firm base and to minimize confusion or error, the general release number (8~2) appears in a comment near the top of each source file, with a suffix (~a or ~b) if and only if specific to the MFC (a) or non-MFC (b) forms, respectively. When run, the title bar and, unless just an observer, the list in AiServer, display the full release number (including suffix). Where more than such a change was made to a source file, a preceding comment states "Modified by John Newbury". For best readably, individual changes are no longer identified (earlier such indications now removed); if required, best to use a text comparison program. (There is still only the one, original, copyright owner for a given file, as specified near the top of each file.)
Normal logging is now generated by calling log (rather than log_tcpip_note) and goes to file biglog.txt (rather than tcpip_log.txt). (This log has long not been specific to TCP/IP). DumbBot also now uses log (rather than its own log_debug, which was only enabled in Debug mode (since its trace of AI activity can be equally useful in Release mode). Errors and warnings are still generated by calling log_error, but now go to file badlog.txt and biglog.txt (rather than just to error_log.txt). (Sending errors to badlog.txt allows a quick check, but sending them also to biglog.txt also usefully displays them in context.)
As before, logging can be set on or off in any mode, but by default, it is now is set on in Debug mode; still off in Release mode. However, whether or not logging is enabled, "Started" is now sent as the first record and "Finished" as the last, in both log files. (It is useful at least to clear otherwise misleading previous logs; "Finished" indicates that the client exited cleanly, with all log messages flushed.)
Now requires the keys of command-line arguments to be lower case. (Allows more (case-significant) simple options, as used in Unix; the "-", rather than "/", prefix already follows Unix, rather than Windows, standard.)
Added "-d" command line argument to DumbBot to enable generation of CSV files. (These contain a summary of AI values used in a given turn; originally generated if and only if Debug mode. Usually unneeded clutter, but may be of value in any mode.)
Removed the redundant "Close" button on the main window (the window-independent "X" can be used); added resizing and minimizing functionality. (This was the simplest way to make the window the same in both sub-products (without MFC there is no GUI design tool). In future, the now-empty window could be more usefully used to display state information or new controls.)
Removed unnecessary file and line identification on each source file. (Redefinition of new in StdAfx.h in Debug mode labels leaked heap blocks, with or without MFC.)
Removed all #pragma once lines. Not only are they non-portable, but also pointless (albeit generated by Visual; Studio wizards) when inside the functionally equivalent file-specific conditional #ifndef block.
Further miscellaneous minor reorganization, renaming, pruning and other changes have been made – hopefully improvements. Some changes were to improve consistency between the two forms, or compliance with latest editions of Visual Studio.
Previously misleadingly called DumbBot 2~1. No longer distributed.
Released as an updated AiClient Framework, but configured ready with the client-specific source of DumbBot 4. (The resultant binary misleadingly declared itself to be version as 2.1; version 4~1 would have been more systematic and correct.) The AiClient Framework source could be used to update HoldBot and RandBot, using their client-specific sources, available in AiClient 4~0 and from David Norman's site. (These are both version 2; ideally named version 4~1 when using this AiClient Framework.)
Corrects HUH replies.
No longer uses Andrew Rose's cspdll (.LIB or .DLL) – for which no cpp source can be released – nor the associated dcsp* header files.
All TCP/IP code is now incorporated within the new JPN::DAIDE::Socket class, based on (MFC) CSockets.
No longer uses "local" messages.
Allows substitution of an argument list in logging messages.
Inhibits production of CSV files.
By default, just logs certain errors, rather than displaying them and awaiting user response.
Eliminates the (modest) memory leaks that previously to occurred in certain circumstances, thereby aiding identification other, possibly more serious, memory leaks.
Added file and line identification on all cpp files, thereby identifying the source of any leaked heap storage created by any code in this project.
Removed a compile-time pragma message.
For information, all modifications by John Newbury to David Norman's files are identified by blocks beginning #ifdef JPN. Some may not be essential or optimal. Copyright to these blocks is assigned to David Norman; the identification may be removed if desired.
This is an archive of the full (common and client-specific) source and binary of BaseBot 4, DumbBot 4, HoldBot 2 and RandBot 2 – parts of which are no longer obtainable from David Norman's site – (essentially) as used by John Newbury's Tournaments and SAGA/ARENA tests (begun 25 April 2005).
No known issues.
No further development is planned for the AiClient Framework or the above DAIDE clients, as such. However, when development is complete, BlabBot 3, which is derived from DumbBot, and hence the AiClient Framework, is to be released, along with its source. This will probably first be converted to non-MFC.
Any further significant development by John Newbury, of this or any other software product, is likely to be for non-MFC (b) forms only, using the free and portable wxWidgets library where non-trivial windowing is required.
The non-MFC (b) form of JPN::Sockets is to be enhanced to handle server-side sockets in the next release (with source) of MARS. It would probably be reasonably easy to transfer this enhancement to the MFC (a) form if required, but is probably unnecessary, as it should be able to coexist with MFC if MFC required.
JPN::String could usefully be derived from CString (as well as std::string), because the source of CString is supplied with MFC. (There are no obvious licence restrictions.)
The bulk of the product was produced by David
Norman. Grateful
thanks are also due to those in the DAIDE DipAi
group who have contributed ideas over the years.