I've been working on a Purple Link patch for Tri Force Heroes (thread here) for a while now, and it seems I've hit the wall of my abilities to complete it.
Most parts of the patch involved a lot of experimenting and figuring things out myself, beyond what many of the available ROM-hacking programs can do.
For example: Ohana3DS is excellent for viewing character models and it includes a texture replacer. But when using it to extract textures, any portions with 0% opacity have their colour values ignored, and re-inserting these textures leaves black spots on the models in-game. I wondered if the alpha channel even mattered since the textures aren't transparent in-game, and it turns out the alpha channel is used as a specular map! I had to find another program to dump the textures intact. Also, Ohana3DS does a gnarly compression job when replacing ETC1-encoded textures, so I had to find a way to encode them first with higher quality, then replace then in the models via hex editor, after which I discovered that Link's outfit textures have 5 mipmap levels, not 4 as Ohana3DS reported.
Anyway! I'm going to list the remaining parts of my patch and share whatever details I've found out so far. If anybody's able to help or willing to try, that'd be swell!
1. Home Menu banner
I posted a thread about this (here) but it had no replies. Basically, I've edited banner.bin to include the Purple Link and logo. However, this only shows up on the Home Menu if I insert it into the base game. My patch is a RomFS edit of the game's DLC/update, which doesn't include its own banner. I can't figure out how to add this edited banner.bin to the update, or if it's even possible.
Also, the background oval cycles between the 3 Links' colours, so it still appears green at times. (The oval's texture is actually yellow for some reason.) Loading the banner in Every File Explorer indicates that it has 3 "Lights", which I presume are what controls those colours, but I haven't found a way to view or edit their data.
2. Layout files
Tri Force Heroes uses the Wii U extensions BFLYT, BFLAN and BFLIM for its Layout files instead of the usual BCLYT and so on. They appear to use little-endian values like other 3DS files.
I've looked into BCLYT file structure here (https://3dbrew.org/wiki/CLYT_format) and while there's little documentation of BFLYT files, they're based on Wii BRLYT, shown here. (http://wiki.tockdom.com/wiki/BRLYT_(File_Format)). Tri Force Heroes files resemble those file structures but seem to be some differences - many sections don't have the lengths listed in those Wikis, and the tools listed can't seem to read them.
I've read @RosaliinaDaHacker64 's thread (here) which explains the screen coordinates, but when it comes to colour values I'm not sure what to look for. 4-byte RGBA values? Floating-point numbers?
2a. Touchscreen panels
These are most likely coloured via Layout files. I've found various related images in the ROM, for different player setups.
A 3-player game uses these:
course_player_base00 for the other players' panels
course_player_base01 for your player, displayed in your colour (with the slightly brownish hue)
PlayerBaseEdge00 making up the outline on your panel
Constructed example:
A 1-player game uses these:
CoursePBaseSingle00 for all 3 panels, coloured for the active player
PBaseSingleEdge00 & PBaseSingleEdge01 making up the outline for all 3 panels; all coloured, but partially transparent for the inactive players.
Constructed example:
There are also these images:
ArenaPlayerBase00
ArenaPlayerBase01
The "Arena" label refers to Coliseum battles, but I don't have any screenshots from there. Presumably they also use some outline graphics like the others.
There seem to be some relevant files in Archive/Common/Lyt_Game.arc:
Gm_ArenaPlayerBase00.bflyt
Gm_ArenaPlayerBase01.bflyt
Gm_CoursePlayerBase00.bflyt
Gm_CoursePlayerBase01.bflyt
Gm_CoursePlayerBase02.bflyt
Gm_CoursePlaySingle_B.bflyt
Gm_ArenaPlayerBase00_*.bflan
Gm_ArenaPlayerBase01_*.bflan
Gm_CoursePlayerBase00_*.bflan
Gm_CoursePlayerBase01_*.bflan
Gm_CoursePlayerBase02_*.bflan
2b. Link checkers
There are "outline" images that show where the other players are.
LinkChecker_00: Any offscreen players have Link's face, surrounded by this outline in their colour, at the edge of the screen. The outline rotates to point directly to that Link.
LinkChecker_01: This is used when an offscreen player hits the "Over Here!" icon. If the player is onscreen, the coloured outline seen on the speech bubble is a part of that speech bubble image. But if they're offscreen, the game superimposes this outline, coloured via Layout files, to be able to point in the player's direction.
2c. Onscreen text
Whenever a Link totems, takes damage, gets certain items, or various other actions, a text string scrolls across the screen. The Link's name appears in their colour. This is probably done through Layout files, but I don't know where to look for the colour values.
3. Particle effects
Inside the RegionBoot.szs archive, there's a folder called Effects/ which contains five .ptcl files. I presume these stand for "particle", and by looking through them quickly in a hex editor, they contain references to things listed below.
Judging by how some of the encoded sections look, they might also contain some related textures, as there are a bunch mentioned below that I haven't found anywhere else.
I can't find any documentation on .ptcl files, just a couple mentions of them being used in Pokémon as well. It looks like the beginning of the files contain pointers to the data they contain.
3a. Switching doppels
When you switch between the doppels in a 1-player game, a "beam" quickly shoots between the two doppels. It starts as the colour of the old doppel and fades into the colour of the new doppel as it moves. The beam emits some particles and has a sphere at its head.
Here it is, appearing green when I switch to Purple Link:
Once the switch happens, there's a little puff of smoke around the player, also in their colour. This is not to be confused with the yellow "shine" that briefly appears inside the puff:
3b. Platform effect
When a player walks on a specific-coloured platform, as shown, a small ring in their colour pulsates around their feet. If you look closely, you'll see there's green at the outline, and also in a spot directly under Link's feet.
It might be located in the same region as the Dunewalker Duds' sand ring effect, wherever that is.
3c. More glowing stuff
Prismantus has orbs that are coloured by textures, but their glow seems to be a particle effect.
The magic ball that The Lady throws around has this glow too:
Here you can see that it acts as a light source.
There are also some sparks trailing it. When the magic ball hits the ground, it shocks the player with a coloured lightning strike:
You can see that right below Link, the lightning texture starts to repeat, which indicates that it probably is, in fact, a texture.
The magic ball's model only includes the textures on the sphere itself. However, packed in with the Sky Temple 4's files is ObjBigMadamBall.tlb, which seems to make some references to players' colours.
3d. This thing
Could be a particle effect as well. The texture doesn't appear in the enemy's model, any of the stage files, or common texture files.
Most parts of the patch involved a lot of experimenting and figuring things out myself, beyond what many of the available ROM-hacking programs can do.
For example: Ohana3DS is excellent for viewing character models and it includes a texture replacer. But when using it to extract textures, any portions with 0% opacity have their colour values ignored, and re-inserting these textures leaves black spots on the models in-game. I wondered if the alpha channel even mattered since the textures aren't transparent in-game, and it turns out the alpha channel is used as a specular map! I had to find another program to dump the textures intact. Also, Ohana3DS does a gnarly compression job when replacing ETC1-encoded textures, so I had to find a way to encode them first with higher quality, then replace then in the models via hex editor, after which I discovered that Link's outfit textures have 5 mipmap levels, not 4 as Ohana3DS reported.
Anyway! I'm going to list the remaining parts of my patch and share whatever details I've found out so far. If anybody's able to help or willing to try, that'd be swell!
1. Home Menu banner
I posted a thread about this (here) but it had no replies. Basically, I've edited banner.bin to include the Purple Link and logo. However, this only shows up on the Home Menu if I insert it into the base game. My patch is a RomFS edit of the game's DLC/update, which doesn't include its own banner. I can't figure out how to add this edited banner.bin to the update, or if it's even possible.
Also, the background oval cycles between the 3 Links' colours, so it still appears green at times. (The oval's texture is actually yellow for some reason.) Loading the banner in Every File Explorer indicates that it has 3 "Lights", which I presume are what controls those colours, but I haven't found a way to view or edit their data.
2. Layout files
Tri Force Heroes uses the Wii U extensions BFLYT, BFLAN and BFLIM for its Layout files instead of the usual BCLYT and so on. They appear to use little-endian values like other 3DS files.
I've looked into BCLYT file structure here (https://3dbrew.org/wiki/CLYT_format) and while there's little documentation of BFLYT files, they're based on Wii BRLYT, shown here. (http://wiki.tockdom.com/wiki/BRLYT_(File_Format)). Tri Force Heroes files resemble those file structures but seem to be some differences - many sections don't have the lengths listed in those Wikis, and the tools listed can't seem to read them.
I've read @RosaliinaDaHacker64 's thread (here) which explains the screen coordinates, but when it comes to colour values I'm not sure what to look for. 4-byte RGBA values? Floating-point numbers?
2a. Touchscreen panels
These are most likely coloured via Layout files. I've found various related images in the ROM, for different player setups.
A 3-player game uses these:
course_player_base00 for the other players' panels
course_player_base01 for your player, displayed in your colour (with the slightly brownish hue)
PlayerBaseEdge00 making up the outline on your panel
Constructed example:
A 1-player game uses these:
CoursePBaseSingle00 for all 3 panels, coloured for the active player
PBaseSingleEdge00 & PBaseSingleEdge01 making up the outline for all 3 panels; all coloured, but partially transparent for the inactive players.
Constructed example:
There are also these images:
ArenaPlayerBase00
ArenaPlayerBase01
The "Arena" label refers to Coliseum battles, but I don't have any screenshots from there. Presumably they also use some outline graphics like the others.
There seem to be some relevant files in Archive/Common/Lyt_Game.arc:
Gm_ArenaPlayerBase00.bflyt
Gm_ArenaPlayerBase01.bflyt
Gm_CoursePlayerBase00.bflyt
Gm_CoursePlayerBase01.bflyt
Gm_CoursePlayerBase02.bflyt
Gm_CoursePlaySingle_B.bflyt
Gm_ArenaPlayerBase00_*.bflan
Gm_ArenaPlayerBase01_*.bflan
Gm_CoursePlayerBase00_*.bflan
Gm_CoursePlayerBase01_*.bflan
Gm_CoursePlayerBase02_*.bflan
2b. Link checkers
There are "outline" images that show where the other players are.
LinkChecker_00: Any offscreen players have Link's face, surrounded by this outline in their colour, at the edge of the screen. The outline rotates to point directly to that Link.
LinkChecker_01: This is used when an offscreen player hits the "Over Here!" icon. If the player is onscreen, the coloured outline seen on the speech bubble is a part of that speech bubble image. But if they're offscreen, the game superimposes this outline, coloured via Layout files, to be able to point in the player's direction.
2c. Onscreen text
Whenever a Link totems, takes damage, gets certain items, or various other actions, a text string scrolls across the screen. The Link's name appears in their colour. This is probably done through Layout files, but I don't know where to look for the colour values.
3. Particle effects
Inside the RegionBoot.szs archive, there's a folder called Effects/ which contains five .ptcl files. I presume these stand for "particle", and by looking through them quickly in a hex editor, they contain references to things listed below.
Judging by how some of the encoded sections look, they might also contain some related textures, as there are a bunch mentioned below that I haven't found anywhere else.
I can't find any documentation on .ptcl files, just a couple mentions of them being used in Pokémon as well. It looks like the beginning of the files contain pointers to the data they contain.
3a. Switching doppels
When you switch between the doppels in a 1-player game, a "beam" quickly shoots between the two doppels. It starts as the colour of the old doppel and fades into the colour of the new doppel as it moves. The beam emits some particles and has a sphere at its head.
Here it is, appearing green when I switch to Purple Link:
Once the switch happens, there's a little puff of smoke around the player, also in their colour. This is not to be confused with the yellow "shine" that briefly appears inside the puff:
3b. Platform effect
When a player walks on a specific-coloured platform, as shown, a small ring in their colour pulsates around their feet. If you look closely, you'll see there's green at the outline, and also in a spot directly under Link's feet.
It might be located in the same region as the Dunewalker Duds' sand ring effect, wherever that is.
3c. More glowing stuff
Prismantus has orbs that are coloured by textures, but their glow seems to be a particle effect.
The magic ball that The Lady throws around has this glow too:
Here you can see that it acts as a light source.
There are also some sparks trailing it. When the magic ball hits the ground, it shocks the player with a coloured lightning strike:
You can see that right below Link, the lightning texture starts to repeat, which indicates that it probably is, in fact, a texture.
The magic ball's model only includes the textures on the sphere itself. However, packed in with the Sky Temple 4's files is ObjBigMadamBall.tlb, which seems to make some references to players' colours.
3d. This thing
Could be a particle effect as well. The texture doesn't appear in the enemy's model, any of the stage files, or common texture files.