Legend of the Mana Sword (GB Final Fantasy Adventure hack)

Started by xenophile, January 30, 2022, 10:52:35 PM

Previous topic - Next topic

dagmor

Quote from: Ok Impala! on September 08, 2022, 02:23:44 AMSomething I'm hugely interested in is getting rid of the bounce back when you get hit by a monster. As long as the player is in that state it ignores all event scripts on screen. Making it possible to glitch onto tiles you aren't supposed to be on. Eliminating bounce back would fix this, and I'm sure it would feel better in game too.

There is already code for that in the game. When you walk over spikes, you get hurt, but you don't bounce back.

@radimerry: We've got a Discord server where we discuss FFA hacking. Please send me a DM or e-mail if you'd like to join us there for a more indepth discussion about the improvements we are working on for FFA.

I'm not sure if removing it entirely would feel better in gameplay, but I'd be willing to try it out. My gut reaction is that I'd miss it.

I agree about the tile issue though. As evidenced by the very first screen: I can get hit into the gate, and then require going down/left/right and back to progress to the next screen.

That said, I can't get hit back through walls. Would it be possible to change the collision script to consider the event tiles as walls while "hit back" moving?

xenophile

Quote from: dagmor on September 10, 2022, 01:53:00 AMSo much love to you folks for working on this game! :beer:

I did another playtest of the latest release.

Thanks!

QuoteOverall, I enjoyed the improvements. Here's a few oddities I encountered:

Check out Amanda's head. This happens consistently in the menu from this spot.

Several things in the last few days seem to show that the game gets tile math wrong in some cases. It's good to have more cases where it's wrong because changing it is likely to have unexpected effects.

QuoteI don't think I've noticed a chest forming on top of an open chest before. Not a big deal, but odd nonetheless.

Chest placement logic is annoying and unlikely to change. I have accidentally pushed so many chests into walls and rivers.

QuoteI recommend resetting the darkness condition if possible at the start of cutscenes. Otherwise you sometimes wind up with this, which doesn't translate well with the inverted palette (scene crossing the bridge right before coming out of the waterfall):

That's interesting... I actually found the (unused) script commands to set/clear the Dark effect a couple months ago. I modify that particular script to clear Dark but... I kind of like that effect. The bridge was visible until it disappeared, right?

I also cherish the moments when I level up under the effects of Dark.

QuoteI think this has been around a while, but I recommend moving shadow knight down a bit to prevent the overlap.

I have to admit, that's my fault and it was an intentional decision. In the original, Shadow Knight is hidden by the text box, which isn't optimal for any cutscene.

Moving Shadow Knight down even the minimum amount would put him that much closer to you at the start of the fight, making him more difficult. One thing I considered was moving him down for the text, and then having him take a step back at the very end of the cutscene.

I decided on having him break the fourth wall instead, by spawning a second copy of him after the text box is displayed, and then removing the duplicate just before the fight (although I can also say, fighting two of him is possible, and no fun). I might try the step back instead.

That said, to me, Shadow Knight being a larger-than-life villain is important to the story. One thing I've considered for a long time now is using a drop shadow on the S and K in his name (and only his) wherever it is used. What's your opinion on that?

QuoteSo this is new to me, but could be a bug in the original: in this room I killed an enemy with fire, then cast fire again as the enemy turned into a chest, and my fireball started making cloverleaf patterns around the new chest. It never could "kill" the chest, so it just kept trying indefinitely. I grabbed a RetroArch save state if interested. The heroine could not perform any action while the fireball danced.

Has to be a bug in the original. Sounds very annoying, especially if that happened to be the last enemy on the screen.

QuoteThe Dime castle loads slowly upon re-entering the region. I'm not sure if this is original, but it seemed slower than I remember. In general, there seemed to be more flashy/slow sprite action, but it's hard to say if that was due to RetroArch or my own poor memory.

Dime Tower rising is something that I have tried to optimize--the original often draws a tile over a duplicate tile--but I have not touched the script that runs when you re-enter that screen. I hope I have not negatively impacted it. If you want to test the original, your save games should be compatible (and if not, blame the emulator).

QuoteAs an aside, the ninjas can get glitched with the Lit spell just like Shadow Knight. After being hit they move in a straight line, completely off screen, then reappear on the other side. This continues until the player hits the ninja again, then it dies.

Good to know.

QuoteOriginal but annoying. On this screen, if I walk to the left, there's an invisible staircase to go back to the path with elephants. I would argue that transition should occur anytime the player walks below a certain tile, not just on one specific tile with an invisible staircase.

I've thought of making an obvious teleporter, but adding more invisible transition tiles sounds like a better option. I'll give it a shot.

Once again, thanks for the feedback. You highlight a lot of things I've worried over, but bring a fresh viewpoint to them.

radimerry



The sprite-window bug looks annoying. Sprites are 8x16 but we see overlap here, which is why it's removed. If the status box is shrunk 8 pixels, maybe it'll work.



Similar to here.


For Shadow Knight, if text box is shrunk 8px on top, maybe you can sneak by.

dagmor

Quote from: xenophile on September 10, 2022, 05:34:58 AMI kind of like that effect. The bridge was visible until it disappeared, right?

I also cherish the moments when I level up under the effects of Dark.
Yes, I believe so. I find the effect fun too, as long as it doesn't detract from a first time player's understanding of story. To be fair, most first time players would likely sit out the effect until it stops.

There seems to be more to "dark" than color inversion. Otherwise this scene would have more context that you're on a cliff. I think in this case it's fine to leave it, though I wonder if it's problematic elsewhere.

QuoteMoving Shadow Knight down even the minimum amount would put him that much closer to you at the start of the fight, making him more difficult.
Have you considered moving him to be further to the left/down and facing right, and likewise moving the player up and facing left? The intent being that they're still staring each other down, but making a horizontal line instead of a vertical one.

QuoteThat said, to me, Shadow Knight being a larger-than-life villain is important to the story. One thing I've considered for a long time now is using a drop shadow on the S and K in his name (and only his) wherever it is used. What's your opinion on that?
Sure! Shadow Knight is a fairly generic name, so adding embellishment may help it stand out as unique. Even though it wasn't direct translation, I kinda liked "Dark Lord" better for stirring that dread and main bad guy feeling.
QuoteHas to be a bug in the original. Sounds very annoying, especially if that happened to be the last enemy on the screen.
Thankfully the player can still move, just not use A, B, start, or select. Leaving the room resolves the issue. There may still be a soft lock potential in there somewhere, but nothing comes to mind.
QuoteOnce again, thanks for the feedback. You highlight a lot of things I've worried over, but bring a fresh viewpoint to them.
:thumbsup:

Ok Impala!

#44
Quote from: dagmor on September 10, 2022, 02:09:30 AMThat said, I can't get hit back through walls. Would it be possible to change the collision script to consider the event tiles as walls while "hit back" moving?

I haven't found a way to do just that yet, would be a great solution though. I did find a way to make an event detect that the player is in this state and bounce him back again from the event. So, in this case the gate would throw you back. But since the "hit back" animation takes so long, the game monster would push you back again too, resulting in a "pinball" effect for a second. So, that way wasn't feasible either.  :laugh: I use events a lot in Ember of Mana for closed doors. That way I created closed doors that only have to be opened once in the game. Though because of the glitchy behavior with the bounce back, I can't have any monsters in the same room with a closed door. The glitchy bounce back would allow the player to glitch through the door.

Link's Awakening only uses bounce back sparsely, and that feels and works way better. I think for FFA the bounce back is just way too large and glitchy, making it feel like you are not in control as a player. At least trimming down on the force of the bounce back would help immensely. But I'd really be happy if it would work the same as in Link's Awakening.
Ember of Mana (https://www.okimpala.net)
Zelda II - Amida's Curse (http://www.romhacking.net/hacks/6292/)
Super Mario Kart - Epic Racers (https://www.romhacking.net/hacks/5514/)
Super Mario Kart - The Impala Battles (https://www.romhacking.net/hacks/154/)

radimerry

#45
Knockback is a weird beast. Some experimental patches for playing around
https://github.com/radimerry/bucket/raw/01ef67e5b1602ed4873146bc01b9969858bbf46a/ffa-knock-none.ips
https://github.com/radimerry/bucket/raw/01ef67e5b1602ed4873146bc01b9969858bbf46a/ffa-knock-short.ips

None = player doesn't move (01:4fa5 = ld a, $00)
Short = small kickback (01:4fa5 = ld a, $01)

Odd part is if you set a very high damage timer @ c4d2, you'll keep flying backward until it reaches $33. Then you regain control of player.

-- --


Spikes look controlled by a metatile (script) event trigger @ 0:1700, which sets damage timer to $33 so no kickback triggered. Player can still be immediately touch damaged though, unlike the kickback damage.



What does this all mean? I have no suggestions towards a fix. Leaving collision detection always on can trigger an infinite pinball spin of eventual death.


The annoying part about floor triggers is the snapping. If we span 2 16x16 bg metatiles, it checks only 1. So we get 2 hits and 2 misses. If it's possible to force the chest to only work when completely covers the floor tile, then I think the bug would go away.
-- -- --


======================


Quote from: Ok Impala! on September 11, 2022, 12:26:07 AMI haven't found a way to do just that yet, would be a great solution though. I did find a way to make an event detect that the player is in this state and bounce him back again from the event. So, in this case the gate would throw you back.

You could clip the damage timer (c4d2) to $33 to stop the kickback itself if state detected.

dagmor

Quote from: radimerry on September 11, 2022, 08:44:20 PMThe annoying part about floor triggers is the snapping. If we span 2 16x16 bg metatiles, it checks only 1. So we get 2 hits and 2 misses. If it's possible to force the chest to only work when completely covers the floor tile, then I think the bug would go away.
Please forgive me if this is already apparent, but just to be clear: the game promotes that the bottom half portions of chests or snowmen are the parts that can interact with switches. I believe this is attempting to add authenticity to the "3D" sprite look.

If the puzzle was changed to require full overlap of the chests/snowmen and switches, that'd need to be done across the board. This may prove problematic for other puzzles.

Ok Impala!

Quote from: radimerry on September 11, 2022, 08:44:20 PMKnockback is a weird beast. Some experimental patches for playing around
https://github.com/radimerry/bucket/raw/01ef67e5b1602ed4873146bc01b9969858bbf46a/ffa-knock-none.ips
https://github.com/radimerry/bucket/raw/01ef67e5b1602ed4873146bc01b9969858bbf46a/ffa-knock-short.ips

None = player doesn't move (01:4fa5 = ld a, $00)
Short = small kickback (01:4fa5 = ld a, $01)

Odd part is if you set a very high damage timer @ c4d2, you'll keep flying backward until it reaches $33. Then you regain control of player.

Spikes look controlled by a metatile (script) event trigger @ 0:1700, which sets damage timer to $33 so no kickback triggered. Player can still be immediately touch damaged though, unlike the kickback damage.



What does this all mean? I have no suggestions towards a fix. Leaving collision detection always on can trigger an infinite pinball spin of eventual death.

You could clip the damage timer (c4d2) to $33 to stop the kickback itself if state detected.

Thank you! This really helps! I'll start experimenting with these settings.
Ember of Mana (https://www.okimpala.net)
Zelda II - Amida's Curse (http://www.romhacking.net/hacks/6292/)
Super Mario Kart - Epic Racers (https://www.romhacking.net/hacks/5514/)
Super Mario Kart - The Impala Battles (https://www.romhacking.net/hacks/154/)

dagmor

Quote from: Ok Impala! on September 11, 2022, 12:26:07 AMLink's Awakening only uses bounce back sparsely, and that feels and works way better. I think for FFA the bounce back is just way too large and glitchy, making it feel like you are not in control as a player. At least trimming down on the force of the bounce back would help immensely. But I'd really be happy if it would work the same as in Link's Awakening.
I just loaded up Link's Awakening for comparison. The three enemies I fought all induced knockback. You're totally right though, it feels better. Maybe from a combination of shorter distance and more accurate direction. In LA the player is on a finer grid, so diagonal knockback makes sense. That probably wouldn't fly in FFA. Still, something like half the distance would help!

Ok Impala!

Quote from: dagmor on September 12, 2022, 01:21:30 AMI just loaded up Link's Awakening for comparison. The three enemies I fought all induced knockback. You're totally right though, it feels better. Maybe from a combination of shorter distance and more accurate direction. In LA the player is on a finer grid, so diagonal knockback makes sense. That probably would fly in FFA. Still, something like half the distance would help!

Yeah, I have to check what causes the different feel. But I surely want to aim at the Link's Awakening feel for the new bounce back in Ember of Mana. I think no bounce back at all might work if the animation changes convincingly, there are ARPG that go that route. Other option would be to scale back the bounce back to make it more subtle and add a nice sound effect, and maybe a flash or short pause too. Really exciting to improve on this mechanic, as it just doesn't feel right in vanilla FFA.
Ember of Mana (https://www.okimpala.net)
Zelda II - Amida's Curse (http://www.romhacking.net/hacks/6292/)
Super Mario Kart - Epic Racers (https://www.romhacking.net/hacks/5514/)
Super Mario Kart - The Impala Battles (https://www.romhacking.net/hacks/154/)

radimerry

Quote from: dagmor on September 12, 2022, 12:38:55 AMPlease forgive me if this is already apparent, but just to be clear: the game promotes that the bottom half portions of chests or snowmen are the parts that can interact with switches. I believe this is attempting to add authenticity to the "3D" sprite look.

Did not realize the pseudo-3D, 3/4 viewpoint perspective. That completely changes a lot.


Quote from: Ok Impala! on September 12, 2022, 03:11:12 AMYeah, I have to check what causes the different feel. But I surely want to aim at the Link's Awakening feel for the new bounce back in Ember of Mana.

LA has a fast but brief shoveback. Just some experimenting
1:4fa5 = ld a, $0a -- speed
1:4fac = ld a, $36 -- how long
(no picture)

Warning that I get shoved into dungeon walls more often (left and bottom). This I'm curious about. :o

xenophile

Forgive me for not getting back to y'all for a while. There's a lot I wanted to respond to (and do) and I wanted to make sure not to miss anything. I've also been spending a fair amount of time going through the disassembly, trying to learn more.

First, knockback. I've only played with this a little bit. I believe Ok Impala! has found a setting that works for Ember of Mana. I agree it could be much improved, but I'm hesitant to make changes without understanding it better. I tried changing the "how long" from $3c (60, presumably one second, which seems accurate) down to $20 and it seemed like that increased the speed and distance. It's hard to tell.

The chest/switch thing I haven't had a chance to really look into yet.

@radimerry: Disappearing after Jackal. I've got this fixed using a script hack, turning the Hero to face whichever direction they are already facing. This is for Jackal only since the game has a lot of intentional delay there, and players won't have built up trust in the hack yet. I considered reducing the delay(s) but so far I'm going to leave them as is. FYI, there is a one second delay before the music is cut out, and then a one and a half second delay before the text box shows up.

Speaking of sound, I saw your analysis about the buzzing when the music is muted. The Game Boy sound systems are a bit of a mystery to me. I fixed this myself by changing 0f:405e from $10 to $00, but sometimes I hear sound glitches that I worry are my fault. Do you have any thoughts on what the correct fix is?

I've applied your copy-forward change for the line effects, the empty inventory slot fix, and the (v1) warp fix.

I also confirmed that the high level Nuke fix was fixed after the Japanese release. Thanks for looking into that.

About the tile loading on the Sickle. I've been looking at the tile animation code recently--used for things like the river in the Sickle test screen. The game can (in my experience) copy five tiles during VBlank, and depending on what what animated tiles are present, it may queue up to two for a frame. While the player and the weapon animations seem to be designed to alternate which is copying at any point, any change they make is at least four tiles, and that Sickle special attack looks like it may transfer eight at a time? I'm actually pretty surprised more graphic corruption doesn't happen (or at least isn't noticeable).

@dagmor: I moved Shadow Knight down under the window. Also, repositioned him to centered horizontally. You should have to scramble a little more to get out of his way at the beginning of the fight. Shrinking just one text box isn't possible.

I added the invisible teleporter to my list, but I'm not going to touch it yet because adding additional triggers will grow the room's data, and that would move a lot of things.

"There seems to be more to "dark" than color inversion." It turns black to white and all three of the other shades to black. The problem here is the only visible tiles with black are the cave and the two shadowed cliff tiles. Even without the dialog box you wouldn't have much more context.

One interesting thing I discovered recently by looking at the disassembly: They had a pretty complete scriptable dark mechanic that they don't use, including two light type objects ("Torch" and "Dwarf Lantern"). Presumably they would use this on caves or individual rooms. The items are designed to remove the effect for a certain period of time. It's interesting seeing how complete their development was, but it's likely it got cut because it was too tedious.

Ok Impala!

Quote from: radimerry on September 11, 2022, 08:44:20 PMKnockback is a weird beast. Some experimental patches for playing around
https://github.com/radimerry/bucket/raw/01ef67e5b1602ed4873146bc01b9969858bbf46a/ffa-knock-none.ips
https://github.com/radimerry/bucket/raw/01ef67e5b1602ed4873146bc01b9969858bbf46a/ffa-knock-short.ips

I used the small knock-back setting and it works like a charm! Tried some other settings too, but came back to the short knock-back. That one feels pretty good and it feels a lot less glitchy. Ember of Mana will make use of the short knock-back for sure!  :)
Ember of Mana (https://www.okimpala.net)
Zelda II - Amida's Curse (http://www.romhacking.net/hacks/6292/)
Super Mario Kart - Epic Racers (https://www.romhacking.net/hacks/5514/)
Super Mario Kart - The Impala Battles (https://www.romhacking.net/hacks/154/)

radimerry

Quote from: xenophile on October 04, 2022, 02:56:14 AMSpeaking of sound, I saw your analysis about the buzzing when the music is muted. The Game Boy sound systems are a bit of a mystery to me. I fixed this myself by changing 0f:405e from $10 to $00, but sometimes I hear sound glitches that I worry are my fault. Do you have any thoughts on what the correct fix is?

I would've done the same thing - set volume register to zero. Game appears to correctly set volume when playing new instruments.

Are glitches sfx or music? Stutters? Skips? Assuming that game does not user timer interrupts (0087-0096 could be freed up).


Quote from: xenophile on October 04, 2022, 02:56:14 AMThe chest/switch thing I haven't had a chance to really look into yet.

For that room, can the puzzle logic be changed to a counter? Adds +1 for every chest pushed to tile or -1 if removed. When 4 is reached, open door.



Quote from: xenophile on October 04, 2022, 02:56:14 AMI tried changing the "how long" from $3c (60, presumably one second, which seems accurate) down to $20 and it seemed like that increased the speed and distance.

I think it's tied to another value that controls when to stop the pushback but keep the no-damage blinking on (try ~1:4b38).

xenophile

Quote from: radimerry on October 04, 2022, 12:42:31 PMI would've done the same thing - set volume register to zero. Game appears to correctly set volume when playing new instruments.

Are glitches sfx or music? Stutters? Skips?
What I've heard is sort of a loud "bazap!" sometimes when killing an enemy. I don't think this has happened on real hardware, but I wouldn't swear to it.

QuoteAssuming that game does not user timer interrupts (0087-0096 could be freed up).
I've done some color testing, and I removed this routine for space with no problems.

QuoteFor that room, can the puzzle logic be changed to a counter? Adds +1 for every chest pushed to tile or -1 if removed. When 4 is reached, open door.
The scripting only allows one bit variables. You can do a counter with nested if structures, but it gets messy quickly.

The puzzle logic for that room is pretty simple: push a chest off of a trigger tile (or destroy it while it is on one). Pretty clear what they were going for.

QuoteI think it's tied to another value that controls when to stop the pushback but keep the no-damage blinking on (try ~1:4b38).
Okay, I see the logic now. Movement is stopped on wPlayerDamagedTimer == $34, so when I reduced it to $20 it looped something like $ff - $34 + $20 times.

It looks like that function also drives the blinking logic: 01:4b4f bit 3, a. I might try changing that to twice as fast.

Looks like presently knock back is 32 pixels. I'm concerned that changing that would nerf bosses, most of whom are very susceptible to just spamming attacks and exploiting invincibility frames.

dagmor

Quote from: xenophile on October 04, 2022, 02:56:14 AM@dagmor: I moved Shadow Knight down under the window. Also, repositioned him to centered horizontally. You should have to scramble a little more to get out of his way at the beginning of the fight. Shrinking just one text box isn't possible.

I added the invisible teleporter to my list, but I'm not going to touch it yet because adding additional triggers will grow the room's data, and that would move a lot of things.

"There seems to be more to "dark" than color inversion." It turns black to white and all three of the other shades to black. The problem here is the only visible tiles with black are the cave and the two shadowed cliff tiles. Even without the dialog box you wouldn't have much more context.
Thanks for the update!

How does the game look with the grays inverted as well (instead of being black)? Or perhaps drop down the tint by 1 on every shade (white to light gray, light gray to dark gray, dark gray to black, black stays black).

As a random aside, when I branch a speedrun mod off this LotMS mod, I'm going to look for a way to auto-use keys and AB button combo mattocks. I may also try to A+select to cycle through weapons. Anything to reduce menu time...

xenophile

Quote from: dagmor on October 08, 2022, 12:36:16 AMHow does the game look with the grays inverted as well (instead of being black)? Or perhaps drop down the tint by 1 on every shade (white to light gray, light gray to dark gray, dark gray to black, black stays black).

Give it a try: setDarkGraphicEffect. I think that is the only function that needs to be changed. I tried a couple things in a graphics editor, and excluding dark gray from being changed looked pretty good on the screen you mentioned. Consider this a little gentle pressure to start hacking.  >:D

QuoteAs a random aside, when I branch a speedrun mod off this LotMS mod, I'm going to look for a way to auto-use keys and AB button combo mattocks. I may also try to A+select to cycle through weapons. Anything to reduce menu time...

Menus are frustratingly slow. If I recall correctly, there is a script command to scan your inventory for a certain item, and another to remove it. The only issue for keys is that it isn't coded to deal with stacked objects, but that still means it should be pretty simple to implement auto using keys. Especially because there's just one simple script that manages all every normal locked door.

xenophile

New version up!

This is a big release for bug fixes to the original:
* Restore the HUD to the original location! (Exactly one pixel lower.)
* Fix equipment power bug. (Thank you radimerry.)
* Poison and Fuji's heal now tick even while you are attacking. (Although poison can be a bit annoying, this makes Fuji useful during bosses.)
* Fix Sickle warp bug. (Thank you radimerry.)
* After the Jackal fight ensure the Hero is visible.

While you can be left invisible due to taking damage after any boss, it's really common with Jackal, the script includes a lot of intentional delay, and players are still learning what to expect. This was easier to fix with a script change, saving a bunch of assembly debugging.

Other things:
* Due to feedback I've repositioned Shadow Knight during his pre-fight banter. (Thank you dagmor.)
* The formula for maximum mana has changed. It used to be that every 14th point of Wisdom you gained would not give a point of MP. Now every point of Wisdom you gain always gives exactly one point of MP. Previously MP would max out at 98 when Wisdom hit 99, but now it maxes at 99 when Wisdom hits only 95. (Wisdom above 96 still gives you extra magic damage, but I doubt you'll need it.)
* Mithril Helm now gives resistance to certain enemy attacks, just like Mithril Armor. The entire elemental resistance/immunity/bonus/block system is complex and I've been working to understand it better--this fix just happened to be obvious and easy.

There's still a lot to test and understand about the elemental system(s). As far as I can tell, a lot of what is documented in the manual and many guides is wrong (or misleading). For instance:
* Undead enemies seem to be vulnerable to the Mana Sword--not the Mithril Sword--but good luck getting either of them before you face Vampire.
* Werewolves probably take extra damage from all axes, not just the Were Axe.
* All magic spells seem to be the same element (for the purposes of vulnerability, which is different than immunity), so no bonus damage to fire/ice vulnerable enemies.


xenophile

Quote from: xenophile on November 02, 2022, 02:39:42 AMFix equipment power bug. (Thank you radimerry.)

New version up. In copying and pasting radimerry's fix into the disassembly I managed to make a mistake. All equipment (except what is equipped?) was having its AP/DP set to zero on load from a save.

A lot of people are probably playing with save states, but... you probably want to upgrade to the new fixed version (available now).