tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
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.
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
With the release of v2.9, the GA bot is already compatible with BizHawk v2.9. No code changes were necessary.
bpm46
He/Him
Joined: 3/16/2023
Posts: 11
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?
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
bpm46 wrote:
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.
bpm46
He/Him
Joined: 3/16/2023
Posts: 11
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)
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
bpm46 wrote:
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.
bpm46
He/Him
Joined: 3/16/2023
Posts: 11
tom_mai78101 wrote:
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?
The bot was paused and the emulator was running.
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
bpm46 wrote:
tom_mai78101 wrote:
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?
The bot was paused and the emulator was running.
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.
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
bpm46 wrote:
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.
bpm46
He/Him
Joined: 3/16/2023
Posts: 11
tom_mai78101 wrote:
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.
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
bpm46 wrote:
tom_mai78101 wrote:
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.
bpm46
He/Him
Joined: 3/16/2023
Posts: 11
tom_mai78101 wrote:
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.
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
bpm46 wrote:
tom_mai78101 wrote:
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?
bpm46
He/Him
Joined: 3/16/2023
Posts: 11
tom_mai78101 wrote:
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.
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
bpm46 wrote:
tom_mai78101 wrote:
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.
Hello, I believed I fixed the bug you have reported. https://github.com/tommai78101/Bizhawk-GeneticAlgorithmBot/releases/tag/1.0.2 Can you check and test this out for me?
bpm46
He/Him
Joined: 3/16/2023
Posts: 11
tom_mai78101 wrote:
Hello, I believed I fixed the bug you have reported. https://github.com/tommai78101/Bizhawk-GeneticAlgorithmBot/releases/tag/1.0.2 Can you check and test this out for me?
Seems to be working now, thanks!
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
bpm46 wrote:
tom_mai78101 wrote:
Hello, I believed I fixed the bug you have reported. https://github.com/tommai78101/Bizhawk-GeneticAlgorithmBot/releases/tag/1.0.2 Can you check and test this out for me?
Seems to be working now, thanks!
Thank you again for using the bot and reporting here. I hoped you have a wonderful day.
bpm46
He/Him
Joined: 3/16/2023
Posts: 11
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
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
bpm46 wrote:
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.
Oh nice! Feel free to send me testimonials~~! 😁
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
Updated bot to v1.0.3:
  • Fixed issue related to loading a previously saved BOT file.
NhatNM
He/Him
Experienced player (719)
Joined: 6/17/2009
Posts: 600
Location: Vietnam
@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
A man come from Vietnam My YouTube: https://www.youtube.com/c/NhatNM/playlists
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
NhatNM wrote:
@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.
NhatNM
He/Him
Experienced player (719)
Joined: 6/17/2009
Posts: 600
Location: Vietnam
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
A man come from Vietnam My YouTube: https://www.youtube.com/c/NhatNM/playlists
tom_mai78101
He/Him
Player (127)
Joined: 3/16/2015
Posts: 160
NhatNM wrote:
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
I am in the process of creating said bot. https://github.com/tommai78101/Bizhawk-GeneticAlgorithmBot/tree/experiment/neat But it's still experimental. No guarantees if it will work.
Editor, Active player (459)
Joined: 2/11/2018
Posts: 240
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.