DKC2 Neat from MarI/O
Find a file
2021-04-29 07:22:08 -04:00
doc Added image of donkutil 2021-03-17 06:40:41 -05:00
pool Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
.editorconfig Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
.gitignore Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
config.lua Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
donkutil.lua Fix base 2021-03-23 00:54:01 -04:00
font.font Add font 2021-03-15 16:05:40 -05:00
game.lua Reuse processes for more efficiency 2021-04-28 18:54:39 -04:00
LibDeflate.lua Compress the pool files 2021-03-06 08:53:37 -05:00
LICENSE.watchexec.md Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
mathFunctions.lua Stage rulers. Try to hijack algorithm used to determine tile location 2021-03-03 15:40:19 -05:00
neat-donk.lua Added promise library, serpent.load, temp logic 2021-04-28 04:05:16 -04:00
pool.lua Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
promise.lua Added promise library, serpent.load, temp logic 2021-04-28 04:05:16 -04:00
README.md Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
runner-process.lua Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
runner-wrapper.lua Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
runner.lua Reuse processes for more efficiency 2021-04-28 18:54:39 -04:00
serpent.lua Switch to Serpent 2021-04-23 15:39:11 -04:00
spritelist.lua Fix bump logic 2021-04-07 17:30:46 -04:00
state-test.lua Reuse processes for more efficiency 2021-04-28 18:54:39 -04:00
util.lua Added watchexec to remove Powershell dependency 2021-04-29 07:22:08 -04:00
xpra-run.sh Tweak some colors 2021-04-24 06:00:28 -04:00
xpra.css Proper event handling for Linux. Xpra CSS 2021-04-28 23:18:26 -04:00

Donkey Kong Country 2 NEAT

An AI based on SethBling's MarI/O to play Donkey Kong Country 2 with lsnes.

See YouTube for an example run.

Requirements

  • lsnes with Lua 5.2 (do not try to build with 5.3, it does not work!)
  • inotifywait for Linux, or a fairly recent version of Windows that has PowerShell
  • A Donkey Kong Country 2 1.1 US ROM (matching hash b79c2bb86f6fc76e1fc61c62fc16d51c664c381e58bc2933be643bbc4d8b610c)

Instructions

  1. Start lsnes
  2. Go to Configure -> Settings -> Advanced and change LUA -> Maximum memory use to 1024MB
  3. Load the DKC2 ROM: File -> Load -> ROM...
  4. Load the neat-donk.lua script: Tools -> Run Lua script...
  5. You may also want to turn off sound since it may get annoying. Configure -> Sounds enabled
  6. Look at config.lua for some settings you can change. Not all have been tested, but you should be able to change the number on the _M.Filename = line to get a different state file from the _M.State list. Also note the Threads = line. Change this to 1 to prevent multiple instances of lsnes from getting launched at once. If you use more than 1 thread, you may also want to launch lsnes using xpra to manage the windows, with the xpra-run.sh script. Currently Windows does not support multiple threads.

If you want a better idea of what's going on with the tile and sprite calculations you may want to load donkutil.lua. It will mark the tiles with their offsets on the screen, give a crosshair with tile measurements (every 32 pixels), and list information about the sprites (you can use the 1 and 2 keys above the letter keys to page through them). Sprites labeled in green are considered "good", red is "bad", normal color is neutral. Solid red means that it's the active sprite in the info viewer.

Keys

1: Stop/start

4: Play the best run

6: Save the pool file

8: Load the pool file

9: Restart

Notes

  • Only tested on Pirate Panic
  • The pool files are gzipped Serpent data

Credits

TODO

  • Incur penalty for non-hazardous enemy collisions to encourage neutralizing Klobber
  • Make enemies neutral when held? (Klobber, Click-Clack, etc.)
  • Multiple nets to handle different contexts s/a clicking map items