{"id":19432961,"url":"https://github.com/bonifatius94/nwins","last_synced_at":"2026-04-11T04:33:29.805Z","repository":{"id":133709768,"uuid":"389330771","full_name":"Bonifatius94/nwins","owner":"Bonifatius94","description":"Connect-N Game UI (Godot) and C# Lib / AI Tools","archived":false,"fork":false,"pushed_at":"2022-08-26T16:57:11.000Z","size":4164,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T07:48:41.431Z","etag":null,"topics":["connect4-game","csharp","docker","docker-compose","godot-game","python3","reinforcement-learning"],"latest_commit_sha":null,"homepage":"","language":"C#","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/Bonifatius94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-25T11:25:58.000Z","updated_at":"2023-08-08T11:07:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3d5aa30-6436-4bfe-910f-916b06f5e270","html_url":"https://github.com/Bonifatius94/nwins","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bonifatius94/nwins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonifatius94%2Fnwins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonifatius94%2Fnwins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonifatius94%2Fnwins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonifatius94%2Fnwins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bonifatius94","download_url":"https://codeload.github.com/Bonifatius94/nwins/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonifatius94%2Fnwins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31669116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"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":["connect4-game","csharp","docker","docker-compose","godot-game","python3","reinforcement-learning"],"created_at":"2024-11-10T14:37:46.191Z","updated_at":"2026-04-11T04:33:29.788Z","avatar_url":"https://github.com/Bonifatius94.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect N\n\n## About\nThis project contains a reinforcement learning approach for playing an adaptation of the very popular game *Connect Four*\nconsisting of basically 3 components: game logic, game UI and AI training.\n\nThe project was developed by:\n- Marco Tröster\n- Simon Pistrosch\n\n## Game Rules\nThe original game consists of 6 rows and 7 columns. Both players can put one of their stones into a column alternatingly. \nWhen putting a stone into a column, the stone drops to the bottom of the column, so the columns get filled up with stones\nwhile the game progresses. The main goal for both players is to connect 4 of their own stones, either as row, column or diagonal.\nAs soon as one player manages to do so, the game is over.\n\nFor better adaptability there have been made some modifications to the original game such as parameterizing \nthe rows and columns of the board and allowing to define the amount of stones to connect. \nTherefore the new game is named *Connect N* (or *n-Gewinnt* as we say in Germany).\n\n## Quickstart\n\n### How to play the game\nThis section is about getting the Godot game to work (using an Archlinux Manjaro distro).\n\n1) Set up your machine using a script from the setups directory (see the README for further information).\n2) Build the Godot game app (see the README from src/nWis.Game/)\n3) Download some pre-trained AI database\n4) Launch the Godot game app you just built using the pre-trained draw database\n\n### How to train the AI\nThis section shows how to run some dockerized AI trainings. Some examples are covered in the experiments/ directory.\n\n1) Set up your machine to run Docker, Docker-Compose and Git (and VSCode as text editor).\n```sh\n# install docker and git (Ubuntu 20.04)\nsudo apt-get update \u0026\u0026 sudo apt-get install -y docker.io docker-compose git\nsudo usermod -aG docker $USER \u0026\u0026 reboot\n\n# install VSCode text editor (optional)\nsudo snap install code --classic\n```\n\n2) Download the source code from GitHub if you have not done already.\n```sh\n# clone the git repository\ngit clone https://github.com/Bonifatius94/nwins\ncd nwins\n```\n\n3) Build the Docker image and start a training session with a sample configuration.\n```sh\n# build the Dockerfile and tag the image nwins:latest\ndocker build . -t \"nwins\"\n\n# start a sample training with two random agents playing against each other\ndocker run --name training_001 nwins 00_rand_vs_rand.json\n```\n\n4) Create your own experiments with Docker-Compose. Here's an example how it could look like:\n```yaml\nversion: \"2\"\n\nservices:\n\n  lamda_80_sl:\n    image: nwins:latest\n    command: 01_sl_lambda_80.json\n    volumes:\n      - './settings:/app/settings'\n      - './train:/app/train'\n\n  lamda_90_sl:\n    image: nwins:latest\n    command: 02_sl_lambda_90.json\n    volumes:\n      - './settings:/app/settings'\n      - './train:/app/train'\n\n  lamda_95_sl:\n    image: nwins:latest\n    command: 03_sl_lambda_95.json\n    volumes:\n      - './settings:/app/settings'\n      - './train:/app/train'\n\n  lamda_99_sl:\n    image: nwins:latest\n    command: 04_sl_lambda_99.json\n    volumes:\n      - './settings:/app/settings'\n      - './train:/app/train'\n\n  lamda_999_sl:\n    image: nwins:latest\n    command: 05_sl_lambda_999.json\n    volumes:\n      - './settings:/app/settings'\n      - './train:/app/train'\n```\n\n5) Extract the training results and convert it from CSV to a SQLite database model \n(see create-model/ directory for further information).\n\n6) Copy your trained model into the model/ directory of your binary Godot app output.\n\n### Useful Docker commands for manual configuration\nFor working with dockerized training sessions following commands may be useful:\n\n```sh\n# show all running containers\ndocker ps\n\n# create a new training session with training settings file 'rand_vs_rand.json'\n# specify the container name 'training_001' using --name option\ndocker run --name training_001 nwins 00_rand_vs_rand.json\n\n# start / stop explicit containers (can also be a list of containers)\ndocker start training_001\ndocker stop training_001\n\n# show logs from a container\ndocker logs training_001\n\n# extract log files and trained models from a container and copy them to the host OS\ndocker cp training_001:/app/train .\n\n# attach to the container via bash console\ndocker exec -it training_001 bash\n```\n\n## License\nThis project is available under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonifatius94%2Fnwins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonifatius94%2Fnwins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonifatius94%2Fnwins/lists"}