Huichelaar's Assembly Adventures

Here I’ll be uploading some ASM I wrote. Everything here is only for FE8U. I’m pretty new to thumb assembly and have not shared ASM before, so expect issues when trying to use this stuff. I’d really appreciate it if you could tell me of any issues you run into!

Also, massive thanks to the people who helped me understand asm over at the spell-academy channel in FEU’s discord. You’ve been a great help! Teq’s guide has also been incredibly helpful:

Multipalette Colour BGs

Multipalette Colour BGs v4

Link.
This patch will allow you to use BGs that display in 256-colour mode.
details in the README.md.

mGBA_2023-04-11_16-22-59

Base Chapters

Base Chapters v1

Link.
details in the README.md.

https://i.imgur.com/z8ZfXr0.gif

HueShift

HueShift v0

Download
Github

How to install
Install by using Event Assembler to apply “Disco.event” to an FE8U ROM, or include “Disco.event” in your buildfile.

What’s this?
This replaces the “Link Arena” option in the “Extras” submenu, accessible after going through the title screen. The new “???” option works like a toggle. Once you select it, all palettes will gradually have their hue shifted. Once a full hue shift loop has been made, the process repeats. You can disable the effect the same way you initiated it, by simply selecting “???” in the “Extras” submenu again.

Warning
Hueshifting all 512 colours (yes even the transparent ones, sorry) every frame seems to put quite a burden on the GBA (and a few emulators, curse their accuracy). Performance very notably goes down. I would not recommend using this hack for anything in its current state. It’s more of a proof-of-concept.

Concluding
I made this hack for the FEU community asm telephone hacc: Feature (Not a Bug)
Loads of fun stuff in there, check it out. Oddly many things relating to manipulating colours in there; Great minds think alike! I even needed to hook in someone else’s hook because we both needed the same area.

I don’t assume performance would be as much of an issue if the amount of hue-shifted colours is reduced to, for example, three or so. More practical applications are beyond this proof-of-concept. I’ll leave that implementation as an exercise to the reader (or future me).

Until next time. 09/07/2022 ~Huichelaar

https://i.imgur.com/qk2l3vW.gif

Another Animation Assembler

AAA v0

Download
Github

How to install
There’s more details in the README. What’s there is just an environment to showing off the one feature of the script I think is possibly interesting to people.

What’s this?
So this is an environment for showing off a script I’ve been working on, AAA. It takes a battle animation script as input. It also needs the frames mentioned in the script. It then produces an Installer.event file which can be inserted in a buildfile project. So far all of this can be achieved with existing tools. I just added a few new options for some fun. Most noteworthy (in my opinion) is the option of using two palettes for 30 colours instead of the usual 15.

The Bow Knight example animation shown below uses 27 of these 30 colours.

NO$GBA_2022-01-06_14-55-07

SoundRoomBG

SoundRoomBG v1.1

Download
Github

How to install
This patch is for FE8U!

  • Buildfile users: Install by using Event Assembler to apply “SoundRoomBG.event” to your ROM, or include “SoundRoomBG.event” in your buildfile.

  • FEBuilder users: “Advanced Editors”->“Insert EA”->“Select File”. Pick “SoundRoomBG.event” and press “Load Script”.

What it do?
This patch adds the option to display different backgrounds in the sound room based on which song is currently playing. It’s possible to have multiple backgrounds display consecutively (with 5 second pauses before transitioning to the next background) or a single background only. Whilst in the soundroom, press L to hide the UI. Press any button to display the UI again.

More details can be found in the README.

2021-09-12_16-56-21

Minimug palette fix

Minimug palette fix v2

Download
Github

How to install
This patch is for FE8U!

  • Buildfile users: Install by using Event Assembler to apply “MinimugPalette.event” to your ROM, or include “MinimugPalette.event” in your buildfile.

  • FEBuilder users: “Advanced Editors”->“Insert EA”->“Select File”. Pick “MinimugPalette.event” and press “Load Script”.

What it do?
When switching from one minimug to another, the new palette is buffered, but the new tiles are immediately flushed to VRAM. This patch instead buffers the tiles, preventing that one frame where a minimug is using the wrong palette.

https://i.imgur.com/qLrsgsI.gif

Preparations Augury

Preparations Augury v1

Download
Github

How to install
This patch is for FE8U!

  • Buildfile users: Install by using Event Assembler to apply “PrepsAugury.event” to your ROM, or include “PrepsAugury.event” in your buildfile.

  • FEBuilder users: “Advanced Editors”->“Insert EA”->“Select File”. Pick “PrepsAugury.event” and press “Load Script”.

What it do?
This patch adds another option (default: “Tactics”) to the preparations menu. Choosing this option will go to another screen where dialogue text is executed. Once the text ends, the game returns to the preparations menu. The idea is to mimic FE7’s “Augury” feature, although without the need to pay any money.

Customization
Details can be found in the README.txt.

Concluding
23/8/2021. This took me far less time (only two days!) than I imagined it would. I made this for an asset trade with Retrogamer, and they allowed this to be shared with everyone else.
27/8/2021. I added the option to display different text based on whether certain units are alive or certain flags are set. It’ll unfortunately make it necessary to plan ahead when using more rigid tools like FEBuilder.

2021-08-23_19-57-44

Custom Thrown Weapon Animations

Custom Thrown Weapon Animations v1

Download
Github
There should be a big green “Code” button on this page, allowing you to download everything.

How to install
Install “CustomThrownWeapon.event” on an FE8U ROM using Event assembler or include “CustomThrownWeapon.event” in your buildfile.

What it do?
This thing adds a new thrown lance animation and a new thrown axe animation. The thrown lance animation is basically the same as the vanilla ones but with its own graphic, whereas the thrown axe animation uses different framedata as well.

  • WyvernKnightJavelin
    Spell 0x48 is now a thrown lance resembling the WyvernKnight’s lance.

  • Big Handaxe
    Spell 0x49 is now a bigger thrown axe.

Customization
There are three tables, AxeAnim.event, LanceAnim.event and Spells.event.

  • Spells.event is a table of pointers to spell animations. If you want to move thrown weapon spell animations around, make sure to also update their spell slots in Lance/Lance.event and Axe/Axe.event.

  • AxeAnim.event is a table indexed by classes. Indicates which thrown axe anim should be used by which class.

  • LanceAnim.event is a table indexed by classes. Indicates which thrown lance anim should be used by which class.

Credits

  • I took the thrown lance from the FE8U WyvernKnight animation.

  • BigHandaxe blurs are from Super Robot Wars W, ripped by Domobot. I made the in-between though. Obsidian Daddy added the brown handle part to the blurs.

  • Spell Loader, [FE8U][FE7U]Spell Loader by Kao, circleseverywhere, Tequila.

  • Item Effect Revamp, A Teraspark of Assembly - #2 by Teraspark by Teraspark.

Assuming I didn’t miss anything, the rest should go to me, Huichelaar.

ezgif.com-gif-maker (1) ezgif.com-gif-maker (2)

Custom Battle Animation Commands

Custom Battle Animation Commands v1

Download
GitHub

How to install
Install by using Event Assembler to apply “BattleAnimCommands.event” to an FE8U ROM, or include “BattleAnimCommands.event” in your buildfile.

Whatitdo?
This thing can be used to assign new effects to battle animation commands 0x7C and up. You can add your command to the list in “Commands/Commands.event”. There’s another list for playing sound effects here as well. Take a look at some vanilla command implementations to see how it works. If you add any commands, make sure to increase the value of the CommandCount variable in “BattleAnimCommands.event”

The original commands have also been repointed in “Commands/Commands.event”, so you can also assign different effects to these.

This version comes with two new commands taking up slot 0x7C and 0x7D. C7C is basically the same as C2E, but the rune’s palette is more reddish instead of blue. Analogous for C7D and C2F. I may have added more commands by now. Newest version in the link.

Concluding
21/5/2021. I got my anniversary badge two days ago. A year goes by so fast. This fortunately only took a day. I had fun making this. I’ll try experimenting with more custom commands at some other point in time.

Credits
Me, me, me!

2021-05-21_17-43-29

World Map Flags

WMFlags v1

Download
GitHub

How to install
Install by using Event Assembler to apply “WMSprites.event” to an FE8U ROM, or include
“WMSprites.event” in your buildfile.

If you’re already using csv tables, I’d recommend just adding “Paralogue.nmm” to your file organization. I didn’t provide a separate csv for this struct, but it’s a 1-byte struct, so it shouldn’t be too difficult to prepare your own. If you’re using Snek’s TableManager, just add a “Paralogue” column to your World Map Node table and add this line to TableOptions.s: “TABLE WMPTableLABEL WorldMap/Paralogue.nmm” right below your world map node table. Also add a “#define WMPTable WMPTableLABEL” to your “DataInstaller.event” or equivalent.

There’s a functionality that changes the effect of the “Guide” button. This button is part of the menu that you can open by pressing A on an empty square on a map. You can enable this functionality by uncommenting "#include “Debug/Debug.event”. Now, the “Guide” button will make you win the current chapter. (Doesn’t seem to work on Ephraim chapter 10, Turning Traitor. Maybe to do with it being a survive chapter.) If or once you don’t need this, feel free to delete the Debug directory & the "#include “Debug/Debug.event” line.

I’m also using this in my own hack project, so once I release some build of that, there’ll be an example of this being used.

Customization
The one thing to customize is of course which nodes are or are not paralogues. You can do this by changing the values of the “Paralogue” column in “Tables/WorldMap/Nodes.csv”. The other columns won’t be used by the initial setup I made, so don’t worry about their data. Feel free to add more rows, but be aware that vanilla only has 28 nodes, and a number of loops have hardcoded this limit, so I wouldn’t try to go beyond that if you don’t know what you’re doing.

Once you’re happy with the setup, make sure to assemble the tables (by pressing AssembleTables.bat) before using EA!

Whatitdo?
In the world map, vanilla only draws a red flag over the most recently set destination node, but this will draw flags over any node that has been set as destination. Moreover, nodes that have been set as paralogues will wave a green flag instead of a red flag, when they’re set as (a) destination.

Future expansions
I may add some other routines to draw other sprites on the world map some time in the future, if I can make use of it. For now, there’s some commented lines in “ASM/DrawSprites.asm” indicating where I’d call these routines.

Concluding
Today’s the 12th of April 2021. This was fun to make, and only took me about 2 days. That moment when you realize something that, out of ignorance, seemed complicated to mess with, but is actually quite straightforward. Always gets me giddy.

Credits

  • EA credits, copied from EA. Idk who first person is referring to.
    -Nintenlord for making this.
    -Kate/Klo/whatever for writing FE6 CHAR support
    -Everyone who submitted event codes for this, especially
    Fire Blazer and flyingace24.
    -markyjoe1990 for FE7 event template.
    -Mariobro3828 for FE7 world map definition values and
    for making the EAstdlib Macro and Command List.txt.
    -Arch for making code I can use to debug this app,
    for his tutorials and his FE6 template.
    -Ryrumeli for telling me the ASM routine that handles
    the events in FE8.
    -Omni for reporting errors with FE6 disassembly script.
    -Camtech075/Cam/Kam for making FE8 template.
    -Everyone who uses this and/or reports bugs and/or gives
    feedback.
  • FEBuilder by 7743. I used this for documentation. GitHub - FEBuilderGBA/FEBuilderGBA
  • HyperGammaSpaces’ notes on the WM struct at 03005280.
  • Snek (Snakey1), TableManager.
  • Huichelaar, c’est moi.
    Tell me if I’ve missed anyone, I’ll make sure to add them to the credits.

2021-04-12_09-57-57

Suspend x2

Suspend x2 v1

Download
GitHub

How to install
Install by using Event Assembler to apply “Suspendx2.event” to an FE8U ROM. Or include
Suspendx2.event in your buildfile. Read the README.txt; There’s a few quirks to pay mind to.

Whatitdo?
This is my attempt at replicating a sort of Mila’s Turnwheel/Divine Pulse in FEGBA. It is admittedly more limited.

You can create a backup suspend save at any time (except during a tutorial) during a chapter. Press “Backup” in the chaptermenu and you’ll be offered the option to create a backup save. If you don’t have a backup save yet, the command will be glowing green. If you choose “Yes” a backup of your current progress in the chapter will be made. If you already had a backup save, it will be overwritten.

To return to your backup save, go back to the main menu (by suspending or resetting the game), pick “Resume Chapter” and you should be presented with an option to either load your backup save “Bkup” or the suspend save, “Susp”. If this option isn’t presented to you, it’s either because you don’t have a backup save (they are cleared on regular saves, just like suspend saves), you ran out of "UNDO"s (more on that later), or there’s a bug. In that last case, let me know, so I can fix it.

Regarding “UNDO”. The “UNDO” window is displayed when you pick “Resume Chapter” and a backup save exists. The number in this window indicates how many more times you’re allowed to return to this backup. When this counter hits 0, you won’t be able to return to your backup save. The “Backup” command will not appear anymore either. Reset the counter by loading or saving a regular game save and subsequently making another backupsave.

Of course, regular suspend is still available. The game automatically saves after every action you take. If you return to a backupsave this save will also overwrite the regular suspend save (resuming a suspend/backup save also counts as an action), so feel free to turn off the game after returning to a backupsave.

So, like the Turnwheel, but with only one moment (of your choosing) you can go back to.

Creating backups is free, but returning to them can only be done a finite amount of times, before the player needs to save or load a game save to reset the counter. If you don’t save in between chapters, the backup save will still be available, but the counter won’t reset (nice try!)

Customization
There’s one variable, “UndoCount.” Change the value this holds in “Suspendx2.event” to whatever many times you wish to allow the player to return to a backup.

By default, there will be a backup command in the chaptermenu, right below suspend. If this makes the menu too cluttered, uncomment the #define OverwriteSuspend in “Suspendx2.event.” This will remove the backup command from the chaptermenu. Instead, you can create a backup save by pressing suspend and declining the offer to return to the main menu.

Credits

  • EA credits:
    • Nintenlord for making this.
    • Kate/Klo/whatever for writing FE6 CHAR support
    • Everyone who submitted event codes for this, especially
      Fire Blazer and flyingace24.
    • markyjoe1990 for FE7 event template.
    • Mariobro3828 for FE7 world map definition values and
      for making the EAstdlib Macro and Command List.txt.
    • Arch for making code I can use to debug this app,
      for his tutorials and his FE6 template.
    • Ryrumeli for telling me the ASM routine that handles
      the events in FE8.
    • Omni for reporting errors with FE6 disassembly script.
    • Camtech075/Cam/Kam for making FE8 template.
    • Everyone who uses this and/or reports bugs and/or gives
      feedback.
  • Text Processor made by circleseverywhere, StanH_.
  • ExModularSave made by StanH_, Colorz.
  • FEBuilder by 7743. I used this for documentation. GitHub - FEBuilderGBA/FEBuilderGBA
  • StanDOC by StanH_.
  • Teq Doq by Tequila.
  • Assuming I didn’t miss anything, the rest should go to me, Huichelaar.
    Tell me if I’ve missed anyone, I’ll make sure to add them to the credits.

2021-07-25_18-06-58

Fortresses & Materials

Fortresses & Materials v0

Download
GitHub
There should be a big green “Code” button on this page, allowing you to download everything. I’m trying something new here, if it doesn’t work out I’ll set up a dropbox.

How to install
Install by using Event Assembler to apply “Fortresses.event” to an FE8U ROM. Or include
Fortresses.event in your buildfile.

What it do?
Heya, this here is a thing I made which installs fortresses, forts, for short. These forts can do two
things for the player. First, they produce materials which can be used to upgrade these forts (I’m
also planning on building a crafting system which can use these materials to craft items). Second,
the forts can provide bonuses based on the (player) unit in charge of the fort. The only bonus I’ve
implemented so far is an exp boost, but I’m planning on making more. More details regarding how stuff
is implemented can be found in “README.txt.”

It’s all still very WIP so I doubt anyone can find a use for it yet, but if you’re interested you can at
least check it out.

Credits
Tell me if I’ve missed anyone, I’ll make sure to add them to the credits.

  • The tree being chopped down in the fort menu was made by Obsidian Daddy.
    • The other assets displayed in that animation (pirate, plateau) are in vanilla FE8, so credit goes to IS for that. I Frankenstein’d the “MATERIALS” and “FORTS” displayed in the fortmenu from vanilla FE8 menu UI, so credit goes to IS for that too.
    • The material icons in order of appearance in “Graphics/Materials.png”:
      • Coal from Bomberman Jetters Densetsu no Bomberman, ripped by Garamonde.
      • Copper from Bomberman Jetters Densetsu no Bomberman, ripped by Garamonde.
      • Lime from Bomberman Jetters Densetsu no Bomberman, ripped by Garamonde.
      • Iron from Bomberman Jetters Densetsu no Bomberman, ripped by Garamonde.
      • Wood made by kb.
      • Magic wood simple recolour I made of an icon by kb.
      • Spice from Minecraft, ripped by WizToad.
      • Gunpowder from Minecraft, ripped by WizToad.
      • Hemp made by Zarg.
      • Belladonna made by Beansy.
      • Laurel from Minecraft, ripped by WizToad.
      • Topaz made by GabrielKnight.
      • Ruby made by GabrielKnight.
      • Emerald made by GabrielKnight.
      • Diamond made by GabrielKnight.
      • Milk from Fire Emblem Fates, ripped by Henrai.
      • Cabbage from Fire Emblem Fates, ripped by Henrai.
      • Grape from Fire Emblem Fates, ripped by Henrai.
      • Fish from Fire Emblem Fates, ripped by Henrai.
      • Wheat from Fire Emblem Fates, ripped by Henrai.
      • Meat from Boktai 3 / Shin Bokura no Taiyou, ripped by Greiga Master.
      • Down from Radiant Historia, ripped by redblueyellow.
      • Hide from Radiant Historia, ripped by redblueyellow.
      • Wool from Radiant Historia, ripped by redblueyellow.
      • Oil made by GabrielKnight.
      • Rune from Radiant Historia, ripped by redblueyellow.
    • ExModularSave made by StanH_, Colorz.
  • EA credits:
    • Nintenlord for making this.
    • Kate/Klo/whatever for writing FE6 CHAR support
    • Everyone who submitted event codes for this, especially
      Fire Blazer and flyingace24.
    • markyjoe1990 for FE7 event template.
    • Mariobro3828 for FE7 world map definition values and
      for making the EAstdlib Macro and Command List.txt.
    • Arch for making code I can use to debug this app,
      for his tutorials and his FE6 template.
    • Ryrumeli for telling me the ASM routine that handles
      the events in FE8.
    • Omni for reporting errors with FE6 disassembly script.
    • Camtech075/Cam/Kam for making FE8 template.
    • Everyone who uses this and/or reports bugs and/or gives
      feedback.
  • Text Processor made by circleseverywhere, StanH_.
  • Assuming I didn’t miss anything, the rest should go to me, Huichelaar.

2021-01-01_20-02-25

Custom Chapter Intro

Custom Chapter Intro v1

Download
The one with the crystals. This version runs pretty poorly on GBA. I’ll probably delete this link soon.
The better one with the crystals.
The one without the crystals. Used in Pokémblem.

How to install
The following two options exist:

1. If you have a buildfile, just add an #include "ChapterScreen/ChapterScreen.event" or #include "ChapterScreenPokémblem/ChapterScreen.event" to the buildfile. Make sure that the ChapterScreen or ChapterScreenPokémblem folder is in the same directory. Alternatively, apply ChapterScreen.event directly to a clean FE8U ROM using Event Assembler.

2. If you’re using FEBuilder, go to Advanced Editors → Insert EA → Open. Pick ChapterScreen.event and press Load Script. If I’m not mistaken FEBuilder will just ignore the defined FreeSpace in ChapterScreen and use its own generated value instead.

What it do?
This patch replaces the standard chapter opening with something I made. There’s a segment that shows off some crystals doing some funky rotations followed by a segment displaying the chapter title while all living recruited units run from left to right, presumably to this chapter’s destination.

Customization
Which crystals will display is determined by a table that takes chapterID as an index. If you wish to change which crystals will appear per chapter (maybe for plot reasons?), you can change the values in this table. Details on how to do this can be found in the README. The combination of displayed crystals will affect the colour of the background once the gems are ‘slotted’.

I can understand that having the crystal combination be determined by something as rigid as ROM may not be desirable, therefore there’s a GetGemMask function which is used to get the combination of crystals to be displayed during the chapter opening. All you have to do is change this function to maybe grab some reserved byte in RAM instead and everything should be good. The mask can be stored in a single byte, even just 6 bits (one for each gem) will be enough.

There’s more details on customization in the README.

Pokémblem version
I made a variant without gems/crystals. This one uses a 256-colour background. Mind, only 224 colours are available, as the last two palettes are reserved. Vesley’s Pokémblem uses this variant as of 8 November 2020, but it should be compatible with vanilla FE8U as well.

Concluding
I had wanted to do this for a while, but had to first finish my previous project. Now that it’s finally here, seeing it all come together, it’s all very rewarding. The only frustration I had was coming up with ideas for this whilst having to wait a decent while before I could see them come to fruition due to the time it takes to implement the ideas. Not to mention the stuff I still want to implement, but I guess I’ll save that for another custom chapter opening someday in the future.

Credits

  • Agro/Brendor for the 16 Tracks/12 Sounds Fix.

  • Alusq for the amazing music installer template they made.

  • 7743 for FEBuilder. Amazing multipurpose tool, great for documentation too!

  • Square Enix for the Gems/Crystals and Ryan914 for ripping them from Final Fantasy (Dawn of Souls).

  • Konami for the Mist and SMITHYGCN for ripping it from Castlevania Harmony of Dissonance.

  • Konami for the Relief and Urathros for submitting it to Spriters Resource. Idk who ripped it, but it’s used in Yu-Gi-Oh!: Reshef of Destruction.

  • Game Freak for the VersusBG and DRAGOON for ripping it from Pokémon Platinum Version.

  • Game Freak for the AreaBGs and Latias Tamer for ripping them from Pokémon HeartGold/SoulSilver Version.

  • Huichelaar, that’s me. Idk if it’s rude putting yourself on a credit list, but I did make the thing.

Also a massive thank you to the people over at the FEU’s discord #spell-academy channel who have:

  • helped me understand how thumb works.
  • made tutorials regarding inserting assembly, creating processes, using Lyn, reducing buildtime, etc.
  • referred me to great resources such as GBATek and tonc.


Adaptive BGM

Adaptive BGM v0

Dropbox containing the patch.

This one is really just a proof of concept at this point. I’ll get back to this, eventually.

What it do?
Basically, Adaptive BGM mutes/unmutes certain tracks/channels of a midi during battle and unmutes/mutes those tracks outside of battle. In the example I provided in dropbox, I’m using a modifed version of Desire Below (arranged by Libera over at ninsheetmusic, modifed by me). Outside of battle, only tracks 1, 2 and 3 are playing (0, 1, 2 depending on your mood). When battle starts, tracks 4 and up are unmuted. When battle ends tracks 4 and up are muted again.

Prerequisites
To take full advantage of Adaptive BGM, you should assemble the Change Battle BGM By Chapter (credit: 7743) patch.

You should probably also assemble the 16 Tracks/12 Sounds Fix (credit: Agro/Brendor) patch. It’s part of the Essential Fixes of the skillsystem.

Make sure NOT to assemble the Continue Battle BGM Between Map and Combat (credit: 7743) patch. Adaptive BGM actually uses a modifed version of Continue Battle BGM.

How to install
There’s 2 options:

1. If you have a buildfile, just add an #include "FE8-CalmFlow/CalmFlow.txt" to the buildfile. Make sure that the FE8-CalmFlow folder is in the same directory. Alternatively download the Dependencies folder and buildfile.event, and assemble buildfile.event using a clean FE8U ROM.

2. Apply the FE8U-ABGM.ups patch to a clean ROM. This patch also sets the Prologue’s Player Phase BGM, Player Phase Battle BGM, Enemy Phase BGM and Enemy Phase Battle BGM to Desire Below. Please let me know if the patch doesn’t adapt successfully, or if something goes wrong.

How to use
I’ll be using FEBuilder a lot in this section. I find it more easy to work with for this part.

There’s no need to keep the .midi, .s or .mp4 files in the FE8-CalmFlow folder, but to replicate what’s happening in the .mp4 sample, import Fire Emblem Fates - Desire Below.s in FEBuilder’s Song Track editor to track 3DD.

Make sure to also set 3DD’s priority type to High (Map Music) in FEBuilder’s Song Table. Finally, in the chapter editor, set the Player Phase BGM and the Player Battle BGM and/or the Enemy Phase BGM and Enemy Battle BGM to 3DD. That should be all.

Customization
Right-o, that’s all neat for this one (poorly adapted) soundtrack, but what about other soundtracks? Well, there’s some room for customization!

  • Simply importing a different MIDI to location 3DD will have the same effect of channels 4 and up being unmuted during battle and muted outside of battle.
  • This effect can also be applied to a different location, X, if you replace all instances of 3DD in InitCalm.asm, ReturnCalm.asm, FadeoutCalm.asm, EndBattleCalm and ContinueBattleBGM.asm with X and re-assemble these files.
  • What if you want to mute different (from the top 3) channels outside of battle? Not very hard, but requires a little knowledge of asm. I’ll provide some details below.
  • Maybe there are certain channels you wish to mute during battle. This one will also require some asm knowledge. More details below.
  • You may want to have multiple soundtracks that can adapt. Maybe for one of these soundtracks channels 3 and up should be muted outside of battle, yet for another soundtrack it’s channels 5 and up. This requires more asm stuff. this time too, it’s not particularly hard, but rather than me painstakingly explaining every step for this one I’d rather you take a look at the asm (I commented it) and ask me if anything isn’t clear, so I can clarify it.
Muting channels outside of battle

There’s a cmp rX, #0xD command (where X can be some number between 0 and 7) in InitCalm.asm, ReturnCalm.asm and FadeoutCalm.asm, followed by a conditional branch (either ble or bgt). 0xD ensures that channels 3 (0xE), 2 (0xF) and 1 (0x10) remain unmuted outside of battle. increment 0xD to 0xE, and only channel 1 and 2 will be unmuted outside of battle. Decrement 0xD to 0xC and channel 1, 2, 3 and 4 will remain unmuted outside of battle. You will also have to increase or decrease the immediate in line 36 of ContinueBattleBGM.asm accordingly, to indicate which tracks should be unmuted during battle. Also, the immediate in line 38 of EndBattleBGM.asm needs to be adapted appropriately as well. As long as the channels that are to be muted outside of battle are at the top (not interwoven with the other tracks), this will work. If they aren’t, you’ll have add a few more conditional and unconditional branches and labels. Teq’s guide should be very helpful for this: GBAFE Assembly for Dummies, by Dummies - #4 by Tequila

muting channels during battle

I won’t go into too much detail this time, but to mute channels when battle starts you’ll have to put some conditional branches around line 52 in ContinueBattleBGM.asm. If the immediate in line 52 is 0x40, the track (which should be 0x10-r5) at that iteration of the loop will be unmuted when battle starts. If the immediate is 0x0 the track will be muted when battle starts. r5 contains the counter which counts down for every iteration of the loop, and we know which track we’re dealing with by subtracting it from 0x10.

Concluding
In retrospect, after writing all these paragraphs, I do see how user-unfriendly this patch really is. I still believe it’s more helpful than nothing, but I understand it’s not very attractive to have to do assembly-coding to ‘properly’ take advantage of this patch. I’ll see if I can make the patch more user-friendly in the future!

Danger Radius

Danger Radius v1.2

Github

How to install
Install by using Event Assembler to apply “FogDR.event” to an FE8U ROM, or include “FogDR.event” in your buildfile.

There are some other details to pay attention to so make sure to read the README.txt.

What it do?
This patch implements Danger Radius. Unlike Danger Zone, the danger radius of individual enemy units can be viewed by pressing the select button when hovering over their map sprite. Pressing select again will disable their danger radius.

I also made some macros for some custom ASMCs:

  • CheckDangerRadius(charID): Returns 1 if true - currently displaying the Danger Radius for charID.

  • CheckDangerRadius(X, Y): Returns 1 if true - currently displaying the Danger Radius for unit at coordinates X, Y.

  • SetDangerRadius(charID): Sets the Danger Radius for charID.

  • SetDangerRadius(X, Y): Sets the Danger Radius for unit at coordinates X, Y.

  • UnsetDangerRadius(charID): Unsets the Danger Radius for charID.

  • UnsetDangerRadius(X, Y): Unsets the Danger Radius for unit at coordinates X, Y.

  • SetAllDangerRadius: Sets every enemy’s Danger Radius.

  • UnsetAllDangerRadius: Unsets every enemy’s Danger Radius.

  • SetNearbyDangerRadius: Sets the Danger Radius for all nearby enemies. Thanks to Vesly for implementing this.

Limitations

  • The Fog of War palette is used to display danger radius. To avoid conflicts, If Fog of War is active during a map, Danger Radius is replaced by the more standard Danger Zone as was originally implemented (but not available) in vanilla FE8U. I’d recommend not using the custom ASMCs during FOW.
  • Depending on the size of a map, calculation of multiple units’ danger radii could slow down the game considerably. Make sure not to have too many units’ danger radii active, if you want to avoid lag. Fewer than a dozen should be safe.
  • Danger Radius automatically disables itself when the current phase is not player phase. It can, of course, be re-enabled during player phase.
  • A byte in RAM and a bit in RAM enemy unit structs are reserved. Make sure these are available.
  • I’ve also repurposed a bit in the GameState bitfield. 0x202BCB0 +0x4, bit 3 is used to indicate to SetFog that FogMap should be filled in instead of SubjectMap. It’s set by InitializeDR before MapAddInRange is called, and unset after. I didn’t run into any issues with this yet. This bit seems to originally have been used to indicate dangerzone is active.

Danger Area Colour
I created this Python program which you can use to change the FOW palette of a tileset. It’s in the Graphics directory. Details on how to use it are in the README.txt

Concluding
Here’s what I wrote back in Fall 2020:

Yesteryear

So, Danger Area got a lot of feedback, and it seems that for a number of people, not being able to use Fog of War as a result of the Danger Area patch was a dealbreaker. Allowing both Danger Area/Radius and FOW on a map wouldn’t be possible due to certain limitations, but giving people the choice between either on a map-by-map basis was certainly doable. Personally, and I’m sure others would have this issue too, I couldn’t stand the lag that came with Danger Zone as soon as not even two-dozen enemies were present on a semi-big map.

Danger Radius aims to fix these two issues. Unlike Danger Area, Danger Radius is implementable on vanilla FE8U. I’ve made a version for the SkillSystems as well. Hopefully it won’t get deprecated any time soon.

I’m also planning, somewhere further in the future, probably within the next year, to come back to this and add and rework a few more things; I’d like to remove a certain piece of hard-coding and I intend to implement some option in the in-game options menu to let the player limit the max amount of active DR.

It’s May 3rd 2021 and I’ve finally done this rework I had been thinking about since. Although there’s no
option in the in-game options menu, boo! Not much changed above-the-hood, but underneath it:

  • Danger Radius now has variables that can be changed simply in FogDR.event, instead of having to re-assemble .asm files into .dmp files.
  • I tried to stick to certain conventions this time around (also using lyn now!)
  • There’s just one version now, instead of separate versions based on whether you’re using SkillSys or not (although it’s actually more related to Modular Stat Getters, curse my previous ignorance).
  • Some really specific and easily broken dependency is now removed (check whether value on user stack+0x44 is this specific return address to know whether you were called by some function, because if so your behaviour changes).

I won’t have to lose sleep over knowing there’re people using my poorly implemented patch anymore.

July 23rd 2021.

  • Turns out there was still a visual error when hovering over a player unit and activating DangerZone during FOW. Considering the exact circumstances that need to happen for this bug to display (I mean, I don’t even use FOW), I can see how it slipped under the radar. That’s fixed now.
  • Vesly pointed out to me that danger radius was being recalculated unnecessarily. That’s rectified now. Hopefully this’ll reduce lag, although it’ll be by a factor of two, maybe three, at most.
  • I was considering buffering the fogmap when units take partial actions, but decided against it, considering I’d have to allocate about 0x800 bytes in RAM to fit a map, and it’d only save a recalculation when cancelling a partial action.
  • Changed ClearDR2. It no longer replaces the entire routine it hooks in. This should make it compatible with HyperGammaSpaces CasualModeMenu.

Credits

  • I took some of Vesly’s SetNearbyDangerRadius asm.
  • Mkol made the custom DR mark icon. I made it blue, figured it’d contrast better against red.
  • circleseverywhere made the HpBars hack which shows where the systemicons are stored. They also made the DangerZone patch which I took parts of to make Danger Radius work.
  • Many thanks to Snek’s tmx2tsa for working as an argparse example.
  • Huichelaar. C’est moi.

2021-05-03_17-33-07

Again, please tell me if you run into any issues adapting these patches. I’m also new to these forums, so Hi!

67 Likes

really gonna post a screenshot of ManBat! rennac with no context huh

for this adaptive bgm, is this similar to like what fe13/14/16 do with the rain/thunder versions? I’m trying to understand the functionality

1 Like

I’m not quite sure quite what those games exactly do to transition between the rain/thunder versions, but that is the effect I’m trying to replicate, yes.

I’d upload Rennac’s class to the animation directory, but I’m still planning on tweaking it a little.

4 Likes

basically they have one track with two versions of the same song and the versions switch in real time during battle

so this wouldn’t restart the song but continue it on then? that is a very neat thing to add

Well, this doesn’t switch any soundtracks. It mutes certain parts of the song, instruments (sorta), outside of battle, and unmutes them during battle.

The main limiting factor here is that the two versions of the song share the same 12-note limit.

1 Like

is it possible to upload a video showing it off?

There’s an .mp4 in the dropbox I linked. I’ll upload it to youtube and see if I can embed it.

EDIT: the youtube video is up and embedded.

2 Likes

Oh shit this is actually really cool

i really like the dangerzone range display

oh yeah is exactly what i was thinking
aka sicko mode

Sicko mode… in a good sense?

1 Like

I see danger zone display, I like

1 Like

yuh, this is insane.
For some reason I swear danger zones already existed, but I wouldn’t use them anyway because I’m sadistic. Still, I know that this is a big, sudden contribution from a newcomer, and people with actually good design philosophies are gonna love it. I hope you get the “new member of the month” award.

2 Likes

iirc the danger zone that already exists doesnt continue to show like this one - if you click away on the existing danger zone hack it gets rid of the danger zone thing while this one appears to stay in place

Yes, the original Danger Zone is a bit flighty. I tried to go for a more permanent solution.

UPDATE: I added the Danger Zone patch and instructions.

EDIT: And now the dropbox link is correct, woops, sorry.

5 Likes

This is actually poggers, I’m definitely keeping an eye out for this if you’re continuing to work on it

So, there’s no way to keep this Danger Zone and the FoW?
Maybe using a palette that isn’t tied to the tilesets?
Like a table in which you can set which palette is used for a tileset.

Edit: I found a Bug.
With the Danger Zone active, the skill Elbow Room gives a massive boost of 127 might.
SkillsTest_02 SkillsTest_03
I guess the same happens with Natural Cover.

Thanks! I’ll look into that bug!

The way I understood it, is that there’s a limited amount of palettes that can be displayed at any time for a layer. Which is why there’s no room to let the maptile-layer display more palettes. On second read-through, I’m not quite sure if that actually answers your question.

1 Like

In all fairness, when you know you’re in danger your fight-or-flight response kicks into overgear. Our buddy over here injected a heap of elephant steroids just so he can delete the enemies.

6 Likes

Yoooooo, that adaptive music thing is epic ngl