Updated bot to accommodate new changes to the External Tools API.
It should now be compatible with the latest Bizhawk 2.9 dev build @ commit hash: 5bdbe110e9f66acd60d6df51402f760167a57fef, as of February 8, 2023.
Hey, I saw this today and tried it out. I had some silly issues on my end at first (I tried using the latest build in BizHawk 2.8, oof), but on the current build in 2.9 it seems to be working great. Here are 2 cases where I tested it in a 2D platformer I'm TASing:
1: At the end of one level where you just hold right to get to the end, you can jump at the right moment to save 1 frame. I ran it here and it didn't take very long to find at all, maybe a few hundred attempts at most.
2: A more complex maneuver where you jump on an enemy and move left a bit to land on a platform and collect an item. It finally managed to pick up the item after around 1050 attempts, then became more and more consistent. It kind of flubbed what you're supposed to do afterward, but it didn't know that, so that's fine.
So yeah, very cool tool! I assume the longer you let it sit, the better?
Yes, that is the intent. I am glad you find it useful. I am sure if you leave it running overnight, so as long as it is within a reasonable amount frames (e.g., not 9999 frames), it should perform even better.
Noticed a few bugs:
1: After starting the bot with audio & video enabled, if you pause it and play it again, the screen seems to be frozen though the bot still works. Closing and reopening EmuHawk lets you playback the movie.
2: While the bot was running with audio & video enabled, I minimized everything on the desktop and it crashed with this error:
Fatal Error: Direct3D9Exception
EmuHawk has thrown a fatal exception and is about to close. A movie has been detected. Would you like to try to save? (Note: Depending on what caused this error, this may or may not succeed)
1. When you say "pause it and play it again", are you referring to the bot being paused while the emulator is running, or the emulator paused while the bot is running?
2. I'll need to check with API Hawk and see what's going on.
Wait, how were you pausing the bot? I don't have a "Pause" button in the bot itself. You mean "Stop", right?
Since you have TAStudio opened, make sure TAStudio has "Recording Mode" enabled. The bot needs "Recording Mode" to function.
2: While the bot was running with audio & video enabled, I minimized everything on the desktop and it crashed with this error:
Fatal Error: Direct3D9Exception
EmuHawk has thrown a fatal exception and is about to close. A movie has been detected. Would you like to try to save? (Note: Depending on what caused this error, this may or may not succeed)
I have confirmed this is a bug in BizHawk, not an external tool bug. I'll be filing a Github issue about it. Thanks for reporting.
Wait, how were you pausing the bot? I don't have a "Pause" button in the bot itself. You mean "Stop", right?
Since you have TAStudio opened, make sure TAStudio has "Recording Mode" enabled. The bot needs "Recording Mode" to function.
Sorry yes, I meant "Stop". It is in Recording Mode when this happens.
Wait, how were you pausing the bot? I don't have a "Pause" button in the bot itself. You mean "Stop", right?
Since you have TAStudio opened, make sure TAStudio has "Recording Mode" enabled. The bot needs "Recording Mode" to function.
Sorry yes, I meant "Stop". It is in Recording Mode when this happens.
While the bot is running, were you touching the settings and flags?
Scenario A: The bot has "Turn Off Audio/Video" enabled, and then you start running the bot. Then you realized you want to turn on the Audio/Video but you don't want to stop the bot, so you click on the toggle checkmark to disable "Turn Off Audio/Video". You then noticed the Audio/Video is not updating, making it seem like the emulator is frozen while the bot is still running.
This is actually normal behavior. It's the same behavior as the official Basic Bot behavior. You will need to stop the bot, toggle the flag, then start the bot. It will resume from where you left off and continue botting from that point on.
While the bot is running, were you touching the settings and flags?
I did not touch any settings. Once setting up the bot with audio/visuals on and entering Recording Mode, I press Run and it works normally. If I then press Stop and Start again, the bot continues running but the screen is frozen.
While the bot is running, were you touching the settings and flags?
I did not touch any settings. Once setting up the bot with audio/visuals on and entering Recording Mode, I press Run and it works normally. If I then press Stop and Start again, the bot continues running but the screen is frozen.
Oh like that? Is this reproducible using Basic Bot? My bot is based on Basic Bot, so if the bug appears in Basic Bot, there's nothing I can do about it.
Also, what game and core are you using to reproduce this issue?
Oh like that? Is this reproducible using Basic Bot? My bot is based on Basic Bot, so if the bug appears in Basic Bot, there's nothing I can do about it.
Also, what game and core are you using to reproduce this issue?
Just tried it with Basic Bot and it works fine. Side note, I have the inputs displayed on BizHawk and it IS reading the inputs, but the game screen is static.
The game is "As Aventuras de TV Colosso" with SMSHawk.
Oh like that? Is this reproducible using Basic Bot? My bot is based on Basic Bot, so if the bug appears in Basic Bot, there's nothing I can do about it.
Also, what game and core are you using to reproduce this issue?
Just tried it with Basic Bot and it works fine. Side note, I have the inputs displayed on BizHawk and it IS reading the inputs, but the game screen is static.
The game is "As Aventuras de TV Colosso" with SMSHawk.
I've been trying the bot in a few areas of the TV Colosso game where I suspected there were improvements and it just saved 10 frames in a level which is nice. After going through and removing unnecessary inputs, I see it found some kind of tech where making 2 frame-perfect jump inputs alters the way your Y-speed changes and your jump is a few pixels shorter. It looks indistinguishable from a normal jump and I probably would have never noticed it. Should save a few frames throughout the run.
I've been trying the bot in a few areas of the TV Colosso game where I suspected there were improvements and it just saved 10 frames in a level which is nice. After going through and removing unnecessary inputs, I see it found some kind of tech where making 2 frame-perfect jump inputs alters the way your Y-speed changes and your jump is a few pixels shorter. It looks indistinguishable from a normal jump and I probably would have never noticed it. Should save a few frames throughout the run.
@tom_mai78101 : Could you make simple way for no tech users? I have trouble at begin because I don't know how to do with Ram Watch. How about if let BOT will learn from a sample movie file? User will make a run movie from A point to B point, then BOT will learn about needed inputs and destination target, then try make it done fast as possible
@tom_mai78101 : Could you make simple way for no tech users?
If you know how to use Basic Bot, then this GA Bot will be useful to you. Everything that this bot does is exactly the same way as how Basic Bot works. It just uses a different calculation for entering inputs.
Link to video NhatNM wrote:
I have trouble at begin because I don't know how to do with Ram Watch.
This bot doesn't use the RAM Watch like that. Instead, you need to provide the bot an address that it can keep track of, and then attempts to improve the previous attempt.
NhatNM wrote:
How about if let BOT will learn from a sample movie file? User will make a run movie from A point to B point, then BOT will learn about needed inputs and destination target, then try make it done fast as possible
This bot doesn't work like that. It's not capable of being trained to learn player inputs and work its way in the game.
Thank your reply, I got misundertood about this BOT
tom_mai78101 wrote:
This bot doesn't work like that. It's not capable of being trained to learn player inputs and work its way in the game.
Could you make a new BOT can work like this? It'll be very useful for TASers. Most time while TASing, we're not sure what we choice is best or not, because we can miss something in run. Must be time later, we just found out something can make it better. First target is just need BOT help find ways can help move A point to B point ingame for fastest time
Thank your reply, I got misundertood about this BOT
tom_mai78101 wrote:
This bot doesn't work like that. It's not capable of being trained to learn player inputs and work its way in the game.
Could you make a new BOT can work like this? It'll be very useful for TASers. Most time while TASing, we're not sure what we choice is best or not, because we can miss something in run. Must be time later, we just found out something can make it better. First target is just need BOT help find ways can help move A point to B point ingame for fastest time
Gave it a quick try. I had no idea what to set the probability controls to. I wanted to use as few left presses as possible, so set right and B to 65, A to 25, and left to 5. Main value of the highest X position and 100 frames.
It had good results after 75 generations. I kept it going until 180 generations and it hadn't improved. I was able to improve it by a few frames by manually editing the input afterwards to remove a few left presses.
My initial attempt had 715 xpos, the bot found 730, and my changes afterwards got it to 741. So a good result for just a few minutes of work, and saved me figuring out a frustrating section to optimise.