-
Notifications
You must be signed in to change notification settings - Fork 816
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
FF1: Bizhawk Client and APWorld Support #4448
base: main
Are you sure you want to change the base?
Conversation
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.
pure code review, did not run the client at all nor play any games, also only briefly reviewed docs changes and full Client.py code
You will also need to update inno_setup.iss to remove the old frozen executable (and likely the old folder since you're moving to .apworld format too) but other than and my pkgutil comments looks good
worlds/ff1/Items.py
Outdated
FF1_PROGRESSION_LIST else ItemClassification.useful if name in FF1_USEFUL_LIST else | ||
ItemClassification.filler) for name, code in items.items()] | ||
self._item_table_lookup = {item.name: item for item in self._item_table} | ||
file = pkgutil.get_data(__name__, os.path.join("data", "items.json")).decode("utf-8") |
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.
file = pkgutil.get_data(__name__, os.path.join("data", "items.json")).decode("utf-8") | |
file = pkgutil.get_data(__name__, "data/items.json").decode("utf-8") |
ref #4232
for this and the other similar suggestion (also there's no need for the os
import after this change)
worlds/ff1/Locations.py
Outdated
# Hardcode progression and categories for now | ||
self._location_table = [LocationData(name, code) for name, code in locations.items()] | ||
self._location_table_lookup = {item.name: item for item in self._location_table} | ||
file = pkgutil.get_data(__name__, os.path.join("data", "locations.json")) |
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.
file = pkgutil.get_data(__name__, os.path.join("data", "locations.json")) | |
file = pkgutil.get_data(__name__, "data/locations.json") |
…changed the logger in the client to actually do something.
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.
not certain there aren't more required inno_setup changes, but the updates fixed every issue that existed to my knowledge
worlds/ff1/Client.py
Outdated
|
||
async def read_ram_value(self, ctx, location): | ||
value = ((await bizhawk.read(ctx.bizhawk_ctx, [(location, 1, self.wram)]))[0]) | ||
return int.from_bytes(value) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
worlds/ff1/Client.py
Outdated
if self.consumable_stack_amounts is None: | ||
self.consumable_stack_amounts = {} | ||
self.consumable_stack_amounts["Shard"] = 1 | ||
self.consumable_stack_amounts["Tent"] = (await self.read_rom(ctx, 0x47400, 1))[0] + 1 |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
worlds/ff1/Client.py
Outdated
self.consumable_stack_amounts["Ext1"] = (await self.read_rom(ctx, 0x47406, 1))[0] + 1 | ||
self.consumable_stack_amounts["Ext2"] = (await self.read_rom(ctx, 0x47407, 1))[0] + 1 | ||
self.consumable_stack_amounts["Ext3"] = (await self.read_rom(ctx, 0x47408, 1))[0] + 1 | ||
self.consumable_stack_amounts["Ext4"] = (await self.read_rom(ctx, 0x47409, 1))[0] + 1 |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
worlds/ff1/docs/multiworld_en.md
Outdated
- Your legally obtained Final Fantasy (USA Edition) ROM file, probably named `Final Fantasy (USA).nes`. Neither | ||
Archipelago.gg nor the Final Fantasy Randomizer Community can supply you with this. | ||
|
||
## Installation Procedures | ||
|
||
1. Download and install the latest version of Archipelago. | ||
1. On Windows, download Setup.Archipelago.<HighestVersion\>.exe and run it | ||
2. Assign EmuHawk version 2.3.1 or higher as your default program for launching `.nes` files. | ||
2. Assign EmuHawk or higher as your default program for launching `.nes` files. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
ff1 client cleaning
Fixed a bug with extended consumables being switched.
You'll want to add the old client and script to the inno_setup script so they get get deleted by the installer. |
Unless I'm crazy, I already caught the old client, but I did completely miss removing the old Lua script, thank you. Latest commit fixes that. |
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.
while i can't speak for the specifics of ap, the legacy lua behiavours have been correctly transferred to the client and the appropriate memory addresses and values are queried
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.
Mostly just a quick scroll through. I think the client looks fine from the standpoint of interacting with BizHawk. Comments are basically just suggestions.
worlds/ff1/Client.py
Outdated
status_b = await self.read_sram_value(ctx, status_b_location) | ||
status_c = await self.read_sram_value(ctx, status_c_location) | ||
|
||
# First character's name's first character will never have FF |
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.
There's no problem here, I just have to comment on the silliness of this sentence.
Also implemented item received messages in Bizhawk.
…nto FF1-Bizhawk-Client
Fixed a bug with the guard against writing on title screen. Removed redundant read.
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.
Everything looks fine as far as correctly utilizing BizHawk Client. Didn't test, and couldn't say myself whether it correctly replaces all the necessary behaviors.
worlds/ff1/Client.py
Outdated
current_gold = int.from_bytes(await self.read_sram_values_guarded(ctx, gp_location_low, 3), "little") | ||
if current_gold is None: | ||
return |
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.
current_gold
is not something that needs to be checked for None
- It will never be None
What needs to be checked it the result of await self.read_sram_values_guarded(ctx, gp_location_low, 3)
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.
Oops. Fixed.
Please format your title with what portion of the project this pull request is
targeting and what it's changing.
ex. "MyGame4: implement new game" or "Docs: add new guide for customizing MyGame3"
What is this fixing or adding?
Converts FF1 to using the Bizhawk Client instead of its bespoke client and connector, with updated documentation.
Also makes the few changes needed to allow it to be an APWorld instead of a folder in lib/worlds, mostly for my convenience.
How was this tested?
Ran through an entire game, checked every location to make sure it sent. Received items, both naturally and through admin console, and confirmed they arrived properly. Also put this up for testing in the Discord, and no issues have been reported as of the latest version (whether this means no testers or no issues is, as always, up in the air).
If this makes graphical changes, please attach screenshots.