GithubHelp home page GithubHelp logo

aleju / mario-ai Goto Github PK

View Code? Open in Web Editor NEW
679.0 48.0 142.0 538 KB

Playing Mario with Deep Reinforcement Learning

License: MIT License

Lua 100.00%
deep-learning torch mario deep-reinforcement-learning agent reward machine-learning

mario-ai's People

Contributors

aleju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mario-ai's Issues

Run in Ubuntu Latest

I got this working with some tweaks.

Question, do you have a newer project? Also, how can I get the agent to improve over time? I wanted to see if use a MoA ( Mixture of Agents ) approach and improve upon some of the agent limitations beyond level 1.

Please let me know if you are active on other or similar projects, I know a lot of this code is old! ( I created a virtual env for the dependencies )

Screenshot location

You have the screenshot filepath set to /media/ramdisk
I think that /tmp is a better location, as its a standard ramdisk.
Alternatively, the creation of /media/ramdisk should be included in the installation guide.
Cheers!
config.lua:

-- filepath where current game's last screenshot will be saved
-- ideally on a ramdisk (for speed and less stress on the hard drive)
SCREENSHOT_FILEPATH = "/media/ramdisk/mario-ai-screenshots/current-screen.png"

lsnes run lua script error

Hi, aleju. I have followed your instructions and I got stuck in:

Now start the training via Tools -> Run Lua script... and select train.lua.

when I do this operation, the lsnes will throw an error:
Error running Lua hunk: [string "train.lua"]:5: module 'paths' not found:
no field package.preload['paths']
no file './paths.lua'
no file '/usr/local/share/lua/5.1/paths.lua'
no file '/usr/local/share/lua/5.1/paths/init.lua'
no file '/usr/local/lib/lua/5.1/paths.lua'
no file '/usr/local/lib/lua/5.1/paths/init.lua'
no file './paths.so'
no file '/usr/local/lib/lua/5.1/paths.so'
no file '/usr/local/lib/lua/5.1/loadall.so'

But I have already installed paths in ~/torch by using luarocks and require 'paths' works fine in lua cmd line.
It seems that lsnes doesnot recognize modules in torch?
So, I install package 'paths' in /usr/local/lib/luarocks, then this error was replaced by: module 'torch' not found.
Any idea for what's wrong with this problem? Thx

Video Tutorial

Can you make a video tutorial on installing this ai? This would be very helpful

Error while compiling the emulator

Hey,

I'm currently trying to get your mario project to work. I was able to resolve most problems that came up while following your tutorial, but now I'm stuck. When compiling the emulator, I get the following error:

...
make -C bsnes-legacy
make[3]: Verzeichnis „/home/jojo/emulator/lsnes-rr2-beta23/sources/src/emulation/bsnes-legacy“ wird betreten
g++ -c -o core.o core.cpp -I../../../include -I../../../bsnes -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -std=gnu++0x -pthread -g -DNATIVE_THREADS -DUSE_LIBGCRYPT_SHA256   -DBSNES_IS_COMPAT -DBSNES_HAS_DEBUGGER -DBSNES_VERSION=\"085\" -DLIBSNES_INCLUDE_FILE=\"ui-libsnes/libsnes.hpp\"  -Wreturn-type

In file included from ../../../bsnes/nall/array.hpp:10:0,
                 from ../../../bsnes/snes/snes.hpp:28,
                 from core.cpp:49:
../../../bsnes/nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 24]’:
../../../bsnes/snes/cpu/core/registers.hpp:52:69:   required from here
../../../bsnes/nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 24]’ not a return-statement
   }
   ^
../../../bsnes/nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 2]’:
../../../bsnes/nall/varint.hpp:32:55:   required from ‘nall::uint_t<bits>::uint_t(unsigned int) [with unsigned int bits = 2u]’
../../../bsnes/snes/controller/controller.hpp:27:33:   required from here
../../../bsnes/nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 2]’ not a return-statement
Makefile:44: die Regel für Ziel „core.o“ scheiterte
...

This sounds like a bug in the code to me. I checked the file bit.hpp, the corresponding block looks fine to me:

  template<int bits> constexpr inline unsigned uclip(const unsigned x) {
    enum { m = (1U << (bits - 1)) + ((1U << (bits - 1)) - 1) };
    return (x & m);
  }

The error points to the last closing bracket.

Although this is more of a problem with the emulator than with your code, maybe you came across this problem before or know something that could help me?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.