{"id":38302944,"url":"https://github.com/stepantita/q-learning","last_synced_at":"2026-01-17T02:25:02.054Z","repository":{"id":122610856,"uuid":"605712279","full_name":"StepanTita/q-learning","owner":"StepanTita","description":"a Python-based platformer infused with Q-Learning and dynamic level creation from simple JSON files.","archived":false,"fork":false,"pushed_at":"2023-08-11T00:44:52.000Z","size":283,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-29T22:59:19.482Z","etag":null,"topics":["epsilon-greedy","game-ai","machine-learning","machine-learning-algorithms","platformer-game","python","q-learning","q-learning-algorithm","reinforcement-learning","reinforcement-learning-algorithms","reinforcement-learning-environments","reinforcement-learning-playground"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StepanTita.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-23T18:36:08.000Z","updated_at":"2023-08-21T23:58:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"85be1b76-a164-47a6-a6b1-172a5754c6ad","html_url":"https://github.com/StepanTita/q-learning","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":0.5,"last_synced_commit":"55cb100290691a35682116bf4b02b6c363931115"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StepanTita/q-learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepanTita%2Fq-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepanTita%2Fq-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepanTita%2Fq-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepanTita%2Fq-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StepanTita","download_url":"https://codeload.github.com/StepanTita/q-learning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepanTita%2Fq-learning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"online","status_checked_at":"2026-01-17T02:00:07.808Z","response_time":85,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["epsilon-greedy","game-ai","machine-learning","machine-learning-algorithms","platformer-game","python","q-learning","q-learning-algorithm","reinforcement-learning","reinforcement-learning-algorithms","reinforcement-learning-environments","reinforcement-learning-playground"],"created_at":"2026-01-17T02:25:01.986Z","updated_at":"2026-01-17T02:25:02.038Z","avatar_url":"https://github.com/StepanTita.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Q-Learning game with epsilon-greedy algorithm 🎮 🧠\n\nThis is a university project.\nThe game with basic level editing. One can add obstacles, enemies, and bonuses on the level by putting those in the JSON file. That way creating and editing test environments is as easy as adding a couple of rows to the JSON file. After the level is built, one should initialize some basic parameters and see the model performance. Based on that, one may consider updating or keeping the parameters. The game itself is just a set of primitives. The objects can either be static or moving.\nWe also introduce the concept of **reward backpropagation** in this project. \n\nMore precise description of the solution and full report please find in the [REPORT](report.pdf)\n\n## Demo:\n\n\nhttps://github.com/StepanTita/q-learning/assets/44279105/f73161c0-a61a-4915-9b8b-e93fbdd7c867\n\n\n\n## Features 🚀\n- **Q-Learning Powered**: Experience a game environment influenced by Q-Learning.\n- **Epsilon-Greedy Strategy**: Watch the game evolve and adapt its strategy over time.\n- **Custom Levels**: Design and play on your very own levels using straightforward JSON structures:\n\n_*.json level file_\n```json\n{\n  \"floors\": [\n    {\n      \"shape\": \"rect\",\n      \"type\": \"platform\",\n      \"x\": 0,\n      \"y\": 650,\n      \"width\": 150,\n      \"height\": 10\n    }\n  ],\n  \"walls\": [\n    {\n      \"shape\": \"rect\",\n      \"type\": \"wall\",\n      \"x\": 800,\n      \"y\": 400,\n      \"width\": 10,\n      \"height\": 300\n    }\n  ],\n  \"spikes\": [\n    {\n      \"shape\": \"triangle\",\n      \"type\": \"spike\",\n      \"scale\": 25,\n      \"internal_angle\": 45,\n      \"rotation\": 0,\n      \"x\": 150,\n      \"y\": 575,\n      \"rotor\": true,\n      \"angle\": 5\n    }\n  ],\n  \"finish\": {\n    \"shape\": \"rect\",\n    \"type\": \"finish\",\n    \"x\": 950,\n    \"y\": 650,\n    \"width\": 100,\n    \"height\": 10\n  }\n}\n```\n\n## Tech Stack 📚\n- [Python](https://www.python.org/)\n- Reinforcement Learning: Q-Learning with epsilon-greedy algorithm\n- Reward backpropagation concept. Please find detailed description in the [REPORT](report.pdf)\n\n## Getting Started 🏁\n\n### Prerequisites\n- Python 3.8+\n\n### Installation\n1. Clone the repository:\n```bash\ngit clone https://github.com/StepanTita/q-learning.git\n```\n2. Install requirements:\n```bash\npip install -r requirements.txt\n```\n3. Run the game:\n```bash\npython main.py\n```\n\nor\n\n4. Run the game in reinforcement learning mode:\n```bash\ncd reiforcement # make sure you are in the correct direction\npython main.py\n```\n\n## Level Creation 🌍\nCreate custom levels using JSON files. Refer to the [level creation guide](level-creation-guide.md) to learn about the structure and possibilities!\n\n## License 📄\n\nThis project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.\n\n## TODO:\n- enemies\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepantita%2Fq-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstepantita%2Fq-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepantita%2Fq-learning/lists"}