{"id":16217431,"url":"https://github.com/hhyyrylainen/mlbrickbreaker","last_synced_at":"2026-01-21T16:35:19.392Z","repository":{"id":72303335,"uuid":"329551402","full_name":"hhyyrylainen/MLBrickBreaker","owner":"hhyyrylainen","description":"AI learns to play brick breaker","archived":false,"fork":false,"pushed_at":"2021-02-16T12:44:27.000Z","size":359,"stargazers_count":1,"open_issues_count":14,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T20:13:43.615Z","etag":null,"topics":["cpp","cpp17","godot","machine-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/hhyyrylainen.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-01-14T08:22:57.000Z","updated_at":"2023-08-08T11:04:29.000Z","dependencies_parsed_at":"2023-05-29T16:30:23.070Z","dependency_job_id":null,"html_url":"https://github.com/hhyyrylainen/MLBrickBreaker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhyyrylainen%2FMLBrickBreaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhyyrylainen%2FMLBrickBreaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhyyrylainen%2FMLBrickBreaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhyyrylainen%2FMLBrickBreaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hhyyrylainen","download_url":"https://codeload.github.com/hhyyrylainen/MLBrickBreaker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247721927,"owners_count":20985083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cpp","cpp17","godot","machine-learning"],"created_at":"2024-10-10T11:45:03.033Z","updated_at":"2026-01-21T16:35:14.364Z","avatar_url":"https://github.com/hhyyrylainen.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MLBrickBreaker\nAI learns to play brick breaker\n\n## Building\n\n### Repo init\n\n```\ngit clone git@github.com:hhyyrylainen/MLBrickBreaker.git\ncd MLBrickBreaker\ngit submodule update --init --recursive\n```\n\nYou need to run the last line above whenever you pull changes that\nchange the submodule versions.\n\n### Build tools\n\n```sh\npip install scons --user\n```\n\nAnd also install cmake. On Windows make sure it is added to PATH.\n\n### Compiler\n\nOn Linux, just install gcc or clang or whatever your systems default compiler is.\n\nOn Windows, probably use latest Visual Studio.\n\n### Godot\n\nInstall Godot **3.2.3** and create a symbolic link in your PATH to it named `godot`,\nso that running:\n\n```sh\n$ godot --version\n3.2.3.stable.mono.official\n```\n\ngives output like that (here the mono version is used but that is not\nrequired for this project).\n\n\n### First time build commands\n\nCommands for setting up remainder of things (replace ALL_CAPITAL with\nright values for your system, refer to:\nhttps://docs.godotengine.org/en/3.2/tutorials/plugins/gdnative/gdnative-cpp-example.html\nalso replace the number after `-j` with your number of CPU threads):\n\n```sh\nmkdir build\n# Use this if Godot tries to import .obj files from the build folder:\ntouch build/.gdignore\ngodot --gdnative-generate-json-api build/api.json\ncd third_party/godot-cpp\nscons platform=PLATFORM generate_bindings=yes -j20 use_custom_api_file=yes custom_api_file=../../build/api.json bits=64 target=release\n# if don't want to build in debug mode this may not be needed:\nscons platform=PLATFORM generate_bindings=yes -j20 use_custom_api_file=yes custom_api_file=../../build/api.json bits=64 target=debug\ncd ../..\n```\n\n### Compile\n\nIt's finally time to compile the game modules. \nConfigure build:\n\n```sh\ncd build\ncmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo\n```\n\nFor debug build set the type to `Debug`.\n\n\nFor Windows (if you use visual studio), you need to use this instead:\n```sh\ncmake .. -G \"Visual Studio 16 2019\" -A x64\n```\n\n\nThese steps need to be repeated each time the C++ source code is modified\n(note that you need to run this in the build folder):\n\n```sh\ncmake --build . --config RelWithDebInfo\n```\n\nAlternatively use `make` or visual studio to compile.\n\n### Godot tab config\n\nYou need to change \"Editor Settings\u003eText Editor\u003eIndent\u003eType\" to spaces.\n\n## Debugging\n\nTo run the debug build, add `.debug` suffixes in `bin/mlbb.gdnlib`. For example on Linux:\n```\nX11.64=\"res://bin/x11/libmlbb.debug.so\"\n```\n\n\n\n## Some random notes\n\nGDNative tutorials:\n- https://docs.godotengine.org/en/3.2/tutorials/plugins/gdnative/gdnative-cpp-example.html\n- https://docs.godotengine.org/en/3.2/tutorials/plugins/gdnative/gdnative-c-example.html#doc-gdnative-c-example\n- https://github.com/godotengine/godot-cpp/tree/master\n- https://github.com/BastiaanOlij/gdnative_cpp_example\n- Might be useful to get Windows build working: https://gist.github.com/willnationsdev/437eeaeea2e675c0bea53343f7ecd4cf\n\n`reloadable=true` needs to be in any GDNative modules to make\nrecompiling them reload them in the editor, otherwise you will be\nclosing and reopening the Godot editor a lot.\n\n\nNEAT resources:\n- http://nn.cs.utexas.edu/?neat-c\n- http://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf\n- https://en.wikipedia.org/wiki/Neuroevolution\n- https://en.wikipedia.org/wiki/Neuroevolution_of_augmenting_topologies\n- http://www.cs.ucf.edu/~kstanley/neat.html\n\n\n## Starting networks\n\nstartgenes, commented (when copying to config remove from `#` to line ends):\n\n```\ngenomestart 1\ntrait 1 0.1 0 0 0 0 0 0 0\nnode 1 0 1 1 # input (paddle x)\nnode 2 0 1 1 # input (ball x)\nnode 3 0 1 1 # input (ball y)\nnode 4 0 1 1 # input (lowest brick x)\nnode 5 0 1 1 # input (lowest brick y)\nnode 6 0 0 2 # output (left)\nnode 7 0 0 2 # output (right)\nnode 8 0 0 2 # output (special)\ngene 1 1 6 0.0 0 1 0 1 # link 1-\u003e6\ngene 1 2 6 0.0 0 1 0 1 # link 2-\u003e6\ngene 1 3 7 0.0 0 1 0 1 # link 3-\u003e7\ngene 1 4 6 0.0 0 1 0 1 # link 4-\u003e6\ngene 1 5 7 0.0 0 1 0 1 # link 5-\u003e7\ngenomeend 1\n```\n\nThe syntax is:\n\nTrait (placeholder, always use this):\n```\ntrait 1 0.1 0 0 0 0 0 0 0\n```\n\nNode:\n```\nnode NodeID TraitNum (NodeType: 0 - neuron, 1 - sensor (can be used for input) (NodeLabel: 0 - hidden, 1 - input, 2 - output, 3 - bias)\n```\n\nGene:\n```\ngene TraitNum InputNodeID OutputNodeID Weight IsRecurrent InnovationNumber MutationNumber Enabled\n```\n\nFor InnovationNum just use incrementing numbers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhyyrylainen%2Fmlbrickbreaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhhyyrylainen%2Fmlbrickbreaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhyyrylainen%2Fmlbrickbreaker/lists"}