Post subject: Genetic Algorithm in Mario, Using LUA to Close the Client
Joined: 3/20/2015
Posts: 2
I am trying to use a genetic algorithm to beat Super Mario. I have a C# application launching BizHawk and I have BizHawk configured to open the savestate and open and start the script. I am currently using os.exit(0) to close it, but I keep getting access violation exceptions and I think it is because the client is not closing properly. So, the actual question, is there a built-in way to gracefully close the entire BizHawk client from a LUA script? I am opening and closing BizHawk over and over while the algorithm keeps evolving. Another question would be is there a better emulator suited for this type of application? Any help is appreciated! Another option would be to open BizHawk and then just have the script reload the savestate each time and not close the main client at all. I might try this when I get off work.
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3573)
Joined: 11/3/2004
Posts: 4754
Location: Tennessee
Lua has easy support for saving and loading savestates. And those sounds infinitely better than a bunch of opening/closing of the emulator. Closing the emulator via lua could be probably be added pretty easily, but I'd need a good reason for it. So far it sounds like you have better options than that.
It's hard to look this good. My TAS projects
Joined: 3/20/2015
Posts: 2
Thanks for the quick reply! I will try the savestates tonight and reply back if I hit any other errors.