Print Page - Partial (yet extensive) rewrite of the PlayStation port
Board of Slick
Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: Gemini on January 14, 2014, 08:04:24 PM
Title: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 14, 2014, 08:04:24 PM
Time for a comeback! :laugh: So here I go again with my hacking of FF4 for the PSX, this time with some interesting new approach to the task, something that could also be a group effort because of the way I'm managing it at the moment. Briefly, I'm working on a code rewrite of the engine built on the PSX port made by TOSE, with the reworked code written almost entirely in C.
What does this mean? More power and ease of writing the code. :childish: With a C framework the hacking of this game is quite faster to carry on, as you can see from these pictures: (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/dsmenu1.png) (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/dsmenu2.png) (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/SCES_03840_15012014_020500_0738.png) (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/dsmenu3.png) These are to show you my personal reimplementation of the menu shell, completely made from scratch. Menus implemented so far are the following:
Root;
Inventory;
Abilities/Spell/Magic (this one has a little gimmick enabling the user to pick any spells from the list, even monster commands);
Status.
Visually speaking they are completely functional, however they lack most of user interaction. I'll be working on this as soon as I'm done gathering more information about how the game manages some of the key fields in data structures (getting that "To Next Level" value was a tough one; kudos to pinkpuff for the help!). Square did a real mess with data storage in this game. :/ I'll probably expand and rearrange some of the data if necessary.
What has been done so far on the coding side of the project:
Updated graphics, a combination of DS and GBA assets;
Font sets are rendered proportionally and with arbitrary screen coordinates, allowing much more text to fit and to be placed anywhere you wish;
Most text assets have been expanded and no longer pose any real limitations, removing entirely the issues caused by fixed length strings. They can also be arranged in packages, allowing support for multiple languages like on the GBA port (you can see this from the mixed languages in my screens);
Playable character names have been expanded to 8 letters with a simple 6-bit encoding;
Dialog banks are compressed using MultiHuffman, which means no byte goes to waste. ;P
And here's a couple older hacks I made in full assembly (I'm already rewriting most of these to C, don't worry): (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/dialogtestff4a5.png) (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/dialogtestff4a4.png) (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/testhudbattle8.png) I wouldn't really dislike replacing the entire GFX with that of the GBA port, which would not just improve the generally poor quality but also fix bugs with most emulators (notice the black stuff pretty much everywhere a transparency should apply). Also replacing the streaming sound engine with a proper tracker wouldn't be too bad, but I still need to decide whether to use the DS soundtrack (to which I already have a partially complete player) or the original one, maybe with slightly updated instruments. This last change would also allow for data to freely come from the CD-Rom unit, instead of using a huge block of data as a straight copy from the SNES rom.
My project would also include a full rewrite of some of the trivial stuff posed by hacking this game, such as spell formulas. This should give a hacker enough room to hack the engine in an easier way so that custom parts could be added at will with very little effort. For example, you'd be able to add extra spells, enemies, new commands, and change the general behaviour of the engine itself.
Everyone's free to contribute with code or information to build a more complete framework! :wink: Yet, the former contribution form isn't ready to go as I need to properly put up a google code page. :P An old revision of the code can already be found here (https://mega.co.nz/#!SRsgFArY!O0V_d1mdiUJFV5V1JDpcACrRzTwhPP1sMTQNBWu9CSc), but I'll provide soon a link with the latest stuff.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Grimoire LD on January 14, 2014, 08:44:49 PM
This is an an absolutely, positively, incredible undertaking you are on Gemini! so this would be an executable of FFIV then with all of the code written in C for people (with knowledge of C) to pick up, alter and add as they please then?
I must say though... I absolutely Hate the GBA Portraits, they looked Way too Western, (FFIV DS only a slight improvement in that regard) I personally think that FFIV for the SNES or FFIV Complete Collection had the best portraits.
Other than that I love how slick and smooth everything looks in the menus!
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: LordGarmonde on January 14, 2014, 09:04:47 PM
Hi Gemini! I remember seeing your early posts with pics of your first editor; impressive! :happy:
Time for a comeback! :laugh: So here I go again with my hacking of FF4 for the PSX, this time with some interesting new approach to the task, something that could also be a group effort because of the way I'm managing it at the moment. Briefly, I'm working on a code rewrite of the engine built on the PSX port made by TOSE, with the reworked code written almost entirely in C.
What does this mean? More power and ease of writing the code. :childish: With a C framework the hacking of this game is quite faster to carry on...
To quote Eric Cartman: "You bet your sweet clown ass it is!" - now C is something I have some history with :wink:
I'm in the midst of attacking the experience problem myself - doing away with the reference table all together and calculating it. But with C I can easily write up a formula to calculate TNL from current level. You can see what's been cooking on that regard if you are interested - but the C version would be infinitely simpler: TNL (for Lv. X) = aX4 + bX3 + cX2 +dX + e -- or something like that: very little to ask of C! :childish:
Anyway if you're interested I'll write it up sooner rather than later (I know I'll write it up eventually just 'cus) - It's good to see you here; to you I wish the very best of luck!
Oh to be able to ask of Assembly what I can C - but, challenge accepted!
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Pinkpuff on January 15, 2014, 03:59:57 AM
First off, this looks totally amazing.
Sadly though, using FF4kster with this will almost certainly be disastrous for your rom.
And... oh God, Huffman trees... I definitely understand the utility of them but I still get nightmares about those from trying to hack Jeopardy for the NES. I managed to figure out the tree by tracing the code, then found that the answers used a different tree from the clues... and then once I deciphered those I discovered I had no clue how to even go about looking for the pointers... it was a mess. But at least with this, you'll have that kind of information handy right? :wink:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 15, 2014, 05:31:11 AM
This is an an absolutely, positively, incredible undertaking you are on Gemini! so this would be an executable of FFIV then with all of the code written in C for people (with knowledge of C) to pick up, alter and add as they please then?
It creates a bunch of compiled binaries that can interact with the rest of the game thanks to armips' integration in assembly for hooking up the new code. It will still use the original executable for the most and original data when needed, but all the extra code will reside in separate and compact modules, and that's where the user can interact to make huge modifications to the game's behaviour. :wink:
Quote
I must say though... I absolutely Hate the GBA Portraits, they looked Way too Western, (FFIV DS only a slight improvement in that regard) I personally think that FFIV for the SNES or FFIV Complete Collection had the best portraits.
Portraits can be easily replaced with anything really. :happy: At the moment I'm simply converting them on-the-fly from a file stored with the SNES 4BPP encoding, but this can be changed to use proper bitmap images, even 8 bit ones if necessary. Branching from here is extremely simple because I made so that tiled pictures are assembled in a non-tiled manner and replacing sprite information is just a matter of populating a mapping structure. :D
I'm in the midst of attacking the experience problem myself - doing away with the reference table all together and calculating it. But with C I can easily write up a formula to calculate TNL from current level. You can see what's been cooking on that regard if you are interested - but the C version would be infinitely simpler: TNL (for Lv. X) = aX4 + bX3 + cX2 +dX + e -- or something like that: very little to ask of C! :childish:
Calculating said value in C was pretty much straightforward, other than for a few quirks with the way FF4 manages base level for a character. :P It took me a while to figure out what Square did there with those pointers. As for the TNL formula, this is what it looks like in my code:
// resolve the huge mess needed for calculating "to next level" values int Get_exp_to_next(PLAYER_DATA *p) { u32 cur_exp, prev_exp, need_exp; int cur_lv; LEVEL_UP_DATA *lv; u16 *ptr=(u16*)levelup_data; // take into account levels >= 70 cur_lv=(p->level>=70 ? 69 : p->level-1); // pointer to this char's level up table // NOTE: pointers are coded in a way that makes the base level useless because // 'garbage' level up data is counter already as skipped, meaning the pointer // actually counts from a point way below the start level lv=(LEVEL_UP_DATA*)&levelup_data[ptr[p->id-1]+cur_lv*sizeof(LEVEL_UP_DATA)-0xB500]; // cache variables cur_exp=MAKE24WORD(p->exp); prev_exp=MAKE24WORD(p->exp_prev); need_exp=MAKEHWORD(lv->exp) | ((lv->mp_gain & 0xE0)<<11);
// retrieve the correct value return prev_exp+need_exp-cur_exp; }Quite small, isn't it? :finger: And since there is a ton of room for new data, this could be expanded to make full level up tables for the entire cast, not just "start from lv X" ones.
Sadly though, using FF4kster with this will almost certainly be disastrous for your rom.
Yeah, I thought of this too, but there is a solution, although it could be awkward to realize: databases. Say, you could save most information in an expandable format as human readable data, like XML. You could dump data to XML and graphics to PNG/BMP, then open a project from there and transform the data into whatever form you desire, being it for the original SNES rom or smaller packages needed by my project. I'll give this a shot soon in order to dump all monster data to a database I will later use for a bestiary; I'll be using a structure that embeds all information for a monster in a single block of data with no shared attributes (i.e. drop lists can be updated to be unique).
Quote
And... oh God, Huffman trees... I definitely understand the utility of them but I still get nightmares about those from trying to hack Jeopardy for the NES. I managed to figure out the tree by tracing the code, then found that the answers used a different tree from the clues... and then once I deciphered those I discovered I had no clue how to even go about looking for the pointers... it was a mess. But at least with this, you'll have that kind of information handy right? :wink:
Mind you, I don't have any idea how this works exactly as I'm only familiar with regular Huffman. xD Kingcom sent me a wall of C/C++ code a long time ago with his own implementation, to test how MultiHuffman would perform on FF4; it did pretty well, even with no DTE or dictionary, but it's only natural as this algorithm was specifically intended to be used on text rather than any other types of data. Surprisingly, the actual decompression code used in game is quite small, like 50-55 lines of assembly at best.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Pinkpuff on January 15, 2014, 06:02:35 AM
Sadly though, using FF4kster with this will almost certainly be disastrous for your rom.
Yeah, I thought of this too, but there is a solution, although it could be awkward to realize: databases. Say, you could save most information in an expandable format as human readable data, like XML. You could dump data to XML and graphics to PNG/BMP, then open a project from there and transform the data into whatever form you desire, being it for the original SNES rom or smaller packages needed by my project. I'll give this a shot soon in order to dump all monster data to a database I will later use for a bestiary; I'll be using a structure that embeds all information for a monster in a single block of data with no shared attributes (i.e. drop lists can be updated to be unique).
Aw yeah, I love it! Just to make sure I understand what you're saying correctly, we could have some kind of agreed-upon "save file" format, different/separate from the actual rom, that both our programs could import/export from?
And... oh God, Huffman trees... I definitely understand the utility of them but I still get nightmares about those from trying to hack Jeopardy for the NES. I managed to figure out the tree by tracing the code, then found that the answers used a different tree from the clues... and then once I deciphered those I discovered I had no clue how to even go about looking for the pointers... it was a mess. But at least with this, you'll have that kind of information handy right? :wink:
Mind you, I don't have any idea how this works exactly as I'm only familiar with regular Huffman. xD Kingcom sent me a wall of C/C++ code a long time ago with his own implementation, to test how MultiHuffman would perform on FF4; it did pretty well, even with no DTE or dictionary, but it's only natural as this algorithm was specifically intended to be used on text rather than any other types of data. Surprisingly, the actual decompression code used in game is quite small, like 50-55 lines of assembly at best.
Oh yeah don't get me wrong, Huffman is super efficient! I know nothing about "MultiHuffman" but I assume it's probably even more efficient. But it's just such a pain for hacking ^_^;
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: LordGarmonde on January 15, 2014, 06:57:03 AM
Quite small, isn't it? :finger: And since there is a ton of room for new data, this could be expanded to make full level up tables for the entire cast, not just "start from lv X" ones.
Very true - that's nice bit of code - and with how simply that call is and space at your disposal I think you're right not to screw around. I'll confess that even in the original ROM with space constraints as they are - had it been a complete table I probably would have just let it go. On the plus side, since Square went all Kung-Fu Cut Man on it ('yikes' on that reference...) I had already filled in the blanks. Values should be pretty accurate - I used the averages from each character that actually had data for that interval (i.e. Paladin Cecil and Rydia for 1-4, then those two and Edward up through 9, etc.) but each value was adjusted based on how the compared to each other over they later intervals where the data did exist. Enjoy!
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 15, 2014, 07:27:52 AM
Aw yeah, I love it! Just to make sure I understand what you're saying correctly, we could have some kind of agreed-upon "save file" format, different/separate from the actual rom, that both our programs could import/export from?
Pretty much, yeah. With XML you define a more or less standard way to represent data, which can be manually edited and expanded at will. Here's and example of what I have in my enemy database:
Oh yeah don't get me wrong, Huffman is super efficient! I know nothing about "MultiHuffman" but I assume it's probably even more efficient. But it's just such a pain for hacking ^_^;
MultiHuffman is even more efficient as it uses a set of trees for each text bank, and each tree can branch to a different one depending on the contents of the string. In other words, Huffman on steroids. :happy:
Values should be pretty accurate - I used the averages from each character that actually had data for that interval (i.e. Paladin Cecil and Rydia for 1-4, then those two and Edward up through 9, etc.) but each value was adjusted based on how the compared to each other over they later intervals where the data did exist. Enjoy!
If those can be reformatted to a database of sorts I'm sure we can put them to good use. :laugh:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: LordGarmonde on January 15, 2014, 01:54:13 PM
If those can be reformatted to a database of sorts I'm sure we can put them to good use. :laugh:
I'll need to work up an XDS map for Excel to use in exporting the table as XML file. In the meantime the link below leads to a post on The Drawing Board with the whole table if you want to quickly grab/reference a number
Pretty much, yeah. With XML you define a more or less standard way to represent data, which can be manually edited and expanded at will. Here's and example of what I have in my enemy database:
Yup that's pretty much what I was picturing. FF4kster will still need a ROM file regardless because it gets all sorts of other information from there, including things like the font and menu graphics (so it's literally unusable without a loaded rom). But I can certainly picture something like "export project file" which will create an xml file based on the loaded rom or "import project file" which will read the xml file the user provides and alter the loaded rom according to the specifications.
That said, it probably won't be happening any time soon. It's still evolving at a fairly rapid pace (relatively speaking), and we're still discovering things about the game data that would cause us to have to revisit the structure for some objects fairly frequently. But it does sound like an ideal solution to the problem down the road.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 16, 2014, 07:45:22 AM
Having fun with a bestiary module: (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/SCES_03840_16012014_143813_0467.png) (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/SCES_03840_16012014_143837_0967.png) It's still a WIP, so don't mind the horrid layout and strings inconstantly flying all over the screen. I took some time to add a few things just for this one, that is archived files (instead of having a ton floating on my folders) used to store monster data for this. Currently this is using the GBA sprites for monsters and, again, PSP backgrounds (resized a little better than the older ones). Drop rates are recalculated so that repeated items stack in a single entry and generate a global percentage. Say, if you have 3 potions for a 25% drop rate, there will be only one potion showing in there with a drop rate of 18.75%.
Now, if I could get those threads to work this could use a lot of async stuff. :shadow:
I'll need to work up an XDS map for Excel to use in exporting the table as XML file. In the meantime the link below leads to a post on The Drawing Board with the whole table if you want to quickly grab/reference a number
But I can certainly picture something like "export project file" which will create an xml file based on the loaded rom or "import project file" which will read the xml file the user provides and alter the loaded rom according to the specifications.
That's the same thing I'm doing right now, in a manner of speaking. :finger: Currently dumping some of the data to XML, then I'll start adding tweaks. The bestiary thingy already contains some of these tweaks, like a description and custom fields.
Quote
That said, it probably won't be happening any time soon. It's still evolving at a fairly rapid pace (relatively speaking), and we're still discovering things about the game data that would cause us to have to revisit the structure for some objects fairly frequently. But it does sound like an ideal solution to the problem down the road.
No problem, there's no rush. :cycle:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: JCE3000GT on January 16, 2014, 05:51:07 PM
Definitely cool. I will follow this for sure. :)
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Dragonsbrethren on January 16, 2014, 08:50:46 PM
Wow, this is incredible work, Gemini!
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 17, 2014, 06:40:30 PM
I guess I'm getting kinda frustrated again by how this game stored every damn piece of information. :sleep: On to the problem: (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/SCES_03840_18012014_012902_0565.png) (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/rubicante.png) Now, while most of it is fine in my revision of the bestiary, there is something missing: the 'Magic' attribute. I have absolutely no idea where that is stored or how it could be calculated, since it's not part of the usual stats a monster has.
Here's what Rubicante's stats look like in my XML:
<Monster ID="187" Name="Rubicant"> <Stats lv="50" hp="34000" boss="1"/> <Attack mult="8" perc="70" base="80"/> <Defense mult="2" perc="25" base="3"/> <MagicDefense mult="8" perc="80" base="37"/> <Speed min="38" max="38"/> <Status type="0" atk_elem="0x00" atk_stat="0x0000" def_elem="0x41" def_stat="0x0400" weakness="0x00"/> <Gain exp="18000" gil="7000"/> <Drops id1="206" id2="206" id3="206" id4="206" rate="0"/> </Monster> Could the magic value be derived from somewhere else? Like the attack patterns and stolen items. No clue really, but I'd like this to be as complete as possible, so if anybody can help let me know. :shadow:
Meawhile I started adding more to the module itself, like the ability to switch backgrounds on-the-fly and a full scrollable list (a carbon copy of the usual bestiaries from FF Origins on). The information for the BGs is stored along with the order of the bestiary, meaning we can have the list to skip bogus entries such as scripted battles or dummy enemies. :childish:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: chillyfeez on January 17, 2014, 07:35:14 PM
Do you mean magic as in, what spells he can cast (as opposed to his magic power, I mean)? If so... hoo boy, are you in for a treat...
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 17, 2014, 08:05:04 PM
I meant both, but the spell power of a monster in particular.
Damn, I'm dumb. :tongue: I found the spell power by rereading my notes and I totally forgot to copy that bit of information from the extra flags, so the spell power went completely under my nose even if it was accounted for in the parsing procedure. One more bit added to the bestiary. Now I'd really like to parse dynamically all the battle script stuff about spells and make this almost as complete as the Chrono Trigger DS bestiary. :happy:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 17, 2014, 08:26:30 PM
I've been silently following your FFIV PSX project for some time and I really love it! While I enjoyed the graphical updates the GBA version got (Wonderswan Color, actually), the engine itself just didn't feel right. None of the remakes really managed to capture the pacing and fluidity of the original's battle system IMHO.
In terms of music my vote is for the original untouched - it's perfect! Or maybe an option? What about sound effects? They were somewhat muffled in the PSX version, weren't they? How exactly did TOSE manage to screw up the sound in every single of their PSX ports anyway, I wonder...
Looking at those Golbez and Rubicant sprites reminds me of something: You probably realize that some sprites were shrunk for the WSC/GBA versions and never made it back to their original size. Even in versions that provided enough space:
(http://imageshack.com/a/img560/1281/3sek.jpg)
Just yesterday I found out that the game "Final Fantasy: All the Bravest" has some of them restored to full size:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: koala_knight on January 17, 2014, 09:43:42 PM
Damn! This is a really impressive project! Kudos.
Using the original SNES music with upgraded samples gets my vote. I'm most looking forward to the ability to pretty much freely adding "custom parts". There are quite a few spells and commands I'd like to add.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 18, 2014, 07:10:32 AM
In terms of music my vote is for the original untouched - it's perfect! Or maybe an option? What about sound effects? They were somewhat muffled in the PSX version, weren't they? How exactly did TOSE manage to screw up the sound in every single of their PSX ports anyway, I wonder...
I haven't done much about sound, although I did get myself into a yet-to-be-perfected NDS SEQ tracker that plays most of the FF4 DS tunes more or less indecently. If that can be completed for good, we can use the tracker as a base to port over the SNES tunes and make them play with either original instruments or improved ones. The real challenge in this port is that TOSE didn't bother to use a tracker format for music and simply went streamed instead, locking the CD-Rom unit pretty much entirely. The other horrible gimmick they have in this port is that the entire sound library for SFX is stored inside a single, huge file always cached in the SPU RAM. In other words, they put in there a ton sound samples and made sure they would fit in 400 or so KB, butchering quality beyond redemption. :tongue: Fortunately this problem can be fixed when I'm done identifying most of the sound core aspects of the engine, so that a replacement with dynamic loading can be provided. This is how I'd store the sound fonts:
System samples that are always supposed to be in memory (i.e. cursor sounds, spells for menu, misc sfx from the field module);
Battle static samples, such as sword slashes, arrow hits, etc. In other words, a pool of samples that are always supposed to be there and cached when the battle module is running;
Dynamic caching of spell samples, loading along with new graphics as soon as a player finishes casting;
SEQ+VAG banks for music, cached as soon as a new tune starts playing.
Quote
Looking at those Golbez and Rubicant sprites reminds me of something: You probably realize that some sprites were shrunk for the WSC/GBA versions and never made it back to their original size. Even in versions that provided enough space:
(http://imageshack.com/a/img560/1281/3sek.jpg)
Just yesterday I found out that the game "Final Fantasy: All the Bravest" has some of them restored to full size:
I do remember some of the sprites going down in size even in other ports, like FFOrigins, but with FF4 it's barely noticeable. Not that I wouldn't like restored size while they retain improved color smoothness. :happy: My bestiary module can already take any size of sprites, as long as they fit in 256x256 pixel VRAM pages (they always fit :finger:). Heck, I could even put some of those to break the 16 color limit, like Zeromus EZ/EG.
I would also be interested in full sprite-sheets of players, but I couldn't find myself a decent way to rip them, other than grabbing a few from S-E's website. :/
Using the original SNES music with upgraded samples gets my vote. I'm most looking forward to the ability to pretty much freely adding "custom parts". There are quite a few spells and commands I'd like to add.
If I can add a way to replace spell formulas and sprite effects, this is definitively going into the project. :laugh:
:edit: I added something new to the mix: http://www.youtube.com/watch?v=xOr3cY3LiE8 Monsters now have a description, too. It is stored right inside their bestiary data, so the descriptions cache in real time and don't sink down my memory reserved for system strings. :happy: For those who can't open YT videos, here's what the bestiary looks like right now: (http://i239.photobucket.com/albums/ff233/Geminimewtwo/SCES_03840_18012014_182325_0157.png)
:edit: Moar news: I started slightly rewriting part of the way the menu works in order to split submodules into separate overlays (as I was running low on RAM space :tongue:) - should be extremely useful when item/magic usage code starts to get added in. I also took some time to drop most statically defined strings (i.e. function string parameters) and I replaced them with a proper system pool; messages are stored to an external chunk of data and can be rebuilt without the need of a source recompilation or huge #ifdef's in the code. This will be somewhat useful if anybody wants to make a localized version in other languages, plus it strips away all the string padding GCC bloats the binaries with. :cycle: When I'm done with string packages, all of them will be moved to independent files that can be cached and accessed at will from the CD-Rom unit, for example from a language selector.
By way, the bestiary is pretty much complete and embellished with some FF Origins icons. ;D (http://i239.photobucket.com/albums/ff233/Geminimewtwo/SCES_03840_19012014_175506_0828.png) I have no idea why, but it also loads much faster than its GBA counterpart, and I'm not even using compression. :wtf: Also, anybody willing to put together a nice list of monster descriptions? I'm totally not good at writing any of those - I may even end up describing Bahamut's lunar palace in detail instead of going background info on him.
And finally: (http://i239.photobucket.com/albums/ff233/Geminimewtwo/SCES_03840_19012014_182251_0757.png) (http://i239.photobucket.com/albums/ff233/Geminimewtwo/SCES_03840_20012014_015926_0337.png) (http://i239.photobucket.com/albums/ff233/Geminimewtwo/SCES_03840_20012014_015930_0636.png) Adding the last few menus left - headaches ahead, yay! :childish:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 19, 2014, 07:40:33 PM
Ah, so you too noticed the mobile version's new sprites! Were you able to get a complete sprite sheet?
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 20, 2014, 09:18:15 AM
I am aware of the new battle sprites, however I have only some of them, most coming from TAY. For example, Cid is just TAY's recolored to have a brown beard, and Golbeza (flashback) & Fusuya are identical to their FF4 counterparts. I would have dumped the graphics myself from the game, but apparently there's no data dump anywhere on the net, probably because i-mode games can't be dumped or something (or Japanese people don't like to share these :shadow:). :hmm:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 20, 2014, 01:01:36 PM
Yeah, I couldn't find much either - except for a few promotional screenshots... I fooled around a little, trying to port the new palettes and some additional elements back to the originals:
(http://imageshack.com/a/img690/9574/w1pl.png)
A complete set would non the less be very handy!
Regards!
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Grimoire LD on January 20, 2014, 01:05:36 PM
Gah, I am not a fan of super-pale Yang. It just seems to suck all of the character out of him. Is there anyway to marry the two style while keeping the original skin tone intact? Maybe something closer or akin to Cyan's skin tone?
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 20, 2014, 01:14:47 PM
Gah, I am not a fan of super-pale Yang. It just seems to suck all of the character out of him. Is there anyway to marry the two style while keeping the original skin tone intact? Maybe something closer or akin to Cyan's skin tone?
I get what you're saying, in terms of nostalgia factor. When I played the game for the first time as a kid, my English wasn't very good yet. So I figured he was some kind of robot due to his unnatural orange color! :childish:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 22, 2014, 12:36:08 PM
Also, anybody willing to put together a nice list of monster descriptions? I'm totally not good at writing any of those - I may even end up describing Bahamut's lunar palace in detail instead of going background info on him.
Is there some kind of official source for monster descriptions? I remember looking at one of those old Japanese guides: "FINAL FANTASY IV BATTLE ANALYSIS"
(http://imageshack.com/a/img138/9519/ixi8.png)
It looks like there beeing descriptions in there to me (not understanding Japanese at all). I see a "3" in the 2nd one - might be talking about the three heads possibly... :wink:
Regards!
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 22, 2014, 03:11:05 PM
According to that page, this is Remedy Bomb's description:
Quote
自分がピンチになると、「自爆」で相手も 道連れにする。早いうちに一撃で倒そう
Which roughly translates to:
Quote
When in a pinch, this enemy uses "Self-destruct" in an attempt to kill its opponents. Defeat it as quickly as possible!
Sounds like a good source of information. :childish: Is that official guidebook easy enough to find or to buy? I could use some good transcription of it.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 22, 2014, 03:31:55 PM
According to that page, this is Remedy Bomb's description:
Quote
自分がピンチになると、「自爆」で相手も 道連れにする。早いうちに一撃で倒そう
Which roughly translates to:
Quote
When in a pinch, this enemy uses "Self-destruct" in an attempt to kill its opponents. Defeat it as quickly as possible!
Sounds like a good source of information. :childish: Is that official guidebook easy enough to find or to buy? I could use some good transcription of it.
It seems rather available. Right now there are a couple on ebay, ranging from 15 to 25 EUR including international shipping! Not bad for what you would expect to be a collector's item...
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Grimoire LD on January 22, 2014, 04:39:29 PM
Interesting enough that data for the Balloon is all wrong! Haha.
The Balloon has 600 HP, not 697. 66x5 (90%)Attack Power - Not 72x6 (70%) 3x2 (45%)Def - Not 4x3 (60%) - (Good work in including evasions that have never done anything in any release by the way Guide!) 19x4 (60%) is correct
315 Gil is correct Though it gives 2480 Exp. not 2459
Chimera is correct.
The Black Lizard is only slightly off at 700 HP not 792. 62x5 instead of 64x5
45 Gil, not 43 and 1300 Exp. not 1298.
I wonder if this means that the game was slightly different at one point? In any case that old guide book looks quite interesting! Is there any full scan of it?
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: chillyfeez on January 22, 2014, 04:52:22 PM
Any chance ffivj has different stats for these monsters? Seems like a lot of work for no good reason, but I wouldn't put it past them.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 22, 2014, 05:00:20 PM
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Grimoire LD on January 22, 2014, 05:19:31 PM
Wow... I don't know what to say...? Why would Square opt to change such small insignificant numbers? It's not like a 100HP or +4 attack power will make the game any more or less difficult.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 22, 2014, 11:09:26 PM
(http://oi43.tinypic.com/2i76437.jpg) It took me a while to find some of the info in the GBA code, and some bits are still unknown, like the actual frame count for each sprite entry. If I can reorganize this better, along with town tile sets, most of the visuals in the game should one-up in a single blow. :cycle: Too bad I have no freaking idea how tile sets are loaded on the GBA; needs more debugging. :shadow:
:edit: Now working on a new rendering procedure for the field module: (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/SCES_03840_24012014_143212_0552.png) This is from Baron town's map. The drawing info about NPC seems to be stored at 7E:0900 and it follows this structure:
typedef struct tagNpcRender { u8 unk00; u8 id;// ? 0x20=continuos frame h-flip u8 movement;// 00=no movement u8 x_pos, x_tile; u8 y_pos, y_tile; u8 unk01[4]; u8 unk02;// doesn't do a thing u8 move;// u8 palette:4; u8 flip:4;// OAM flip flags u8 frame;// seems like a frame counter } NPC_RENDER;// located at 0x900 in ramI still need to identify most of this mess and also locate x/y screen coordinates, plus the actual map data in RAM. With these tasks out of the work table, I can pretty much ditch the SNES interpreter and render everything natively with improved graphics and performance. :childish:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 25, 2014, 05:15:26 PM
Oh wow, it's really amazing how deep you're going here! Especially since PSX hacks seem to be such a rare thing anyway. [...] OK, so I just had to double check - I think you were indeed involved in every single one I was aware of! :happy: It's been some time since I played the PSX version, but it did have the occasional slowdown, didn't it? I don't even remember it much, beeing disappointed with the porting quality I barely touched it... :sad:
Since Grimoire LD mentioned the choice of Portraits I'd like to insert something here: Couldn't help myself and searched for some more info on the mobile version. Now I realise that version has different Portraits as well. It looks like they touched up the GBA version's - it's hard to tell because of the poor quality but there's certainly something going on:
(http://imageshack.com/a/img706/5097/c91r.jpg)
Rosa GBA looks sort of disfigured in comparison, doesn't she?! And Rydia should have left the place where time flows differently a little earlier, hmm...
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Grimoire LD on January 26, 2014, 01:09:45 PM
Bah, they would... admittedly though the phone ones look much better. I hate a lot of the portraits for GBA. There was something endearing about that look of fiery determination on SNES Cecil's portrait that they just tried too hard on in the GBA port. His Mobile version is better, but that one looks a little too Asian. Rydia's GBA original portrait is Abysmal. That look of caution in her original portrait is absent and as you mentioned, looked like she's in her 30's. Rather than late teen-early 20's which is fixed in her other portrait, but she looks a little young there, but it is better at least.
Eh, I always thought their Edge was fine.
Rosa looks a Lot better than her GBA abomination, softer features, but something still looks off though. I don't like either of these Kain's though. They both pale in comparison the the SNES's darker take on Kain's portait.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: LordGarmonde on January 26, 2014, 01:32:17 PM
Agreed about Kain :tongue:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: chillyfeez on January 26, 2014, 02:24:41 PM
Rosa looks a Lot better than her GBA abomination, softer features, but something still looks off though.
It's that collar... She looks like she stole her cloak from a large-bodied pimp.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Dragonsbrethren on January 26, 2014, 03:53:42 PM
Personally, I'd see about getting an artist to touch up the original SNES portraits with more color. Maybe it's just nostalgia, but those were easily the best.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: JCE3000GT on January 26, 2014, 05:57:04 PM
Personally, I'd see about getting an artist to touch up the original SNES portraits with more color. Maybe it's just nostalgia, but those were easily the best.
^ What he said.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 26, 2014, 06:55:50 PM
The originals are pretty good for 7 colors, no doubt. The original twins are my favorites - original Palom is the most mischievous of all. I felt they looked a little babyish in the GBA version as well... The people who touched up the monsters should have done the profiles as well! But since that isn't gonna happen anymore I tend towards the mobile version as my new favorites, at least from what I've seen. (It should be said that this is a total daydream, Japanese fans obviously can't be bothered to preserve their stuff...) :tongue:
And it's true, Rosa really doesn't have that collar anywhere in the artwork... :celosa:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Dragonsbrethren on January 26, 2014, 08:13:38 PM
Actually, the WSC version and early shots of the GBA version did touch up the originals, but unfortunately also had to cut them down in size to fit the low screen resolutions.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Grimoire LD on January 26, 2014, 08:20:15 PM
I cannot agree with these sentiments more...
From Best to Worst...
SNES - PSP - DS - Mobile Phone - GBA
SNES retouched FFIV portraits would be fantastic.
As you mentioned nothing shows Porom's proper innocence and Palom's mischief in his eyes. To be fair though, no version has screwed up Dark Knight Cecil. It's kind of difficult to screw up a menacing armored face though.
@Dragonsbrethren, they did? Are there pictures of these nicer looking portraits?
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 26, 2014, 10:12:31 PM
Oh yes, I think I remember early GBA screenshots where they used the WSC portraits, right.
JCE3000GT has some menu screenshots at his site:
http://www.jce3000gt.com/ff4wsc_et.php
They use more colors it seems but it really doesn't jump at you. They did a better job at downsizing while still improving monsters IMHO.
And not just Porom's innocence, but that wiser than her years thing! Just one clarification: When I talk about what my favorite portraits are, I mean for this hack. There is some very nice artistic stuff in the later ones, but stylistically the mobile ones SEEM to be the best fit for this hack to me. (And I like Rosa's quite a bit - just like a princess) :happy:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Grimoire LD on January 26, 2014, 10:38:37 PM
That is another good find. You're right they did touch them up a bit, a shame they couldn't do more though.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 27, 2014, 05:51:17 PM
As long as they don't break the menu layout, any mugshot should really work, even the original stuff Amano created. :wink:
Meanwhile, in the land of dragon-clones: (http://i239.photobucket.com/albums/ff233/Geminimewtwo/Final%20Fantasy%20IV/SCES_03840_28012014_004534_0074.png) Cains, Cains everywhere! Slowly grabbings bits of information from the original rendering routines. I still need to figure out how the NPC status structure works exactly, but so far the result isn't too bad. :happy:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Deathlike2 on January 28, 2014, 01:41:20 AM
Rosa GBA looks sort of disfigured in comparison, doesn't she?! And Rydia should have left the place where time flows differently a little earlier, hmm...
Rosa looks like she needs a nosejob. Rydia got too serious.
Hey Gemini... what happened to the FF4 SNES/SFC revised/upgraded graphics that was supposed to be the GBA port's equivalent (the menus, backgrounds, etc.)? I haven't actually been keeping track of that.
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gemini on January 28, 2014, 05:51:29 AM
I actually worked directly on the SFC version only once, years ago. I think that could still be sorta done, but not without huge optimizations, like palette reorganization and better VRAM management. For example, injecting the improved battle backgrounds would required a massive palette search algorithm in order to compress 8 bit pictures to use no more than two palettes. :shadow: I do know more or less how the SFC code works, since it's what I use in IDA to decipher what the PSX counterpart does, but writing optimized code for the 65c816 definitively isn't my field of knowledge. :tongue:
Title: Re: Partial (yet extensive) rewrite of the PlayStation port
Post by: Gedankenschild on January 28, 2014, 07:28:55 AM
It doesn't have to be the GBA battle backgrounds. I actually experimented with porting back elements of the Wonderswan backgrounds, which are not bad at all. The SNES ones seem quite wasteful sometimes with lots of redundancy. Do you know how and where the tile layouts are stored? There does not seem to be any info on that in any documents I've looked at! I think there's a lot of room for improvent even with only two 8 color palettes if only tiles could be moved around more freely.