{ "info": { "author": "Alex Havermann, Ian Kottman", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Slime Mind\n\n![slime](images/slime_default_1.png \"Slime Mind\")\n\n# Introduction\nWe made this game structure to allow us to write and test AI programs. Writers can use the example code to explore making their own AI. As a writer's code advances they should submit it to be tested against other AI. Eventually tournaments will be run between all submissions. \n\nThe current game is still being balanced and many of the parameters will likely be changed. Changes will be made in an attempt to balance the system but not destroy certain strategies. If someone figures out a way to win no matter what through complex AI or an out of the box strategy then good for them.\n\nEventually additional game mechanics may be added, and a new game with the same basic structure but additional mechanics may be released.\n\n# Setup\n## Suggested IDE\nYou are free to use whatever editor you want to create your AI. If you don't know where to start, we recommend [visual studio code](https://code.visualstudio.com/)\n\n## Installing python\nYou must install Python 3.6 or later. See this [guide](https://docs.python-guide.org/starting/installation/) for steps.\n\n## Installing libraries\nYou must install [arcade](http://arcade.academy/installation.html) to visualize the game.\n\n# Running Matches\n## Runners\nThere are multiple ways to run AIs against each other. All of them are available in `main.py`. For instructions try\n```\npython main.py --help\n```\n## Configuration\nThere are some configuration options in `config.ini`, such as the ability to turn off visualization. \nNote: the multi-match runner does not visualize matches, regardless of the `render` configuration.\n\n# Game Mechanics\n## Setup\nSlime Mind is played on a map that is broken into squares with a set number of columns and rows. The exact number of columns and rows may be changed in the config.py file. However the standard number that will be used for tournaments and such is:\n30 columns and 15 rows (likely this will be tweaked). At the start of a game plants, rocks, and slimes are put randomly on the map and mirrored across x and y so player's have an even playing field.\n\n## Turns\nPlayer AIs control each individual slime from their team every turn. Once a game begins each object will be given a single round per turn.\n* Rocks go first and do nothing.\n* Plants will go next and run on a defined AI described in the Game Pieces section of this document.\n* Slimes will then go alternating between each team until all slimes have gone.\nThen the map will update and the turn will be completed.\n\n## Game Pieces\nThere are three types of game piece in this game. All of them are given the following attributes:\n```\nx - This is the column index of the game piece (starting from 0)\ny - This is the row index of the game piece (starting from 0)\n```\n\n### Rocks\nRocks are only meant to get in the way. They are placed at the beginning of the game and cannot be moved or destroyed.\n\n### Plants\nPlants are the food source for the slimes. All plants have the following attributes:\n```\nmax_level - This is the highest level a plant can reach.\nlevel - Used to calculate the maximum health of the plant. \nmax_hp - This is the most health a plant can have.\ncurrent_hp - This is the current health of a plant.\n```\nPlants are placed at the beginning of the game at level 1 with a set amount of health. Every round the plant has a % chance to level up, which increases maximum health regains some lost health. Once a plant reaches its maximum level it will gain the ability to spread seeds. Every round a max level plant has a % chance to spread a seed to one of the 8 squares surrounding it. If a plant succeeds in seeding another plant at level 1 will be placed in the target square. Plants at maximum level will change color in the visualizer. \n\n### Slimes\nSlimes are the gamepieces controlled by the submitted AI code and will be used to determine which AI wins a game. Each slime has the following attributes:\n```\nxp - Used to calculate the level of a slime.\nmax_level - This is the highest level a slime can reach.\nlevel - Used to calculate the attack and maximum health of the slime. \nmaximum_hp - This is the most health a slime can have.\ncurrent_hp - This is the current health of a slime.\nattack - This is the amount of health a slime or plant will lose when this slime bites it.\n```\nSlimes are placed at the beginning of the game at level 1. A slimes attack and maximum HP increase as they level up. The table below shows the minimum XP for a slime to become each level and the other attributes for that level. The full equation can be found in the code.\n```\nxp\tlevel\tattack\tmax_hp\n1\t1\t3\t11\n2\t2\t4\t13\n6\t3\t7\t18\n15\t4\t10\t23\n33\t5\t13\t31\n62\t6\t16\t40\n106\t7\t20\t50\n169\t8\t24\t61\n254\t9\t29\t75\n368\t10\t33\t89\n513\t11\t38\t105\n695\t12\t43\t122\n\n\n```\nEvery turn each slime is given a round to take a single action determined by the submitted AI. Invalid commands and AI that exceed a set timeout are ignored, skipping that slime's round. Valid commands are applied immediately, before the next slime's round begins. Note that the game state given the AI is immutable, so changes are not reflected in the game engine.\n\n# Commands\nThere are only 10 acceptable commands that a slime can accept. They are:\n```\nLEFT\nRIGHT\nUP\nDOWN\nBITELEFT\nBITERIGHT\nBITEUP\nBITEDOWN\nSPLIT\nMERGE\n```\n\n### Move Commands\nThe four move commands available to slimes are:\n```\nLEFT\nRIGHT\nUP\nDOWN\n```\nMove commands attempt to move the slime in the corresponding direction (`LEFT` moves the slime to the square that has the same y value but an x value of one less etc...). If the target square is occupied by another game piece or is past the edge of the map the move will be ignored.\n\n### Bite Commands\nThe four bite commands available to slimes are:\n```\nBITELEFT\nBITERIGHT\nBITEUP\nBITEDOWN\n```\nBite commands attempt to attack nearby gamepieces in a particular direction. If there is not a valid target in the location then the slime will do nothing for its round. If there is a slime or plant object in the target location then that slime or plant will have its `current_health` reduced by the biting slimes `attack`. The biting slime will also have its `current_hp` increased by 1 and its `xp` increased by 1.\n\n### Split Command\nThe only split command available to slimes is:\n```\nSPLIT\n```\nTo split a slime must be at least level 4. Splitting creates a new level 1 slime in any empty adjacent square. This divides the `xp` of the splitting slime by 4 (rounding down).\n\n### Merge Commands\nThe only merge command available to slimes is:\n```\nMERGE\n```\nThis sets a slime as ready to merge. If an adjacent friendly slime is ready to merge it will be destroyed and the initiating slime will gain its `xp`. Every turn all slimes are set to no longer ready to merge, so you must coordinate merging within a single turn.\n\n# Victory conditions\nThe game will continue until turn 1000 or until one team has 0 slimes. Scores for each team are calculated based on the remaining slimes. This score calculation is based solely on the slimes level _not_ on its total xp. The table below shows a simplified level to score ratio. The full equation can be found in the code.\n```\nlevel\tpoints\n1\t0.2\n2\t0.4\n3\t1.6\n4\t5.2\n5\t13.7\n6\t29.9\n7\t57.7\n8\t101.7\n9\t167.0\n10\t259.7\n11\t386.7\n12\t555.3\n\n```\nThe team with the most total points at the end of the game wins.\n\n# Writing a Custom AI\nYour AI must inherit the `PlayerBase` class and override the `command_slime` method. See the `playerCode` folder for examples.\n\n# Packaging\n\nRun the following commands to package this library:\n```\nrm -rf dist build */*.egg-info *.egg-info\npython3 setup.py sdist bdist_wheel\ntwine upload dist/*\n```\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/teofrastusb/SlimeMind", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "slime-mind", "package_url": "https://pypi.org/project/slime-mind/", "platform": "", "project_url": "https://pypi.org/project/slime-mind/", "project_urls": { "Homepage": "https://github.com/teofrastusb/SlimeMind" }, "release_url": "https://pypi.org/project/slime-mind/2.0.0/", "requires_dist": [ "arcade" ], "requires_python": "", "summary": "AI competition game", "version": "2.0.0" }, "last_serial": 4615016, "releases": { "2.0.0": [ { "comment_text": "", "digests": { "md5": "6cc34712cc265eeaecef5204ba454b66", "sha256": "31c7587b0c99103c0b04f509a352ff1169db086b0676b2a9c73751e71153aebe" }, "downloads": -1, "filename": "slime_mind-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6cc34712cc265eeaecef5204ba454b66", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 278003, "upload_time": "2018-12-19T04:11:57", "url": "https://files.pythonhosted.org/packages/a6/af/01aca6ca53f94985a4ab287709b92c428b2f80c31ee7bf8daacbaac6081b/slime_mind-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "36081a89e8f84abd13cb6c26e0470316", "sha256": "de67cfacb222775a037b8296390f510d0a930a1ecfc29bb961929ee60bad04f9" }, "downloads": -1, "filename": "slime_mind-2.0.0.tar.gz", "has_sig": false, "md5_digest": "36081a89e8f84abd13cb6c26e0470316", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 274261, "upload_time": "2018-12-19T04:11:59", "url": "https://files.pythonhosted.org/packages/3e/b0/8463a300f011e227ff05756ff3a076197846766ea4b4a5758c664fdddfe2/slime_mind-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6cc34712cc265eeaecef5204ba454b66", "sha256": "31c7587b0c99103c0b04f509a352ff1169db086b0676b2a9c73751e71153aebe" }, "downloads": -1, "filename": "slime_mind-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6cc34712cc265eeaecef5204ba454b66", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 278003, "upload_time": "2018-12-19T04:11:57", "url": "https://files.pythonhosted.org/packages/a6/af/01aca6ca53f94985a4ab287709b92c428b2f80c31ee7bf8daacbaac6081b/slime_mind-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "36081a89e8f84abd13cb6c26e0470316", "sha256": "de67cfacb222775a037b8296390f510d0a930a1ecfc29bb961929ee60bad04f9" }, "downloads": -1, "filename": "slime_mind-2.0.0.tar.gz", "has_sig": false, "md5_digest": "36081a89e8f84abd13cb6c26e0470316", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 274261, "upload_time": "2018-12-19T04:11:59", "url": "https://files.pythonhosted.org/packages/3e/b0/8463a300f011e227ff05756ff3a076197846766ea4b4a5758c664fdddfe2/slime_mind-2.0.0.tar.gz" } ] }