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
Raww Le Klueze
Global Admin
Posts: 1915
Joined: Sat Jun 26, 2004 1:38 am

Re: Bug Fixes

Post by Raww Le Klueze »

I never bring Gadget anywhere so I've never seen it.
Doctorum Non Urina Singulus.
User avatar
Cloud_Mc_Rip
Posts: 8
Joined: Thu Sep 25, 2014 7:44 am

Re: Bug Fixes

Post by Cloud_Mc_Rip »

German Version
  • While defending Two River, you have to fight against some Highland soldiers. Then you get to make a choice between going to the Kobolds or to fight against more Highland soldiers. The game seems to crash after the last of these fights.
I have made a video to show up this bug.
Here: https://www.youtube.com/watch?v=Dxx5Ll2 ... e=youtu.be
:arrow:
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

It's hard to tell in the video, but does it let you scroll down a third time there, or is the text glitching the minute you press anything at all?

There's a weird thing with some selection strings where rather than being two separate strings, they're one, long, oddly formatted string and the presence of a newline character seems to separate choices. I wonder if they hosed this one up trying to get it to look pretty in the dialogue box. The bottom string is also missing the ending double-quote, so maybe they overran the string and unwittingly mangled the first pointer or two in the next array of string pointers.
User avatar
Cloud_Mc_Rip
Posts: 8
Joined: Thu Sep 25, 2014 7:44 am

Re: Bug Fixes

Post by Cloud_Mc_Rip »

Pyriel wrote:It's hard to tell in the video, but does it let you scroll down a third time there, or is the text glitching the minute you press anything at all?
Yes it does, it only appears when you choose an awnser. The text is at the moment glitching when you can choose an awnser.
You can scroll up and down but if you choose an awnser, the game will freeze after Lord Ridley appears with his troops.

The Hero can choose two awnsers:
[ "Wir haben noch nicht
verloren, Lord Makai." ]
[ "Es besteht immer noch
eine Chance." ]

After this showed up, you can only see:
[ ÄE'[]^KLV^[]RE *[]LV^d Makai."
"Es besteht immer noch eine Chance.
Pyriel wrote:There's a weird thing with some selection strings where rather than being two separate strings, they're one, long, oddly formatted string and the presence of a newline character seems to separate choices. I wonder if they hosed this one up trying to get it to look pretty in the dialogue box. The bottom string is also missing the ending double-quote, so maybe they overran the string and unwittingly mangled the first pointer or two in the next array of string pointers.
Yes, that's my thought too.
:arrow:
Antimatzist
Posts: 2774
Joined: Sat Apr 19, 2008 9:48 am
Location: Germany, yeah baby
Contact:

Re: Bug Fixes

Post by Antimatzist »

The bug at Two River is the same with Valeria/Kasumi, btw. I mean the same cause, a line too much.
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Would either of you be able to supply a save file close to that point?
Antimatzist
Posts: 2774
Joined: Sat Apr 19, 2008 9:48 am
Location: Germany, yeah baby
Contact:

Re: Bug Fixes

Post by Antimatzist »

I'll see if I can get it done this week.
STARWIN
Posts: 29
Joined: Thu Sep 03, 2015 8:48 am

Re: Bug Fixes

Post by STARWIN »

there might be a bug somewhere according to http://forum.fobby.net/index.php?t=msg&th=1285&start=0& near PC=8003e44c. Though it is a bit strange if no one else had triggered such a common one (at least if this works fine on hardware).
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

OK, getting my account back happened more quickly than I thought it would. Could a mod just delete the post above?
:arrow: Celes: Done.

Yeah, it's a bug in the patch. I had my assembly directives in the BP0_SEC version of the Character/Rune Speed patch set to:
.org 0x8003E428
.area 0x8003E44C-.

When they should have been:
.org 0x8003E42C
.area 0x8003E450-.

It started writing new operations one operation too early, which would have been fine if it hadn't caused the "debug trace" Konami has in there to store the destination address when it does a "jump to register" operation to be left in place. As it's not replaced, and part of the patched code involves using the register that holds the location of the trace variable, it winds up storing to a location in kernel RAM, which will likely be unaligned and cause an exception to be thrown. You'd have to play on real hardware, or an accurate emulator, use magic in the second round or beyond, and it would have to be some spell other than the first on a Rune to see the issue.

I pushed an update to GitHub that should fix it.
Metsu
Posts: 66
Joined: Wed Apr 15, 2015 9:27 am

Re: Bug Fixes

Post by Metsu »

Great stuff, Pyriel. I like reading through some of this stuff, interesting bits! I wish I could help out but it would take some time for me to learn IDA and looking at the files themselves. I only excel at breakpointing memory and following the RISC assembly while the game runs : /
Metsu
Posts: 66
Joined: Wed Apr 15, 2015 9:27 am

Re: Bug Fixes

Post by Metsu »

I was just playing around today with reading and figuring out each of the rare finds timers/shop values and think I discovered something I'll have to debug later. I noticed if I freezed the shop access time to 00 (last accessed none basically or 0:0:0), and froze my time to 00:XX:00 for minutes, that the shop would refresh as low as 21 minutes. I tried for a while on 20 minutes and did not trigger it. So it could either be a better chance based on the amount of minutes, or 21 minutes is the lowest value. It will be real easy for me to breakpoint on that memory read but I wasn't interested in that at the time. Just wanted to check out which store was what, and what they sold of course. :)
Omnigamer
Posts: 324
Joined: Wed Feb 13, 2013 11:48 am

Re: Bug Fixes

Post by Omnigamer »

If it works anything like the Trading Shop code (I'm guessing it does), each shop has a different refresh rate. If it works exactly like the Trading Shop code, then each item in the rare finds list also has a separate refresh rate (based on experience, I think this is less likely). All it does is store the total in-game minutes (I have the address somewhere at home; it's counted separately from the actual timer) of when you last accessed the shop and compares it the next time you check it. Even if it doesn't refresh, the "last checked" variable is still updated to your current minutes.

It sounds like the store you are at may have a refresh time of 21 minutes, which is pretty reasonable. Most people assumed that refreshes happened at 30 minute intervals or so. That said, enumerating what each of the different shop refresh times are is certainly useful information to have.
Metsu
Posts: 66
Joined: Wed Apr 15, 2015 9:27 am

Re: Bug Fixes

Post by Metsu »

Pyriel provided what he thought the start of those timers were, and from there I found all the Muse city shop timers and equipment. I think you're right about the timer per shop. It's one two byte number for the amount of game time in minutes only. It only refreshes this value the second you leave the buy/sell/rarefind menu. Oddly enough, it does it even if you haven't waited long enough! So seems to me if you had a 30 minute shop refresh time, and you checked it at 25 minutes, you just screwed yourself over with 30 more minutes of waiting. But I'd have to confirm that.

I'll have to stop being lazy and just use the other emulator to breakpoint that address and follow the assembly code to find out if it's a fixed or per Shop number.

I did notice they are not organized well as all of the Muse shops were pretty far away from each other in memory. But maybe it's organized by all armor shops, then rune shops, etc. I'll travel around the world and check each shop one by one. From the bytes, my shot-in-the-dark guess is 68 different stores and timers. For reference, here are the locations for the three I've found so far:

8006a59e (#26) = muse item shop: leggings, flaming arrows, sun badge, recipe #35
8006a604 (#43) = muse armor shop: earth armor, none, none, none
8006a652 (#56) = muse rune: water, fury, none, none

The byte format is just like Pyriel said. Six bytes each:
2 byte integer for the gametime represented in whole minutes since last checked
1 byte x 4 = item quantities of predefined items

You can add 1 to each quantity to force the shop to show you all it's rare finds, but you must do this before the menu is up, and after you close it because it overwrites these values on closing the menu.
User avatar
Pyriel
Webmaster
Posts: 1229
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

0x8006A61C must be the start of the Rune Shop timers then. As I recall, I got that address from a base value used in one of the routines, e.g., (0x8006A61C + 6 * index). I can't really think of a good reason for having separate routines for that purpose, but who knows.
Metsu
Posts: 66
Joined: Wed Apr 15, 2015 9:27 am

Re: Bug Fixes

Post by Metsu »

So I followed the error in assembly for that double rune shop. Gregminister's error is pointing to the Muse City #1 Rune shop. And I say #1 because there seems to be multiple versions of Muse or at least the shops. But the one it's pointing to is the early game rune shop. At least it loads up the items correctly and at the point you get to Gregminister, that Muse shop is long gone and using a different set so it's not a bad bug. Maybe an exploit if anything.
Post Reply