home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 3
/
CDPDIII.bin
/
fish
/
811-820
/
ff811
/
whitelion
/
whitelion.doc
< prev
next >
Wrap
Text File
|
1993-02-14
|
13KB
|
231 lines
-----------------------------------------------------------------------------
---- WhiteLion 1.2 --------------------------------------------------
-----------------------------------------------------------------------------
---- Program Documentation --------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
---- getting started --------------------------------------------------------
-----------------------------------------------------------------------------
To play, just doubleclick on the WhiteLion_FD_gb icon, and on the [?] gadget
in the program window. It should work fine on all Amigas with Kickstart 1.2
or higher. Try a game and don't be disappointed if you lose. You'll soon get
used to it... :^>
On Hires Laced Screens, you need the Topaz 11 Font.
Insert your Workbench Fonts disk into DF0:, open a Shell and type:
Copy DF0:Fonts/Topaz#? SYS:Fonts ALL
-----------------------------------------------------------------------------
---- for german-only speaking users -------------------------
---- (there might still be some, you never know...) -------------------------
-----------------------------------------------------------------------------
Zum Start klicken Sie bitte zweimal schnell auf das WhiteLion_FD_d Icon, und
im Programm auf das [?] Gadget.
Sie benötigen den Topaz 11 Font, um auf Hires Laced Screens zu spielen.
Legen Sie die Workbench Fonts Diskette in DF0:, starten Sie die Shell und
geben Sie ein:
Copy DF0:Fonts/Topaz#? SYS:Fonts ALL
-----------------------------------------------------------------------------
---- background information -------------------------------------------------
-----------------------------------------------------------------------------
Always being fascinated by artificial intelligence, I started to write this
program in 1991, when I still worked in an old people's home in Hanover.
In Germany you have to fulfil a social civil service if you don't go to the
german army.
My first idea was to use a very quick, move-oriented evaluation of the game
positions to let the program calculate many moves ahead. But the result was
a quite weak, silly playing game which looked four or five moves ahead,
evaluated the resulting positions wrong and tried to reach one of the wrong-
valued new positions.
So I implemented the standard AI alpha-beta pruning algorithm and a position-
oriented evaluation after a while.
In 1992 I found a very useful article by Paul S. Rosenbloom in the Paderborn
University library called 'IAGO - A World Championship Level Othello
Program', published in 'Artificial Intelligence, vol. 19 (1982)'.
This is where I got most of the Minimum Disk Strategy and the Mobility
measurement inspirations from. I then decided to write my own functions for
the border and inner-room evaluation.
The idea of AI games is the following:
Let's assume the computer has to move and there are 12 possible moves in this
position. He executes the possible moves internally, i.e. builds up all 12
new board positions, and saves them. Then he calls an evalutation function
for all saved boards, and the one which gets the highest number is chosen.
If you want the computer to think ahead, let it compute the 12 following
boards ('sons') first, and then for each of the 12 sons compute all following
boards ('grandsons') again. Then evaluate the grandsons, and choose that one
of your sons for play which gives you the best value if the human finds the
best grandson afterwards.
For three moves ahead, compute all grandgrandsons...
This method is called MINIMAX.
In fact, you needn't compute all of them. There is a heuristic search
algorithm called 'alpha-beta pruning' which will give you exactly the same
(MINIMAX) result, but will create less boards:
If the average number of moves per board position is called 'b', and the
search depth 'd', it will only use ca. 2*b^[d/2] instead of b^d moves.
The FD version provides different strategies on the 4 available levels:
Level 0 will play pure Maximum Disk strategy, i.e. it will count the disks
and return the difference as an evaluation result. But the search depth is
three moves to make it not too easy. However, you'll soon find out that the
computer plays a bit silly, and I'm sure you'll figure a simple strategy to
beat it after some games yourself.
Level 1 adds a border evaluation and changes the count evaluation as the game
proceeds. The search depth is 1.
Level 2 also uses border and count, but adds an inner-room evaluation only in
the opening game, to make it more difficult for you to get to the border. It
also adds a mobility measure evaluation which counts the moves you have, the
moves the computer would be able to make and the moves both of you have. It
returns a number which shows the mobility of each player. The search depth is
1 again.
Level 3 uses the same evaluation as Level 2, but the search depth is 2. This
should be quite strong already for beginners.
You'll see that the evaluation function, not the search depth, is essential
for the strength. If the machine looks eight moves ahead, but evaluates the
occuring boards wrong, it will try to get to a wrong position. If it gets
good values near to the real ones, one (halve-)move ahead will be strong
already. If you take a greater search depth then, the game will soon become
unbeatable. But note, in general a computer will never play perfect if it
does not search up to the very end. If you've got only endboards to evaluate,
you've just got to detect who has won. You may then force a win by simply
moving to a position wherefrom all endboards are victories, if it is at all
possible. Currently WhiteLion searches for endgame positions from move
(55-LevelNr/2) on, (56-LevelNr) in the registered version.
If you like the game so far, and you did already beat it on level 3, please
consider sending me the Shareware fee. Then you'll receive the source code
with more explanations on the algorithms (GB and D) and the executable
programs. The source is in C and has been compiled with DICE, a freely
distributable C compiler from Fish Disk 491. I also tried Manx Aztec C 5.0a,
but DICE was both faster and created the smaller executable. Thanks, Matt!
The source was originally written in German. I translated the comments
afterwards, but the variables are still a german/english mixture. Should be
no problem, though. Next time I'll write the source completely in English,
that's for sure.
You'll also receive the (D and GB) registered versions of WhiteLion 1.2.
They look similar, but WhiteLion now plays a very strong and mysterious
strategy, which is called the Minimum Disk Strategy. The idea is, WhiteLion
tries to get as few disks as possible in the opening game, to reduce the
number of moves you may choose from. You'll find that if you've got less
moves, the bad ones are still there, while the good ones seem to have
disappeared. While the game continues, WhiteLion gets into a strong position
and catches all disks back in the endgame. You'll see! Here the level number
is equal to the number of halvmoves WhiteLion calculates ahead.
The Shareware fee is 10 DM, 7 US$ or 4 british £ in banknotes. I presume it
is not too much if you consider how much time I invested to write the game.
Especially those goodlooking new 5 DM-bills are welcome. Wrap it into a paper
sheet to protect it from curious eyes on its journey, and simply send it in a
standard envelope letter, asking for the registered version of WhiteLion.
I'd be interested in your basic computer model and your Kickstart/Workbench
version. If you've got any suggestions on how to strengthen the evaluation or
want a user interface feature or if you found a bug (i.e. weird behaviour),
I'd be glad to hear from you. But if you don't want to, you needn't write a
letter. I promise I'll send back the disk as soon as possible, in general the
next working day. If you've got an EMail address, I can also send you the
game over the wire, packed with lha and uuencoded. This will usually be even
faster and saves me the expenses for disk and stamps. Just let me know.
When I receive the first letter from Japan, I'll be glad to send back the
money. I know that Othello is very popular there (next to Go, of course...),
and I'd especially like any measurement on WhiteLion's strength from there.
I'll keep the right to develop a major new version of Othello even if I get
less then 20 registrations, but it is quite unlikely. I don't want to write
complex programs if noone is interested in them afterwards.
Plans for WhiteLion 2.0 include:
- complete new user interface according to the Style Guide, including Menus,
MenuHelp, 2D/3D board display, OS 2 style cycle and slider gadgets, and
special OS 3 features like 256 colour display and localization. As a result,
this major new version will require OS 2.04 as a minimum platform to run.
I'm definitely not going through this 'have to keep it 1.2 compatible'
problems again. I might consider putting the stronger algorithms described
below into the OS 1.2 version, if there is enough interest. I might also
give away a licence and the necessary sources instead if someone asks.
- ARexx and Library implementation so you may try out your own strategy by
remixing and weighting the evaluation components. You will be able to
easily simulate the whole search process using the library calls so you'll
need ARexx only to supply the result. This ensures it will still be fast.
- replacement of the a-ß algorithm with the faster SSS*; replacement of SSS*
with SCOUT in the endgame, when the number of possible moves gets lower;
replacement of SCOUT with SOLVE when the computer begins to search to the
very end.
- tournament mode to play against clocks. Implementation of time-dependant
search depth and time usage strategy.
- rewriting of the mobility evaluation. Spreading of the mobility evaluation
over the search tree to save time, i.e. counting the moves while building
up the tree.
- your suggestions. Just tell me.
-----------------------------------------------------------------------------
---- legal stuff ------------------------------------------------------------
-----------------------------------------------------------------------------
In the following context, 'This Program' means the whole WhiteLion1.2 package
as described below. If any part of the following context should be illegal
under a country's law, the whole rest remains valid nevertheless.
This Program is © (c) MXMII, MXMIII by me, Martin Grote, born 25.04.1970.
All Rights Reserved Worldwide.
This Program must not be changed by anyone except written permission by me or
for personal use only.
This Program is Shareware. Only the version with the disabled [4] gadget may
be freely redistributed. It may be distributed only as the whole package, a
directory containing the following files:
WhiteLion_FD_gb size: 50608 Bytes
WhiteLion_FD_d size: 48452 Bytes
WhiteLion.doc size: 12730 Bytes
WhiteLion_FD_gb.info size: 1614 Bytes
WhiteLion_FD_d.info size: 1614 Bytes
WhiteLion.doc.info size: 842 Bytes
The whole package may be packed with a program like 'lha', and be redistri-
buted as such, if no extra charge is applied for this. It must unpack to
This Program then.
I would be glad if Mr. Fred Fish, Amiga Library Disks, would consider placing
This Program on one of his AmigaLibDisks. He may distribute it for whatever
he assumes necessary then.
In no case may anyone else redistribute This Program for more than 5 US$,
five US dollars, without written permission from the author.
In Germany This Program must not be distributed for more than 5 DM; in our
words:
»»»» Dieses Programm darf in Deutschland nicht für mehr als 5 (fünf) DM ««««
»»»» vertrieben werden, falls keine schriftlich Erlaubnis von mir, ««««
»»»» Martin Grote, vorliegt. Dies gilt insbesondere für alle deutschen ««««
»»»» »»» PD-Händler! ««« ««««
This Program or any part of it may not be included in a commercial program
package without written permission from the author. Just ask me.
No warranty is given that This Program serves for any special purpose. Use it
on your own risk. No damage is intended, but the author can not be made
reliable for any damage caused by This Program nevertheless.
-----------------------------------------------------------------------------
Nordborchen, 20th of January, 93.
Martin Grote
Wegelange 66
4799 Nordborchen
Germany, EC
EMail: chandler@uni-paderborn.de