{ "info": { "author": "Davide Ceretti", "author_email": "dav.ceretti@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4" ], "description": "[![Alt text](https://api.travis-ci.org/davide-ceretti/strategypy.svg?branch=master)](https://travis-ci.org/davide-ceretti/strategypy)\n\nstrategypy\n----------\n\nA simple strategy game played by Python bots.\n\nThe project is still in development, but if you checkout everything and follow this README it is supposed to work just fine.\n\nPull requests are welcomed, expecially if you want to submit your own bot. Bear in mind the the BaseBot API is not final yet and it might change quite often.\n\nGame rules\n----------\n\nEach player controls a set amount of cells in a grid. The behaviour of these cells is defined by a Bot that implements a specific interface; each cell of the player is represented by an instance of the Bot class.\n\nThe game ends when only one player has still cells alive in the grid.\nA cell is killed if in the 9-cells subgrid centered on itself the number of the cells belonging to enemy players is more then the cells belonging to the owner of the cell.\n\nHave a look at settings.py if you want to change some of the game basic settings.\n\nDemo\n----\n\nJavascript Frontend: http://benqus.github.io/strategypy-ui/\n\nInstallation\n------------\n\nSystem dependencies: python2.7 or python3.4\n\n* ```git clone https://github.com/davide-ceretti/strategypy.git```\n* ```pip install -e .```\n\n**NOTE**: You should be able to install strategypy directly from pypi via ```pip install strategypy```, but it's not fully supported.\n\nQuickstart\n----------\n\nTo run an example game (output is json):\n* ```./play.sh```\n\nTo run a game with simple console-based front-end:\n* ```./play-simple.sh```\n\nTo run a game with a PyGame front-end (Requires https://github.com/davide-ceretti/strategypy-pygame-client and its dependencies):\n* ```./play-pygame.sh```\n\nTo run a game with a Javascript front-end on Firefox (Requires https://github.com/benqus/strategypy-ui, its dependencies and Firefox to be installed):\n* ```./play-firefox.sh```\n\nTo run a game with a console front-end (Requires https://github.com/mrfuxi/strategypy-consoleui):\n* ```./play-console.sh```\n\nGeneral usage\n-------------\n\n* ```strategypy < ...```\n\nThe result of the script is a JSON file that contains all the information necessary for any front-end to play it.\n\nThe name of the bot must be a name of a python module in /bots/. It currently supports a URL of a web service that returns moves, but that is very experimental.\n\nThis JSON result can be saved on a file so that it can be loaded later by a FE:\n* ```strategypy killer prey prey > example.json```\n\nor it can be piped it directly into a FE, for example:\n* ```strategypy killer prey prey | python strategypy/simplefe.py```\n\nSee https://github.com/davide-ceretti/strategypy-pygame-client for a PyGame FE.\nSee https://github.com/benqus/strategypy-ui for a Javascript FE.\nSee https://github.com/mrfuxi/strategypy-consoleui for a Console FE.\n\nTests\n-----\n\nTo run all the tests:\n* ```pip install tox```\n* ```tox```\n\n\nBOT API\n-------\n\nThe current way to build a bot is to create a python file (e.g. mybot.py) in the bots directory. The python file must have a function called action.\n\nThe function \"action\" takes one argument, the context of the game and returns one of the five possible moves: 'move up', 'move left', 'move right', 'move down', None.\n\nExample:\n```\ndef action(ctx):\n return 'move down'\n```\n\nThen you can play a game by running:\n```strategypy mybot < ...```\n\nThe context given to the action function represents the state of the game when action is required for one of your units. It is a dictionary with the following keys:\n\n```\n(int) player_pk\n(int) pk\n(bool) respawn\n(int, int) grid_size\n(int, int) position\n(list) has_killed\n(list) was_killed_by\n(dict) current_data\n```\n\nTODO / Improvements\n-------------------\n\n* Better API for Bots\n* Security in local mode\n* Anti-cheating in local mode\n* Numpy / Performance improvements\n* Performance tracking/acceptance on build\n* Rework game rules and engine to make it more interesting\n* More and better unit tests", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/davide-ceretti/strategypy", "keywords": "strategypy", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "strategypy", "package_url": "https://pypi.org/project/strategypy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/strategypy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/davide-ceretti/strategypy" }, "release_url": "https://pypi.org/project/strategypy/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "A strategy game for Python bots with replaceable front ends", "version": "0.3.0" }, "last_serial": 1468374, "releases": { "0.1.0": [], "0.2.0": [ { "comment_text": "", "digests": { "md5": "c81299cfc8961c920ae891124304bbd9", "sha256": "53835dd9bc20cb9bd470bdd39b40b1c69648f5bacaa4e4843ed0619bfc64e89f" }, "downloads": -1, "filename": "strategypy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "c81299cfc8961c920ae891124304bbd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54699198, "upload_time": "2015-03-12T15:40:14", "url": "https://files.pythonhosted.org/packages/6c/d1/fde6a70be00939acf4bd51ae570d55e0ef85e41b976571e13d0f79ab8516/strategypy-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f4bb31c2547bed5ba227cd3a20a79412", "sha256": "bf2dd1813a563b7b6e53a46b9df09abed0fe604ddc9ffa039830bc307812edda" }, "downloads": -1, "filename": "strategypy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "f4bb31c2547bed5ba227cd3a20a79412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54698709, "upload_time": "2015-03-12T16:23:21", "url": "https://files.pythonhosted.org/packages/9f/86/c07772c922bfe741da9598df3405529115091bf8bf1748ff843790bf9c83/strategypy-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "5fbc95a903f48949d5180cfd522f4238", "sha256": "cdb7c0c83b889050e930d79a1f743c478e4cc7d10612d711fb1908ab837c2f95" }, "downloads": -1, "filename": "strategypy-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5fbc95a903f48949d5180cfd522f4238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16385, "upload_time": "2015-03-19T11:51:55", "url": "https://files.pythonhosted.org/packages/98/17/c3bb3df8e1bf0ad1350de2ade2777b52d5e2c3bb7fff3d30db87648314f2/strategypy-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5fbc95a903f48949d5180cfd522f4238", "sha256": "cdb7c0c83b889050e930d79a1f743c478e4cc7d10612d711fb1908ab837c2f95" }, "downloads": -1, "filename": "strategypy-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5fbc95a903f48949d5180cfd522f4238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16385, "upload_time": "2015-03-19T11:51:55", "url": "https://files.pythonhosted.org/packages/98/17/c3bb3df8e1bf0ad1350de2ade2777b52d5e2c3bb7fff3d30db87648314f2/strategypy-0.3.0.tar.gz" } ] }