• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 28, 2024, 04:45:44 pm

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Leonarth

1
For the race ability lists, you can repoint them and such to get the max number of entries on each race at the same time, there shouldn't be an issue there, but you still can't easily give humans more abilities.

This is because of how AP for mastering abilities is stored. Each unit has about 0x90 bytes to store their AP progress for each ability. There may be a few bytes free in there, I haven't tested it thoroughly, but, considering this starts at +0x40 in the unit data and +0xD0 holds the CT, at most we are looking at 0x90 bytes, with humans already having 0x8D abilities.

If you do use the 1bit abilities engine hack then you no longer have to worry about that, since AP is completely removed and (as the name implies) mastery is stored in a single bit, leaving a lot of bytes free even after raising the limit to ability 0xFF.
2
FFTA/FFTA2 Hacking / Re: Help with Leonhart's Engine Hacks
September 16, 2023, 12:39:31 pm
Quote from: undefinedIn the file it mentions that when a unit spawns, it does so with predetermined stats but with the average stats [...] does that mean that when a unit levels up it does so with the highest possible stats?
The stats will be average for the job the unit spawned as, and they will remain the average when leveling up, not the lowest, not the highest. Let's use soldier as an example:
Soldier has an HP growth of 8.4, a soldier that spawns at level 1 would normally get an extra 8 hp, with a 40% chance to get another point (and so 60% to not get more than 8 points). A soldier spawning at level 2 would normally get 16 extra hp, with a 16% chance to get 2 more points and a 48% chance to get 1 extra point instead (so, 36% chance to not get anything over the guaranteed 16).
If your unit is unlucky they can keep missing these extra points, if they are lucky then they'll be extra buff instead, the difference in hp between two soldiers of the same level (that have never had a different job) can be as high as their level.

With the hack it no longer works that way. Instead, at level 1 the soldier would get 8 points, always, and the 0.4 is essentially saved for the future. At level 2, the soldier would get another 8 points (so, 16 total), we add the 0.4 to the reserve, so we are sitting on 0.8 extra points now. By level 3 the soldier gets yet another 8 points, and another 0.4 leftover points, which brings the leftovers up to 1.2, so the soldier gets an extra point and the reserves go down to 0.2. This way there will never be a difference in hp for two soldiers that have never had a different job.

As a different example, if you had a level 1 soldier you would get a 0.4 of hp saved for future level ups, if you now change jobs to paladin and level up, since paladin has a 7.6 hp growth, we would add 0.6 to the reserve, which comes up to 1 and so the reserve goes down to 0 and an extra point is granted.

Or at least that's how I remember designing it.


Quote from: undefinedAlso, will those stats be the same regardless of the job?
The stats a unit spawns with are 100% based on the job they spawn as, so... No?
The stats depend on the job.


Quote from: undefinedOr will they only be the same when they are the same job and will they vary from one job to another?
If they spawn as the same job, at the same level, they'll have the same stats, if they spawn as different jobs then they won't have the same stats, even if you change their jobs to match after having recruited them.

The game makes no difference between spawning and leveling up, when a unit spawns at level 50 it just spawns and goes up 50 levels one by one. If you change jobs then you change the level up bonuses a unit can get, but you do not change the points they already got.


Quote from: undefinedIt also says that the maximum level goes to be 99, but that's also for enemies, right?
Sure.
3
FFTA/FFTA2 Hacking / Re: Help with Leonhart's Engine Hacks
September 15, 2023, 06:06:49 am
QuoteIf I want to use an option, should I remove "//" at the beginning of each option? And if I want to disable an option, should I add the "//" at the beginning of the option?
Yeah, that's it. Any "//" after the first one are there for actual comments written for humans to read, as opposed to commented out instructions for Event Assembler.

QuoteAfter that, do I use MAKE_HACK.cmd to apply the changes to the rom? I don't need use Event Assambly at all?
You run MAKE_HACK.cmd and it runs Event Assembler for you, as well as anything else that needs to run.

QuoteAnd another question, after Patching the rom with the mods I want, can I apply another ups/ips Patch on the rom with your hacks?
No. You cannot blindly apply a patch like that to a modified ROM because the patch will try to write to specific places in the file, which may now have been changed. If you tried to do this your patching application would probably warn you that the file does not match what is expected by the patch file.
In order to combine patches like this you can either recreate them in event format or make sure there's no conflicts (either because there just weren't any to begin with, or because you modified the events in order to avoid them), neither of which is very straightforward to do.

You can turn an .ups patch into an event file with a tool called CUPS, but even then you'd have to check for conflicts by adding PROTECT statements and such. The source for CUPS is available, so one could modify it so that it generates PROTECT automatically, in which case you'd simply need to include it first in the buildfile for it to either work or throw an error if there's a conflict, so I guess that'd be the straightforward solution, if someone went and did it.
4
FFTA/FFTA2 Hacking / Re: Help with Leonhart's Engine Hacks
September 11, 2023, 05:28:13 am
Use your favorite plain text editor to edit "ROM Buildfile.event".
It's just a text file.

To comment out a line, add "//" in front of it, and delete the "//" in front if you want to do the opposite.
5
It's got nothing to do with the intro skip, the link option is disabled on purpose because the changes to the game are not compatible with it.

Getting the changes to work in link mode would be a ton of effort and I doubt many people would be using it.
6
The change just makes the game return straight away from the routine that gets the 4 random numbers.

Either way, what I didn't realize is that the result is actually substracted from the stat, so to get the best result you would need to write 0x40 0x42 0x70 0x47 (at 0x8002838) to make the starting value (op's 2x) negative, so that it is effectively added to the stat instead of substracted, then the routine returns.

So, yeah, the change was effectively making the stat variance the worst value possible. Either way I'm not sure why you said that "the recruited unit still had stat variance", though, the intention was never to remove the stat variance, it was to maximize it.
7
FFTA/FFTA2 Hacking / Re: FFTA Dispatch results crash
January 28, 2023, 08:35:03 am
Well, if you already unlocked the secret characters then as long as you don't use the cheat codes there's not going to be any difference between playing vanilla vs the missable items mod, you can just stick to the moded version.

As for the bugged items, perhaps at some point you mistyped an address for a cheat code or something similar?
The clan and mission data is all concentreted in one area, so it's not that unlikely for this to happen.
8
FFTA/FFTA2 Hacking / Re: FFTA Dispatch results crash
January 27, 2023, 11:03:06 pm
From what I've seen, you have managed to get some invalid item as a reward for the quest instead of the caravan musk. The game freezes trying to figure out its name.
You've seemingly also got some invalid law cards that crash the game if looked at.

I replaced the invalid item reward with the caravan musk and also removed all of the invalid law cards, but I'm unsure as to how much you could have corrupted this save file, so who knows if you'll run into more issues. The mission pool data did look a bit funky.

Given that you are only level 10, I'd recommend to just start over, but I attached your fixed save file regardless: dispatch_fix.zip

Either way, it was a cool experiment.
9
FFTA/FFTA2 Hacking / Re: FFTA Dispatch results crash
January 27, 2023, 04:24:52 pm
If you post your .sav file I'll try and take a swing at it.
I'll attempt to understand why it's crashing, but if everything else fails I can just cancel the dispatch for you.
10
Quote from: PillsburyJoeBoy on December 11, 2022, 10:03:44 pmI'd like to ask a question along these lines. Moreso just how to modify the default pallet used for special characters.
Ex: The default Marche in your party using the red or yellow pallet instead of the blue.
You can modify this by altering the table at 0x5273D8
The structure of the table is like this:
+0x00 Name ID
+0x01 Default job or something (it's hard to explain)
+0x02 Job ID
+0x03 Secondary job ID (for the second action command)
+0x04 Battle sprite ID
+0x06 Submerged battle sprite ID
+0x08 Battle sprite palette ID <- this is what you are asking about
+0x09 Extra palette to load (the special palettes totemas use)
+0x0A Unused?
+0x0B Portrait ID
+0x0C Portrait Palette ID
+0x0D Unused?

For example, let's say you wanted Montblanc to use the blue palette.
We take the character ID, 0x08, and multiply it by the size of an entry in the table, 0x0E: 0x8 * 0xE = 0x70.
We take the base address and add our result: 0x5273D8 + 0x70 = 0x527448.
We want to change the "Battle sprite palette ID" so we add 8 to that: 0x527448 + 0x8 = 0x527450.
So you only need to change the byte at 0x527450, and Montblanc will then use that palette ID.

There's probably a nightmare module for this, as well?
11
In a USA copy, go to offset 0x2838 of the ROM (or offset 0x8002838, if you are looking at the entire memory), then change 0x70 0xB5 to 0x70 0x47.
12
Like this?

I assume that's not what you meant, but the above is a 1 instruction change.
It is not very refined and it makes npcs with "no job" (like the barkeep) invisible, but other than that it makes the characters use the generic sprites for their jobs.

Anyway, if you mean you want several custom outfits for the characters then no tile editor is going to get that going for you. The code for it does not exist, but it would not be hard at all to implement, I simply never bothered because people are not making custom graphics for this game.

If you are down to make the graphics then stop messing with whatever tile editor you are using, switch to a regular image editor (I recommend Usenti, it was made with the GBA in mind) and simply edit the dumped graphics, respecting the palettes. If you do manage to get a set of custom clothes for the characters going then, like I said, making them work would not be hard on my end.

Here's the sprites, remember you also need to make sprites for when the character is in the water (which is a completely different sprite
ID): ffta_sprites.zip
13
Not sure which offsets/pointers you need.
Is this what you are looking for?


(All I did was run saptapper)
14
Quote from: undefinedafter quitting it in disgust
I did not quit, though, I simply saw that there was no way to properly make FFTA maps with Tiled.
A map editing tool specific to FFTA would need to be made, at least from what I have seen in generic tile editors.

Anyway, I put together some notes on maps, I'd like to know if there's any part of it that people feel needs further explanation.
Map table starts at: $569104
Number of entries: 0xA3
Size of an entry: 0x58

When accessing this table map ID is decreased by 1, so map ID 1 is the first entry, map ID 0 has no entry and instead produces a completely black map.

Map table:
0x00 Word Tileset graphics, relative offset (these are loaded to 0x06000000)
0x04 Word Tile arrangement for both layers, relative offset
0x08 Word Top layer behavior, relative offset
0x0C Short Relative offset to map palette for LCD A
0x0E Short pad?
0x10 Word Terrain map, relative offset
0x14 Word Main tile animations, relative offset
0x18 Word Main tile animation graphics, relative offset
0x1C Word Target VRAM offset for Main tile animations
0x20 Word Extra tile animations 1, relative offset
0x24 Word Extra tile animations 2, relative offset
0x28 Word Extra tile animations 3, relative offset
0x2C Word Extra tile animations 4, relative offset
0x30 Word Extra tile animation 1 graphics, relative offset
0x34 Word Extra tile animation 2 graphics, relative offset
0x38 Word Extra tile animation 3 graphics, relative offset
0x3C Word Extra tile animation 4 graphics, relative offset
0x40 Word Target VRAM offset for Extra tile animations 1
0x44 Word Target VRAM offset for Extra tile animations 2
0x48 Word Target VRAM offset for Extra tile animations 3
0x4C Word Target VRAM offset for Extra tile animations 4
0x50 Word pad?
0x54 Byte Sky palette id for LCD A
0x55 Byte Sky palette id for LCD B and TV
0x56 Byte Map palette id for LCD B and TV
0x57 Byte pad?

Relative offsets in Tile animations are added to their corresponding Tile animation graphics.

A map palette table entry is a short, relative offset to the start of that color mode's table.
Map palette tables start at:
LCD B: $42CC80
TV: $427A04
There is no LCD A table, as the LCD A map palettes are referenced through relative offsets.

All other relative offsets are always relative to the start of the table, $569104

Sky palettes do not work in the same way, I haven't really looked much into them, though.

Data accessed through relative offsets has a compression header.
Not all data can use every mode, for example, Tile arrangement only checks for modes 0x01, 0x10 and 0x11.

Palettes accessed through palette ID are always lzss compressed, with no compression header.

The compression header looks like this:
0x00 Byte Mode

if Mode is 0x00 or 0x02 (raw):
0x01 3Bytes Uncompressed data length
The rest of bytes are raw, uncompressed data

if Mode is 0x01 (raw, fixed size):
0x01 3Bytes Unused
The rest of bytes are raw, uncompressed data, Uncompressed data length is 0x4000 bytes

if Mode is 0x10 (lz77):
0x01 3Bytes Uncompressed data length
The rest of bytes are lz77 compressed data

if Mode is 0x11:
0x01 3Bytes Offset

if Offset is 0xFFFFFF:
Call the decompress routine again, passing the offset + 4 as the argument. For some reason.
I have only ever seen the mode on the new decompress call be 0x10, not sure what the point is.
else:
Get the word at Offset, and divide it by 256 (or >> 8), call this NewID.
Call decompress for Tile arrangement of map NewID (without substracting 1 from NewID).

if Mode is 0x12 (lz77):
0x01 Word Unused
0x05 3Bytes Uncompressed data length
The rest of bytes are lz77 compressed data

if Mode is 0x20 (lzss):
0x01 3Bytes Unused
0x04 Word Uncompressed data length
The rest of bytes are lzss compressed data

if Mode is 0x21:
??? Seems to never be used.
If modes 0x01 and 0x11 are anything to go by, this could be a map specific lzss mode.
That would simply mean the Uncompressed data length is fixed.
As it is never used, I never really bothered checking.

if Mode is 0x22 (lzss):
0x01 7Bytes Unused
0x08 Word Uncompressed data length
The rest of bytes are lzss compressed data

Data is decompressed before it can be accessed, the structures explained here are for the decompressed data.

Tile arrangement:
2 layers of:
64 rows of:
64 columns of:
0x00 Short Tile

The Bottom layer is first, the Top layer is second.
These tiles are stored in WRAM and then copied to VRAM as needed, so their format is just that of a regular GBA tile.
Layers are simply what the map looks like, they technically have no impact on gameplay.

The Bottom layer goes below the units, it contains most of what the map looks like.
Stuff on the Top layer goes above the Bototm layer. It goes below the units as well, unless specified otherwise by the Top layer behavior data.
The Top layer can easily be used as a way to add more detail to maps, which is something vanilla doesn't take advantage of.

Terrain map structure:
16 rows of:
16 columns of:
0x00 Byte Height of the terrain
0x01 Byte Type of the terrain
Positions start with the top left one, going right and down, as if reading.

Type of the terrain is actually a bitfield (not heavily tested):
0b0000 0000: No bits set, regular terrain
0b0000 0001: Can look at but can't walk on, however, can fly over
0b0000 0010: Water (can jump over, can stand on)
0b0000 0100: Can look at but can't even fly over
0b0000 1000: Can't look at and can't walk on
0b0001 0000: Nothing special?
0b0010 0000: Nothing special?
0b0100 0000: Nothing special?
0b1000 0000: Nothing special?

Top layer behavior:
64 rows of:
32 columns of:
0x00 Short Behavior
As you may have guessed, each column in the Top layer behaviour data affects two tiles of the Top layer in the Tile arrangement data.
Behavior is a packed struct that looks like this:
0b--YY YYHH HHH- XXXX
- denotes unused bits.

For example, if we had an X of 8, a Y of 12 and a H of 5:
X: 0b---- ---- ---- 1000
H: 0b---- --00 101- ----
Y: 0b--11 00-- ---- ----
Putting it all together:
0b0011 0000 1010 1000
Or, as a Short:
0x30A8

The purpose of this data is to determine when something in the Top layer goes in front of units, and when it goes behind them.
The X and Y components should correspond with the Terrain map tile this Top layer "object" would be "standing" on.
H should correspond with the height of that same Terrain Map tile.
I have not actually looked into how the game handles this data and what the actual checks look like, but going by these rules works fine enough.

Tile animations:
0x00 Short Length of graphics for each frame
0x02 Short Number of entries in the list
Then, for each entry:
0x00 Short Duration
0x02 Short Graphics relative offset (this gets multiplied by 0x20 after being read, which is the size of a tile)
15
That's a big question. Not an easy one to answer, there's a lot of ways data can be compressed, there's a ton of parts to a map entry (24 different atributes for a map), there's a ton of event instructions, there's a bunch of text tables...

It would take me days to write anything proper about maps or events, which is why I haven't really bothered doing it, two years ago or so I did write a python script that dumps all maps and their tilesets and palettes.
I could touch that up and send it your way if you are interested.

I also have WIP event assembler raws, which are descriptions of the event commands and their arguments that can be used with EA, as well as notes on how events are structured.

For text you can just go to Data Crystal, that should have most of the information you'd need.

Honestly, it's been simply too long since I was active on hacking this game, I don't remember all of the details so writing good doc is very hard, even when I made the custom map I just worried about understanding the parts I was changing and ignored the rest, so doc wouldn't be that comprehensive.

If you are really interested in one of the topics in particular (I assume you want to try your hand at making a tool?) let me know which one so I can focus on writing about that for you.
16
I've been very busy and I haven't really been able to work much on this or any of my other projects.
Most of my free time I use for relaxation, which I honestly think I need.

Quote from: undefineddid the map editor ever find its way to a releasable form
I never even started on a map editor, I used Tiled (as seen on my screenshot).
All I made was a python script that takes a tiled map and turns it into an event file.
It only really handles the visual part of the map.

The height of each map position, their terrain type (water, lava, column) and the allowed deployment positions have to be made by hand.
It does not handle insertion of the map, either, you have to write an installer for your map yourself.

I found there was no good way of using Tiled to make even the height map, which is an absolute basic feature of a ffta map, so I gave up on improving that further.

Quote from: undefinedtool for non Buildfile
If I ever make any tool it will only work for buildfiles.

Either way, what is wrong with your move descriptions? "broken" is very undescriptive.
17
FFTA/FFTA2 Hacking / Re: New jobs
October 29, 2020, 08:05:07 am
This board is for both FFTA and FFTA2 so, unless you specify, with a question this broad we have no way to know which game you are talking about.
18
FFTA/FFTA2 Hacking / Re: Editable Laws
August 26, 2020, 11:41:42 pm
Quote from: undefinedbut is there a way to modify (insert any behavior of the game here)
ASM. Learn ASM and write your own code so you can make new laws.
Although I would assume in vanilla laws are only checked after you act, so moving to a square adjacent to a Judge wouldn't trigger anything (unless you also modified the game to do so), so the law would be "Acting while adjacent to a Judge".
19
FFTA/FFTA2 Hacking / Re: FFTA Sprite Information
August 19, 2020, 07:42:42 pm
I'm not sure what your documentation would be, but I don't think there is anything else to investigate about Portraits, and there's not a lot left to look at for unit animations either.
I fear you are treading treaded ground.

QuoteI feel like I saw a detailed thread regarding this, in particular, which sprites can use which weapons. I'm wondering if there are any generic sprites (per race) that can use all weapons.
If you use my engine hacks all (playable) jobs can use all ability animations and all weapon animations.

You can also check my animation template for humanoids, which includes, again, all ability and weapon animations.

Edit: Honestly we might want to start a discord group or something, if you are committed to working on ffta. The forums are nice for archival but they don't really cut it when it comes to speed when teaching people new stuff and discussing notes and such.
20
You can find (almost) all of my stuff on github.

Rather than using a ROM editor, I use what we call a buildfile, which keeps all changes external to the ROM, which allows for version control, manages space for us and all that nice stuff.

If you do want to work on tools compatible with this, I suggest you take a look at minish maker, which is a level editor for Minish Cap that outputs buildfiles.

You might also want to check my thread: https://ffhacktics.com/smf/index.php?topic=12036.0