,--. +---------+ PAC-TAPE \ : | o ___ o | -------- / : | /. .\ | v1.0 `--' +-+-----+-+ Copyright (C) 1997 by Sean Gugler This work is a derivative work of M.A.M.E. v0.28 and is subject to all its restrictions. WEB: http://www.geocities.com/SiliconValley/Bay/4458/ EMAIL: pactape@geocities.com WARNING: Bulk mail not welcome; I charge $500 per knowing violation. Pac-Man likeness and name are trademarks of Namco. ================================================== CONTENTS o Overview o How to use tapes o How to use learning engine o How to build o Technical notes o Revision History o Quick reference -------------------------------------------------- OVERVIEW -------- Pac-Tape has two main functions: 1) Record and playback Pac-Man sessions 2) Let the computer "learn" how to play by itself At this time, the functions are independent, and do not interact with each other. -------------------------------------------------- HOW TO USE TAPES ---------------- Run PACTAPE.EXE the same way you would run M.A.M.E. ** NOTE: Pac-Man ROM images are required! These files are not now and never will be included with M.A.M.E. or Pac-Tape. ** SEE "readme.txt" for more details. At or before the start of a level: Press 'R' to record or stop recording a "tape" Press 'A' for auto-pilot on or off (playback a "tape") The letter 'R' or 'A' appears in the upper-right corner of the display. The color of this letter indicates Pac-Tape's status: solid BLUE = engaged, running solid RED = cannot engage now flashing YELLOW = will start at beginning of next level Each "tape" remembers one level. They are stored on the disk with filenames "game.Txx", where "game" is the game variant and "xx" is the level number. (e.g. "PACMAN.T01", "PUCKMAN.T08", etc.) Archival and management of these files is left to the user. Two sample "tapes" have been provided with Pac-Tape; place them in the same directory as PACTAPE.EXE and engage Auto-Pilot to view them. ** NOTE: Tapes must be played back with the same dipswitch difficulty setting they were recorded with! The samples provided were recorded on "normal." -------------------------------------------------- HOW TO USE LEARNING ENGINE -------------------------- Run PACTAPE.EXE the same way you would run M.A.M.E. ** NOTE: Pac-Man ROM images are required! These files are not now and never will be included with M.A.M.E. or Pac-Tape. ** SEE "readme.txt" for more details. At or before the start of a level: Press 'L' for learning engine on or off Press 'B' to play back best winning path The letter 'L' or 'B' appears in the upper-right corner of the display. The color of this letter indicates Pac-Tape's status (see "How to use Tapes" above). Another letter will appear next to the 'L', indicating the state of the engine: 'E' = exploring new paths 'P' = playing back the highest-scoring partial path explored so far During exploration, the computer will choose paths according to the algorithm in the file "pacthink.c". The player may override these decisions with the standard controls, in order to "encourage" exploration in certain directions, or to have the computer begin with a known pattern. Note that overriding is restricted by the following rules: - No reversing direction - No "late" decisions -- all corners must be rounded early - Direction must be held down to go straight -- releasing the control will cause the algorithm to take over again - No overriding during playback, only during exploration Each table of explored partial-paths and their ranks is stored on the disk with filenames "game.Exx", where "game" is the game variant and "xx" is the level number. (e.g. "PACMAN.E01", "PUCKMAN.E08", etc.) Each table of winning paths is stored on the disk with filenames "game.Bxx". Winning paths will never be explored again by the learning engine, but may be requested for playback with the 'B' key, as mentioned above. Archival and management of these files is left to the user. ** NOTE: Exploration tables must be used with the same dipswitch difficulty setting they were recorded with! ** NOTE: Only Pac-Man properly supported. Other games have "jog" turns which the engine does not yet take advantage of. -------------------------------------------------- HOW TO BUILD ------------ ** NOTE: For speedy release, source not included yet -- check back in a few days please! -------------------------------------------------- TECHNICAL NOTES --------------- The learning algorithm is currently quite dumb, although smarter than the random procedure of prior versions. There are actually two algorithms: 1) evaluate current game state, and relative merits of possible directions to move from here 2) evaluate current path, relative to other paths stored in the table GAME STATE ---------- Priorities are determined thus: 1) if fruit is on screen, go get it; otherwise, 2) if power pellet was eaten, go get ghosts; otherwise, 3) go get dots It currently makes no effort to avoid ghosts. There are two reasons for this: a) sometimes they reverse, and b) sometimes Pac-Man will actually travel through a monster because of a bug in the original ROM. I thought it would be cool if Pac-Tape discovered some winning paths that utilize this bug; surprise your friends and scare your enemies with invincibility! VALUE OF PATH ------------- Since the engine is currently geared towards finding the best possible winning path, rather than to play the game safely, the search tree heavily penalizes paths that missed the fruit or that ate a power pellet but not all four ghosts. This is why the "playback" portion of learning will usually kick over to exploration long before the end -- it backs up to the last power pellet eaten, unless all four monsters were eaten also. The next highest priority is computed simply by subtracting the path length (times 10) from the player's score. -------------------------------------------------- REVISION HISTORY ---------------- v1.0 97-10-03 Reduce DIP switch setting requirements to difficulty only. Rudimentary smarts, no longer random. Bugs Fixed: tapes weren't storing the final motion to win a level exploration table wasn't correctly storing last path when learn mode disengaged by user Known Bugs: tapes cannot be played with different frameskip values pressing 'ESC' before shutting off Learn mode (by pressing 'L' again) will cause the table file to not be updated pressing L too soon after test sequence can cause coin insert to be ignored using the speed-up cheat will confuse both the tape and learning mechanisms, and render their files unusable Future Plans: implement yet smarter algorithms maybe allow learning engine to reverse after eating ghost allow smart algorithms to be used in place of suicide path to advance to next level more often ---------------- v0.9 97-10-01 Enforce consistent Dip Switch settings. Remember winning paths. Bugs Fixed: rare crash from v0.8 Known Bugs: pressing 'ESC' before shutting off Learn mode (by pressing 'L' again) will cause the table file to not be updated pressing L too soon after test sequence can cause coin insert to be ignored Future Plans: implement smarter algorithms (currently random) allow "forced" exploration during playback part of learning ---------------- v0.8 97-09-10 First inclusion of learning engine. Known Bugs: rare crash when switching from playback to explore ... unknown why it happens Future Plans: allow record/playback to capture/direct the learning engine account for dipswitch settings implement smarter algorithms (currently random) ---------------- v0.7 97-08-27 First Release. Known Bugs: none Future Plans: allow engaging record mode during playback account for dipswitch settings couple this engine with a learning engine -------------------------------------------------- QUICK REFERENCE --------------- Keys: R - record a tape A - auto-playback from tape L - learning engine B - playback best learned path Files created by Pac-Tape: game.Tnn - Tapes game.Enn - Learning exploration table game.Bnn - Best winning path table ================================================== Pac-Tape is Copyright (C) 1997 by Sean Gugler. Pac-Tape is a derivative work of M.A.M.E. as permitted by its authors. Since it makes no contribution to emulation of any existing arcade machine, it is expected to remain a derivation and not become a part of any future version of M.A.M.E. All efforts will be made to keep in synch with the most updated version of M.A.M.E. Restrictions of distribution and license to free use are identical to those applied to M.A.M.E. Its "readme.txt" file has been included for reference. Modifications to Pac-Tape should be reported to the project coordinator at WARNING: Bulk mail not welcome; I charge $500 per knowing violation. Pac-Man likeness and name are trademarks of Namco.