• Welcome to Final Fantasy Hacktics. Please login or sign up.
 

T.O.F.U is ready

Started by Orkney, September 29, 2022, 02:55:33 pm

Orkney

September 29, 2022, 02:55:33 pm Last Edit: November 18, 2022, 03:48:57 pm by Orkney
T.O.F.U
The One Formula (unbounded)

This hack is a Massive formula Hack. It merges all formulas in a single one. Each previous formula now are a table of flags, allowing to build XA&YA and to trigger various vanilla mechanics.
Some of these mechanics are not managed with the formula but with the abilities flag.
The main hack : TOFU suit is mandatory. you have to use it if you want to use any of the other tools
I tried to stick to the vanilla routines. The idea was to keep it compatible with some existing hacks but since i've not tested any hacks yet. Try or Ask first.

In very short : all formulas can support status, evasion, faith, elements, item breakage etc..

What does it changes if you patch your ISO and don't change anything ?
- Oil fix
- Weapon Element is added to Ability element if weapon strike or Weapon range flag are checked
  Consequence : Weather effects apply to weapon element too
- Jump and Throw keep the weapon characteristics (elemental, status and ability proc could be applied)

What can you do with Patcher ? : All formulas take status, evasion, faith, elements, item breakage etc...
- New concept : Hostility. (At the start of the formula hostility will be set)
    - Base hostility is determined by the AI flag "Target Ally" (friendly) or "Target enemy" (hostile)
    - Hostility affect HP&MP effect, Stats (bonus or malus), CT (00 or quick), Lv modification (bonus or malus)
    - If none or both are checked, if Target is a teammate action will be friendly, if Target is a foe, it will be hostile.
    - A target will not attempt to evade a friendly spell, Support Defense will not applies on friendly spell (physical does ,like in vanilla (Formula 0x17 and 0x0e))
Note : this will allow formula consolidation (0x08 and 0x0c are identical)
- Elemental absorption and Undead reverse may reverse an action hostility
- All formulas dealing damage or healing the target can affect HP and/or MP
- if the AI flag affect HP is checked it will affect HP
- if the AI flag affect MP is checked it will affect MP
Note : If both are checked it will affect both with chakra mechanics (MP effect  = HP effect/2)
              If none are checked damage will be ignored
- If there is an element checked, it will be applied.
Strenghten : it will boost by 120% the output of the formula (like vanilla)
Pure vanilla is 120% of XA only for XA*YA formula. Since it has been extended to all formula, there's more to say.
- 120%XA * YA --> 120% of output
- 120%XA + 120%YA --> 120% of output
- No XA and YA but something is dealt (ex Wish where output is 40% of caster HP) --> 120% of output
Cancels : Cancels the action
Resist :
- Formula with XA&YA : halves the result (hit% or damage)
- No XA&YA but formula deals Damage or heal : halves the result
- No XA&YA no damage dealt : halve hit% (accumulate resisted will ends with hit% at 50%, same with all 100% hit formulas)
Weak :
- Formula with XA&YA : doubles the result (hit% or damage)
- No XA&YA but formula deals Damage or heal : doubles the result
- No XA&YA no damage dealt : nothing (yet?)
Absorb
- Hostile spell are reversed (see reversion)
- Friendly spell : 100% hit chances, 100% proc chances, MP cost becomes MP recovery, and MP cost * 2 becomes HP recovery (If No MP were used, it's 12.5% of Max MP and HP)
- Item with formula 0x04 (magic gun) cast ability ID from inflict status field if not null (prevails on element) - Animation is bugged (usual spell casting ) if not using a gun... 
- If status infliction is not null it will be taken into consideration
- If one of the AI flags "add status or cancel status" is checked it will be a 100% infliction chance and action will miss if not inflicted (vanilla way)
- If none of the previous flags are checked it will be a 19% chances of infliction independant of action success.
Note : in vanilla some formulas are 100% status with preserved action : they remains unchanged.
- If Affect stat is checked : Ability will affect stats under conditions
Some formula are meant to affect dedicated stats (all vanilla ones), but if you check affect stats flag while not using one of thoses, you will uses the "hardcoded stat alteration table".
This table exists because of song and dance abilities mechanics (one formula for many effect)
This table can not be used by any formula affecting CT, Lv, Morbol, or Golem (Because abilities using those effects already have their AI flag "affect stat" enabled while not affecting stats)
Last Nybble of Ability ID is used to choose the stat to affect
    Amount of alteration if based on Mod(X,10) from decimal value (12 is +/-2 16 is +/-6). For Brave and faith alteration this value is multiplied by 4. If result is 0 default is 1 or 4 (Br and Fa))
Bonus or Malus is based on hostility and may be reversed (element, undead). Except for the talk skill faith manipulation where bonus/malus is hardcoded to the formula.
   
0x0 PA
0x1 MA
0x2 Br
0x3 CT
0x4 Fa
0x5 Br and Fa
0x6 MA + PA + Sp
0x7 Br and PA
0x8 Sp
0x9 PA
0xa MA
0xb Fa MA
0xc CT
0xd Sp PA
0xe Sp MA
0xf Sp
This Table is editable with a hack provided in this post
Song and Dance abilities uses this table too
- If Unequip is checked the ability will try to destroy something
    -If Unequip is checked and used formula is not a vanilla breaking/stealing one, the
      action will be preserved even if the item can't be unequiped (Not equiped, Monster or maintenance)
- This table is used by break skills and mighty sword skills
- Last Nybble of Ability ID is used to choose the item to break (stealing is not supported yet (you have to use the steal formula)
0x0 Armor
0x1 Helmet
0x2 Weapon
0x3 Accessory
0x4 Shield
0x5 Armor
0x6 Helmet
0x7 Weapon
0x8 Accessory
0x9 Shield
0xa Helmet
0xb Armor
0xc Shield
0xd Weapon
0xe Accessory
0xf Weapon
- Reversion : Every ability could be reverted (undead reverse or element absorbtion) it will affect Damage, malus, status etc...
- Toggle damage and Heal
- Toggle Stats/CT/Lv bonus and malus
- Hostile Ability without damage or stat alteration trigger the absorbtion of the used MP as MP and twice the amount as HP (if no MP is used, it will restore 12.5% of Max HP and MP)
- Friendly reversed Ability without damage or stat alteration triggers nothing (yet ?)
- Status infliction will fail
- Break/Steal will fail
- Knockback will fail

TOFU Maker is done !
While using TOFU Hack, you can use this tool to customize every formula of the game !
For now, only vanilla features are supported, but there is room to add more mechanics. (Throw some ideas !)
A little guide through Xif Excel Hack Template
Once TOFU Maker is downloaded you might encounter a red security alert in the excel file. If you want to get rid of it, you have to right click on the file (in windows folder).
Then check the Unblock Box at the bottom right of the details window.

After that, you will still have to validate one or two security alerts (yellow this time) to activate the macros.

Now you can use Xifanie's Hack Template. (she wrote a tutorial in the dedicated post on the forum if you need it)
First you have to reach the Code sheet (you should be here by default)

Then select the Add-Ins Tab. Click the last Icon (TOFU Maker) and let your creativity flow.
At the end you'll be able to patch a savestate, an ISO or generate a xml.
How does it works ? here are some explanations that you don't realy need to read to use it
This tool is nothing more than a custom formula library.(You can see it in TOFU FORMULA MAKER sheet (hidden by default).
First you have to add some formulas to this collection by using the New Custom Formula button.You will be asked if you want to add a blank formula, a copy of a vanilla formula (imported) or a copy of one of your custom formula.
Then you can browse and edit every formula in your collection. Once editing something, don't forget to press the save button (or save as if you want to change the formula ID).
Then press the Patch button and choose which formula you want to patch/export.
Once you press patch you'll be thrown to the code sheet and frome there you can use Xif HackTemplate functionalities (patch ISO, Patch savestate, generate xml).
I was "forced" to add a not-vanilla feature to support some peculiar formulas (phoenix down and self-destruct).
This feature is the Fork function.
Under certain conditions, the used formula will point to another formula.
By using the fork function you can access twice the number of vanilla formulas (up to formula 0xc8 = 200 formulas)
For example : If target is undead the phoenix down formula will point to a damage 100% of target HP instead of canceling death and restore a few HP.
For now there is very few fork condition. Status ID (on target or on caster) and Target ID (Target is or is not the caster).
I plan to add more conditions types (like used skillset, Gender (with this one, Human and monster could use the same ability but with a different formula))

A big thanks to Xifanie and his marvelous FFT Hack Template Spreadsheet !

TOFU-Main Hack (included in TOFU suit)
  V 0.93 - MultiHit release + updated "break katana" mechanics
  V 0.921- XA and YA Random flags can affect 1st Argument only
  V 0.91 - TOFU Maker release bugfixes
  V 0.82 - Thrown weapon with formula 0x06 keep absorbtion and undead reversion
              - Thrown weapon with formula 0x07 heals the target
  V 0.81 - Thrown weapon proc their abilities (formula 0x02)

TOFU-Formula Table (included in TOFU suit)
  V 1.2 - MultiHit flags (formula 1E 1F 5E and 19)
  V 1.1 - KnockBack flag fixes (formula 0x2A and 0x37)

TOFU-  Ability Tweaks (included in TOFU suit)
  V 1.1 - Change Ability 2D X value to 3 (formula 19 uses the X+1 multiHit routine)

TOFU - Formula maker
  V 0.93 - MultiHit boxes + updated katana tips
  V 0.92 - XA and YA Random flags can affect 1st Argument only
              Button to toggle description off (won't automatically fill the description field of the patch)
TOFU - Base XA customization
  V1.2 - XA and YA Random flags can affect 1st Argument only
  V1.1 - Random flag fixed
  • Modding version: PSX

Orkney

October 04, 2022, 04:28:49 pm #1 Last Edit: November 12, 2022, 08:06:20 am by Orkney
TOFU - WEAPON BASE AND JUMP DATA EDITOR

This Excel sheet will allow you to customize every weapon type damage calculation.

TOFU uses 2 tables to manage weapon damage calculation :
- Base attack table
- Jump attack table

You can edit both.
To do so, go to the "TOFU Base XAYA builder" sheet and select the "Complement" Tab (just before the "Help" one by default)

1/ Edit the desired weapon data
- Create a new line :
- By adding a blank line and fill all the gaps (clic on add a blank line)
- By importing a pre-filed line with the Vanilla (TLW) data (clic on import base or import jump)
- Fill the gaps, if there is some red cells, you're doing something wrong

2/ Export the data to the "Code" sheet (button) and use Xif's tool as normal (generate XML or patch save state etc...)

XA and YA can support 4 "arguments" and do maths with them.
First you have to set the number of arguments
  Example : Attacker PA is one argument, Attacker (PA+Speed)/2 is three))

Once the number is set,choose the maths formula
  The MATHS column list will be adjusted to the nb of arguments and you'll have to choose in the list
  For Example : Attacker (PA+Speed)/2 --> choose (A+B)/C

Then specify if XA is the value itself or a random number between 1 and this value (Axe flail etc...)

First choose if the argument is a unit's stat, an ability state or a raw number
- For unit stat choose Attacker or Target in the list
- For Ability choose Ability
- For raw numbers :
- if the number is less than 16 : choose i<16 (i for immediate...)
- if not choose i>16. Then select a number in the list.

Big credit to Xifanie for her FFT Hack Template, which is the base of this tool
  • Modding version: PSX

nitwit

Do the Stat Up/Down formulas allow one to set a floor or ceiling relative to the affected character's base stat plus gear bonuses?

Does this allow one to alter the Brave, Faith, and Anti-Faith formulas?


Orkney

I don't understand what you're asking with the stats floor/ceiling. It's like in vanilla. I just merge everything in one formula. So i guess the response is no.

Faith and anti Faith are supported On both, on caster only or on target only (and cross faith too). Brave is not supported yet.

First I wish to release a sheet allowing to customize every formula flags. Then i'll add more.

  • Modding version: PSX

nitwit

Quote from: Orkney on October 04, 2022, 05:20:26 pmI don't understand what you're asking with the stats floor/ceiling. It's like in vanilla. I just merge everything in one formula. So i guess the response is no.
I'm asking if you could without much effort add a branch to miss if a stat is below/above a certain value + base stat + gear stat bonus.
...

short PA_ceiling = 3

if (current_PA > (base_PA + gear_PA_bonus + PA_ceiling))
{
    goto PA_up_miss
}

...
This would apply to any formula which increases or reduces SP, PA, or MA.

Quote from: Orkney on October 04, 2022, 05:20:26 pmFaith and anti Faith are supported On both, on caster only or on target only (and cross faith too). Brave is not supported yet.
My question lacked detail. I'll try to ask better questions.
  • Is it possible to change all instances of (Brave / 100)% into ((Brave / x) + y)%, where x and y can be predetermined by the spreadsheet user?
  • Is it possible to change all instances of (Faith / 100)% into ((Faith / x) + y)%, where x and y can be predetermined by the spreadsheet user?

Quote from: Orkney on October 04, 2022, 05:20:26 pmFirst I wish to release a sheet allowing to customize every formula flags. Then i'll add more.
Looking forward to it!

Thanks for your efforts, by the way.

Orkney

Well the PA ceiling seems a bit complicated. What if PA ceiling is reached but not MA ceiling ? PA misses but not MA boost. It'll add a check to every stat alteration. it is doable but not lightly. Not a priority but who knows ?

I planned to modify Faith and Brave alteration in a very close way of what you're thinking. But it was for my own purpose, adding a way to alter formulas output based on brave (like faith). For what you're asking, it's easy for faith, the brave instances seems more difficult to track, scattered around reaction routines... (i've little knowledge of those routines yet).
  • Modding version: PSX

nitwit

October 14, 2022, 02:49:09 am #6 Last Edit: October 15, 2022, 01:16:52 am by nitwit
Quote from: Orkney on October 05, 2022, 07:11:43 amWell the PA ceiling seems a bit complicated. What if PA ceiling is reached but not MA ceiling ? PA misses but not MA boost. It'll add a check to every stat alteration. it is doable but not lightly. Not a priority but who knows?
Yeah, that's an issue if you have a skill that alters more than one stat; which unfortunately is both vanilla and something people would want for their Ramza Sword Saint patch. I would limit stat up/down to one stat at a time, though given that I want a stat steal skill I need to account for both the target and caster.

Quote from: Orkney on October 05, 2022, 07:11:43 amI planned to modify Faith and Brave alteration in a very close way of what you're thinking. But it was for my own purpose, adding a way to alter formulas output based on brave (like faith). For what you're asking, it's easy for faith, the brave instances seems more difficult to track, scattered around reaction routines... (i've little knowledge of those routines yet).
People would probably want the unarmed formula to use Brave in a different way than reaction triggers. Being able to completely nerf unarmed, katana, or knight sword damage with a spell that can also turn a target into a chicken and negate reactions is a bit OP to me.

IMO the floor and ceiling for Brave modification to damage should be the same as that of Faith modifications: 50 to 100.

On the other hand reactions should never trigger 100% of the time so the floor and ceiling should both be lower. How much lower I'm not sure, depends on the reactions available I guess.

And there's already a hack that determines Brave gain while chickened, so that's not an issue if someone wants to make Chicken a temporary major debuff rather than an assurance that your goose is cooked.

Also note that you could make these things set when someone applies the ASM hack but essentially hardcoded when editing skills in FFTPatcher. There's no reason for different skills or formulas to each have different floors and ceilings, but there are several good reasons (Ramza shrieking at Weigraf as he slowly becomes a disturbingly muscular Sonic the Hedgehog [do not Google]) to have a per mod stat cap.

Orkney

TOFU Maker is out !
Check the main post for more infos.
  • Modding version: PSX

Orkney

Some updates.
All related to a new feature allowing to set a random flag only on the first argument of XA or YA build.

For example :
Rdm (1 to PA) + PA/2 resulting in an output of 0.5*PA to 1.5*PA
  • Modding version: PSX

Orkney

New Update !

- Break katana : now if you uncheck this box with regular draw out skills your katana won't break. Checking this box outside the regular draw out ability wont' break anything, and may lead to strange messages.

- Multi Hit : Any formula can access multi hit mechanics. You'll find two boxes in TOFU maker.
    - X + 1 : Lead to X + 1 hits
    - Rdm (1...X) : Rafa Malak mechanics (random number between 1 and ability X)

Multi Hit is not restricted to default and monster action menus anymore. Elements, draw out and maths are fully operational.
Weapon inventory avoid the multi hit section.
Jump and Aim abilities lack of ability X field.


  • Modding version: PSX