News:

11 March 2016 - Forum Rules

Main Menu

Lufia-Patches by Artemis

Started by FlamePurge, September 01, 2015, 04:42:13 AM

Previous topic - Next topic

FlamePurge

What music glitch? This isn't the Stereo > Mono > Stereo > LV 0 glitch, is it? Because Relnqshd fixed that a long time ago. I think looking into the Ancient Cave armor issue should really be the last thing, judging by your report.

Thanks again for all the hard work, Rainponcho. :)
Check out and discuss my projects

Artemis

This is the music glitch:

https://www.youtube.com/watch?v=RVuiPL_j2cU

And there are also these glitches:

https://www.youtube.com/watch?v=lPOG4X94wQ8
https://www.youtube.com/watch?v=ohBPCIjCnsg
https://www.youtube.com/watch?v=vwra-3rLrpE


As this altogether really is a lot, so let's have a look at what's important.

The remaining boundary issues:
Completely not worth it, especially considering you said these ones are harder to do. I expect to be that Dragon Mountain one also to be somehow tied into the puzzle logic (related to the falling bridge, I guess). So I'd say it's the best to screw these.

Capsule Monsters feeding:
Also not that important because it doesn't do too much harm - aside from making the CMs some snobbish and obnoxious assholes. I'd say, skip it if it makes too much trouble.

Pot glitch:
Looks strange, but doesn't do any real harm. So, especially considering that it looks fixing it has the potential to destroy more than it actually fixes, this one can be skipped as well.

Lufia report glitch:
This one is a bitch because it totally spits on all your effort and invested hours to beat the Ancient Cave. So this should be fixed if possible.

Music glitch:
This one is annoying because it easily happens and doesn't go away unless you reset. So this one also should be fixed if possible.

Inn stay:
Not really a glitch because it just seems like an intentional safety measurement to ensure you always can refill your powers at all. Theoretically, instead of not touching your money at all, the inn keepers at least could take all the remaining money. But that's not really worth it. Let's just call it generosity.

Hook sound glitch:
Somewhat annoying but as it seems easily to cancel, so no real harm. Therefore, this one really isn't important.

Ancient Cave creation glitch:
This one is annoying as it can completely screw over your run. Especially annoying, if you found great stuff, but no Providence yet. However, I don't have any savestate for this one.

Arek intro glitch:
I don't care. If anything, it makes Arek even more mysterious, so it's actually not a bad thing, eh?  ;)
I'd say screw this one.

Ancient Cave chests:
Actually I'm undecided about this one. I say you can look whether you find an error that lets us make conclusions about how actually it was supposed to be. Then we can think about it again. If, however you don't find this kind of error, then let's skip this one, too.

That's all there is about glitches and bugs I think.
My silly RPG Maker 2k game (German language, and be warned: it's as trollish as Kureji Lufia):
https://www.mediafire.com/file/fe11rhmcd5ldo4o/Flannida_Tales_-_TPoD_-_v1-2.zip/file

FlamePurge

Rainponcho already provided two fixes for the Capsule Monster feeding glitch though.

Quote from: rainponcho on October 16, 2016, 10:59:29 AMCapsule Monster Feeding fix

Option 1 - 14908h @ fe 00 00
Yum = fussy + 1

Option 2 - 14908h @ ea ea ea
Yum = fussy + 0

Yuck = fussy - 1

(*) fussy = item craving level
Check out and discuss my projects

rainponcho

Quote
Lufia report glitch:
This one is a bitch because it totally spits on all your effort and invested hours to beat the Ancient Cave. So this should be fixed if possible.

Can you explain this one some more? So I understand it better? I know it sounds obvious but my gears aren't clicking.


Quote
Inn stay:
Not really a glitch because it just seems like an intentional safety measurement to ensure you always can refill your powers at all. Theoretically, instead of not touching your money at all, the inn keepers at least could take all the remaining money. But that's not really worth it. Let's just call it generosity.

They take all your money. :)


Quote
Ancient Cave chests:
Actually I'm undecided about this one. I say you can look whether you find an error that lets us make conclusions about how actually it was supposed to be. Then we can think about it again. If, however you don't find this kind of error, then let's skip this one, too.

B10 gives you aprons for armor? O_o

Artemis

These last two values aren't saved properly. As soon as you go game over or reset and re-upload your save, when you finally get your report it will display zeros in both cases - regardless of whether you were in the AC or even did beat the Master or not.

And so you did already fix the inn stay issue?
My silly RPG Maker 2k game (German language, and be warned: it's as trollish as Kureji Lufia):
https://www.mediafire.com/file/fe11rhmcd5ldo4o/Flannida_Tales_-_TPoD_-_v1-2.zip/file

rainponcho

Inn stay - take money
4165 @ 9c
416a @ 9c

Artemis

About the capsule monsters, what's the meaning of the h in 14908h?

And what exactly are the two options doing?
My silly RPG Maker 2k game (German language, and be warned: it's as trollish as Kureji Lufia):
https://www.mediafire.com/file/fe11rhmcd5ldo4o/Flannida_Tales_-_TPoD_-_v1-2.zip/file

rainponcho

#67
Normally game sets monster diet value to item rating.


Hex editor - go to rom offset 14908 hex.

You have two choices how to fix this (for items it wants to eat):

At 14908h, replace with FE 00 00. This raises monster diet rating by 1 point each time (regardless of item value).

Or replace with EA EA EA. This keeps monster diet rating constant - no affect when eating item, does not go up ever until next level.


Game deducts 1 point from diet rating when it gets a yucky item.



edit2:
Cancel the inn fix. Corrupts something else. Need to proper ips fix this later.


edit3: inn fix.
http://s000.tinyupload.com/index.php?file_id=67679743663245022817

My rom got corrupted somehow. So made clean ips.


edit4: Lufia report fix.
http://s000.tinyupload.com/index.php?file_id=06417180040781528965


note: Very tricky fix to make work. There appears to be 3 "unused" lufia report statistics bytes: 7e0b65, 7e0b66, 7e0b67.

Go to a church and save your game. It will now record the values for later loading.


edit5: Confirmed Ancient Cave armor generation is a programing glitch (from b10 basically).

Fills items at 7f:0000 = weapons, 7f:1000 = armor. Deeper you go, longer list becomes.


ex.
1000-108f - b4
a4-b9
e3-f1
10f-123
143-145 + 147-151


1000-10f5 - b9
a4-c5
e3-fd
10f-131
137
143-145 + 147-156 + 15b
169-16e


1000-1103 - b10
a4-c7
e3-fe
10f-133
137
143-145 + 147-156 + 15b
169-170


Eventually list gets larger than 255 bytes (2 bytes per item). Triggers overflow error (104h => 04h). So you get aprons or dresses. Possible list of items you get is hard-coded per level. I need to check B99 to see how large both lists get and make a hackfix.


upd6: ancient cave - armor generation fix
http://s000.tinyupload.com/index.php?file_id=09475236236981797273

You now get all sorts of stuff. Aprons are still possible on any floor, just very less likely now (B10 in particular).


upd7: Working on new cave fix. They use a multiplication trick that doesn't work perfectly with expanded item list - creates possible glitches.

Artemis

#68
Quote from: rainponcho on October 17, 2016, 07:45:18 PMPossible list of items you get is hard-coded per level.

Are you sure? It shouldn't be hard-coded for the red chests, but instead depend on some properties of the items themselves. Like the cheaper the shop price, the earlier they can appaear. Besides, there's one (or two I forgot) byte in the item code that can affect whether an item can appear at all.

Only blue chests should be hard-coded.

Or wait, do you mean the list of blue chest items which makes sure that these items don't appear as red chests?
My silly RPG Maker 2k game (German language, and be warned: it's as trollish as Kureji Lufia):
https://www.mediafire.com/file/fe11rhmcd5ldo4o/Flannida_Tales_-_TPoD_-_v1-2.zip/file

rainponcho

v2 cave chest generation fix. Make sure to revert the v1 above fix completely before using this one!
http://s000.tinyupload.com/index.php?file_id=44593571139705240064


Quote
but instead depend on some properties of the items themselves. Like the cheaper the shop price, the earlier they can appaear.

That's what I was aiming for but failed completely to describe. ;)

B50 seems to be nearly full - random selection pool (red chests).

Digitsie

Ok I've lost track of all the patches and will just wait for one comprehensive one. :D

rainponcho

v17 aio - applied on top of clean frue lufia headered rom. probably works on other ones by Artemis too.
http://s000.tinyupload.com/index.php?file_id=10966831243019290523


all working patches to-date. no experimental ones. there's not much left to work on so that's nice.

Artemis

Quote from: rainponcho on October 18, 2016, 07:37:45 PM
That's what I was aiming for but failed completely to describe. ;)

Do you completely understand it? Because there are some items missable which still are questionable.

Like the Fly Ax.
Setting B6078 from 60 to 00 should fix it.
Would that fix the issue without any other negative consequences?

Or the Zircon Armor.
However, the corresponding byte at offset B696E seems fine. So i don't know whether I fully understood it.
My silly RPG Maker 2k game (German language, and be warned: it's as trollish as Kureji Lufia):
https://www.mediafire.com/file/fe11rhmcd5ldo4o/Flannida_Tales_-_TPoD_-_v1-2.zip/file

rainponcho

#73
Fly Ax = b6077
+0 = 02  (bit 02 must be set!)
+1 = 60 (bit 20 must not be set!)
+5 = 26ac (item value) (early dungeon floors reject based on value)
+7 = 2401 (bit 01 = weapon pool)

These are basic conditions for adding item to rng pool #1. I have no idea what all these other flags, missing values do.


Zircon = B696D
+0 = 02
+1 = 00
+5 = d2f0
+7 = 2502 (no bit 01 = armor, shield, helmet, rings, jewels)

It gets added properly to rng pool #2.


At B98, there are [1]172h bytes in pool #2 (7F:1000-1171). 172/2 = B9 = 185 items.

Glitch would randomly give you {1}72h / 2 = 39h or 57 items.

DE - Zircon plate = given (7F:1070) - max item
DF - Zircon armor = glitch = not given (7F:1072)
E0 - Mirak plate = never given
E1 - Ruse armor = never given
E2 - Pearl Armor = never given



With the new chest fix you get all 185 items.

1CE - Tag Ring - cursed - 7F:116E
1CF - Tag Ring - uncursed - 7F:1170

7F:1172 = list end



Pool #1 @ 7F:0000 = {0}0B2 / 2 = 59h or 89 items.


Max limit is 256 items per pool. I have no idea if the game will punk you if you add more missing items like earrings or catfish jewel.

Considering that other stuff like walls, monsters, map layouts share (??) the space after these lists, it might not be safe. Aka tiny room, no stairs glitch.

But! Comparing B4 vs B50 vs B98, I think game seems to understand how much space was used for the rng lists and adjusts accordingly. So it might be okay.


edit:
Quote
Setting B6078 from 60 to 00 should fix it.
Would that fix the issue without any other negative consequences?

I think so yes.

Artemis

#74
So, the Zircon Armor wasn't given due to the glitch whereas the Fly ax wasn't given due to its item code?
My silly RPG Maker 2k game (German language, and be warned: it's as trollish as Kureji Lufia):
https://www.mediafire.com/file/fe11rhmcd5ldo4o/Flannida_Tales_-_TPoD_-_v1-2.zip/file

rainponcho

That looks correct.


Casino glitch - does this happen on real hardware? I checked with bsnes-plus-073.2 (debugger) several times and cannot get music to glitch out.

Dragon Egg Shrine is horrible with snes9x when casino bug happens - very noticeable right at the start with the bell hit.

Artemis

#76


And with 185 you mean only weapons and armor etc. (but no potions), right?

October 18, 2016, 10:34:10 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

Quote from: rainponcho on October 18, 2016, 10:28:10 PM
Casino glitch - does this happen on real hardware? I checked with bsnes-plus-073.2 (debugger) several times and cannot get music to glitch out.

Dunno. Might indeed be an Snes9x issue, then.
My silly RPG Maker 2k game (German language, and be warned: it's as trollish as Kureji Lufia):
https://www.mediafire.com/file/fe11rhmcd5ldo4o/Flannida_Tales_-_TPoD_-_v1-2.zip/file

rainponcho

#77
weapons (swords, axes, staffs, whips, spears, wrenches, bows?) are in the first list of 85 entries. This is not a hard limit.

armor (body, shields, helmets, rings, jewels, tag ring) are in the second list of 185 entries. This is not a hard limit.


There are assignment categories:
AE-FF = weapons list - variable limit
81-AD = armor list - variable limit

63-80 = spells - 23h items fixed limit
5E-62 = see 94:EEA0 - 29h items fixed limit
24-5D = potions (see 91:FFDC) - 09h items fixed limit
00-23 = items (see 94:F13D) - 1Fh items fixed limit


fixed limits can likely be adjusted, as long as you have space in that particular list.


edit:
These are the snes addresses for the fixed limits
83:915B = items limit (1F)
83:91AE = potions limit (09)
83:9193 = spells limit (23)
83:91C9 = ?? limit (29)


edit2:
By flipping the item's 01 bit, you can redistribute items between weapons / armor lists.

Artemis

So 00-80 is fixed limit and nothing here is changed at all compared to the original?

And which weapons/armor are now on the list of obtainable/unobtainable stuff? Is Dual Blade still unobtainable - as it should - for example?
Or to make that question easier - it's now solely dependent on the item code, right?
My silly RPG Maker 2k game (German language, and be warned: it's as trollish as Kureji Lufia):
https://www.mediafire.com/file/fe11rhmcd5ldo4o/Flannida_Tales_-_TPoD_-_v1-2.zip/file

rainponcho

Quote
So 00-80 is fixed limit and nothing here is changed at all compared to the original?

Nothing was changed by me for any of the fixed item lists at all.


Here's the process:
1) Game picks a random # between 0-255. Let's say 2F. Or 24. Or 5D.
2) Code says to pick a random item from the potion list. This is currently fixed at 9 items.
3) It picks another rng between 00-08. Say 05.
4) Potion list is looked up for item 05. That is added to the chest list.
Repeat this several times (let's say 10 items total).

5) Game now generates the map. But it only wants to add 4 red chests. So only the first 4 items selected are added to the dungeon floor.


I should mention that you can now have 256 armor items. But only 128 weapon items. Which I can asm hackfix to give 256 weapon choices also.


Quote
Or to make that question easier - it's now solely dependent on the item code, right?

Right. Item code determines when it becomes available.


Quote
And which weapons/armor are now on the list of obtainable/unobtainable stuff? Is Dual Blade still unobtainable - as it should - for example?

Yup. Didn't touch any of that. Only rng bug is fixed - actual rng itself remains exactly the same.


edit:
And I have no usable information on how maps are actually generated. That's a harder mystery. Or blue chests.