{"id":16687007,"url":"https://github.com/paralin/tasbot","last_synced_at":"2026-04-18T10:02:26.680Z","repository":{"id":26740829,"uuid":"30198498","full_name":"paralin/tasbot","owner":"paralin","description":"A mirror of tom7misc's playfun / learnfun algorithm repository.","archived":false,"fork":false,"pushed_at":"2015-02-02T18:16:31.000Z","size":2704,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-05T22:36:27.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://sourceforge.net/p/tom7misc/svn/HEAD/tree/trunk/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paralin.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-02T17:22:00.000Z","updated_at":"2019-09-24T12:51:39.000Z","dependencies_parsed_at":"2022-09-15T11:22:09.762Z","dependency_job_id":null,"html_url":"https://github.com/paralin/tasbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paralin/tasbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Ftasbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Ftasbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Ftasbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Ftasbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paralin","download_url":"https://codeload.github.com/paralin/tasbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Ftasbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31964546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":[],"created_at":"2024-10-12T15:07:31.659Z","updated_at":"2026-04-18T10:02:25.203Z","avatar_url":"https://github.com/paralin.png","language":"C++","readme":" Learnfun \u0026 Playfun                          Tom 7       17 August 2013\n\n Experimental code for automating the play of NES games.\n This directory contains some false starts and the playfun and learnfun\n algorithms, which are described here\n\n   http://tom7.org/mario/\n\n The intended platform is 64-bit windows 7. There's no windows-specific\n stuff here, but compiling in this era is a nightmare and so I don't\n expect it to work straightforwardly on other platforms. See HACKING\n for my notes on compiling. (For what it's worth, compiling on linux\n should be less painful but I've done none of the work there.)\n\n The fceu subdirectory is the fork of FCEUX. I deleted a bunch of\n stuff from it, and made it compile cleanly under 64-bit mingw for\n x64. It is licensed under the GPL (see fceu/COPYING), including my\n modifications.\n\n Despite depending on SDL (for networking) this is currently a\n headless compile; no graphics or sound or input. It compiles for me\n with the makefile I built, after installing the cygwin packages like\n x86_64-w64-mingw32-g++ (don't get the i686 ones; I hear they are a\n trap!). Make sure you get libz since it's required by this. Follow\n the instructions on http://mingw-w64.sourceforge.net/ to make sure\n that it's running the right binary (this is all so very confusing),\n but I installed via cygwin and that worked and so that was +1 for\n cygwin. You will also need Google's protocol buffers to compile the\n network stuff. This part is super annoying and I'm not good at it\n either.\n\n It's now possible to use learnfun and playfun as executables if you\n have a 64-bit windows computer. For anything serious you'll want to\n be able to compile, since many constants are just embedded in the\n source code.\n\n learnfun - learns a lexicographic ordering of RAM values, as well as\n            capturing input motifs, that can be used to automatically\n            try to play the game (with playfun)\n\n playfun  - plays the game given the output of learnfun. More or less\n            works for \"easy\" games like Super Mario Bros.\n\n You should read the paper at tom7.org/mario, or at least watch the\n video, to understand the basics.\n\n Learnfun and Playfun work well enough to play \"easy\" games without\n any customization. The steps are:\n\n - Use FCEUX to record a movie (FM2 format) of you playing the game.\n   I usually do a few thousand frames and I try to keep it simple.\n\n - Optionally, modify the beginning of the movie to have only a single\n   frame of the \"START\" button. You don't need to do this, but since\n   the learning (and playing) process begins with the first button\n   press, it may be cleaner training data if it never sees you press\n   START after that, including on the next frame. In most games,\n   having START among the input motifs is an annoyance, because\n   Playfun will pause the game sometimes. (This does sometimes allow\n   it to play better because it can wait when all its futures are\n   bad.) If it's pausing a lot, it probably has no idea what it's\n   doing, anyway. You might consider editing the training data to\n   be cheating. Up to you.\n\n - Modify config.txt to contain e.g.\n\n   game zelda\n   movie me-playing-zelda.fm2\n\n   and make sure you have a file called \"zelda.nes\" in the current\n   directory as well as the FM2 file you made, called\n   \"me-playing-zelda.fm2\". Make sure there's a newline after every\n   line.\n\n - Run ./learnfun.exe to produce an .objectives and .motifs file\n   based on your inputs. It also makes some SVGs that are optional.\n   The outputs are all based on the game name from the config file.\n   This is usually pretty fast.\n\n - Now you want to run Playfun to automate playing the game. It uses\n   the same config file. I strongly recommend running Playfun in\n   MARIONET mode. I don't even think single-cpu mode really works any\n   more and it's very slow (you would at least need to turn down the\n   constants like NFUTURES). This means first starting a helper for\n   each logical CPU (this is probably 2x the number of cores, since\n   you probably have a hyperthreaded CPU), then a single master.\n\n   ./playfun.exe --helper 8000\n   ./playfun.exe --helper 8001\n   ./playfun.exe --helper 8002\n   ./playfun.exe --helper 8003\n   ./playfun.exe --helper 8004\n   ./playfun.exe --helper 8005\n\n   (wait until each helper says Ready.)\n \n   ./playfun.exe --master 8000 8001 8002 8003 8004 8005\n\n   These of course need to keep running, so you should do them in\n   different console windows. They output ANSI colors and escape\n   sequences to draw progress bars. The program \"ansicon\" works\n   for me in Windows 7 to render ANSI control codes. I usually\n   run ansicon, then from the command prompt run cygwin's bash,\n   then playfun. One window per playfun.\n\n - Playfun will run forever. Every once in a while it writes\n   an .fm2 file (*-playfun-futures-progress.fm2) which you can\n   view in FCEUX to see what it's doing! Note that playfun is\n   very slow; on a 6-core Intel Extreme whatever, I often run it\n   for many days to produce a few minutes of gameplay.\n\n - You can load up the fm2 files it outputs in an emulator to\n   watch them play the original ROM. You should probably use FCEUX,\n   since many emulators have subtle differences.\n\n Other stuff in here:\n\n scopefun - Generates a series of PNGs and a WAV file containing the\n            frames and sound from a .fm2 movie and learnfun's objectives.\n            I used this to make my second playfun video, which will\n            be up at tom7.org/mario soon.\n\n tasbot   - A*-ish search for solutions to games. Needs a hand-written\n            objective function. Very slow.\n\n pinviz   - Creates a graphic showing the distribution of the ball\n            in the three screens from the NES game Pinball. This was\n            a write and run once kind of thing.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalin%2Ftasbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparalin%2Ftasbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalin%2Ftasbot/lists"}