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

ALTTP: Add "oof" sound customization option #709

Merged
merged 35 commits into from
Apr 11, 2023

Conversation

Nyx-Edelstein
Copy link
Contributor

This change adds the ability to swap Link's "oof" sound effect with one the user provides.

The required format for this sound effect is a .brr file no more than 2673 bytes. This can be generated from a 16-bit signed PCM (.wav) at 12khz and no longer than 0.394 seconds, using the snesbrr tool (https://github.com/boldowa/snesbrr). The .wav file can be obtained using a tool like Audacity by editing an existing sample or recording a custom one.

Sample test file (female "oof" sound): https://github.com/Nyx-Edelstein/The-Unachievable-Ideal-of-Chibi-Elf-Grunting-Noises-When-They-Get-Punched-A-Z3-Rom-Patcher/blob/main/z3_oof_patcher/default.brr

Example CLI usage:

.\snesbrr.exe -e .\oof.wav oof.brr
python .\LttPAdjuster.py --baserom .\baserom.sfc --oof .\oof.brr .\romtobeadjusted.sfc

The gui option simply prompts the user to select a .brr file and ensures it is the right file size.


Original PR from krelbel's branch: #502

Creating a new PR from personal fork

@Ijwu
Copy link
Contributor

Ijwu commented Jun 28, 2022

Code looks good but I do want to pull this and test it... or have someone else do it.

Include 'oof' argument in call to apply_rom_settings
@Nyx-Edelstein
Copy link
Contributor Author

Should the linter error be addressed? No one commented on it and I didn't look too closely at krelbel's code.

@alwaysintreble
Copy link
Collaborator

I didn't have time to fully review the code earlier but now that I have it's fine. The only things that stick out to me are Rom.py 1810 and 501 in lttpadjuster is a docstring so should """look like this""". @Ijwu may have opinions on that tooltips class at 1238 as he really despises LGPL licenses though and that alone may honestly not get approved...

@Ijwu
Copy link
Contributor

Ijwu commented Jun 29, 2022

@Ijwu may have opinions on that tooltips class at 1238 as he really despises LGPL licenses though and that alone may honestly not get approved...

I'm not seeing how lgpl factors in here. Where do you see it?

@alwaysintreble
Copy link
Collaborator

alwaysintreble commented Jun 29, 2022

looks like the source i thought was the wcktooltips source was actually just using it and that was under lgpl. that's my b 😳

@Nyx-Edelstein
Copy link
Contributor Author

It was taken from an example on Stack Overflow so its definitely not lgpl. Technically it would be under CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/) which requires attribution, but I have literally never seen anyone care about that, especially not in a noncommercial project, as most people posting to Stack Overflow do so with the intention of releasing it to public domain.

@Ijwu
Copy link
Contributor

Ijwu commented Jun 29, 2022

It was taken from an example on Stack Overflow so its definitely not lgpl. Technically it would be under CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/) which requires attribution, but I have literally never seen anyone care about that, especially not in a noncommercial project, as most people posting to Stack Overflow do so with the intention of releasing it to public domain.

Please attribute the author of the SO post and link to it in a comment in the code. Thank you.

Yes, the linter error should be addressed. This won't get merged until it does just due to the checks we have in place.

@Berserker66
Copy link
Member

Berserker66 commented Jun 29, 2022

We have other parts of code that are yoinked from stackoverflow, typically we permalink to the post containing the code, so that's the least that should be done here too then. The linter error points out that if your code ever makes it to the error case the logger instruction will result in a crash as the name was never defined, so that needs fixing; yes.

@Nyx-Edelstein
Copy link
Contributor Author

Nyx-Edelstein commented Jun 29, 2022

Sure thing, link to post added.

Remove unnecessary code / linter error
@Berserker66
Copy link
Member

removing the check isn't exactly a great fix ;)

@Nyx-Edelstein Nyx-Edelstein marked this pull request as draft June 29, 2022 02:39
@Nyx-Edelstein
Copy link
Contributor Author

removing the check isn't exactly a great fix ;)

Still intending to add the tutorial as per @alwaysintreble's comments above, will move out of draft after it's completed

@Nyx-Edelstein Nyx-Edelstein marked this pull request as ready for review June 29, 2022 04:31
@strotlog
Copy link
Contributor

Sure thing, link to post added.

Stack Overflow states that contributions made on the date of that 2019-2020 contribution are governed by https://creativecommons.org/licenses/by-sa/4.0/ (Stack Overflow's link), that link gives in part of its non-legal summary:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

"Same license" links to some other compatible licenses you can use instead, but MIT is not noted as being one of them.

@strotlog
Copy link
Contributor

Oops, I meant to come in here just to suggest that the PR and/or final squash commit title should have the game's name for context.

@strotlog
Copy link
Contributor

Sorry for commenting so many times. Just noticed that one of the comments under the StackOverflow contribution that we want to use actually calls out that it does not appear to be an original work, and links to https://web.archive.org/web/20180806215516/http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_01.shtml as the possible original.

@Nyx-Edelstein Nyx-Edelstein changed the title Add "oof" sound customization option ALTTP: Add "oof" sound customization option Jun 29, 2022
@Berserker66
Copy link
Member

Unfortunately in testing this Enemizer fails the required version check due to version tag error in Enemizer, reported issue in Ijwu/Enemizer#15

@Nyx-Edelstein
Copy link
Contributor Author

Unfortunately in testing this Enemizer fails the required version check due to version tag error in Enemizer, reported issue in Ijwu/Enemizer#15

Anything you need me to do?

@Berserker66
Copy link
Member

No, the ball is back in @Ijwu 's court.

@alwaysintreble
Copy link
Collaborator

Grabbed the latest Enemizer release and it's working correctly for me now. GUI element and all. wouldn't hurt to have someone else verify though.

@@ -388,6 +397,7 @@ def generate_output(self, output_directory: str):
world.menuspeed[player].current_key,
world.music[player],
world.sprite[player],
world.oof[player],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually just had a generation issue since this attribute doesn't exist at run time. is this used by the adjuster or do we rip this out until implementing as a generation option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it does. I just removed it.

@Nyx-Edelstein Nyx-Edelstein requested review from alwaysintreble and Ijwu and removed request for alwaysintreble and Ijwu October 5, 2022 05:48
@ThePhar
Copy link
Member

ThePhar commented Oct 28, 2022

So this still only plays the "meme" sound when enemy shuffle is on, even with Enemizer 7.1 installed. Works fine without Enemizer active though.

@ThePhar ThePhar self-assigned this Nov 1, 2022
@Nyx-Edelstein
Copy link
Contributor Author

So this still only plays the "meme" sound when enemy shuffle is on, even with Enemizer 7.1 installed. Works fine without Enemizer active though.

I've been unable to get the latest build running due to not being able to find some required modules, but I can't imagine that the correct version of Enemizer is being used for AP. I did however test it by manually patching a rom generated with enemizer and it worked correctly.

@ThePhar
Copy link
Member

ThePhar commented Nov 11, 2022

So this still only plays the "meme" sound when enemy shuffle is on, even with Enemizer 7.1 installed. Works fine without Enemizer active though.

I've been unable to get the latest build running due to not being able to find some required modules, but I can't imagine that the correct version of Enemizer is being used for AP. I did however test it by manually patching a rom generated with enemizer and it worked correctly.

I generated locally with a fresh clone of this AP PR and latest version of Enemizer (7.1), so if you could verify it working with the integrated Enemizer during generation, that would be excellent.

@Nyx-Edelstein
Copy link
Contributor Author

@ThePhar I'm not sure why my enemizer fix isn't being applied. There should be no way for it to be included. Is there some other step for repatching the ASM files that isn't being done in the build process?

Regardless, I readded my previous fix for just overwriting the relevant bytes with what they should be as part of the Oof SFX patch. I understand why this is dispreferred as per Berserker66 above but in this case does it really matter? This is unused functionality of Enemizer that nothing else touches and which (I am told from VT developers) shouldn't even be there.

@ThePhar ThePhar merged commit 8b7ffaf into ArchipelagoMW:main Apr 11, 2023
10 checks passed
kindasneaki pushed a commit to kindasneaki/Archipelago that referenced this pull request Jun 28, 2023
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
Co-authored-by: Fabian Dill <fabian.dill@web.de>
Co-authored-by: Zach Parks <zach@alliware.com>
FlySniper pushed a commit to FlySniper/Archipelago that referenced this pull request Nov 14, 2023
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
Co-authored-by: Fabian Dill <fabian.dill@web.de>
Co-authored-by: Zach Parks <zach@alliware.com>
Jouramie pushed a commit to Jouramie/Archipelago that referenced this pull request Feb 28, 2024
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
Co-authored-by: Fabian Dill <fabian.dill@web.de>
Co-authored-by: Zach Parks <zach@alliware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: enhancement Issues requesting new features or pull requests implementing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants