Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception when attempting to run the bot #2

Closed
unsightedmetal6 opened this issue Feb 28, 2023 · 3 comments
Closed

Unhandled exception when attempting to run the bot #2

unsightedmetal6 opened this issue Feb 28, 2023 · 3 comments

Comments

@unsightedmetal6
Copy link

unsightedmetal6 commented Feb 28, 2023

I am trying to run the bot with Bizhawk 2.8, but it throws this exception:

************** Exception Text **************
System.MissingMethodException: Method not found: 'System.Nullable`1<UInt64> BizHawk.Client.EmuHawk.HexTextBox.ToU64()'.
   at GeneticAlgorithmBot.GeneticAlgorithmBot.get_MaximizeAddress()
   at GeneticAlgorithmBot.GeneticAlgorithmBot.get_MaximizeValue()
   at GeneticAlgorithmBot.GeneticAlgorithm.SetOrigin()
   at GeneticAlgorithmBot.GeneticAlgorithm.Initialize()
   at GeneticAlgorithmBot.GeneticAlgorithmBot.StartBot()
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Steps to reproduce:

  • Put the bot's DLL file in /ExternalTools/ folder.
  • Launch EmuHawk and load the ROM.
  • Open TAStudio
  • Go Tools->External Tool->Genetic Algorithm Bot
  • Press Yes
  • Create a savestate
  • Put in a RAM address to measure fitness
  • Make sure the slot number in the window is the same as the savestate/branch you want to load.
  • Make at least one button to above 0.0%.
  • Click "Run"

Then this exception appeared. I have restarted Bizhawk multiple times, but it still happens.

Also, since it may be relevant based on the exception, the RAM address in question is 0x000096.

Edit: I also get two other errors sometimes:

************** Exception Text **************
System.MissingMethodException: Method not found: 'Boolean BizHawk.Client.EmuHawk.IMainFormForTools.LoadQuickSave(Int32, Boolean)'.
   at GeneticAlgorithmBot.GeneticAlgorithmBot.StartBot()
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

And another one occurs when I rewind a frame while the botting window is open. It's just a generic message that says 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 also tried on BizHawk 2.9.

@tommai78101
Copy link
Owner

tommai78101 commented Feb 28, 2023

@unsightedmetal6

My bot doesn't support v2.8 due to an issue on the Hawk API that's fixed in the latest Bizhawk dev build. You will want to pull down the latest Bizhawk dev build and compile it using their Dist/QuickTestBuildAndPackage.bat. After that, go to the Releases section, and download the pre-release version v1.0.1 of the bot and install the bot into the latest Bizhawk build. After that, follow the instructions for Source Code Installation.

Don't use the Bizhawk v2.9 RC2 builds.

Let me know if you have any issues.

@tommai78101 tommai78101 added the awaiting user feedback Waiting for the user to respond back label Feb 28, 2023
@tommai78101
Copy link
Owner

By the way, I updated the Readme file, so that you can watch how the Bizhawk Genetic Algorithm Bot Source Installation is done. I used Windows Sandbox because it's the best place to show how everything is installed from scratch.

@unsightedmetal6
Copy link
Author

That was the problem! I wasn't using the GitHub-cloned version of Bizhawk.

Thanks, the errors are fixed now.

@tommai78101 tommai78101 removed the awaiting user feedback Waiting for the user to respond back label Mar 1, 2023
@tommai78101 tommai78101 pinned this issue Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants