"Morningside" A testbed for AI development, by Kris Schnee. Available from . * QUICK START INFO: * Run "morningside_server.exe" or "morningside_server.py". You'll see a static board. Hit Esc to quit. Try putting a text file called "login_[yourname].txt" into the player_io directory first, containing text like "go e" or "say hello" or "take s", then run the program and see what happens! * BASIC INFO: * Version: 2009.9.30 License: GPLv3 or MIT. (English: You may use this program for free; you may share it; you you may look at the source code and modify it; if you release modified code as opposed to a separate program that works with it, you must do so under the same open terms; use the code "as is", at your own risk with no guarantees expressed or implied.) System requirements: WinXP or other OS that can run Windows EXEs; or if running from source, Python (2.5 suggested) and Pygame, which are available free online. Contact info: Kris Schnee, kschnee at xepher dot net. * WHAT IS MORNINGSIDE? * Say you're interested in AI, and want to build a program that has something to learn from and talk about. You could develop an interface to a fancy 3D game or build one of your own... and spend most of your effort on networking, 3D graphic design and other things that aren't AI. Instead, what you could use is a simple game world that's easy to interface with. That's what Morningside is: a program you run on your machine to act as the server for a simple game world. You interact with it by reading and writing text files to one of its sub-directories. Unlike a conventional game, Morningside has very little logic built in. That is, it makes characters move, collide, pick up objects &c when told to, obeying some simple physics, but it doesn't judge success or control characters itself. *You* supply the control for characters. It doesn't know or care whether its players are humans or AIs. I offer the program along with a series of challenges; see below. Example screenshots: http://kschnee.xepher.net/code/morningside/screenshots/ Decent-looking, non-animated 2D tile graphics; nothing fancy. * HOW DOES IT WORK? * Here's the logic it follows: -Load all art from the graphics subdirectory. -Look in the player_io subdirectory for the file "use_this_level.txt". Try to load the level given there, which might involve creating objects or invoking special rules. -For every file "login_[name].txt" in player_io, create a player-character (PC) in the game world. -Start a loop. Wait for files called "from_[name].txt" to appear in player_io from every player who logged in. -Once every player has written their input file, act out their actions. (In the order they logged in, though this should rarely matter.) Apply physics like having walls block movement. -Write a file "to_[name].txt" for each player, describing what they see and otherwise sense. -Repeat till Esc is hit. Assumptions: The world is a 12x8 grid. Each tile has a terrain type, some of which have special effects. Time happens in discrete turns, with each character getting one action. A short, specific list of actions is available. Characters can pick up one object at a time. Objects and characters block movement. On some levels, characters have "energy" that drains with movement and time, "killing" them if it runs out. Vision is perfect and complete, though characters must actively "look" to get certain info. Objects are identifiable by a fixed ID each session. Available commands: Go [dir], get/take [dir], put/drop [dir], look [ID], eat, say [text] * HOW DO I USE IT? * Demonstration Instructions: -Run the server program. The board should appear, along with one player defined by the "login" file within the "player_io" directory. This window is non-interactive. -Now, create a text file that consists of the line: "move s" [no quotes]. This should be in the player_io directory within the Morningside directory. Now rename that file to "from_azure.txt" (or "from_" + whatever the player's name is, in lowercase + ".txt"). -The server will gobble up that file and react to it, by moving the character and creating a response file, "to_azure.txt". Alternate method: -Or you can run the separate human interface program once the server's up. Make sure the path.txt file for that points to player_io. It'll create its own login file if necessary, copying the one in its own directory. Note that the login file must be in player_io before the server starts. (This program is included in the Tools directory as code; if you want an EXE that's available as a separate download.) Using an AI with it: -Look at the sample AI code. (A copy is in the Tools directory.) You only need to look in the player_io directory for input files, write your own output files, and make sure you have a login file in there before the server starts. Reading the output files is mostly a matter of breaking them into lines (at "\n" characters). -What your AI actually *does* is your decision! And since the AIs are separate programs, they can be in any language or format you like. Malbolge code running on a cannibalized Furby, C++ on DARPA's best computer, a guy in a room in China e-mailing you text files, whatever. * WHAT's IT FOR? * Yes, this is a cumbersome method for a human to control a game character. The point is that it's really meant for an external program, an AI, to do so. The response files tell you something about the board's layout and contents, and the results of the characters' actions. This communications method eliminates the need for "sockets" or the Internet Protocol. Just run the server. If you can write a program that reads and writes text files in a particular directory, you can use this server. It should work even if the directory is on a physically remote network drive. This protocol is based on that used for the Loebner Prize Contest, an annual version of the Turing Test for artificial intelligence. The goal is to have a simple game world where AIs have something to talk about, rather than existing in a vaccuum. If you ask an AI "Can you see X?" or "What color is X?" or the like, there will be an objectively true answer. AIs can also be given a problem to solve, like gathering objects or feeding themselves. This approach to AI is in contrast to the "chatterbot" style that converses without reference to any actual experiences or knowledge. * THE CHALLENGES * I've supplied, in a separate file, a series of challenges for an AI using this program. If you can build an AI capable of solving them all, you'll have something that can learn from its environment and describe in English what it knows. Today, I don't know of any AI in the world that can defeat my challenges. Can yours? I'd be very interested to know. Some of the challenges are not yet available due to the levels and level-specific bots not being written. I expect to fix that soon; nudge me if you want. The challenges are designed to guide AI development in a certain direction; more on that in the challenges file. * WHAT FEATURES ARE COMING? * Upcoming features include: -Level-specific bots for certain challenges * OTHER NOTES * -There's an unadvertised "comic" feature that strings together the auto-generated screenshots with commentary on what's happening on each turn. -Multiple players can play at once. Just put more than one login file in the io directory. You can't "take" other characters. Some of the challenges assume you're playing with a human alongside the AI, or with a special level-specific dumb AI. -Look in the levels directory for examples of how levels are structured. The main trouble with making your own is that the layout must be a 96-character (12x8) string on one line. Try typing out 8 rows of 12, then deleting the end-line characters. -Comments and questions are appreciated. * CREDITS * -"Lost Garden" for free tile art. See lostgarden.com. -"Charas" for free custom sprites. See generator at charas-project.net. -"Tepid Monkey" for free font "Eager Naturalist". - -- "Grail" picture source (mangled by me) -The creators of Python and Pygame. -The works of Stephen Pinker and Douglas Hofstadter, particularly "How the Mind Works" and "Fluid Concepts and Creative Analogies".