[FE6][CHAX] skill-system for FE6: Binding Blade

FE6 SkillSystem Source Code at Here


Important update 2023.01.27

  1. Rewrite the total project to be compatible for fe6-decomp, including makefile and c files.
  2. Introduce linux-style config file to setup build options.
  3. By putting debug-text data to Free-SRAM-Space (0x0E008000), we can get Free-RAM-Space with size = 0x2028, which is also defined in config file.
  4. Save data has also been expanded, and BWL table has been free to use by disabling all BWL entry access.
  5. Add hooks to pre-battle-calc, unit status-getter, battle-2-unit-hook, chapter-init hook… for further hacking.

It is @MisakaMikoto that remind me working on FE6 may result in a more freely space control operation.

Based on FE6-Decomp and FE6-Wizardry work by genius @StanH , and refer to construction on FE8U-SkillSystem and SkillLite, I made this FE6 SkillSystem-proto.


Advantage on FE6:

  1. Only 8MB occupied by Vanilla and result in a more flexible space control.

  2. Succinct system without any check on Nightmare or eggs.

  3. Scalability on system design with lots of free-space on item/unit/class attr and others.


Toturials & DOCs

1. Wizardry to-do list
FE6-SkillSys
β”œβ”€β”€ [√] skill-system
β”‚   β”œβ”€β”€ [√] skill infos
β”‚   β”œβ”€β”€ [√] skill infos
β”‚   β”œβ”€β”€ [√] skill stat-screen
β”‚   β”œβ”€β”€ [√] skill ROM list
β”‚   β”œβ”€β”€ [√] skill RAM list
β”‚   └── [√] skill fast list
β”‚
β”œβ”€β”€ [ ] status-getter
β”‚   β”œβ”€β”€ [√] modular status getter
β”‚   └── [ ] mov & con getter
β”‚
β”œβ”€β”€ [ ] battle-system
β”‚   β”œβ”€β”€ [√] battle-unit hook
β”‚   β”œβ”€β”€ [√] pre-battle calculation
β”‚   β”œβ”€β”€ [ ] battle order
β”‚   β”œβ”€β”€ [√] battle can-counter
β”‚   β”œβ”€β”€ [√] weapon tri-angle
β”‚   β”œβ”€β”€ [√] effective judgement
β”‚   └── [ ] battle preview
β”‚
β”œβ”€β”€ [ ] weapon range
β”‚   β”œβ”€β”€ [ ] weapon-range getter
β”‚   β”œβ”€β”€ [ ] draw-string
β”‚   β”œβ”€β”€ [ ] fill-map functions rework
β”‚   β”œβ”€β”€ [ ] check can cover range
β”‚   └── [ ] staff range rework
β”‚
β”œβ”€β”€ [√] chapter-based random-number system
β”‚
β”œβ”€β”€ [ ] stat-screen
β”‚   β”œβ”€β”€ [√] UI rework
β”‚   └── [ ] negative stat boosts UI
β”‚
β”œβ”€β”€ [ ] str / mag split
β”‚   β”œβ”€β”€ [ ] combat hack
β”‚   β”œβ”€β”€ [ ] unit magic power getter
β”‚   β”œβ”€β”€ [ ] check cap
β”‚   β”œβ”€β”€ [ ] auto-level
β”‚   β”œβ”€β”€ [ ] level-up screen (map-anim)
β”‚   β”œβ”€β”€ [ ] level-up screen (banim)
β”‚   └── [ ] magic booster item
β”‚
β”œβ”€β”€ [ ] promotion list
β”‚
β”œβ”€β”€ [ ] buff & debuff rework
β”‚   β”œβ”€β”€ [ ] unit-status rework
β”‚   β”œβ”€β”€ [ ] unit-status UI
β”‚   └── [ ] HP bars
β”‚
β”œβ”€β”€ [ ] item effect rework
β”‚   β”œβ”€β”€ [ ] bm effect
β”‚   └── [ ] prep-screen effect
β”‚
β”œβ”€β”€ [√] save-data
β”‚   β”œβ”€β”€ [√] expanded modular save
β”‚   β”œβ”€β”€ [√] null-bwl
β”‚   └── [√] bwl-support
β”‚
β”œβ”€β”€ [ ] combat-arts
β”‚   β”œβ”€β”€ [ ] combat-art infos
β”‚   β”œβ”€β”€ [ ] combat-art tester
β”‚   β”œβ”€β”€ [ ] combat-art prep-screen selection
β”‚   └── [ ] combat-art battle-forcast selection
β”‚
β”œβ”€β”€ [ ] prep-screen rework
β”‚   β”œβ”€β”€ [ ] prep-screen menu-items reorder
β”‚   β”œβ”€β”€ [ ] skill prep-screen selection
β”‚   └── [ ] combat-art prep-screen selection
β”‚
β”œβ”€β”€ [ ] combat anims
β”‚   β”œβ”€β”€ [ ] skill & combat-art activation animations
β”‚   └── [ ] map banim item effects
β”‚
β”œβ”€β”€ [√] unit-menu
β”œβ”€β”€ [√] unit-action
β”œβ”€β”€ [√] icon-rework
β”œβ”€β”€ [ ] popup-rework
β”œβ”€β”€ [√] load unit hook
β”œβ”€β”€ [√] game init hook
β”œβ”€β”€ [√] chapter init hook
β”œβ”€β”€ [ ] level-up rework
β”‚   β”œβ”€β”€ [ ] Switch & 3DS style level up
β”‚   β”œβ”€β”€ [ ] level-up hook
β”‚   β”œβ”€β”€ [ ] promotion hook
β”‚   └── [ ] modular growth getter
β”‚
β”œβ”€β”€ [ ] post-action procs
β”‚
└── [√] debug system
β”‚   └── [√] fail-screen (by StanH)
β”‚   └── [√] debug-text move to SRAM free-space
2. battle-system overview
DoCombatAction
β”œβ”€β”€ InitObstacleBattleUnit
β”œβ”€β”€ BattleGenerateReal
β”‚   └── BattleGenerateRealInternal
β”‚       β”œβ”€β”€ InitBattleUnit                      ==> battle 2 unit hook
β”‚       β”œβ”€β”€ SetBattleUnitWeapon
β”‚       β”œβ”€β”€ BattleInitTargetCanCounter          ==> check can counter
β”‚       β”œβ”€β”€ BattleApplyWeaponTriangleEffect     ==> WTA bonus
β”‚       β”œβ”€β”€ BattleGenerate
β”‚       β”‚   β”œβ”€β”€ ComputeBattleUnitStats          ==> pre battle calc
β”‚       β”‚   β”‚   β”œβ”€β”€ ...
β”‚       β”‚   β”‚   β”œβ”€β”€ ComputeBattleUnitAttack
β”‚       β”‚   β”‚   β”‚   └── IsItemEffectiveAgainst  ==> effective attack
β”‚       β”‚   β”‚   └── ...
β”‚       β”‚   β”œβ”€β”€ ComputeBattleUnitEffectiveStats
β”‚       β”‚   β”œβ”€β”€ ComputeBattleObstacleStats
β”‚       β”‚   └── BattleUnwind
β”‚       β”‚       β”œβ”€β”€ BattleGetFollowUpOrder
β”‚       β”‚       └── BattleGenerateRoundHits
β”‚       β”‚           β”œβ”€β”€ GetBattleUnitHitCount
β”‚       β”‚           └── BattleGenerateHit
β”‚       └── BattleUnitTargetCheckCanCounter
└── ProcScr_CombatAction
    └── BattleApplyGameStateUpdates
        └── BattleApplyUnitUpdates
            └── UpdateUnitFromBattle            ==> battle 2 unit hook
3. How to add to expanded-modular-save

Suppose we need to save a 8 Bytes from 0x03000000 space in save data:

  1. Get into wizardry/save-data/src/ms-memmap.h, and define this size at the head of the file:
// wizardry/save-data/src/ms-memmap.h
#define MSA_SIZE_EXAMPLE 8
  1. Modify in msa_memmap:
-- MSA_MEMMAP_RSV      = MSA_MEMMAP_UNIT     + MSA_SIZE_UNIT,
++ MSA_MEMMAP_EXAMPLE  = MSA_MEMMAP_UNIT     + MSA_SIZE_UNIT,
++ MSA_MEMMAP_RSV      = MSA_MEMMAP_EXAMPLE  + MSA_SIZE_EXAMPLE,
  1. Get into wizardry/save-data/src/msa.c, and define the .load and .save function:
// wizardry/save-data/src/msa.c
void MSA_SaveExample(u8 *dst, const u32 size)
{
    if (size < MSA_SIZE_EXAMPLE)
        ModSaveErrLog("MSA_SaveExample: size\n");

    WriteAndVerifySramFast(
        (u8 *)0x03000000,
        dst + MSA_MEMMAP_EXAMPLE,
        MSA_SIZE_EXAMPLE);
}

void MSA_LoadExample(u8 *src, const u32 size)
{
    if (size < MSA_SIZE_EXAMPLE)
        ModSaveErrLog("MSA_LoadExample: size\n");

    ReadSramFast(
        src + MSA_MEMMAP_EXAMPLE,
        (u8 *)0x03000000,
        MSA_SIZE_EXAMPLE);
}
  1. Add your save-chunk to EmsChunkSa:
// wizardry/save-data/src/msa.c
    {
        .off  = MSA_MEMMAP_EXAMPLE,
        .size = MSA_SIZE_EXAMPLE,
        .save = MSA_SaveExample,
        .load = MSA_LoadExample,
    },
  1. Rebuild the project and test your rom
    Try to start a new game. If the size or offset is overflow, the debug system (need CONFIG_USE_DEBUG_TEXT defined) will show you the message.

More information can be gotten on readme of Git.

43 Likes

What skills are currently included? cause this looks incredible!

Skills are listed at readme doc on git

This is amazing. Always loved the skill patch but was sad fe6 was not available.

2 Likes

Though some small feedback:
1- Duelist Blow and weirding blow (Aka certain blow) could return to the Fates equivalents of 30 avoid and 40 hit.
2- Crit +15 replaces the Swordmaster and berserker crit boost? Because in fe6 it’s +30 not +15.

1 Like

You could just edit these yourself. The code is right there on the github, and the point of the skillsystem is to be modular in that regard.

4 Likes

This is great.
Thank you for publishing it.
By the way, do you use EA to use this?
I’m not very good at English, and the EA gave me an error.
If you don’t mind, could you tell me how to use it?

Out dated

You can refer to readme file on git. or for simple:

  1. Put EA renamed β€œEventAssembler” in /Tools/
  2. Put lyn.exe in $DEVKITARM (the path you install DevkitPro), since it is the path β€œLYN” defined in MakeFile;
  3. If all of above have been done, open Msys2 or WSL in SkillSystem folder and sh MakeHack.sh

This is for Win10, since I’m not a MAC user so I have no idea how make it on linux.

New build note: see readme file:

  1. You must have a linux system as WSL(for Windows user, see here) or Ubuntu.

  2. You must have a copy of the FE6 clean ROM named fe6.gba in the repository directory.

  3. Install .Net SDK

  4. ./build_tools.sh in the repository directory.

  5. make -j8 in repository directory, then you will get fe6-chax.gba in your repo.

Thank you so much for letting me know.
I’ll give it a try.

Just as @ knabepicer said, you can edit the function in BattleSystem/PreBattleCalc for your own ideas.

1 Like

added SkillList and WishList
Acturally I have no idea how to define Free-RAM-Space.

1 Like

Now THIS is something I’m really looking forward for. FE6 is one of those games I have since forever wanted to experience with a skill system. Now that there is a chance a skill system is currently on development for this game, I am hyped haha.

I will follow this thread closely!

Update 2023.01.08

Rewrite makefile so that we can build it via WSL with arm tool chain.

Just follow the readme file.

  1. Rewrite the total project to be compatible for fe6-decomp, including makefile and c files.
  2. Introduce linux-style config file to setup build options.
  3. By putting debug-text data to Free-SRAM-Space (0x0E008000), we can get Free-RAM-Space with size = 0x2028, which is also defined in config file.
  4. Save data has also been expanded, and BWL table has been free to use by disabling all BWL entry access.
  5. Add hooks to pre-battle-calc, unit status-getter, battle-2-2unit-hook, chapter-init hook… for further hacking.

Wizardry to-do and done list see main page.

3 Likes

Battle System hack note:

DoCombatAction
β”œβ”€β”€ InitObstacleBattleUnit
β”œβ”€β”€ BattleGenerateReal
β”‚   └── BattleGenerateRealInternal
β”‚       β”œβ”€β”€ InitBattleUnit                      ==> battle 2 unit hook
β”‚       β”œβ”€β”€ SetBattleUnitWeapon
β”‚       β”œβ”€β”€ BattleInitTargetCanCounter          ==> check can counter
β”‚       β”œβ”€β”€ BattleApplyWeaponTriangleEffect     ==> WTA bonus
β”‚       β”œβ”€β”€ BattleGenerate
β”‚       β”‚   β”œβ”€β”€ ComputeBattleUnitStats          ==> pre battle calc
β”‚       β”‚   β”‚   β”œβ”€β”€ ...
β”‚       β”‚   β”‚   β”œβ”€β”€ ComputeBattleUnitAttack
β”‚       β”‚   β”‚   β”‚   └── IsItemEffectiveAgainst  ==> effective attack
β”‚       β”‚   β”‚   └── ...
β”‚       β”‚   β”œβ”€β”€ ComputeBattleUnitEffectiveStats
β”‚       β”‚   β”œβ”€β”€ ComputeBattleObstacleStats
β”‚       β”‚   └── BattleUnwind
β”‚       β”‚       β”œβ”€β”€ BattleGetFollowUpOrder
β”‚       β”‚       └── BattleGenerateRoundHits
β”‚       β”‚           β”œβ”€β”€ GetBattleUnitHitCount
β”‚       β”‚           └── BattleGenerateHit
β”‚       └── BattleUnitTargetCheckCanCounter
└── ProcScr_CombatAction
    └── BattleApplyGameStateUpdates
        └── BattleApplyUnitUpdates
            └── UpdateUnitFromBattle            ==> battle 2 unit hook

Alright, this may be a completely dumb question but my curiosity is eating at me.

Is it possible to add the FEH style trace skills to the skill system? like [X]/[X] near/far trace because canto is already in the game and as a skill

I don’t play FEH anymore, thus with little knowlage on new skills. But based on skill description, this skill seems similar to canto + a debuff? If this is the case, it is not difficult to achieve.

That’s exactly what it is, just canto with inflicting debuffs on foe during combat and thank you

Toturial on adding your own chunks to modular-expanded-save

Suppose we need to save a 8 Bytes from 0x03000000 space in save data:

  1. Get into wizardry/save-data/src/ms-memmap.h, and define this size at the head of the file:
// wizardry/save-data/src/ms-memmap.h
#define MSA_SIZE_EXAMPLE 8
  1. Modify in msa_memmap:
-- MSA_MEMMAP_RSV      = MSA_MEMMAP_UNIT     + MSA_SIZE_UNIT,
++ MSA_MEMMAP_EXAMPLE  = MSA_MEMMAP_UNIT     + MSA_SIZE_UNIT,
++ MSA_MEMMAP_RSV      = MSA_MEMMAP_EXAMPLE  + MSA_SIZE_EXAMPLE,
  1. Get into wizardry/save-data/src/msa.c, and define the .load and .save function:
// wizardry/save-data/src/msa.c
void MSA_SaveExample(u8 *dst, const u32 size)
{
    if (size < MSA_SIZE_EXAMPLE)
        ModSaveErrLog("MSA_SaveExample: size\n");

    WriteAndVerifySramFast(
        (u8 *)0x03000000,
        dst + MSA_MEMMAP_EXAMPLE,
        MSA_SIZE_EXAMPLE);
}

void MSA_LoadExample(u8 *src, const u32 size)
{
    if (size < MSA_SIZE_EXAMPLE)
        ModSaveErrLog("MSA_LoadExample: size\n");

    ReadSramFast(
        src + MSA_MEMMAP_EXAMPLE,
        (u8 *)0x03000000,
        MSA_SIZE_EXAMPLE);
}
  1. Add your save-chunk to EmsChunkSa:
// wizardry/save-data/src/msa.c
    {
        .off  = MSA_MEMMAP_EXAMPLE,
        .size = MSA_SIZE_EXAMPLE,
        .save = MSA_SaveExample,
        .load = MSA_LoadExample,
    },
  1. Rebuild the project and test your rom
    Try to start a new game. If the size or offset is overflow, the debug system (need CONFIG_USE_DEBUG_TEXT defined) will show you the message.