Aslickproductions.org/forum/index.php?topic=1855.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index088d.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1855.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index088d.html.zxKNg^]Ћ OKtext/htmlISO-8859-1gzip8: Tue, 10 Mar 2020 08:38:59 GMTN0 0PNg^  Adding monster spells to spell sets

Author Topic: Adding monster spells to spell sets  (Read 1565 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Adding monster spells to spell sets
« on: August 16, 2013, 11:46:06 AM »
It seems that if you try to add a monster spell (such as Explode or Reaction or something) into a player spell set, while it will functionally work correctly (as in, if you select it during battle it will have the correct effect and such), it will not display correctly in the spell menu. The reason for this is mostly obvious. Player spells are 6 letters long while monster spells are 8 letters long. So when it looks through the spell name list, it continues counting by sixes even past the part where it should start counting by eights.

My question then is, is it possible to modify the spell menu display routine in such a way that it (mostly) correctly displays the monster spell names. It can be truncated to six letters, that's probably fine, as you can simply rename whatever spells you intend to do that with to just have six letters and two blanks at the end or something, and would save the headache of having to completely reorganize the spell menu display to allow for 8-letter spell names. The important part is for the spell name to start in the right place.

This could probably be its own separate patch rather than a part of FF4kster, but if such a patch existed, I would then change FF4kster to allow monster spells to be added to player spell sets.
Let's dance!

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Adding monster spells to spell sets
« Reply #1 on: August 16, 2013, 12:23:20 PM »
I just walked someone through doing this recently, but I'm not finding it through a search right now so I'll have to get back to you. The easiest way of doing it is to just move the 8 character names somewhere else and leave the spell menu code unaltered, since the game already has two different loading routines for the spell name display in battle to handle different character counts, and the menu doesn't. If you want to make the game load the first six characters of the eight character names in the menu, that would require writing new code.

 :edit:

http://slickproductions.org/forum/index.php?topic=1803.msg18168#msg18168
« Last Edit: August 16, 2013, 01:23:21 PM by Dragonsbrethren »

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Adding monster spells to spell sets
« Reply #2 on: August 27, 2013, 08:35:43 PM »
Pinkpuff, do you want a patch for the shortened names? If so, do you care if I expand the ROM for the eight character names, to (hopefully) avoid conflicts with other patches that use free space? I could also do the tweak to the battle code so it loads eight character names for the original player spells too. Then in the editor you could have a six character and eight character field for everything. Let me know, easy enough to do one or the other.

 :edit:

If you're really adamant about reusing the existing text and chopping off the last two characters for enemy skills in the menu, I guess I could try that too; it's been a while since I looked at the menu code. I'd probably want to do ROM expansion in that patch too, for convenience/avoiding conflicts again.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Adding monster spells to spell sets
« Reply #3 on: August 28, 2013, 06:38:42 AM »
Ok, well, in an ideal world, all the spells would be the same number of letters and would all work and display correctly in all the game menus.

Since we do not live in an ideal world, we have no choice but to work with what we have. It seemed to me like going through the game code and finding all the places where it expects six-letter names and changing them to eight letters and having it display and select correctly would be a pain, which is why I made the cropping suggestion. However, if it turns out that it's actually easier to do the expanding than the cropping then that solution would also be fine.

My concerns with expanding the rom are twofold:

My major concern would be if it messes up the locations of other things. So for example, would spells still start where they do normally? What about everything else? Would any of the data or code that's being accessed by the editor currently or could potentially be accessed as a solution to the other wishlist topics be moved? If so there would have to be a lot of accomodations being made by the editor for this one patch which may not be worth it.

My more minor concern is that I would have to figure out a new way to detect whether the rom has a header, as right now it's just reading the file size.
Let's dance!

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Adding monster spells to spell sets
« Reply #4 on: August 28, 2013, 03:05:15 PM »
Just to make it clear, in case I was confusing, I was really only talking about using eight character names in the box displayed the the top left/right of battle. Expanding the names in the battle menu isn't viable (it would require rearranging the menu to only have two columns of spells like the GBA version; I wouldn't even know where to begin doing that). It's possible to get eight character names to fit in the main menu, J2e does it in their translation, but I hadn't considered it when I proposed the patch. It's an option, I'd have to trace that routine again.

Here's how things would be handled in my current hack described in the other thread: The enemy skills at their current location would no longer be eight characters long, instead they'd be six characters. You would have to detect that the hack has been applied and compensate for this, since it's the most practical way of making the change. (You could do this by reading the bytes for the name printing code and see if it matches the patch) The eight character skill names will be stored somewhere else in the ROM. It's possible to also use eight character names for character spells, this is entirely optional but easy enough to do.

Expanding the ROM from 8Mbit to 12Mbit is literally tacking 4Mb of 00 onto the end of it, nothing in the first 8Mb moves. I'm just afraid there's not enough continuous free space in an unexpanded ROM for a longer list of spells, since the original space is now partially occupied by the six character names.

I suppose another alternative is to only have six character skill names. I doubt anyone really wants all skills to be limited like that, though, only the ones they plan on using in the menu.

 :edit: typo
« Last Edit: August 28, 2013, 05:46:34 PM by Dragonsbrethren »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Adding monster spells to spell sets
« Reply #5 on: August 28, 2013, 03:51:33 PM »
What about this: Suppose instead of expanding the space for spells, we have the same fixed number of spells/techniques, but we just allow a changing of where the cut-off point is between six-letter spells and eight-letter spells, much like the other "item ranges" or "features"? That way, suppose you have a set of abilities that seem like monster techniques but you want them to be learnable by a player for whatever reason, you can just extend the "six-letter spell range" and put those after the regular player spells. If you want all the abilities to be six letters you can just set it like that. How doable would that be?
Let's dance!

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Adding monster spells to spell sets
« Reply #6 on: August 28, 2013, 04:55:57 PM »
Very. From the other thread:

Code: [Select]
$02/CBAF BF B0 8A 0F LDA $0F8AB0,xThis offset (SNES LoROM, of course) is the start point for the eight character names.

Code: [Select]
$02/CB9B C9 48       CMP #$48This is the value of the first eight character spell. Anything below this is six characters.

Code: [Select]
$02/CBA0 E9 48       SBC #$48This is subtracting the value of the first eight character spell, so that the index for eight character names starts at 0 instead of $48 in the loading routine.

So basically, what you want to do is set the two $48 values to whatever the first eight character name is and adjust the offset accordingly. Since you'll be overwriting the start of the eight character names with six, nothing actually needs to move (there's no reason why there can't be blank space between the six and eight character names) so you can leave everything in the same place it is now. (Well, assuming you only allow six character names to be expanded; removing some would require the entire list of eight character names to be shifted.)
« Last Edit: August 28, 2013, 05:04:29 PM by Dragonsbrethren »