øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1873.msg21072e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexd193.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1873.30e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexd193.html.zxZ8g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ…¬J4OKtext/htmlISO-8859-1gzip0|ÖJ4ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 07:05:21 GMT0ó°° ®0®P®€§²ð®Y8g^ÿÿÿÿÿÿÿÿÔ.J4 Keeping everyone in shadow party

Author Topic: Keeping everyone in shadow party  (Read 9194 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #30 on: July 27, 2014, 05:15:29 AM »
So does this affect the way actor data is stored? Specifically, FF4kster looks for (and saves) the information for whether the actor loads initial character data or loads it from a certain shadow slot. Will those bytes still be there and just do nothing (in which case the editor should be already compatible, at least in that respect), or will it mess everything up if it writes something strange to those places?

Also, welcome back LordGaramonde! Good to see you again!
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #31 on: July 27, 2014, 08:45:38 AM »
It uses those bytes, in a way that is compatible with Ff4kster (I'm using it as I go, as I usually do  :happy: ).
Every character's load and save byte reads as a shadow slot that is a multiple of 05. So for loading, they read 80, 85, 8A, 8F, 94, &c. For saving they read 00, 05, 0A, 0F, 14, &c.
If there is no shadow data in that slot, the loading code will instead use the actor ID to load initial stats. Ff4kster seems entirely cool with all of this. It just reads the load and save bytes as "shadow slot 0, shadow slot 5, shadow slot 10, &c." The user can't set those, but the editor won't change them either.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #32 on: July 27, 2014, 08:02:02 PM »
OK, I have a first draft of the loading code written. Loading from initial stats works like a charm. Loading from the shadow needs testing and debugging - probably a lot. Depending on how much time I get over the next few days - and how extensive my inevitable mistakes were - I'd say I'll have this thing up and running by the end of the week.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #33 on: July 27, 2014, 09:27:48 PM »
Well done! We are nearly there to be free of this poorly conceived Shadow Slot idea that Square used for FFIV.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Keeping everyone in shadow party
« Reply #34 on: July 28, 2014, 05:02:26 AM »

OK, I have a first draft of the loading code written. Loading from initial stats works like a charm. Loading from the shadow needs testing and debugging - probably a lot. Depending on how much time I get over the next few days - and how extensive my inevitable mistakes were - I'd say I'll have this thing up and running by the end of the week.

I'm excited! When it's ready I'll definitely give it a good testing; it'd be my pleasure.  :wink:

Well done! We are nearly there to be free of this poorly conceived Shadow Slot idea that Square used for FFIV.

Seconded!  :yabin:

Looking at the last few posts got me to thinking (uh-oh...). What about a system where an incoming member's level is set using Cecil's level as reference. Instead of having the shadow party gain the whole time what about these as alternatives:

1) Every time Cecil gains a level, so does everyone in the Shadow Party. Possibly not even 1-to-1, maybe something like (3/4 Shadow)-to-(4/5 Cecil)  -  or

2) Similar thinking: when someone joins they advance as many levels as required to catch up to Cecil +/- (1/2). This would require looping through level gain one at a time to take care of stats (right?) - I have no idea how noticeable that slow down would be.

Those were just a couple things to throw out there. Actually, that's one of the things I never really worked out in my mind: just as to how one is going to actually be at (x) Level when first loaded - without the TNL table to reference, I can't see any way to do it other than looping through a string of off-screen level gains - which may be OK; I don't know yet. I'll expand more on what I've found so far over on the drawing board. - See you there!  :kedgar:

Also, welcome back LordGaramonde! Good to see you again!

Thanks Pinkpuff! It's good to be back and it's definitely great to see you!  :childish:
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #35 on: July 28, 2014, 11:10:26 AM »
There is a "Party Level Average" the game looks at when calculating certain things at the start of battle such as Preemptive Strike/Ambushing/Back Attack. It's quite likely this can be taken advantage of to be used to average out Shadows, the difficulty lies in looping to that correct level for the TNL though, that would probably be the killer of that idea..

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #36 on: July 28, 2014, 08:27:44 PM »
Ho-ly-crap. It works!
My TNL code is off slightly, and that needs to be fixed before I can put patch out, but it's not crashing!
I had to learn how to do some things I've never done before (change direct page and data bank registers) but the mechanics of it all are working exactly as planned.
It's cool, I can load a character, then send them to the shadow, then cheat their experience up to 98967F (9,999,999) then reload the character and actually watch the game level them up to 99! That was the most outside the box part of the plan, and was the part I was SURE would go wrong.
Can't wait to share this with you guys!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #37 on: July 28, 2014, 08:48:45 PM »
You mean in data you watch their Exp continue to increase, their level go up and the exp continue to increase, all in real time?

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #38 on: July 28, 2014, 09:14:37 PM »
Well, after the character loads from the shadow, the game runs through the level up routine to account for all of the exp collected while in the shadow. So, if you put level 1 Rydia in the shadow, then increase her exp to max, then load her back into the party, the game runs through the level up routine 98 times. The whole process (for that many levels) takes about half a second or so, so if you're actually watching the RAM data at 7E:1000 (or wherever the applicable character slot is), you can actually see it roll up from lv 1 to lv 99.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #39 on: July 28, 2014, 09:22:43 PM »
Oh, that's really neat! I was wondering what the slowdown in that regard would be, seems it is a lot less than I had thought it would be. I did not know the game could actually run the level-up routine outside of battle, since... well it never does normally to my knowledge, heh.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #40 on: July 28, 2014, 09:39:31 PM »
Yeah, as long as the internal registers are set to their proper values (direct page =0000, data bank =7E.  As mentioned above, I had to learn how to do this), it works just fine. I also had to set a couple of bytes in RAM so that the level up routine runs as though it were leveling up a shadow character, so it doesn't try to display "soandso gained a level," "learned such-and-such spell."

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Keeping everyone in shadow party
« Reply #41 on: July 29, 2014, 02:04:22 AM »
Ho-ly-crap. It works!

Way to go, chillyfeez!  :cookie:

I was actually thinking about that yesterday - what a continuous loop would look like. That brought me back to the old Game Genie days and using a code to let Exp keep piling up & watching the gang fist-pump so long that the total gained actually rolls over and all that time was for not. The times I wasn't so greedy I remember watching the levels come pouring in. I'm definitely going to watch the RAM and see that ticker work its way up - too cool!

Oh, that's really neat! I was wondering what the slowdown in that regard would be, seems it is a lot less than I had thought it would be. I did not know the game could actually run the level-up routine outside of battle, since... well it never does normally to my knowledge, heh.

Yeah - I'd have lost money on that one: but it appears that the 68516c is indeed the little processor that could did! Running it outside of battle was something I was considering - but only for the reason of splitting up when to add levels - but what a pain in the ass that would turn out to be. What made me think of that was the classic approach to covering load times in FF7 with cur scenes.

1/2 sec to make it through 98 level gains - sounds good to me!  :wink:

But oh man - can't wait to have a look at that code and then see what it can do!

There is a "Party Level Average" the game looks at when calculating certain things at the start of battle such as Preemptive Strike/Ambushing/Back Attack. It's quite likely this can be taken advantage of to be used to average out Shadows, the difficulty lies in looping to that correct level for the TNL though, that would probably be the killer of that idea..

Apparently we'll be able to make good use of it. Do you happen to know how the "Party Level Average" is calculated - probably a pretty conventionally way - but at the same time I thought of all the backwards broken mechanics when it came to party statistics in FF1. Really I was more wondering if the calculation lent greater weight to Cecil or was it more even.

   -   Happen to know - LOL  - Of course you know! - Now so do I     - Hey, at least (for once) I thought to look before actually clicking 'Post'  - http://slickproductions.org/forum/index.php?topic=1883.msg19959#msg19959

:edit: I knew I had seen another entry about that!  http://slickproductions.org/forum/index.php?topic=1940.msg20858#msg20858  :happy:

Ho-ly-crap. It works!

- I just had to cite that one again. Holy crap indeed!  :childish:
« Last Edit: July 29, 2014, 02:32:36 AM by LordGarmonde »
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #42 on: July 31, 2014, 09:49:03 PM »
OK, this is almost finished, but I've run into a hang-up and I'm looking for help if anyone knows what's going on here...

The characters' level up data don't match up with the pointers on a 1-to-1 basis. Theoretically, one should be able to add the pointer value to 0F/0000 (LoROM) to find the beginning of the data, but this only works for Rydia and P.Cecil. everybody else's data is off by some. For a lot of characters, it's off by 2D, but not all. Here's what I've got:

Code: [Select]
CHAR POINTER DATA(LoROM) DIFF
---- ----- ------ ----
CECIL B4FB 0F/B528 2D
KAIN B62F 0F/B65C 2D
RYDIA B790 0F/B790 00
TELLAH B892 0F/B8F1 5F
EDWARD B9DF 0F/B9F2 13
ROSA BB13 0F/BB40 2D
YANG BC47 0F/BC74 2D
PALOM BD7B 0F/BDA8 2D
POROM BEAF 0F/BEDC 2D
P cEC C010 0F/C010 00
CID C112 0F/C171 5F
EDGE C1FB 0F/C273 78
FUSOYA C267 0F/C35C F5

This difference affects the automatic adjustment of TNL data when characters are loading from the shadow (since I'm not storing that in the shadow anymore).
Now, I can just write those differences into the coding to make this work just fine, but I don't know if they will remain consistent if the hacker were to change level up data. So... does anyone understand why these differences exist, and/or where they come from?
I'm thinking they may, possibly, have something to do with the character's starting level, since a lot of characters start at level 10 and a lot of characters have a difference of 2D, plus Rydia and P.Cecil, who both start at level 1, bot have a difference of 00, but that's the best I can figure, and even still that doesn't really help, since 2D is not a multiple of 0A (or 09).

Thoughts?

 :wtf:

 :edit: alternatively, if anybody can confirm that these differences do not change at all regardless of how much you edit level up data, then I can just figure them into the coding and be done with it...
 :edit: 2 - It's definitely related to the character's starting level in some way...
Code: [Select]
Starting level     Difference
-------------      -----
01 (1)             00 (0)
05 (5)             13 (19)
0A (10)            2D (45)
14 (20)            5F (95)
19 (25)            78 (120)
32 (50)            F5 (245)
Anybody understand the pattern here?
 :edit: 3 oh, there it is...
(S-1)*5=D
Where S is starting level and D is difference.
except Edward's difference is 19 instead of 20?! Again, I say  :wtf:
« Last Edit: July 31, 2014, 11:28:58 PM by chillyfeez »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #43 on: July 31, 2014, 11:25:05 PM »
Those Have to be something dealing with starting levels.

It is 00 for every Level 1 Starter
It is 13 for Edward - Level 5 Starter
It is 2D for every Level 10 starter.
It is 5F for Tellah and Cid - Level 20 Starter
It is 78 for Edge - Level 25 Starter
It is F5 for FuSoYa - Level 50 Starter


Now 13 into 5 Levels? Is 19 in Decimal (20 if counting byte 0?) which does align well with the concept of 5...
2D is 45 (46?) which doesn't split well into 10, nor is it just double that...

I'll take a look at the data and see if I can find anything.
 
In any event, these initial pointers do something with the TNL, even though in Dark Knight Cecil's case for instance they should start B528 if you null the first row of B4FB the game will assume that he has a much higher length to go to reach Level 11. Sorry, afraid that really wasn't much help.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #44 on: July 31, 2014, 11:45:31 PM »
Got it. The info on rb.thundaga.com is off by 1 for Edward's data. He starts at B9F3, meaning his difference is 20.
So, great, that's settled. I'm done messing with this for the night but I think I'll be all done with it tomorrow and ready to post!

 :edit: now that I think about it, this makes perfect sense - it allows the game to use the same formula to find the level data for a specific level regardless of character:
(Current level - 1) * 5 + Character's Pointer + 0F/0000 = Level Data Offset
« Last Edit: August 01, 2014, 12:47:45 AM by chillyfeez »