Final Fantasy Hacktics

Modding => War of the Lions Hacking => Topic started by: Nax on February 02, 2018, 07:18:02 pm

Title: Multiplayer Content Availability Patch [0.3.0]
Post by: Nax on February 02, 2018, 07:18:02 pm
Multiplayer Content Availability Patch

(https://media.giphy.com/media/l4pTdWER7xT9c48Wk/giphy.gif)

(https://s17.postimg.org/9m5lsdrmn/screen.png)

Hi Guys,

I just finished the first version of this patch and thought you may enjoy it.
The Multiplayer Content Availability Patch aims to bring the new WotL multiplayer-exclusive items to singleplayer.

This patch should only be applied to an US iso.

As of now, every item but the fell swords and the onion stuff (minus the onion sword) can be obtained.

Some of the items can be obtained by catching them from high level ninjas, the other by stealing them from high-level ennemies.
This patch aims to be as vanilla as possible, but certain changes to the old items were unavoidable (see changes).

Changes from vanilla WotL:

PSP Items:
* Moonblade can be thrown by level 97 ninjas
* Onion Sword can be thrown by level 98+ ninjas
* Francisca can be thrown by level 92-95 ninjas
* Golden Axe can be thrown by level 95+ ninjas
* Orochi can be thrown by level 97 ninjas
* Moonsilk Blade can be thrown by level 98+ ninjas
* Vesper can be thrown by level 96+ ninjas
* Durandal can be thrown by level 97 ninjas
* Gae Bolg can be thrown by level 95 ninjas
* Gungnir can be thrown by level 96 ninjas
* All other items can be stolen

PSX Items:
* Sasuke's Blade is now thrown by level 94 ninjas
* Koga Blade is now thrown by level 95 ninjas
* Save the Queen is now thrown by level 94 ninjas
* Excalibur is now thrown by level 95 ninjas
* Ragnarok is now thrown by level 96 ninjas
* Holy Lance is now thrown by level 93 ninjas
* Dragon Whisker is now thrown by level 94 ninjas
* The genji items can be stolen

Changelog:
* 0.1.0: Initial version, with the ninja throwing PSP stuff
* 0.2.0: Updated the patch so ennemies start with PSP stuff equipped.
* 0.3.0: Limited the generation of PSP-exclusive items, as way too many ennemies started with a full gear of them.

Technical Details:

For the ninja throwing, the patch modifies the following instructions:
At 0x89B1A58, change sb to sh.
At 0x89B1028, change lb to lh.
At 0x89b1030, change the immediate 0x100 to 0x13C.

The first two changes are necessary to make the throw command 16-bit aware on the AI side.
The last change is necessary to make the AI consider the new items as potentially throwable.
Please note that the first two changes are technically unsafe, as we move 16 bits in and out a field supposed to hold 8. However, the byte immediately after the thrown item field seems unused, so this should not cause issues.

For the enemies equipped items, I had to change way too many instructions to list them all, but it was mainly a matter of rewritting the AI equipement selection routine, and patching a lot of instructions that masked registers to 8 bits, so they mask them to 16 bits instead.

Have fun  ;)

EDIT: Added an alterative PPF based on a decrypted ISO. It is much smaller and work out of the box with other patches (like the slowdown fix).

EDIT 2: The 0.3.0 patch was corrupted due to a stupid PPSSPP bug, please use 0.2.0 in the meantime.
Title: Re: Multiplayer Content Availability Patch
Post by: Quantumpencil on February 03, 2018, 09:13:22 pm
This is great!

I wonder how difficult it would be to perform a similar hack for move-find-item rewards?

It might be possible to modify the 3rd and 4th bytes of each maps 16 byte move-find-item field to instead be one 2-byte value representing the 2-byte item type; I'm not sure where the routine that reads those bytes from battle.bin lives, though. If any of the four bytes which hold a maps move-find-item ids are followed by unused bytes, it might be possible to do something like this there as well.

This is pretty exciting.
Title: Re: Multiplayer Content Availability Patch
Post by: Nax on February 03, 2018, 09:34:40 pm
Thanks!

I am pretty sure it would be possible to find unused bytes and/or to make clever use of masking to encode the 9th item ID bit into the X/Y coords.
However, it would be harder than the ninja trick. The ninja trick work because the "Currently considered best item to throw" temporary variable is on the stack, between two 16 bits vars, or at least I think that's the case.
Because there are no unaligned access on MIPS, this 8 bit value had to be aligned on 16 bits, thus giving us new itemID compatibility for free.

I will surely check for a Move-Find Item "Treasure Hunter" patch, but right now the most promising target is enemy generation.
The "ninja trick" work on the enemy initial equipement generation too, due to an oversight. There is a buffer for candidate items allocated on the stack, but it's way too big: the game just don't have enough same-type items for a buffer overflow to happen, even with 16 bit IDs, so it should be safe. It's just quite long to patch, as the item ID is masked with 0xFF a bunch of times, and I also have to patch the item-stack increments (by 2 instead of one) and selection logic (so it doesn't just fall between two i16 IDs). I expect to produce a working version of this in a few hours. This would allow us to get every item but the fell swords (cannot be thrown, cannot be equipped by non-DK) and the onion stuff (cannot be equipped by non-OK, but the sword can be obtained via ninjas).
Title: Re: Multiplayer Content Availability Patch [0.2.0]
Post by: Nax on February 04, 2018, 02:26:06 pm
Done! The updated patch is attached to the first message.
Now the only missing items are the fell swords and the onion set minus the sword.

The planned way to make them available will be via Poach, but I'm open to suggestions!
Title: Re: Multiplayer Content Availability Patch [0.2.0]
Post by: Quantumpencil on February 04, 2018, 03:35:08 pm
Amazing work man

This makes one real advantage for the PSP version, since we now have the extra item slots to work with.

I'm eagerly awaiting your next release.
Title: Re: Multiplayer Content Availability Patch [0.2.0]
Post by: Wolfhart on February 05, 2018, 01:18:16 pm
Awesome work. I thought I won't plat FFT again anytime soon. You just made start it again. Thank you.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Nax on February 18, 2018, 03:06:35 pm
Upgraded the mod to 0.3.0

Now there is a 7 out of 8 chance that PSP items are ignored for enemy gear generation, independant for every item slot.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Zero Dozer on May 16, 2018, 04:17:00 am
Given what I learned from Eternal when we were talking about his FFT hacks, I know there's a massive catch to adding the Multiplayer items due to very few people here being interested in hacking the PSP version due to the problems with the extra (And half-assed at that) coding added to it. So, what items did you have to remove to put those into the inventory?

Makes me think Idea Factory got inspired by Square Enix when they decided to port Spectral Souls II to the PSP.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Nax on May 16, 2018, 04:42:25 am
I did not have to remove any item, that's kind of the point.
I patched the game code so it handles the 16 bit items ID more gracefully.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Zero Dozer on May 19, 2018, 07:43:50 pm
Think you could manage to pull the Onion Knight set into the game? (I know, an impossibility since it can't be thrown like the weapons, but still.)

If it's true, you may be the first fully successful person to bring at least a part of the Multiplayer-exclusive items into Single Player.

Oh, and you're also working at the Safeguard problem. I'm doing that work too on an editor, I'm yet to test the patch against Elmdore in the Riovanes Roof fight.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Nax on May 20, 2018, 02:08:53 am
QuoteThink you could manage to pull the Onion Knight set into the game? (I know, an impossibility since it can't be thrown like the weapons, but still.)


The mod does not only handle throwable stuff: since version 0.2.0, MP-Only equipment can be stolen from high level enemies.
The only MP-Only stuff that isn't obtainable in this mod are the Onion Knight set (minus the sword) and the fell swords.

They have the same problem: they cannot be equipped by anyone but their signature jobs, and there are no random OK or DK, ever.
And no, fell swords are not regular swords (like the onion sword) or knight sword, so they cannot be thrown.

I am going to include them eventually (maybe via Poach or otherwise) but I haven't figured out exactly how yet.

QuoteIf it's true, you may be the first fully successful person to bring at least a part of the Multiplayer-exclusive items into Single Player.


Looks like it  ;)
Making ninjas throw the weapons was not too hard, but making enemies be generated with MP stuff was very tedious, and I ended up having to patch the whole equipment generation routine.

QuoteOh, and you're also working at the Safeguard problem. I'm doing that work too on an editor, I'm yet to test the patch against Elmdore in the Riovanes Roof fight.


Not sure what you mean by that, as my patch does not touch Safeguard. I guess you mean that my patch provides a workaround for the fact you cannot steal the Genji gear anymore? Then yeah.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Nyzer on May 20, 2018, 02:49:05 am
Have you considered setting up a special Job that can equip Fell Swords, and sprinkling a few of those around random battles?
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Zero Dozer on May 20, 2018, 07:10:40 pm
Actually, you can still remove Safeguard from Elmdore in both his fights, and the new ones in the Beowulf sidequest as well. And Zombie Algus too. All with the help of an editor.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Nax on August 16, 2018, 03:00:09 pm
@Nyzer: I considered this, but I think it would be too much of a change for a mod that aims to be as vanilla as possible.
I will probably re-make this mod once the ModLoader is complete, as we could then directly give multiplayer items to enemies in the ENTD.

@Zero Dozer: Yeah, you can directly remove safeguard from Elmdore. I didn't, because using Multiplayer, you can get as many Genji equipment pieces as you want. I wanted to replicate that in the mod.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Caster on August 25, 2018, 04:51:23 pm
bro , can i ask i try patch booth your patch to my psp iso i get crash on formation screen bro , this patch for wotl psp right?
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Nax on September 01, 2018, 06:01:52 am
Hello,

Well, it's not supposed to crash.

Which patch did you use? The clean-EBOOT version or the full version?
You're supposed to either use the full patch on a retail WotL US iso, or the clean-EBOOT version on a decrypted (via FFTPatcher or another utility) US WotL ISO.

Maybe there is a bug in the patch itself, I barely tested it on real hardware. Gonna investigate.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Nax on September 01, 2018, 06:24:16 am
@Caster: The 0.3.0 patch was indeed corrupted, causing the crash. Sorry about that.

I'm gonna fix it. In the meantime, you can use 0.2.0.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Caster on September 01, 2018, 09:08:25 am
thx for relply bro , i use clean wotl us.iso bro , now i can trought the formation screen but now , iinstanly game over because no my party not have spirit , what wrong bro?? i donwload the iso from emuparadise..me  bro can u help bro what wrong ?
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Nax on September 01, 2018, 09:49:18 am
I am not sure I get what you mean, but you probably used your bad 0.3.0 iso as a base when applying the patch. please use a brand new ISO and apply 0.2.0 to it.
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: Caster on September 01, 2018, 10:29:07 am
SOLVED , .... Thx Big Bro ur the best :)
Title: Re: Multiplayer Content Availability Patch [0.3.0]
Post by: mosihara on August 14, 2022, 03:40:52 pm
Hello is there any update on the Fell swords and OK gears?