News:

11 March 2016 - Forum Rules

Main Menu

Mato Projects (mostly FF4/6 stuff)

Started by Tomato, April 21, 2020, 05:51:06 PM

Previous topic - Next topic

Kain Stryder

Nice work! I'm sure the community would love to know this. At least we can write that one bug off from the list now :D

Queue

#121
99.9% sure they're well aware (and have been for ~25 years). Most SNES emulators intentionally don't implement accurate timing requirements for the multiplier / divider because it's computationally expensive and doesn't matter for commercial games since they had correct delays before the result read; it only bites ROM hacks and new development tested against the emulators that don't bother delaying the result.

The multiplier needs 8 cycles maximum and the divider needs 16 cycles maximum. Note I say maximum; if the value to multiply / divide by is smaller, the result is computed sooner. Safe code will always just make sure there's the full delay before the read to avoid bugs. Emulators that do implement the delay may not implement partial / early results to match real hardware, either, so again, safe code waits the full time.

The cycle cost of the instruction decoding of the result read itself (LDY in this case) can be counted as part of the delay requirement because the decode occurs before the actual result read; that'll be 3 cycles in this case since it's a 3 byte long instruction.

Note the vanilla FF6 code has a much longer than necessary delay at 31 cycles = 14 * 2 (NOP) + 3 (LDY decode).

Your fixed code is barely safe; it's 3 (JMP) + 5 * 2 (NOP) + 3 (LDY decode) = 16 cycles.

Tomato

#122
Yeah, as I was looking into it, I came across talk about instruction cycles vs. master cycles and was in over my head. Luckily my fix worked regardless of it. I'm glad those NOPs were still there at least, they made for a nice, clean fix.

March 27, 2021, 05:34:03 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

How have people discovered the step counter bug in the past? Do they just go into the Achievement Room and notice that they've unlocked it somehow? Or do they just see a flag get set/message get displayed while walking around?

I ask because I wonder if it might somehow be related to missing NOPs again, although I don't know why that'd be the case.

Kain Stryder

#123
Just entering the achievement room to check progress and seeing it. I've had it unlock right at the start of the game with Locke and Terra personally, same with one streamer, and seen it unlock randomly between 80,000-180,000 steps for a handful of other streamers.

Some of the flags for achievements in there for costumes are also a bit wonky, but Tsushiy is aware of it or unable to address the issues. For example, when you unlock Edgar's costumes with access to the dressing room, he always has his first 2 unlocked since his "Chief" costume (Gerad) is opened with the quest for the dressing room completed, and his TAY Kain costume for freeing South Figaro from the empire during the banquet. Well, when you go and check at the npc, only the Gerad costume shows up, but if you go to the achievement room and see his statue/achievement, *then* his Kain costume is available. This applies to a handful of other costumes and I've made a note in the files telling players to just periodically check the achievement room if a costume doesn't appear after unlocking it.

Tomato

Okay, I've noticed that the game checks & sets the >200,000 steps taken flag when walking through this specific door.



The game actually only checks to see if you've gone over 0x030000 steps, so the achievement technically unlocks at 196,608 steps. It looks like it does a similar check but with money, so if there's a money achievement it might also have an "unlocks at a different number than what the achievement says" thing going on too.

Basically, the game checks the full word at $1868, which contains the high byte of the total steps + some other probably unrelated number. For some reason, this unrelated number is assumed to always be 0x55, so the achievement check actually looks to see if the word is >= 0x5503. If the achievement ever gets set off early, it's because you walk through that achievement door while that unrelated byte has mysteriously changed to something higher than 0x55.

In vanilla FF6, this mystery 0x55 byte would actually be the ID of the first item in your inventory. But it looks like Tsushiy moved the inventory data elsewhere, so I dunno what this 0x55 is used for. Maybe there's some leftover inventory code somewhere that still fiddles with inventory data in its original RAM location, and that sets the achievement off early.

Kain Stryder

Interesting. There's no money achievement, and the only items you can really have at that point are like Potions, Elixir, Dagger, Mythril Dagger, Buckler, Mythril Shield/Lance, Cotton Robe (drops from either the rats or bats in the mines), Leather Hat/Armors, and Phoenix Downs. I also wasn't aware it unlocked at 196,000 or so.

If that 0x55 thing was still the inventory, I believe usually Potions are the first item with auto-sorting, so perhaps having x number of them via farming may be the cause? I don't know otherwise. Nice find, though!

Serity

0x55 is one of... some sort of default values that it sometimes resets memory to (0b01010101). If you look through the memory in the 0x1400~0x1B00 block you can see just huge swathes of it, especially after starting up the game. For example, in my NMI Byte check to see what mode of the game we're in, I have this code:

local GameScenes = {
    Uninitialized = 0x555555, -- unloaded ram
    Cinematic   = 0x7E71BF, -- opening cutscene, narshe walking, world of ruin scene, etc
    Field       = 0xC00182, -- dungeons, towns, etc
    Battle      = 0xC10B8A, -- combat
    Menu        = 0xC313F2, -- any menu
    WorldFlight = 0xEEA500, -- flying on the airship on the world map
    World       = 0xEEA71F, -- walking on the world map
    MinecartCinematic = 0xEEA944, -- magitek facility minecart cinematic
}
function checkNMI()
    local NMIByte = bit.band(0x00FFFFFF,memory.readdword(0x7E1501))
...

Tomato

#127
OK, after some testing it seems that the old inventory bytes get filled with a bunch of stuff when on the save/load menus, and whatever the heck $1869 is supposed to have, it basically never re-initializes it. So the step counter achievement in FF6T is super unreliable and can be unlocked right at the beginning, just as you mentioned.

I've inserted a small workaround in my project to make the step counter comparison work right (by ignoring $1869 in the comparison). It's kind of hacky but it does the job right at least.

March 29, 2021, 02:31:20 AM - (Auto Merged - Double Posts are not allowed before 7 days.)

On an unrelated topic, does anyone know if there's a RAM address that holds the game's text speed/is used as a delay timer for drawing each letter of main dialogue? Currently, the game's intro text doesn't finish printing before each fade-in and it's kind of distracting.

Kain Stryder

I went ahead and asked a few of the guys who run some of the mods for FF6 for their input on that (Return of the Dark Sorcerer and Brave New World), as well as Serity. They aren't sure themselves, but this is what was discussed:

Spoiler
$BD-$D3 Dialog Text
-------------------
    $BD Current Dialog Character
    $BE Next Dialog Character
    $BF Text's Current X Position on Dialog Window ($04-$E0)
might be BF but uh idk really
i think it copies like one letter per frame or something like that


He could draw more than one per frame, but I don't know if he could draw the whole text box in a single one..
$BF is updated with ($BF + char width) each time you draw.

[close]

Otherwise, they're unsure or just don't know themselves.

Tomato

I've hit the part of Bank 2's text that's filled with music titles. I looked at the music player and some of its titles are kind of wonky and not what they're known by in English. I can anticipate that these will be a sticking point for some players, so I thought I'd run them by people here for suggestions/fixes/advice.
For reference, here's an FF6T soundtrack playlist I made years ago that might be out of date: https://www.youtube.com/watch?v=SltTStPo6WM&list=PL8fufren85t_HrXNDwPg6YEej9Lf5HIs4

It seems like some pieces of FF music have gone by multiple names over the years, so I dunno which ones are preferred over others. If anyone can offer help, please do!


KingMike

Quote from: Serity on March 28, 2021, 08:56:58 PM
0x55 is one of... some sort of default values that it sometimes resets memory to (0b01010101). If you look through the memory in the 0x1400~0x1B00 block you can see just huge swathes of it, especially after starting up the game. For example, in my NMI Byte check to see what mode of the game we're in, I have this code:

local GameScenes = {
    Uninitialized = 0x555555, -- unloaded ram
    Cinematic   = 0x7E71BF, -- opening cutscene, narshe walking, world of ruin scene, etc
    Field       = 0xC00182, -- dungeons, towns, etc
    Battle      = 0xC10B8A, -- combat
    Menu        = 0xC313F2, -- any menu
    WorldFlight = 0xEEA500, -- flying on the airship on the world map
    World       = 0xEEA71F, -- walking on the world map
    MinecartCinematic = 0xEEA944, -- magitek facility minecart cinematic
}
function checkNMI()
    local NMIByte = bit.band(0x00FFFFFF,memory.readdword(0x7E1501))
...

I know SNES9x uses 0x55 as the default RAM fill value (which on a real console should be assume random-filled). Does the game actually reinitialize unused RAM to 0x55 as well?
"My watch says 30 chickens" Google, 2018

Tomato

I'm not sure, but because the value in that address can and does change, I wasn't comfortable assuming it'd be safe for me to initialize myself. Luckily the problem is easily fixed with a few extra lines of code.

Kain Stryder

#132
Quote from: Tomato on March 31, 2021, 10:24:01 PM
I've hit the part of Bank 2's text that's filled with music titles. I looked at the music player and some of its titles are kind of wonky and not what they're known by in English. I can anticipate that these will be a sticking point for some players, so I thought I'd run them by people here for suggestions/fixes/advice.
For reference, here's an FF6T soundtrack playlist I made years ago that might be out of date: https://www.youtube.com/watch?v=SltTStPo6WM&list=PL8fufren85t_HrXNDwPg6YEej9Lf5HIs4

It seems like some pieces of FF music have gone by multiple names over the years, so I dunno which ones are preferred over others. If anyone can offer help, please do!

https://www.mediafire.com/file/fd0n3xfedo7c45d/bgm.html/file

Here's my take on the song names. I just used the official ones and checked the wiki/OST names for any I wasn't sure on.

The only ones I would argue on, from a translation standpoint, would be if you felt changing the "Tina" song to "Terra", the "The Empire "Gastra" to "Gestahl" etc etc, since alot of the FF6 songs official names use the Japanese character names. However, that falls into the "well the official name *is* Tina still... so..." it's a difficult choice. I don't feel there's really any wrong way but for my pick I just stuck to official and our dialogue script still calls her Terra, Sabin, etc.

In Final Fantasy XIV for example, they use the word Magitek (since the empire here is more or less 6's empire just with more Star Wars empire motifs), Terra's name is used for her song, yet Cyan's Theme is also used (the music title calling it that name), however, Cyan in this game is called by his Japanese name of Kaien (since 14 has its own version of Doma). So you have a mix of official English Woolsey terms here and then random official Japanese names thrown about.

Tomato

Thanks! I think what I'm going to do is keep the Music Player titles basically the same and then in the Dev Room's music room I'll have it display those titles along with actual translations of the original Japanese titles. It'll cover the best of both words, basically.

Also, I looked into the Rage achievement bug and added a fix for it. It's not a clean, ideal fix but it gets the job done safely, similar to the Step Count achievement fix I made. Incidentally, does the Tonberry rage really not do anything? It's weird that you can fill up the Rage list except for the very last one at the very bottom right. I assume it's the way it is now for a reason though, so I guess my current fix is fine.

Another question: that big painting in the far back, how do you get paintings for it? I can see the various options you can get just from looking at the script, but I'm not sure how to actually unlock the painting options in the first place.

Kain Stryder

The far bottom right is empty on purpose, there's no rage there in T-Edition. Tonberry in this does Everyone's Grudge (damage+chance of Death proc).

The far back room with the single portrait is for the FF11 paintings, they're unlocked via the Zilart/Divine Might battles. The NPC there rotates them for you to I think a Mandragora, then the several female heroines of the game.

Tomato

I'm working through the song lyrics section of Bank 2 script text. Many of these are already in English, but I've noticed a typo or two without even having heard the songs. So I thought I'd ask - do you know already if there are any other significant mistakes in the lyrics?

Kain Stryder

Not off the top of my head, no. All I know is the music player some of the names have typos (just honest mistakes since Tsushiy isn't fluent in English).

Tomato

I've taken a quick stab at the FFXI-related descriptions and I think I've got things correct, but since I've never played FFXI before, can someone more familiar with it fact-check these for me? (this is just a rough draft so there's weird phrasing, typos etc probably)

Ayame
FINAL FANTASY XI
Ayame is the fourth-ranked member of the Mythril Musketeers, an elite guard that serves the Bastokan president.
In Norg, Ayame undergoes training as a Samurai and eventually becomes the youngest Musketeer ever.
Her strict sense ofself-discipline is reflected in the words, "The katana exists to remain sheathed."


Curilla V Mecru
FINAL FANTASY XI
Curilla is the leader of the San d'Orian Temple Knights.
She is considered to be te finest swordsmaster in the kingdom, and is highly respected by her fellow knights.
Curilla injured her left eye while sparring with Prince Trion during a previous Sword Tournament.
However, she keeps this fact hidden to those around her.


Shantotto
FINAL FANTASY XI
Shantotto is one of the Three Professors of the Federation of Windurst.
As a former minister of the Orastery, she whips Ajido-Marujido into shape to become the current minister.
According to Hiwon-Biwon of Magic Paradise weekly, Shantotto is "as high-and-mighty as Yutungah's fiery mountain, and as rough-cut as the rocky Gustaberg Ranges-wanges."


Lion
FINAL FANTASY XI
Lion is a hume female from Norg who indepdently investigates the activities of the beastmen and Shadow Kindred.
She possesses a strong will and a cheerful personality.
Together with Aldo of the Tenshodo, the Dark Knight Zeid, and the Adventurer, Lion eventually facs off with a great evil that has operated from the shadows for 10,000 years.


Prishe
FINAL FANTASY XI
Prishe is an elven girl who lives in the Tavnazian Safehold and studies theology.
For certain dogmatic reasons, she was previously locked away in Tavnazia Cathedral as "the abhorrent one".
For a time, Prishe defended the citizens as one of the Safehold's patrol leaders.
After meeting the Adventurer, she eventually gets caught up in the conflict surrounding the Keeper of the Apocalypse.


Aphmau
FINAL FANTASY XI
Aphmau, also known as the Royal Puppeteer, is an innocent and pure-hearted Puppetmaster who serves Empress Nashmeira II.
She is accompanied by her friend Automatons, Mnejing and Ovjang.
In truth, Aphmau is none other than Nashmeira herself - the 16th Empress of Aht Urhgan's Majaab Dynasty.
However, the actual reins of government lie in the hands of her vizier and older brother, Razfahd.
While pursuing the Astral Candescence and a pirate ship, Aphmau learns the truth about the Empire.
Together with the Adventurer and the Pirate Luzaf, Aphmau sets out to prevent a Ragnarok war from occurring.


Lilisette
FINAL FANTASY XI
Lilisette is an elegant Dancer and member of Troupe Mayakov, a highly regarded dance group in Past Vana'diel.
As a particularly popular Dancer, she's commonly referred to as the "Moonshade Butterfly".
Just like the Adventurer, she has actually traveled 20 years into the past. By going back in time, she hopes to save her father.
At first, she pursues Cait Sith, a mystering being that might hold the secrets of Past Vana'diel.
As events progress, however, she and the Adventurer are caught up in a battle surrounding the Light Future and the Dark Future.


Arciela V Adoulin
FINAL FANTASY XI
Arciela is the younger sister of Ygnas, the Grand Chancellor of the Sacred City of Adoulin.
In front of others, Arciela carries the air of neatness, modesty and elegance.
The take-charge spirit she hides underneath, however, leads her to take action on her own, including investigating a forbidden forest.
As a direct descendent of the first king, she belongs to one of the Twelve Orders, but the people respect her and call her "Princess" anyway.
After the Adventurer arrives from the Middle Lands, Arciela eventually pursues the mystery of the Ulbukan continent.


Mandragora
FINAL FANTASY XI
A mobile, sentient plant commonly found in the Sarutabaruta region.
Whether it's their clothing, where they live, or their ability to communicate non-verbally, Mandragoran civilization is wholly unique.
Mandragoras could be considered a mascot of Final Fantasy XI.
They've since made appearancies in other releases, including Final Fantasy XII, the Chocobo's Dungeon series, and the Dissidia Final Fantasy series.

Kain Stryder

That's all spot on, having played FF11 for years I can assure you that's all correct, translations and all. Bunch of typos as you said, so just browse through to fix them :P

Tomato

#139
Since the music issues will be a big pain for people who aren't aware of them, I'm thinking of including a boot-up screen that mentions the issues, similar to what I did with my FF2c translation patch. Problem is, it looks pretty ugly and unprofessional right now:



This is all displayed in BG Mode 0 and is actual text data rather than a big image converted to tiles. If anyone has suggestions on how to improve this lemme know. I'll try to improve it on my own but I don't have high hopes, heh.