øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=426.0;prev_next=nexte:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf6ce.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=426.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf6ce.html.zx¨wg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0°jÓOKtext/htmlISO-8859-1gzip@øÕÓÿÿÿÿÿÿÿÿTue, 10 Mar 2020 11:35:28 GMT0ó°° ®0®P®€§²ð®¨wg^ÿÿÿÿÿÿÿÿ#Ó FF2/4 SNES: Turns out not-in-party characters DO gain experience!

Author Topic: FF2/4 SNES: Turns out not-in-party characters DO gain experience!  (Read 4608 times)

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
The discussion for this topic started here, but since other things were discussed after those posts, I thought I'd start a new thread for this.

While play-testing my hack, I noticed one of my characters coming back into the party with some funky weapons equipped (7 arrows in one hand and a claw in the other -- very dangerous).  :lungs:  I traced the data change back to finishing a battle, at which point I figured the shadow data must be modified when battles finish. The only logical explanation for this was: not-in-party characters DO gain experience, contrary to what I previously thought.

Fortunately I found I had stashed the ASM routine away for experience adding when finishing a battle, and after combing through it for a bit, I verified that experience does get added to characters stored in shadow slots (as well as levels being increased and the experience modifiers being changed). The amount of experience added is the same as what in-party characters get, which means the total experience divided by the number of characters in the party.

Luckily for me, it was a one-byte fix to make sure that experience only got added to party members. In my hack, I only want party members to gain experience; plus I'd have to heavily modify the subroutine to calculate the right positions in RAM for my shadow character's experience addresses. So I'm glad it was a relatively easy fix -- it already cost me a few hours to figure out what was going wrong and how to fix it.
 :tongue:

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF2/4 SNES: Turns out not-in-party characters DO gain experience!
« Reply #1 on: October 01, 2009, 10:58:18 PM »
This was never new news though.

The way FF4 works was always that once the game "created" the character (that means, they join your party), they would continue to gain EXP even after leaving your party. All (at time, I believed it was 100%) the EXP you would get while they were away would allow them to keep pace with the others. However, it didn't really resolve it well (if you overlevel the twins like I do, I get a better Kain, Rosa, and Rydia).

IIRC, this always explained how FuSoYa's HP would scale for the final battle.

For FF4A, all the character's data are stored (instead of the 5 character limit)... including those that never come back. This specifically affects Tellah (despite him going away forever) and DK Cecil... not that it ultimately mattered.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: FF2/4 SNES: Turns out not-in-party characters DO gain experience!
« Reply #2 on: October 02, 2009, 04:11:01 AM »
Yeah, I've known this pretty much since the first few times I played the game.

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: FF2/4 SNES: Turns out not-in-party characters DO gain experience!
« Reply #3 on: October 02, 2009, 05:20:44 AM »
Oh well, I guess I was the only one who thought otherwise. At least I fixed another random bug that's come up for my hack. Only who-knows-how-many more to go...

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: FF2/4 SNES: Turns out not-in-party characters DO gain experience!
« Reply #4 on: October 02, 2009, 05:42:31 AM »
I figured it out with Rosa. Some times she'd come back knowing Cure3, sometimes she wouldn't. I sucked at the game back then, and had trouble beating Valvalis without it, so I figured out how she gained it pretty quickly by leveling in the tower. The reason they did it is pretty obvious; it stops you from leveling Kain to 50 before Mist, and getting him back around 30.

You should document that piece of code, in case anyone else wants to utilize it. Since you moved things around, I'm guessing you've documented more about the shadow party data? I remember you mentioning before than you didn't know how the game knew when to store stats there, and for who. I've been trying to plan around that limitation, and it's kind of halted all progress on my game, since I don't have a solid idea of who I want in the final party yet. (On the plus side, it stopped me from being an asshole and stealing all possible items obtained when you get thrown in prison fairly early on... I didn't want to waste instances of the two characters you have on prisoner gear.)

vivify93

  • Liquid Flame
  • *
  • Posts: 304
  • Gender: Male
  • White Wizard
    • View Profile
Re: FF2/4 SNES: Turns out not-in-party characters DO gain experience!
« Reply #5 on: October 02, 2009, 08:21:24 AM »
So, the only way to stop charcters from gaining experience while not in the party would be to kill them before they leave?

Obviously, I don't mean it for Kain, Rydia, or Rosa, but for the schmucks who leave permanently.

...This wouldn't pertain to the GBA version, of course.
Hacking is hard. :sad:

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF2/4 SNES: Turns out not-in-party characters DO gain experience!
« Reply #6 on: October 02, 2009, 08:56:41 AM »
So, the only way to stop charcters from gaining experience while not in the party would be to kill them before they leave?

Obviously, I don't mean it for Kain, Rydia, or Rosa, but for the schmucks who leave permanently.

...This wouldn't pertain to the GBA version, of course.

No, I believe the system ignores the fact that they are dead when they leave. They keep getting EXP. All characters that come back have full HP/MP, but I dunno if they are stored away as dead though (not that it mattered).

Notable characters that aren't permanent but do come back for a time would include Yang and Tellah.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: FF2/4 SNES: Turns out not-in-party characters DO gain experience!
« Reply #7 on: October 02, 2009, 09:20:39 AM »
No, I believe the system ignores the fact that they are dead when they leave. They keep getting EXP. All characters that come back have full HP/MP, but I dunno if they are stored away as dead though (not that it mattered).

Yeah, I think that's right. The check for deceased characters is only for ones in your party.

I figured it out with Rosa. Some times she'd come back knowing Cure3, sometimes she wouldn't. I sucked at the game back then, and had trouble beating Valvalis without it, so I figured out how she gained it pretty quickly by leveling in the tower. The reason they did it is pretty obvious; it stops you from leveling Kain to 50 before Mist, and getting him back around 30.

He'd still come back at 50, since it stores the character's current level. What would have been bad is if he had left after Mist at level 2 or whatever, then come back at that level when you regain him the first time. :laugh: Now that I think about it, after knowing how the shadowing routine works, I'm not sure how I could have thought characters didn't get experience, for that very reason.  :blush:

You should document that piece of code, in case anyone else wants to utilize it.

The experience/leveling part of the battle finishing routine is from 1EE58-1F213 (FF2us ROM with header). At 1EFE6 the ASM data is "C9 0A" -- the "0A" is used to repeat ten times, marking which party and shadow slots have characters in them, and storing them in the ten addresses from $405F-4068. I changed the "C9 0A" instruction to "C9 05", which will then only mark slots for characters in your party.

Since you moved things around, I'm guessing you've documented more about the shadow party data? I remember you mentioning before than you didn't know how the game knew when to store stats there, and for who. I've been trying to plan around that limitation, and it's kind of halted all progress on my game, since I don't have a solid idea of who I want in the final party yet. (On the plus side, it stopped me from being an asshole and stealing all possible items obtained when you get thrown in prison fairly early on... I didn't want to waste instances of the two characters you have on prisoner gear.)

Well, I did figure out how the game knows who and when to store data for. It's described in this post. It sounds like that won't help you, though, if you don't know who you want in your final party. I'm still working on getting my shadowing routine to work right. Bugs like the one I fixed today seem to keep cropping up. I'll definitely post it, though, once it's actually in a working form.

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: FF2/4 SNES: Turns out not-in-party characters DO gain experience!
« Reply #8 on: October 02, 2009, 09:38:39 AM »
Well, I did figure out how the game knows who and when to store data for. It's described in this post. It sounds like that won't help you, though, if you don't know who you want in your final party. I'm still working on getting my shadowing routine to work right. Bugs like the one I fixed today seem to keep cropping up. I'll definitely post it, though, once it's actually in a working form.

No, no, that's great! Somehow I missed that post before; got those offsets noted for my omni-doc now. My problem was trying to force my characters into the existing slots that I knew had shadow data, rather than just creating my characters in whichever slots and worrying about the data later on down the road. I thought I was forced to have certain characters replace the FF4 characters that leave the party, in order to keep their stats. This makes things so much easier.