Bug Fixes

If you are stuck in the Dunan Unification Wars; or wish for more details on the gameplay systems, this is the place.
Post Reply
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Actually, that 10K cap in other games is the only reason I'd consider capping the experience at all. I don't remember if Konami had that in the third game, but I know it's there starting with the fourth. That Konami intended for characters to gain 60 levels in one fight seems unlikely to me. But, again, I see it as more of an oversight on their part, rather than a bug. It's not game-breaking, and you have to be very deliberate to get such extreme results.

Like I said, I'd probably do it as an optional tweak, or maybe part of a "hard-mode" patch.

Raww is right about the Amada glitch, I think. I'm still going to try to trigger it, but if I can't do it with a turbo-controller, I'm going to assume it's entirely impossible to do it under normal circumstances. Weird behaviors that arise when you alter processor speeds, frame rates, etc., aren't bugs. Timing is crucial in programs likes games. On consoles, designers can also depend on the hardware to be identical for all users, so they're more likely to rely on things like CPU clock cycles for timing than someone writing games for Windows would be.
Antimatzist
Posts: 2774
Joined: Sat Apr 19, 2008 9:48 am
Location: Germany, yeah baby
Contact:

Re: Bug Fixes

Post by Antimatzist »

Pyriel wrote:Actually, that 10K cap in other games is the only reason I'd consider capping the experience at all. I don't remember if Konami had that in the third game, but I know it's there starting with the fourth. That Konami intended for characters to gain 60 levels in one fight seems unlikely to me. But, again, I see it as more of an oversight on their part, rather than a bug. It's not game-breaking, and you have to be very deliberate to get such extreme results.
IV had it? I don't really remember - but it had still other means to get to Lvl 99.
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Regarding the Kindness Rune, does anybody have a save convenient for testing a fix? If not, I'll just dig up an old save, and see if I can get it to happen with a new recruit.

Fix Kindness Rune Bug
80088974 1821
80088976 0240

Some things to note: It looks like they intended the maximum bonus to be +127, while you can be penalized by as much as -128. The glitch operates because they treat negative numbers as huge positive numbers when calculating attack. I think they screwed really badly here again. If the hero is really able to get bonuses above 127, that implies that their dodgy bounds checking allows the value to overflow. It may be better to retain the +255 bonus that's already documented, and make it impossible for a penalty to occur.
KFCrispy
Global Admin
Posts: 6183
Joined: Wed Jun 30, 2004 3:29 pm

Re: Bug Fixes

Post by KFCrispy »

aw, why would we fix the Kindness Rune glitch :)
where do you see +127 was the intended max value...

you can use a time setting code activated by a button to keep changing time do a 1 second or so before the next hour so that each time you trigger it, the kindness value goes up. then you can easily test going beyond 127... using a stat stone on the character also increases the value

also, we got 255 as the maximum value.... someone at gamefaqs had actually verified it [searches for posts] .... here! http://suikosource.com/phpBB3/viewtopic ... 713#p97713
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Well, I don't know how he determined that, so it's hard to say what he was going by. I'm trying to work out Konami's intentions, rather than how it currently works.

They store the "Kindness" statistic as a byte, and treat it alternately as signed and unsigned in some circumstances. That alone makes their intent hard to determine. However, they return the value as a signed byte from the function that manages it, which means the value range will be -128 to +127. The only reason higher values are accessible is because they turn around and essentially use the value as an unsigned half-word when adding it into ATK. Additionally, when they add or subtract from Kindness, they do this check where they add 127 to it, and then check to see if the result is more than 255 (this is where it is treated as unsigned). That tells me the signed byte was most likely their true goal. It looks like they wanted to stop adding to it, once you reached 127.

The way the underrun works is:
  1. Character's initial Kindness is 0.
  2. Character is left dead at end of battle. Game adds -1 to Kindness. The result of this will be 0xFFFFFFFF (-1) in a register. It's then stored as a byte (0xFF).
  3. When needed, the Kindness value is retrieved as a signed byte. This puts 0xFFFFFFFF on the register (retrieving unsigned would be 0x000000FF.
  4. By and by, the ATK function takes the Kindness value retrieved for it, and ANDs it with 0xFFFF. This clears the sign bit, and turns the value into 0x0000FFFF or 65,535. it then adds this into the running total for the ATK stat. By all rights, you should have been penalized 1 point of attack. Instead, you're getting a bonus much larger than intended.
  5. Immediately thereafter the ATK value is set to 999 if it's anything greater than 999.
It actually looks like their attempt to limit the value to 127 is sound. Has anyone ever tried to max it out before, aside from doing the underrun glitch?

Edit: I found a guide on it that says the value goes up by one every hour on the half hour. I used a code to set the minutes and seconds to 29:59 (it can roll to 30:00 before the cheat engine can overwrite), and the value started going up every second. My hero's ATK without the Kindness Rune was 338. I let it run for about 15 minutes, just to be sure, but he topped out at 465. The maximum, intended bonus is indeed +127.

The code I posted previously may be sufficient to fix the glitch.

I managed to fix what I think is the last messed up song.

Fix Chant (Final Duel Song)
300ECFFF 0001

Edit 2: Part 1 of Trade Rumors Translation. This is the general idea of what I'm thinking of doing. Since they didn't update the UWASA files at all from the Japanese version, I'm left working with files drastically smaller than they ought to be. Short of expanding them, modifying the disc image, and repairing every file that contains seek data for other files (hopefully only the executable), there's not much I can do but try to work within the bounds of the file size provided. I want to look into the freer approach at some point, but for now, I'm just planning to work within the limits I have.

Even trimming the rumors down this far, and reclaiming space from duplicates (XREF column), I've still only got about 100 bytes to work with. Or more like 50, maybe, when you include end of line characters that will be needed, etc. The green number at the bottom is the actual number of bytes in the file allocated to text. The red number is approximately the number of characters required for the substitution strings.
Antimatzist
Posts: 2774
Joined: Sat Apr 19, 2008 9:48 am
Location: Germany, yeah baby
Contact:

Re: Bug Fixes

Post by Antimatzist »

だ。」 "There's business {eol} Gatsutari they do because of the vagina, military kingdom."
Best line ever. I love translation machines!
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Yeah, I found the machine translations hilarious, but mostly useless. I just wanted them as a quick bench-check to see if the text entries lined up.
User avatar
BadPotato
Posts: 170
Joined: Mon Feb 09, 2009 10:07 am
Location: Canada - Québec

Re: Bug Fixes

Post by BadPotato »

Pyriel wrote: [*]How do you get an advantage by configuring the Hero's party that way against Luca Blight? I've never heard of it before. I'll have to find a save and give it a shot.
Here the actual setup, before aggreed with Shu to deploy your troop, ask leona to get 6 character and then set your hero formation to the backrow/left slot. Then talk to Shu and he will ask for your hero formation, just leave it with your hero alone and at the formation setup you should be able to see your hero in the left backrow. After configuring your flicktor group, fighting him, the third battle begin and riou should be able to attack, but luca blight won't... he's just gonna to pass his turn, all the time. I think I saw a video once that suggested it was probably because luca doesn't have any attack that target the characther at this particuliar slot.
Pyriel wrote: [*]How do you equip a shield to someone who ordinarily can't? I'm aware you can do it with a cheat, or at least there's a cheat that prevents the crash that occurs when you do it. I wasn't aware it was a glitch in the game, though.[/list]
I might got mislead on this one... I remember that I did something weird once with either a shield or the blue ribbon, but saddly I can't remember anything.
Raww Le Klueze wrote:That can only happen with a tool assist, it's not a surprise that the game doesn't work if you break it's limitations. You might as well include the "bug" that you can only win 100 potch at a time in Chinchichorin if you use infinite money codes.
This is a common confusion to compare the tool-assisist feature with cheat code. When pushing the game to his "limit", this usually means that there aren't any enhancement such as particuliar hack, cheat, etc... we just spam button and then we let the emulator deal with it.
Pyriel wrote: On consoles, designers can also depend on the hardware to be identical for all users, so they're more likely to rely on things like CPU clock cycles for timing than someone writing games for Windows would be.
For the timming I'm more worried about how the emulator actually handle data from the CD than framerate, but I'm not an expert about it. So, yes we should alway keep in mind that the glitch from the emulator might be safe on real console.
Pyriel wrote: Raww is right about the Amada glitch, I think. I'm still going to try to trigger it, but if I can't do it with a turbo-controller, I'm going to assume it's entirely impossible to do it under normal circumstances. Weird behaviors that arise when you alter processor speeds, frame rates, etc., aren't bugs. Timing is crucial in programs likes games.
Well, it's quite an obscure glitch, so at worst it might be useful for documentation purpose. Thought if you really going to try it with a special controller, I suggest you to alternate L1 and R1 rather than "pressing X, wait 1 frame, pressing X, wait 1 frame, etc..." to skip text.

Some more and possibly negligible glitch:
- When you first encounter Eilie, Rina and Bolgan at ryube, if the hero has 1hp left and you let Eilie shooting a knife at you, you HP is set to 0. Usually when you die from battle the hp is alway come back to 1... I didn't test if this particuliar stat can cause some other obscure glitch, but I thought it was kind of funny, since it the only way to get 0hp outside of battle.
- You can freeze the game if you use the knockdown rune against Sierra in Tigermouth and manage to win while she is knockdown.
- There also this freeze glitch... it require the ability to wait a precise amount of frame and then press the up and down control in the same time. So yeah, I doubt it's currently possible on real console.

Also, I tried your BugFix(U)_0.2.0 patch and it synch well on my old speedrun. The gilbert battle sound good. This almost feel like a new game :shock:
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Now that you describe it, I think I have heard of that cheat with Luca before.

You're right, there's value in documenting glitches/bugs/oddities, even if they're minor or something I don't intend to fix.

I want to try that Eilie thing. I never noticed before that you lost a hit point. Do you have to move, or does any throw work? I expect that after your HP goes down, it'll be restored to 1 before anything bad can happen, or at worst, the hero will start the next battle dead. This is probably an "oddity". The only thing I could do is identify the script that ticks off the hit point, and change it to not take any. It might be possible to expand the script, and insert a check. I just don't think it'd be worth the trouble to preserve something that minor.

I vaguely remember hearing about the knockdown issue with Sierra.

Yeah, on a console it'd be difficult to impossible to trigger that bug. Although, you can mash down the entire directional cross at once. However, I'm not sure if actually hits multiple contacts when you do that. In any case, it shouldn't be possible to hit UP and DOWN simultaneously, so I can't imagine anybody's pad routines accounting for that. You probably threw the game into an infinite loop by generating a single state from two that should be mutually exclusive.
KFCrispy
Global Admin
Posts: 6183
Joined: Wed Jun 30, 2004 3:29 pm

Re: Bug Fixes

Post by KFCrispy »

hm i thought we had re-tested the Kindness bonus timing and found it was every HOUR instead of half hour.
the method used by __C_L_O_U_D__ (gamefaqs) was using Stat stones. he was stat pumping characters and determined the +255 max.

the steps you have about the Kindness calculation are a little difficult to follow for me but that's fine :)
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Well, I can try again, and add stat stones into the mix. I think if he was able to get it higher, he must have been using STR stones and not accounting for them. There's only one Kindness Rating per character, and everything about how it's handled says it's a signed byte/8-bit value. Anything over 127 should be impossible. But, if he knew what he was doing, and made the mistake of throwing in even one STR stone, he might have called it 255 as soon as the bonus appeared to hit 128 or above. GameFAQs drops topics so quickly, we'll probably never know now.

Regarding the calculation, the simplest way I can put it is, if we created a completely arbitrary system where A=0, -A=0, Z=65,535 and -Z=-1, if you destroy the sign, you completely change the value. If I say "A + -Z", and you miss the negative sign, the result is way, way off. That's almost what happens. Really it's kind of a hardware and representation thing. In terms of a single byte, 0x80 can be 128 or -128, depending on how you want to handle it. The PSX works on 32-bit registers, so it has to use the 32-bit representation of the number when it operates on it. So if I say I want to take the byte from address 1 and put it on a register as an unsigned value, it'll just load 0x00000080, and away we go. If I need it signed, it has to propagate the sign to the unused register bits in order to retain the value. So loading 0x80 as a signed value gets 0xFFFFFF80 on a register, i.e., the 32-bit representation of -128. If I was to dumbly turn around and zero out some of the bits, I'd completely alter the value. That's what Konami does. Instead of just adding negative whatever, as it was retrieved from the Kindness Rating function, they clear out the sign and a big chunk of the other bits, and leave themselves with a completely different value.

Edit: Nope. Ran it up to 127 again and then started pumping stat stones (Luck). I did six or so, and never once did his ATK even consider going up.
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

After some more testing, it looks like the code I posted before will "fix" the Kindness Rune issue. The only thing is, it's nigh impossible to determine what the developers' intentions were in allowing the number to go negative. Clearly, they didn't want it to go negative and confer a huge bonus, but the way they programmed it, I can't tell if they wanted the penalty to be simply no bonus until you've been kind enough to the character, or if they actually intended to subtract from ATK.

Points in favor of ATK penalty:
  1. They use the same number for the Kindness Rating and the ATK bonus.
  2. The management function for the Kindness Rating can return a negative value. If they intended the penalty to be only "time until bonus restored", they could as easily have returned 0 when it's negative.
  3. The ATK calculation allows for the possibility that ATK will become less than zero after adding in bonuses. (It sets it back to zero in that case.)
  4. Without an ATK penalty, it's impossible to know just how "nice" you have to be to a character to restore the Kindness Rating.
Points against:
  1. The ATK calculation looks like it expects an unsigned, 16-bit value for Kindness Rating, rather than the signed 8-bit value it receives.
  2. Using the same value could just be a convenience, and the ATK calculation should have been "if(kindness > 0) then ATK + kindness".
  3. Whoever wrote the management function for the Kindness Rating may have just assumed that other programmers would want access to the actual value, and would make their own decisions about how to use it.
Anyway, my best guess is that they intended to penalize ATK. The idea of zero penalty, aside from the time it takes to raise the number past zero, hinges on the ATK calculation acting like it expects an unsigned 16-bit number. That looks to me like a mistake, or a miscommunication that occurred in development. Beyond that, it only seems right that unkindness should have a cost.
User avatar
BadPotato
Posts: 170
Joined: Mon Feb 09, 2009 10:07 am
Location: Canada - Québec

Re: Bug Fixes

Post by BadPotato »

Pyriel wrote:[*]Without an ATK penalty, it's impossible to know just how "nice" you have to be to a character to restore the Kindness Rating.
If we remove such penality, I thought we would be setting back the kindness level at 0 if it go bellow zero. No?
Pyriel wrote:[*]The ATK calculation allows for the possibility that ATK will become less than zero after adding in bonuses. (It sets it back to zero in that case.)
There several rune that give you malus in a specific stat, but then give you a greater bonus for an another stat.. but I don't remember any rune where you can attach to a character and simply give you a malus without compensation. So I guess it probably wouldn't follow game developper idea to give you an item, that could simply penalyse yourself.

Also, would it be possible to get a character with negative ATK, if the character already had poor stat? What happen when you get bellow 0 ATK?
Pyriel wrote:Now that you describe it, I think I have heard of that cheat with Luca before.
It might be better to not call it a cheat, since it can be done without gameshark or anything external device. Maybe I wasn't clear enough when explaining, but if this is still too confusing, I could do a video about it.

Oh, and some more glitch:
-Get your heal restored when asking for saving your game at the Inn, but then cancel right away.
-Abuse rune unite MP cost (gamefaqs)
-Also there seem to be some bug related to the Greenhill liberation that end the game very early, see those post : (post1), (post2)
(Unfortunately, there aren't enough info about the requirement in order to trigger this glitch)
-Getting chaco level 1, when you refuse him for joining you.

edith: typo
Last edited by BadPotato on Sun Nov 20, 2011 7:02 pm, edited 1 time in total.
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Yeah, it is true that an hour is a long time to wait (it might only be 30 minutes, but either way), just to rebuild one point of Kindness. It is also unusual to have an item give only a penalty, without being some kind of explicit "curse", but the Kindness Rune is fairly unusual to start with. Its effect is not well-explained, grows according to odd rules, and 13 years ago, it might have been a total mystery why it gave 0 points to Pesmerga, and 25 points to Nanami. The way I see it, getting -2 isn't that much more confusing. And if you let Chaco die 15 times, and you don't like having his ATK lowered by 15 points, take it off and put it on someone else.

That said, I'm open to alternatives on this. I really think it most likely that a penalty was intended (say 70% vs. 30% likelihood). Since the developers couldn't do it right, I can see fixing only the 999 part of the bug, and making the minimum modifier 0, regardless of how far negative the Kindness Rating goes.

I understood the Luca thing just fine. I mainly called it a cheat because the place I remember reading about it was the "Cheats" listing on GameFAQs. Chaco, and the Inn are part of the list. Thanks for the reminders, though. I'll add the Rune Unites as well, but man that's fiddly.

On the GreenHill thing, people reading this thread can maybe keep an eye out for it. Considering how many issues there are with this game, I can't claim much confidence that such a bug is impossible. It's just, like you sort of said, there's nothing much to look into. Two isolated and vague reports, four years apart, aren't useful for debugging. I will say--and this might sound a little bigoted, but it's not intended that way--the first guy comes from Singapore, and a good percentage of games bought in that part of the world are pirated duplicates. The consumers aren't even necessarily aware of it. When I moderated the CodeBreaker forum, scores of people from the Philippines, Malaysia, Indonesia, etc. popped up to report problems, after having bought copies of leaked beta software that was being sold in brick-and-mortar stores in official-looking packaging. Hell, the second report might be the same guy, or since they're four years apart, he might have bought his used copy from the first guy.
KFCrispy
Global Admin
Posts: 6183
Joined: Wed Jun 30, 2004 3:29 pm

Re: Bug Fixes

Post by KFCrispy »

the Luca thing is basically the ability to abuse enemy AI / poor programming (similar to abusing Firefly Runes, Skunk Runes, and Blue Ribbons). it's not a bug like a door is movable giving access to an unintended area, an item doesn't drop because the checks are wrong, and a song isn't playing
Post Reply