• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 28, 2024, 09:48:25 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


FFTA - Unused class slots

Started by rrs_kai, July 06, 2020, 04:22:54 pm

rrs_kai

July 06, 2020, 04:22:54 pm Last Edit: July 11, 2020, 01:34:32 am by rrs_kai
The AIO shows all the possible classes and there are some blank ones as well. The enemy only classes like Biskmater, Hermatic, and Runeseeker do not have any sprite set and use the sprite given by a "special character". Special characters seem to have their sprites set and do not depend on the class' sprite. This means that a special character like Montblanc can be a Nu Mou or even a Totema.

---Question 1---
I wanted to add some extra bosses and so I gave these name-only classes some sprites and it worked fine with no bugs. What I want to know is, can we do this to the blank slots as well?
Also, going by the logic above, the classes used in the snowball fight can also, probably, be used with custom sprites because all them are "special characters".
I am not very sure, but I vaguely remember someone saying that these blank slots are used for some background checks. Is this correct? Because some the slots are not using any unknowns.
If these are just plain empty slots then we can use them to add custom classes, like the yellow monsters?

---Question 2---
There are 5 slots with the name "Totema" and I gave each of them a different sprite. When I try to assign these classes to a mission it looks fine, but all of them default to the first Totema when I hit SAVE.

Note: The game somehow cannot handle all 3 totema on a given map. This is probably why we have the "Deph" variety of Totemas. If you want to know what I mean, then add all the 3 "special character" totema to the same battle. You'll either see a blue Adremmelech or a green Famfirt/Mateus (all very cool). To switch palettes just view the info screen of any totema and their palette will be applied to the other two.

In case you found this interesting and wanted the sprite and portrait addresses, Fallujah documented a nice spreadsheet here
  • Modding version: Other/Unknown

Leonarth

Question 1:
The unused classes are for Marche, Montblanc and the other special characters, they just don't really do anything in the final game. They still have them set in character data I believe it was.
If I remember correctly the only thing they actually read from these classes is the unarmed attack value?

Anyway, if anything it's safer to do it with the blank ones.

Question 2:
Totemas use special palettes, there can only be one special palette at a time.
As to why they default to the same sprite when you save, no clue.
  • Modding version: Other/Unknown

rrs_kai

July 07, 2020, 02:51:17 pm #2 Last Edit: July 07, 2020, 03:32:42 pm by rrs_kai
Quote from: Leonarth on July 07, 2020, 09:57:47 amAnyway, if anything it's safer to do it with the blank ones.
There were 5 blank [ALL] but all of them had the skill set Item. This probably means its giving item command to all 5 races. I think its better to leave these.
There are a few

Quote from: Leonarth on July 07, 2020, 09:57:47 amIf I remember correctly the only thing they actually read from these classes is the unarmed attack value?
You're right. I found 3 blank ones that only have Unarmed Power and Aggressiveness values. Marche and Montblanc take values the class that they are currently in. So, who is using these three?

Quote from: Leonarth on July 07, 2020, 09:57:47 amTotemas use special palettes, there can only be one special palette at a time.
As to why they default to the same sprite when you save, no clue.
The game is able to handle two totema on a map, but not three though.

I thought it defaulted to the first totema because all five of them have the same name.
For example, white mage starts with the race name [HMN] White Mage
  • Modding version: Other/Unknown

Leonarth

QuoteThis probably means its giving item command to all 5 races.
Not at all. They really just are unused jobs for the special characters, it is likely that early in development either they wanted each special character to have a unique job or that this was how they originally handled the sprites for special characters.

QuoteMarche and Montblanc take values the class that they are currently in.
I think they still get the unarmed attack from these jobs.

QuoteThe game is able to handle two totema on a map, but not three though.
No it can't? You even showed it in your pictures. Totemas look wrong because there's only one special palette slot. There's actually two iirc, but one of them is EXCLUSIVELY used by Li-Grim, nothing else will ever be loaded there in vanilla, which is why all the totemas look wrong (except one).

Quotebecause all five of them have the same name
This doesn't have anything to do with anything.
  • Modding version: Other/Unknown

rrs_kai

Quote from: Leonarth on July 07, 2020, 05:29:49 pmNo it can't? You even showed it in your pictures. Totemas look wrong because there's only one special palette slot.
You're right, the game can only handle one. Tested; each of the totema has a unique palette.

(Maybe I'm just imagining... but the first time I tried a map with Adremmelech and Mateus, the game actually loaded both, this is why I added Famfirt)

Quote from: Leonarth on July 07, 2020, 05:29:49 pmThis doesn't have anything to do with anything.
You're right, the issue is not the game, the AIO seems to default to the first name if it is a name shared by many classes.

The solution was oddly simple:
-1-Make your changes
-2-Move your selection to a class without a shared name
-3-Hit Save.
  • Modding version: Other/Unknown

Leonarth

Quote from: undefinedThe solution was oddly simple
That's a pretty weird quirk... Never would have I expected that.
Glad you found a solution though.
  • Modding version: Other/Unknown

rrs_kai

Quote from: Leonarth on July 11, 2020, 08:36:51 amThat's a pretty weird quirk... Never would have I expected that.
Glad you found a solution though.
Me too. Biskmatar and Li-Grim's second ability-only class slots can now be used.

Do you how to add abilities?

The abilities for classes are present one after another. Human abilities, then Bangaa, Nu Mou...Monsters and finally specials. But in the AIO the "Start" address restarts at 1 for every new race.

For example, the Official has only one ability picked from address 8D. I wanted more, so I gave a range of 87 to 8D.
After 8E Bangaa abilities start. So, a Human can have bangaa skill added but the Bangaa race restarts at 1. So how does one go back if he wanted human abilities added to a bangaa skill set?
I ask this because I found some good monster sprites and job names, but am unable to add new abilities. Is there a free space that can be used to add new abilities without messing anything else?
  • Modding version: Other/Unknown

Leonarth

You can specify a list of non-continuous ability IDs instead of a range of ability IDs by using my job and race customization engine hacks.

Look in "\Engine Hacks\jobAndRaceCustomization\jobAbilityTable.event", there's an example with the vieraRedMageAbilities fix. You just want a pointer to a 0 terminated list of ability IDs, this also means you can only go forward though, you can't make it look at a previous list.

Nor should you be making it look at the next list, either. What you want is to extend the original list, so you would repoint it and add new abilities to the end of it. By doing this you can have about 0x90 abilities for any race (whatever the highest ID for Hume is, that's the limit) if using the vanilla AP system, or 0xFF if using 1 bit abilities.

Note: when I say ability IDs I mean each entry in the race's list of abilities, so ability 1 would not be the same ability for say Hume and Viera, do not confuse this with ability effect IDs, which are shared for all races.
  • Modding version: Other/Unknown

rrs_kai

Quote from: Leonarth on July 11, 2020, 07:48:29 pmvieraRedMageAbilities fix.
Oh, you've fixed the cure issue; that's nice.
No matter what ability to gave to the RedMage's first slot from the AIO, Cure would overwrite it in vanilla.

Quote from: Leonarth on July 11, 2020, 07:48:29 pmWhat you want is to extend the original list, so you would repoint it and add new abilities to the end of it.
I understand this.
If I just extend the current list forward, it goes into into the next race's list. How do I re-point?
  • Modding version: Other/Unknown

Leonarth

To repoint something you want to copy the data for it, place it in freespace and edit the old pointer so that it points to the new location, if you wait a day or two I can get some free time and make an example with actual offsets.
  • Modding version: Other/Unknown

rrs_kai

Quote from: Leonarth on July 12, 2020, 07:17:53 amTo repoint something you want to copy the data for it, place it in freespace and edit the old pointer so that it points to the new location, if you wait a day or two I can get some free time and make an example with actual offsets.
I want to add more monster classes. So, I would need a new pointer for each monster race, correct?
Thanks for looking into this. All your effort could go to waste if I make the monster boring.

The monster pointers end before the special classes. So, I wanted to use special/totema skills for monsters. Only thing I would need to do is to change the addresses.
Also, why should we not use the skills of another race?
  • Modding version: Other/Unknown

Leonarth

Quote from: undefinedSo, I would need a new pointer for each monster race, correct?
Monsters don't have many abilities so you can have new monsters using old races without much trouble, you just need to extend the list of abilities, you don't need to make new races.

Quote from: undefinedAlso, why should we not use the skills of another race?
Because it's a bad idea. You are essentially making the routines that check for abilities look at something that's beyond the end of their table, if in the future you want to move these tables or extend them then everything will break. It's also limiting you for no reason at all.
If you repoint the lists then you can have 0xFF unique abilities for each race, if you don't then races will be forced to share abilities for no reason.
  • Modding version: Other/Unknown

rrs_kai

Quote from: Leonarth on July 12, 2020, 01:09:31 pmIf you repoint the lists then you can have 0xFF unique abilities for each race, if you don't then races will be forced to share abilities for no reason.
I will wait for your reply.

Side note:
I have an idea inspired from the Totema's secondary skill set "Magestorm". What if we just create one list and categorize it as [ALL]. We can add this to any class as a secondary skill set. Would this cause any problems?
  • Modding version: Other/Unknown

Leonarth

July 13, 2020, 06:44:35 pm #13 Last Edit: July 17, 2020, 11:36:48 pm by Leonarth
Okay, so first, on repointing:
You will want to get a hex editor if you don't have one already, I use HxD.

To repoint something you want to copy the data for it into free space, then you need to change the original pointer so that the game looks for the data at the new location. By doing this we can expand on the original data without affecting what originally came after it.

The table of race ability lists starts at $51BA84, each entry in this table is 4 bytes long and is just a pointer to the list itself. So for example, if we wanted the Hume list:
$51BA84 + (4 * RaceID) -> $51BA84 + (4 * 1) -> $51BA88
Now we know that the pointer to the list is at $51BA88, if we look at the values there we see: 64 BB 51 08.
Now endianess comes in, if you don't know what that means you can look it up, essentially we just want to flip the order of the bytes so that: 64 BB 51 08 -> 08 51 BB 64 -> $0851BB64.
This is the pointer to the list, the 08 at the front just means that it's in the ROM as opposed to RAM, to get the offset we just remove the 08: $51BB64. This is the offset of the Hume ability list. If we go to this offset we'll see a bunch of 0s, which is to be expected since the first ability of a race is blank, since 0 is used when you don't have an ability.

The tldr so far: go to [$51BA84 + (4 * RaceID)], get the pointer there, go to the offset the pointer points to.

Now we need to copy this data, to do so we need to know how long it is, you can either multiply the number of abilities by 8 (the length of the data for one ability) or just look at the pointer for the next list, because ours will end when that one starts.
We'll paste that data into a new binary file and call it "test.bin".

Now, for the repointing itself, that's the easy part, actually, you just want to paste this in your buildfile:
#ifndef newAbility
#define newAbility(Name,Desc,Effect,Type,Cost) "SHORT Name Desc Effect; BYTE Type Cost"
#endif
PUSH; ORG $51BA84 + (4 * RaceID); POIN MyNewList; POP //we change the pointer so that it points to our new label
ALIGN 4 //a friend that makes sure things work
MyNewList: //our label
#incbin "test.bin" //the file with the original data
//-- add new abilities below this line --
newAbility(0xDD,0x93,0x4C,1,10) //an example, this is identical to First Aid
//-- add new abilities above this line --
BYTE 0 0 0 0 0 0 0 0 //this works as a terminator
Of course, you want to reaplce RaceID with the ID of the race and name the MyNewList label and the file something recognizable.
And now we can just add abilities into the list! Up to 0xFF, if using 1 bit abilities, like I mentioned previously.
NOTE that cost in the example is divided by 10 compared to normal, vanilla actually lies to you, there is no such thing as 1 AP, the minimum you ever get is 10, so everything just has a 0 tacked on at the end. Also, 999AP is how the game displays 1000AP.

I know all of this stuff can be pretty confusing at first so be sure to ask if you don't get something.

About the sidenote:
Quote from: undefinedWhat if we just create one list and categorize it as [ALL]. We can add this to any class as a secondary skill set. Would this cause any problems?
This would cause the problem of outright just not working. The list would be different for each race, because what each Ability ID means depends on the unit's race and nothing else, not job, not the name of your list, exclusively race, with the only exception being Item, which has special code just for it. So essentially this is just pointless to do. You might say "but then what's up with Magestorm?". Magestorm is, as I said, completely pointless, it essentially exists only for show and it only works because all Totema are the same race to begin with (or at least share the same list of abilities).

Anyway, jobs and their ability lists don't have categories/race, that's just a way AIO has to show you what they are meant to be used for... I'm not even sure what you mean by categorizing as "all", how would you do that? There is nowhere in the ROM that says "this one job is for Viera" and such, the code is (in vanilla) made so that you only see Viera jobs when reclassing a Viera, and that's all there is to it, there isn't even a list of job races in the code per se. If you are curious, the way it works is that when you enter the job change screen it checks your race, then it checks for each job from X to Y if you have it unlocked and displays it, it only has a start and an end.

On a similar note, and as I'm pretty sure I've said before, Jobs and their Ability lists are not the same thing. Being a soldier is not what gives you Battle Tech, those are completely different things, it is just that the code is made so that they are always coupled. Being a soldier is also not what makes a unit hume, these three things are all different attributes of a unit.

So tldr: There is no outplaying the races' ability lists short of writing your own code for it. A whole lot of code.
  • Modding version: Other/Unknown

rrs_kai

Quote from: Leonarth on July 13, 2020, 06:44:35 pmOkay, so first, on repointing:
I understand the concept.
I don't understand the math.
Where can I get the Race IDs?

Quote from: Leonarth on July 13, 2020, 06:44:35 pmAbout the sidenote:This would cause the problem of outright just not working.
Oh right, the race for items was labelled as [ALL] in the AIO. I mistook it for an all purpose class.

Quote from: Leonarth on July 13, 2020, 06:44:35 pmSo tldr: There is no outplaying the races' ability lists short of writing your own code for it. A whole lot of code.
...sigh
  • Modding version: Other/Unknown

Leonarth

I just noticed my math was wrong because for some reason I remembered Hume being race 2, with race 0 being unused and 1 being items, but that's not the case, 0 is items and 1 is Hume.
I guess I'll correct it.

QuoteWhere can I get the Race IDs?
You can probably get a list of them from some nigthmare module but here's one anyway:

00 None (Item abilities go here)
01 Hume
02 Bangaa
03 Nu Mou
04 Viera
05 Moogle
06 Goblin
07 Flan
08 Bomb
09 Dragon
10 Lamia
11 Antlion
12 Turtle
13 Tonberry
14 Panther
15 Malboro
16 Ahriman
17 Zombie/Vampire
18 Fairy
19 Llednar
20 Ezel/Babus/Cid
21 Totema
22 Li-grim
23 Judge (Enemy)
  • Modding version: Other/Unknown

rrs_kai

Quote from: Leonarth on July 13, 2020, 06:44:35 pmI know all of this stuff can be pretty confusing at first so be sure to ask if you don't get something.
I am dumb and I have difficulty just understanding what you've written. If you can bear with me, I have many questions:

-1- Do I paste the whole code in the buildfile? or do I just paste the first three lines?
-2- MyNewList is address of the new pointer? Can I just use some address beyond 0xA39920?
-3- test.bin is automatically created? or must I put something in it?
-4- about the code newAbility(0xDD,0x93,0x4C,1,10)
--5--0xDD this is index.
--6--0x4C is the ability First Aid. Do I just a digit for 3 digit addresses like 0x136 Meteorite?
--7--0x93 is its description/flavor text.
--8--(81 is the yellow in-battle effect text; it's not in that code, so is it not important?)
--9--what is 1? does it mean A-ability? If so, what to use for S/R/C abilities?

I got the list of indexes and abilities here, but not descriptions and type https://datacrystal.romhacking.net/wiki/Final_Fantasy_Tactics_Advance:String_Tables
If you're still here, a few more dumb questions:
-10- Is it required to copy abilities? Can I only repoint and add abilities via the AIO or will this break something somewhere?
-11- If we can't do the above, can I just copy and paste "First Aid" multiple times and edit later in the AIO?

Monsters and playable classes have some 10 slots each and I want to double that.
  • Modding version: Other/Unknown

Leonarth

Quote from: undefined-1- Do I paste the whole code in the buildfile? or do I just paste the first three lines?
The first three lines are a macro to write ability data, the rest is an example of how to repoint an ability list and how to write ability data to the repointed list.

Quote from: undefined-2- MyNewList is address of the new pointer? Can I just use some address beyond 0xA39920?
If you want to live like a caveman, sure, use a fixed offset instead of a label.
Nothing stopping you. Just remember to keep track of the offset and to add the terminator to the end of the list, 8 zeros.

Quote from: undefined-3- test.bin is automatically created? or must I put something in it?
You have to make this file, it is explained in 3rd to 5th paragraphs: you need to copy the data of the vanilla ability list, this is just so you don't have to redo all the abilities.

Quote from: undefined--5--0xDD this is index.
It is the index... Of the name string. We are not specifying the ID of the ability anywhere in here (we do specify the effect ID, don't confuse those two), the ID of the ability is going to be based on where it is in the list. You can make a macro that inserts to a specific index in the table as well, if you want that:

#ifndef newAbility
#define editAbility(label,ID,Name,Desc,Effect,Type,Cost) "PUSH; ORG label+(8*ID); SHORT Name Desc Effect; BYTE Type Cost: POP"
#endif

This macro can also be used to edit lists you haven't repointed by using their offset instead of a label, obviously not to expand them, just to edit the existing abilities.

Either way, if you look at the macro it tells you what each value means newAbility(Name,Desc,Effect,Type,Cost)
Name (ID), Description (ID), Effect (ID), Type, Cost

Quote from: undefined--8--(81 is the yellow in-battle effect text; it's not in that code, so is it not important?)
0x81, not 81, and that is part of the effect list. It's not that it isn't important, it's just not part of the ability list of a race. Completely different tables.
It would have made more sense to have in the ability list, if you ask me, but that's not how it is.

Quote from: undefined--9--what is 1? does it mean A-ability? If so, what to use for S/R/C abilities?
3 is support, 4 is reaction, 5 is combo, anything else is action as far as I know

Quote from: undefined-10- Is it required to copy abilities? Can I only repoint and add abilities via the AIO or will this break something somewhere?
-11- If we can't do the above, can I just copy and paste "First Aid" multiple times and edit later in the AIO?
It's required if you want to keep them. Either copy the raw data of the table (test.bin in the example) or make them from scratch using the macro.
As for AIO, I have no clue, I don't use it, I don't know how it works.

Will it read your new pointer or are the offsets of the lists hardcoded?
I don't know.
If it does read your new pointer, will it show more learnable abilities in the list or is that hardcoded?
I don't know.
Will it behave the same way in the job editor and in the learnable moves editor?
Probably not.

If I had to go with a gut feeling, I would say it will read your new pointer, and you will be able to edit the Start and End abilities for the jobs, but you won't be able to edit the ability data, or at least not the ability data for entries past the original ammount.
  • Modding version: Other/Unknown

rrs_kai

Quote from: Leonarth on July 07, 2020, 05:29:49 pmit is likely that early in development either they wanted each special character to have a unique job
I am not well aware of FFT (blasphemy?) and I recently saw an LP, which had characters with jobs named:
Dark Knight
Ark Knight
Rune Knight
These three are present in FFTA as name-only jobs.
  • Modding version: Other/Unknown

Blunderpusse

Quote from: Leonarth on August 02, 2020, 11:25:54 am-11- If we can't do the above, can I just copy and paste "First Aid" multiple times and edit later in the AIO?

You can make multiple copies of "First Aid" (or whatever other ability you want) on your "MyNewList" and edit it later on AIO (tried it as well, but with "White Wind"). However, I found it too much of hassle to edit the abilities later on AIO.

If you use the macro Leonnarth provided to repoint ability lists, you can give more abilities to monsters. Imagine, if you repoint the Goblin's ability list to your "MyNewList", your goblins will have the abilities you put on your "MyNewList".
  • Modding version: Other/Unknown
"You sure are a keen observer of the obvious, kupo!"