-
Notifications
You must be signed in to change notification settings - Fork 722
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
BizHawkClient: Add BizHawkClient #1978
Conversation
Bad commit organization a consequence of working with two different branches and not keeping the commits separated
…perations On 2.9, it would detect LuaJIT and flood the console with deprecation warnings
… address Gambatte frame sync issue
I would prefer to see a python bizhawk communication library that is separate from any of the AP client application stuff. system = await bizhawk.get_system()
await bizhawk.set_message_interval(2)
result = await bizhawk.read(read_list) So this could be used with any python client, and a It seems like being forced into |
Also splits out BizHawk communication functions to their own file for use outside this client
|
||
class BizHawkClient(abc.ABC, metaclass=AutoBizHawkClientRegister): | ||
system: ClassVar[str] | ||
"""The system that the game this client is for runs on""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pokémon Red and Blue can be run on two different systems: GB and SGB. I need to be able to register my game with either of those two systems being reported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Edge cases all the way down. I can make it a Union[str, List[str]]
and just add duplicate references I suppose. And you can detect the system through the async BizHawk functions if you need to. I'll take a closer look tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something that will affect all Gameboy games, and is likely a situation unique to Gameboy games, so perhaps just looking for GB system client handlers when SGB is reported would be a good solution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking about, like, GBA in NDS, or someone going crazy and implementing a client that works for one game ported to two systems like Twilight Princess (but something on BizHawk supported systems).
Changed in d706c3f. You can now specify either a str
or a tuple[str, ...]
. So in this case ("GB", "SGB")
. I'd rather have it explicit for all multi-system games instead of implicitly allowing certain systems to mix just in case there's ever a difference.
In my attempt to get started on adding Pokémon Red and Blue to this, I ran into this when calling
|
This was a recent change related to beauxq's comment that had discussion in Discord.
To more fully explain the changes made, since there's no record of the discussion here except the commits, The functions related to talking directly to the connector script were split into So it should now be possible to import just the functions to talk to BizHawk. I'll update the link in the original message for the example client just after I post this. |
Considering even I managed to forget to use |
Adds a generic client that can communicate with BizHawk. Similar to SNIClient, but for arbitrary systems and doesn't have an intermediary application like SNI.
Adds a generic client that can communicate with BizHawk. Similar to SNIClient, but for arbitrary systems and doesn't have an intermediary application like SNI.
What is this fixing or adding?
Adds a generic client that can communicate with BizHawk. Similar to SNIClient, but for arbitrary systems and doesn't have an intermediary application like SNI. An example implementation of a client for Pokemon Emerald can be found here. It has a block of code at the top related to importing the client as an apworld, but that's not necessary during development. See the Discord thread for more info.
From what I can tell, this is at least as stable as (and often more stable than) any existing BizHawk client/connector when it comes to setup. Switching ROMs, pausing emulation, starting the script before loading a ROM, and closing and reopening the script or client can cause problems in existing scripts, but recover here.
Merging this doesn't require any specific clients to migrate, but obviously there may be some initial confusion among players about which games can and can't use this.
How was this tested?
Integrating Pokemon Emerald and running a couple beta tests. Emerald doesn't need every function, and is the only integrated client on the test branch, so some behaviors were only tested in development.
No currently merged games have been migrated and tested, but I paid attention to their existing Lua scripts to try to cover necessary functionality.