ShadowOne333 / MaternalBound-Redux

A new version of MaternalBound, complete with New Controls and MSU-1 integration... And a lot more features!
GNU General Public License v3.0
79 stars 6 forks source link

QOL Photosensitivity features requested #12

Open goombapatrol opened 2 weeks ago

goombapatrol commented 2 weeks ago

First of all, thank you for all the time and work put into this hack.

Implemented photosensitive reduction hacks made from subsequent releases of EarthBound (SNES Mini, Virtual Console) into MaternalBound, to make the experience the most seizure-safe possible

I was very happy to see this added; being visually sensitive & epileptic has stopped me from trying Earthbound in the past. (And seeing your feature got me to try the game for the first time tonight.)

I played from the beginning (blind) and it seemed fine until in the middle of a battle the entire screen flashed Green. Apparently this is a 'Critical Hit' mechanic "SMAAAASH". I'm okay now, but that strong effect is a dealbreaker (it would be risky playing with those occurring).

...So this has inspired me to request you including an optional accessibility patch with further visual/flash reduction, beyond whatever Nintendo did for VC.

And if any cases don't seem 'fixable' by blending or blurring or substituting, i'd be okay with just removing offending visuals altogether and prioritize making the experience as safe as possible. The music, story, and gameplay is all still there to enjoy.


Thanks! And let me know if you have any questions. I'm looking forward to playing this game someday.

Anonymous941 commented 2 weeks ago

Hi, I'm not a developer of MaternalBound but could make a fork with these patches applied if you want

I played from the beginning (blind) and it seemed fine until in the middle of a battle the entire screen flashed Green. Apparently this is a 'Critical Hit' mechanic "SMAAAASH". I'm okay now, but that strong effect is a dealbreaker (it would be risky playing with those occurring).

Option of disabling the screen/text shaking when getting hit in a battle would be nice too (i.e. Reduced Motion).

I'll look into that, I can probably prevent all flashing and shaking in the game by simply removing that function

Some are pretty bad even when static, so making those a calmer pattern may be the best option. For instance this BG seen here. And if that's all too complicated, forcing them to a solid color/black would also suffice.

The simplest idea I have is to disable all the animations, then apply a blur effect on all of the backgrounds so the static images wouldn't be as much of a problem

Another would be if you can look at all of the backgrounds and make a list which ones that are too busy even when they're static (e.g. 015, 027, etc.) and I could blur or remove just those. Although that definitely seems very tedious, so if it's not too risky, looking at the thumbnails would make it quicker

From briefly previewing PK/PSI effects on Youtube, i can tell those are going to be very problematic. I'd opt to disable the GFX.

Yeah, I can just disable all of these pretty easily

Could you also look at https://github.com/ShadowOne333/MaternalBound-Redux/tree/master/Animations? Each folder contains static frames of the non-PSI animations, so if you could tell me which ones you'd like me to disable that would be great. 1 would almost certainly be a problem (in fact, it's one of the few virtual console changes) but the others are more mild, so I'm not sure if those would be an issue

Hope this helps!

ShadowOne333 commented 2 weeks ago

@Anonymous941 if you manage to get a further photosensitive dampening fork of MB Redux, please let me know, I'd be interested in offering it as an optional patch officially with proper credit to you of course.

goombapatrol commented 2 weeks ago

@ShadowOne333 For sure!

@Anonymous941 Sounds great, thank you so much! I'll get to work on going through those thumbnail + PNG files.

Could you also look at https://github.com/ShadowOne333/MaternalBound-Redux/tree/master/Animations? Each folder contains static frames of the non-PSI animations, so if you could tell me which ones you'd like me to disable that would be great. 1 would almost certainly be a problem (in fact, it's one of the few virtual console changes) but the others are more mild, so I'm not sure if those would be an issue

Yeah the others there seem fine at a glance. And i think Animation 1 can be salvaged. We just duplicate frame 002.png over 003.png to avoid the flash, no need to blur or anything. I'm not sure the context of this graphic, when is it used? (i'd have to see it ingame to know for sure)


Oh and a question; what determines if battle is Letterboxed or not? Watching some example YT videos I saw some BG go full screen (bosses?) Smaller percentage of screen is usually easier to tolerate, so we may play around with that as well.

goombapatrol commented 2 weeks ago

Another would be if you can look at all of the backgrounds and make a list which ones that are too busy even when they're static

Okay I downloaded the repo and went through all the backgrounds one at a time in Photo Viewer and labelled their 'badness', based on comfort and reflexive response. Results seem consistent enough to give you an idea of what needs to be focused on. (Note: I didn't look at any one BG for an extended period or at full screen, so in-game during a longer battle they may be harder to tolerate than this list suggests)

visual-bgs.txt visual-bgs_grouped.txt

x = fine xx = tolerable (there is a lot of variance within this ranking. some are fine and some are maybe not, but i didn't have a strong reaction; some patterns blurring may improve, others are okay) xxx = busy and quite uncomfortable (these are not good. strong blurring could maybe help those with hard edges, but not the really stimulating ones scattered all over the place) xxxx = very strong negative reflex, potentially unsafe

(Lines prefixed with a ; semicolon is a duplicate image i saw in a row for my note taking, no significant meaning.)

I noticed a recurring pattern when making this; the ones i handled worst had stronger contrast or a lot of lines, in particular thin ones. Googling found me some very useful reading on this, bad static images can indeed evoke seizure activity. https://neurosciencenews.com/seizures-images-6609/ Apparently my brain's instinctive reaction lines up with the studies, who knew? :)

And it's interesting that the same shapes just in a different color can cause a more negative response (e.g. 001.png vs 002.png). In general, the more similar the colors and lower the contrast is, the easier it is to process the information.


Some other stuff:

In Swirls folder i saw '4' and '6' are also problematic with the thin lines. I don't know if blending will fix them, so perhaps they can just use a different pattern. (The rest seem fine)

And i looked into Title screen flash; to handle this we can just make GasStation2.png use GasStation1.png's image.


There was a lot to get through but i made it, whew! (271.png actually did induce some noticeable seizure aura activity, so i took a precautious break. I'm okay though.)

I can give you further feedback if you wanted to play around with various blur amounts or types. Attached test images are 002.png with Gaussian blur 7px, and 003.png with a ton of "blur more" applied over and over (Gaussian didn't work as well for this one).

@Anonymous941

002 002_bg_blurred 003.png original (not embedded because i don't want to look at it) 003_bg_blurred

Anonymous941 commented 2 weeks ago

if you manage to get a further photosensitive dampening fork of MB Redux, please let me know, I'd be interested in offering it as an optional patch officially with proper credit to you of course.

Absolutely, I'll make a GPL-licensed GitHub repo and you can use it however you like

I'm not sure the context of this graphic, when is it used? (i'd have to see it ingame to know for sure)

It's used for Ness being struck by lightning, when you talk to Mr. Carpainter in Happy Happy Village (you'll understand that once you get to that point in the game). It is kind of sudden, not sure if that changes anything, but if it helps I can add a dialogue warning or something

Okay I downloaded the repo and went through all the backgrounds one at a time in Photo Viewer and labelled their 'badness', based on comfort and reflexive response. Results seem consistent enough to give you an idea of what needs to be focused on. (Note: I didn't look at any one BG for an extended period or at full screen, so in-game during a longer battle they may be harder to tolerate than this list suggests)

Wow, that's amazing, thank you! I can't imagine how long it took you to go over all of them. I can use ImageMagick to blur these

In Swirls folder i saw '4' and '6' are also problematic with the thin lines. I don't know if blending will fix them, so perhaps they can just use a different pattern. (The rest seem fine)

I'm honestly not sure where these are used in-game (along with 5), @ShadowOne333 do you know?

Oh and a question; what determines if battle is Letterboxed or not? Watching some example YT videos I saw some BG go full screen (bosses?) Smaller percentage of screen is usually easier to tolerate, so we may play around with that as well.

I've been wondering this too, bosses was my guess as well. Maybe it would help if I just made all of them letterboxed

goombapatrol commented 2 weeks ago

It's used for Ness being struck by lightning, when you talk to Mr. Carpainter in Happy Happy Village (you'll understand that once you get to that point in the game). It is kind of sudden, not sure if that changes anything, but if it helps I can add a dialogue warning or something

Okay i found the lightning visual you're referring to here at @ 12s (i did frame advance to preview it, definitely not safe effect to watch!)

I see that it flashes WHITE every other frame. Assuming the white flash can be removed, i think it's very fixable. How much control do we have over animation's frames; that is, telling the game which order to use them and how many frames to hold each for?

I made a proof of concept safe version (effectively slower and skips 003.png altogether):

[noanim  6  frames]  (60fps video)
[000.png 6  frames]  
[001.png 6  frames]  
[002.png 10 frames]  
[001.png 6  frames]  
[000.png 6  frames]  
[noanim  10 frames]  
[loop again]

I think this approach can work! It looks clean and is perfectly safe, no "heads up" dialogue warning necessary.)

https://github.com/ShadowOne333/MaternalBound-Redux/assets/7359713/a058149f-9300-4f02-b1f5-8f8eb08c1722


I've been wondering this too, bosses was my guess as well. Maybe it would help if I just made all of them letterboxed

Yeah for sure, that's something to consider down the line. I see there's full, narrow, and even narrower, so we have some options.

Wow, that's amazing, thank you! I can't imagine how long it took you to go over all of them. I can use ImageMagick to blur these

Glad to help. Your generous response really inspired me, and I'm more than willing to commit and take time to get the best experience possible. It may be a case by case getting each background to look good while staying safe.

I got another idea today; when viewing BG animations on that preview site, I noticed some of the 'in betweens' were actually less bothersome than the static image. So digging through those may be a good resource without having to rely on external tools alone. We grab a less offensive frame to use; for instance i found this very tolerable static within "busy" 003.png's animation:

download (2)

That looks so much better than the blur test of 003.png i posted earlier.

We can even take some creative liberty and use stacked secondary animations to effectively blend or blur really bad ones, and then take a 'good' frame for static use. For instance i obtained this one by combining layer 313 (busy xxx) with harmless 005 to mute it and reduce contrast nicely. It's a cool workaround.

download (7)

Feel free to try this approach out for some of the borderline cases. (I definitely can't safely experiment with them all in motion.)

Oh and once we have some things implemented, is there an easy way to quickly test stuff, like a debug hack? (At some point i'll want to try it out on my CRT firsthand.)


p.s. Here's how the lightning video looks with vf photosensitivity active if you were curious; it handled the effect very well. (A friend made that filter for me a few years back, and now it's officially implemented into ffmpeg; very nice for browsing YouTube!)

Anonymous941 commented 2 weeks ago

Those .mp4 files aren't playing, can you re-upload them?

I see that it flashes WHITE every other frame. Assuming the white flash can be removed, i think it's very fixable. How much control do we have over animation's frames; that is, telling the game which order to use them and how many frames to hold each for?

The way I understand it, I can change these pictures, which have a fixed duration each (I'm not sure exactly how long, it's kind of confusing). The white flash is done somewhere else, but I probably can remove it later

Oh and once we have some things implemented, is there an easy way to quickly test stuff, like a debug hack? (At some point i'll want to try it out on my CRT firsthand.)

Good idea! It can be used to test things like the animations and battles/battle backgrounds

Here's a very simple debug patch (source). It's the same as MaternalBound-Redux but the ATM card opens up a debug menu. Right now it lets you preview the OG lightning effect, that way you can use frame advance (which can usually be activated by pressing a certain key, it on your emulator) and view it frame-by frame. It gives a warning before playing it

Also, if you want to experiment with changing the ROM hack (even if you're not a developer there are some relatively easy things like the animations' pictures and dialog), then I can help with setting up CoilSnake on my temporary fork and you can test out some things

goombapatrol commented 2 weeks ago

Those .mp4 files aren't playing, can you re-upload them?

Which ones, sorry? I only uploaded one mp4 in the post above (carpaint-poc-60.mp4). The rest are all static PNG images. (Here's the safe lightning mp4 again uploaded to my own host, just in case that's what you were referring to.)

The way I understand it, I can change these pictures, which have a fixed duration each (I'm not sure exactly how long, it's kind of confusing). The white flash is done somewhere else, but I probably can remove it later

Yeah, replacing 003.png with 002.png is about the best we can do with pictures alone. And it may be enough with the flash gone to not need any additional frame modification.

I saw this in animations.yml, any idea what the 'unknown' part is referring to?

 1:
  frames: 7
  unknown: 16

Here's a very simple debug patch (source). It's the same as MaternalBound-Redux but the ATM card opens up a debug menu. Right now it lets you preview the OG lightning effect, that way you can use frame advance (which can usually be activated by pressing a certain key, it on your emulator) and view it frame-by frame. It gives a warning before playing i

Ok cool thanks, that will help speed things up a lot. (I've seen Ness in his Pajamas far too many times now.) Is there any difference in EBP patch format, or would IPS/BPS work just as well? (i use FLIPS; have not encountered EBP before.)

Also, if you want to experiment with changing the ROM hack (even if you're not a developer there are some relatively easy things like the animations' pictures and dialog), then I can help with setting up CoilSnake on my temporary fork and you can test out some things

For sure, sounds interesting. And I do have some experience (most recently I've been doing some game development/ASM coding for a Smash 64 hack), but haven't touched SNES stuff in a while (did Yoshi Island stuff years ago). I assume it's a pretty intuitive tool.

So from what i'm reading, the game uses control code scripting.

l_0xc980c1:
    "@If you don't want to be my right hand,{pause(15)} my left would be just fine..." next
    "@Just kidding!{pause(20)}  Your existence is a problem for me and my religion." next
    "@Defy me,{pause(15)} and I'll end your pitiful game![03]" call(data_23.l_0xc6847a) "[1B 03 {e(data_23.l_0xc683de)}][1D 05 FF 01][1B 03 {e(l_0xc9817a)}]" eob

For instance [1D 05 FF 01] is boolean check to see if you have a certain item, and branch accordingly. Very quirky, i like it.


And thanks again!

goombapatrol commented 2 weeks ago

Okay, I found the EBPatcher tool and used it, confirming your debug test patch works. (And good having the safety confirmation prompt, i did indeed frame advance)

ShadowOne333 commented 1 week ago

What specific PSI Animation would need a rework for a photosensitive patch? Iirc, Coilsnake doesn't have a way to properly edit the PSI Animations in any way, but it could be possible to modify the current "animations" module from Coilsnake to be expanded and implement the PSI ones too. There's a PSI editor, but that requires modifying a base ROM, extracting the modified data and adding it as plain data into a Coilsnake source project. It's quite cumbersome, and it'd be better if either the PSI Animations were dumped by Coilsnake, or if CS itself implemented the PSI Editor in some form.

goombapatrol commented 1 week ago

What specific PSI Animation would need a rework for a photosensitive patch?

That's a good question. I don't know what the majority of them look like. If you can show me a PNG dump of them that I could preview, i'll go through them. (Don't feel comfortable watching Videos of them, both for Photosensitive reasons and i'm still trying to avoid game spoilers.) Anything that flashes full screen would be a major no, as well as anything that changes color rapidly.

And I'd be fine (and honestly prefer) just disabling them altogether; from the couple i've seen they are very stimulating.

Anonymous941 commented 1 week ago

I saw this in animations.yml, any idea what the 'unknown' part is referring to?

Good question. It seems that there are four numbers associated with each animation, but for some reason CoilSnake only lets you change 2 of them. As to what they do, I'd unfortunately need someone who can understand whatever the heck this ASM code is doing...

For sure, sounds interesting. And I do have some experience (most recently I've been doing some game development/ASM coding for a Smash 64 hack), but haven't touched SNES stuff in a while (did Yoshi Island stuff years ago). I assume it's a pretty intuitive tool.

So from what i'm reading, the game uses control code scripting.

Yeah, that's used for the dialogue, items and a lot more, with some miscellaneous things (e.g. these animations) being set in .yml files, with some .png files for images. CoilSnake definitely doesn't require ASM knowledge, and it's pretty intuitive

Very quirky, i like it.

Agreed, it's very strange

Anything that flashes full screen would be a major no, as well as anything that changes color rapidly. And I'd be fine (and honestly prefer) just disabling them altogether; from the couple i've seen they are very stimulating.

The vast majority of them are, so it's probably best (and easiest) to just disable PSI animations entirely... If anyone has other ideas, let me know

And thanks again!

Glad to help!

Anonymous941 commented 1 week ago

Hi, sorry for the delay, I'm trying to extract the PSI animations and hopefully I'll be able to be able to convert them into .png files soon. Then I should be able to edit them or remove them entirely

goombapatrol commented 1 week ago

Hi, sorry for the delay, I'm trying to extract the PSI animations and hopefully I'll be able to be able to convert them into .png files soon. Then I should be able to edit them or remove them entirely

No worry, thanks for the update.


In the meantime, I've been messing around with Mother 3 (which i have also not yet played) to see if it could get similar treatment; found a tool called "Funland" which basically allows you to change BGs and map which animations each PSI uses (amongst other features):

2024-07-05_15-42-39

I tested out all PSI as [00] (none) and BGs forced solid gray, here's the before and after.

(Photosensitivity Warning top video contains stimulating lights)

https://github.com/ShadowOne333/MaternalBound-Redux/assets/7359713/5a444309-1922-4c3b-abd2-39075f269012

https://github.com/ShadowOne333/MaternalBound-Redux/assets/7359713/85658a82-d802-4da7-a114-9ee1617c53ef


So this should give an approximate of how it may look in EB; I definitely prefer the PSI removed. (This particular red BG here was pretty tame to begin with, but i'm not about to go through 250+ more static images anytime soon lol.)

Anyway, I'll check back when you're finished extracting. And let me know if there's anything else I can do.