øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1873.msg18913e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index3957.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1873.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index3957.html.zxÚ7g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ…¬ OKtext/htmlISO-8859-1gzip8:Ö ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 07:03:13 GMT0ó°° ®0®P®€§²ð®Ú7g^ÿÿÿÿÿÿÿÿa+  Keeping everyone in shadow party

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

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Keeping everyone in shadow party
« on: August 23, 2013, 06:13:58 PM »
I seem to recall that Phoenix released a patch that allowed enough shadow slots to save the data for all the characters in the game. However, I think it was only for version 1.0, and I also seem to recall it didn't quite work correctly.

It would be a dream for me (and probably others) to be able to make a version of this game that operates more like FF4A near the end and be able to configure your party, or at the very least, even in a more linear plot hack, not have to worry so much about the logistics of different characters sharing a shadow slot.

If we can figure out how exactly he went about it and maybe get it working (preferably for v1.1)  I might be able to put something into FF4kster to detect whether the patch has been applied and if so have the editor accomodate the new slots.
Let's dance!

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Keeping everyone in shadow party
« Reply #1 on: August 23, 2013, 06:52:38 PM »
http://slickproductions.org/forum/index.php?topic=1590

There's a disassembly/interpretation included in the text file, so it shouldn't be too hard to adapt.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #2 on: August 23, 2013, 08:46:53 PM »
Huh... I had seen the thread where he talked about working on this patch, but never saw this.
On the one hand, this is awesome.
On the other hand, I can't believe I spent so much time thinking about the logistics of how I would work character exits and reappearances in my hack using only five slots!

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #3 on: November 02, 2013, 06:18:37 AM »
I'm not able to figure out from that file what to do to convert it to 1.1
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 #4 on: July 16, 2014, 05:38:16 PM »
Hey Grimoire LD (or anyone else, really), do you happen to have a map of character stat records that is more complete than the Bab-il document?
If I'm not mistaken, that was made by Phoenix, and therefore probably doesn't contain any of the info his shadow party hack ignored.

I'm interested in reworking the hack, but it would be silly to try without knowing which pieces of data are essential.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #5 on: July 16, 2014, 09:08:17 PM »
That's pretty much all you need for this. Outside of battle the game only stores 40 bytes and the rest are added in-battle.

2D - Critical Hit Chance
2E - Critical Hit Bonus Damage
2F - ?Steal Evade?

3A and 3C are still unknown, but I've never personally seen them referenced. They are quite possibly unused, which could have interesting ideas for mods down the line....

Phoenix's idea was to get rid of extraneous bytes like current HP/MP, modified stats, status, resistances/weaknesses, physical attack, defense, and magical defense (this would all be recalculated when they would rejoin the party anyhow) so there would be room enough. Would his plan work? Difficult to say, there is a problem with experience that was never addressed. (though there is a mention of disabling Exp. gain for the Shadow Slots, which should, in theory solve the problem) The only real issue is the loss of critical hits from thereon out when using it. All you would need is three more bytes of space, if I'm not mistaken. Thereby the amount of space would go from 0B to 0E which should still be enough space for all of the characters.


Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #6 on: July 16, 2014, 09:31:28 PM »
This wouldn't remember equipment either, would it? Like, if you were to try to implement some kind of dynamic party configuration a-la FF4Advance the character would just get the actor's initial equips replacing whatever it had before, correct?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #7 on: July 16, 2014, 10:10:05 PM »
It does, here is what his Shadow Party hack checks...

         1140   character id/handedness
    1141   class id
    1142   level
      1143-4   max HP
    1145-6   max MP
    1147   strength
    1148   agility
   1149   vitality
    114A   wisdom
    114B   will
   114C   helmet
   114D   armor
   114E   gauntlet
   114F    right-hand item
   1150   right-hand quantity
    1151   left-hand item
   1152   left-hand quantity
   1153-5   experience
His hack also changes matters to a Class based rather than Actor based for Events. I imagine that the Actors are still referenced for their commands, but I couldn't say for sure.

His hack is a good foundation, but it is extremely specific and would be difficult to make work in a basic sense without a heavy overhaul. I'm hoping that Chillyfeez's attempt might be a bit more open, so to speak.
« Last Edit: July 16, 2014, 10:16:15 PM by Grimoire LD »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #8 on: July 16, 2014, 11:39:21 PM »
This is going to be a bit ramble-y... The whole shadow party would need to be stored in the first 1800 bytes of RAM, because that's all that's copied into a save file - and what's the point of a full shadow party if it's erased every time you turn the game off? I don't think there's any significant amount of free space there. Maybe if you're willing to give up the fat chocobo's inventory... Anybody know what 7E:12A0 - 143F are used for? Something, I presume. If it's used for anything at all, then it can't be used for shadow...

As oit stands, shadow data is 320 bytes long.

There are 12 characters. This assumes there is no going back to young Rydia or DK Cecil.

That's 26 (DEC) bytes per character, IF you include Cecil. 29 if you don't. 32 if you also take out the option of keeping Tellah after he dies.

Character ID and upper byte of MP could, in theory, be combined. Handedness (upper two bits) can be determined and recalculated by ID, and the max value for the upper byte of MP is 03 (two bits).

So...
Sprite/class -1
Level - 1
Max HP - 2
Max MP/chr ID - 2
Base str - 1
" agi -1
" vit - 1
" wis - 1
" will - 1
Crit hit chance - 1
" " bonus - 1
Helmet - 1
Armor - 1
Gauntlet - 1
R hand item - 2
L hand item - 2
Exp - 3
TNL - 3

Total - 26.
So, that should work, unless you can see something I missed?
Steals evade (if that's what it is) shouldn't matter for party members, and I think everything I left out can be calculated based on everything that would be saved, right?

Hmm... Come to think of it, if every character has its own shadow slot, then there's really no need to store the first two bytes of character data, either...
« Last Edit: July 17, 2014, 12:17:20 AM by chillyfeez »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #9 on: July 17, 2014, 01:41:28 AM »
1340 to 143F is ridiculously the amount of space that the Fat Chocobo has...

12A0-133F appear to be default visibilities of NPC's. Now the Fat Chocobo section... FF Bytes... 255 slots... this begs the question of Why FFIV chose to do it in this frankly silly manner instead of having a slot open for each item! This is already more than enough slots for items! I wonder what would happen if you tied all item use and acquisition in battle and outside to the Fat Chocobo Bag. Would you not have to worry about item space the?
« Last Edit: July 17, 2014, 01:47:08 AM by Grimoire LD »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #10 on: July 17, 2014, 08:23:11 AM »
It would probably work out of battle but not in-battle. The active inventory gets transferred to a different location in battle, which is only big enough for 64 items.

There are only 44 battle ITEMS, but weapons alone, there are more than 64... Plus, shields. I can't think of a way to make that work...
« Last Edit: July 17, 2014, 09:38:52 AM by chillyfeez »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #11 on: July 17, 2014, 11:15:28 AM »
Hmm... There's a block of several hundred bytes near the end of the 7E block of RAM (7E:F600-FE00 or so) that seems to be unused. We could change that to the in-battle location of inventory, and extend back the out-of-battle inventory to be 100 (h) bytes long (begin it at 1390), then move flags and default visibilities up, giving SOME extra space to shadow data. All that's easy enough (though time consuming), except I don't know how to increase the size of the inventory display window.

Thoughts?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #12 on: July 17, 2014, 11:57:11 AM »
I was going to say that this space may have been the space I had previously located for my failed "keeping commands in RAM" hack.  But if it's only accessed inside of battle then it shouldn't cause any issues I'd imagine. But yes, as you said the problem the size of the inventory display window. That part is a little bit difficult to actually deal with, I'd imagine. Likely something says to repeat the screen 64 times before stopping, in theory it would be a matter of finding LDA/X 0040 that is continually decreased to building the screen and changing it to FF.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Keeping everyone in shadow party
« Reply #13 on: July 18, 2014, 01:40:58 PM »
Ok, well, I can't figure out how to make the item window bigger, but I have some new ideas for how to use the normal 320 bytes of shadow data...
if every character has his/her own shadow slot, then anything that doesn't change doesn't need to be saved in the shadow. The character loading routine can simply run a check on which character it's loading, and fill in the necessary information from a table somewhere.
As far as I know, bytes 2D-2F are in that category of data. I just cheated P. Cecil from level 11 to 99 in a single battle, and these bytes did not change.
Furthermore, I think I can work into the character loading routine a jump through the level-up subroutine, so that the shadow wouldn't need to store the three bytes of TNL data.
The necessary bytes to store, then, would be:
Code: [Select]
offset stat #bytes
------ ---- -----
02 level 1
09-0A max hp 2
0D-0E max mp 2
0F base str 1
10 base agi 1
11 base vit 1
12 base wis 1
13 base wil 1
30 helmet 1
31 armor 1
32 gauntlet 1
33-34 right item 2
35-36 left item 2
37-39 exp 3

total 20 (14h)

With 20 bytes needed per character, and 320 bytes total, that's enough for 16 characters.

1 DK Cecil
2 Kain
3 Child Rydia
4 Tellah
5 Edward
6 Rosa
7 Yang
8 Palom
9 Porom
10 P Cecil
11 Cid
12 Teen Rydia
13 Edge
14 FuSoYa

That gives us enough space with 40 bytes to spare!

It'll take a massive load of coding - I'll have to completely rewrite the shadow loading and storing routines, plus edits to the experience awarding routine... probably more.

Not gonna start immediately, but I'll keep you guys posted on progress as it comes.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Keeping everyone in shadow party
« Reply #14 on: July 18, 2014, 09:01:36 PM »
These are some creative ideas you have! Yes, Critical Hit chance only changes if you have a weapon equipped (x2 with a normal weapon, x4 with a Bow&Arrow) and the Critical Hit Bonus is added from half of the weapon's power + a default amount for each specific character and Steal Evade... is used by Porom and Porom only in the initial Cry command which would increase the chance of stealing an enemy's item, it doesn't ever change, but in most cases it matches the default level of the character.

16 characters would be an ideal amount, it would allow us to use Golbez and Anna's slots to their fullest potential. (Eventually...)