Jump to content

How is the Hector Hard Mode Bonus calculated?


Schreiber
 Share

Recommended Posts

Just on here to ask a question I can't definitively find anywhere: Is it known exactly how the Hector Hard Mode Bonuses for converted characters are calculated?

If this was asked somehwere else, I apologize; I did try searching for it, but since it has no official name, that's kinda difficult.

Link to comment
Share on other sites

Just on here to ask a question I can't definitively find anywhere: Is it known exactly how the Hector Hard Mode Bonuses for converted characters are calculated?

If this was asked somehwere else, I apologize; I did try searching for it, but since it has no official name, that's kinda difficult.

I always thought it was a pre-determined, fixed bonus for each individual character, without any trends, but that's just what I thought, I'm probably wrong.

Link to comment
Share on other sites

void FireEmblem::HMBonus(Unit& UnitName, int BonusLevels, bool FE7, bool verbose){
 UnitName.Reset();
 if (verbose)  UnitName.Print(); //Prints unit NM stats.
 UnitName.SetCurrentGrowths(m_GenericGrowths[unitName.GetCurrentClass().GetClassName()]); /*Sets unit's growths to
 generic class growths.*/
 int BaseLevel = UnitName.GetLevel(); //Saves the unit's Base Level.
 UnitName.EnemyLevelUp(BonusLevels, FE7, true); //Levels up the PC as if it were an enemy
 Stats HMStats = UnitName.GetCurrentStats(); //Grabs the new stats
 HMStats.SetLevel(BaseLevel); //Alters the new stats' level to the base level.
 UnitName.Reset(); //Resets the unit (stats, growths, etc. to base values)
 UnitName.SetCurrentStats(HMStats); //Replaces NM base stats with the calculated HM stats.
 if (verbose)  UnitName.Print();
}


// The following information obtained by Nitrodon 
//
// The formula for enemies automatically leveling up is fairly simple.
// First, the class growth rate in a stat is multiplied by the number of
// levels gained. Then, a RN is generated between 7/8 and 9/8 of this
// value (as opposed to the usual 0-99 RNs). Finally, that random number
// is used as the total growth rate, and a second RN is used accordingly
// to determine how much that stat increases. This is then repeated for
// every stat (except FE7 luck).

void Unit::EnemyLevelUp(int numberLevels, bool ignoreLuck, bool ignoreCap){
 //ignoreCap's main purpose is for HM bonuses, where the number of bonus levels may take a unit above 20 (e.g. Lv 11 Gonzo)
 if ((m_CurrentStats.Level + numberLevels) > 20 && !ignoreCap) numberLevels = 20 - m_CurrentStats.Level;
 m_CurrentStats.Level += numberLevels;

 TRandom3 rand;
 rand.SetSeed();
 //TRandom3 generates random numbers in the range (0,1] (excludes zero, includes 1)

 std::vector<double> growths;
 growths.push_back(m_CurrentGrowths.HP);
 growths.push_back(m_CurrentGrowths.Power);
 growths.push_back(m_CurrentGrowths.Skill);
 growths.push_back(m_CurrentGrowths.Speed);
 growths.push_back(m_CurrentGrowths.Luck);
 growths.push_back(m_CurrentGrowths.Defense);
 growths.push_back(m_CurrentGrowths.Resistance);
 std::vector<double> stats;
 stats.push_back(m_CurrentStats.HP);
 stats.push_back(m_CurrentStats.Power);
 stats.push_back(m_CurrentStats.Skill);
 stats.push_back(m_CurrentStats.Speed);
 stats.push_back(m_CurrentStats.Luck);
 stats.push_back(m_CurrentStats.Defense);
 stats.push_back(m_CurrentStats.Resistance);
 std::vector<double> caps;
 //  caps.push_back(m_CurrentClass.Caps.HP);
 /*Enemies seem to have mostly ignore HP cap, though experiments with FE6 mamkutes seem to imply perhaps it's
   altered to a cap of 80. */
 caps.push_back(80);
 caps.push_back(m_CurrentClass.Caps.Power);
 caps.push_back(m_CurrentClass.Caps.Skill);
 caps.push_back(m_CurrentClass.Caps.Speed);
 caps.push_back(m_CurrentClass.Caps.Luck);
 caps.push_back(m_CurrentClass.Caps.Defense);
 caps.push_back(m_CurrentClass.Caps.Resistance);


 for (unsigned int i=0; i < growths.size(); i++){
   growths[i] *= numberLevels;
   growths[i] = rand.Rndm() * growths[i] / 4.0 + growths[i] * 7.0/8.0;
   while (growths[i] > 1){
     growths[i]--;
     if (stats[i] < caps[i]) stats[i]++; 
   }
   if (rand.Rndm() <= growths[i] && stats[i] < caps[i]) stats[i]++;
 }
 m_CurrentStats.HP         = stats[0];
 m_CurrentStats.Power      = stats[1];
 m_CurrentStats.Skill      = stats[2];
 m_CurrentStats.Speed      = stats[3];
 //ignoreLuck is for FE7
 if (!ignoreLuck)  m_CurrentStats.Luck       = stats[4];
 m_CurrentStats.Defense    = stats[5];
 m_CurrentStats.Resistance = stats[6];
}

For the layman, HHM bonuses are calculated by simply levelling up the character as if it were an enemy generic of the appropriate class by a certain number of levels. For the player characters in FE7 (and presumably the enemies, though as of yet I have not tested this directly), the number of bonus levels is five. The procedure for levelling up as an enemy is to multiply the base growths by the number of levels, use the RNG to generate a value from between 7/8 and 9/8 of this value (allowing for some spread, but not nearly the spread typical for PC-style individual levelling), then increase the stat by the floor of this value, generate a random number to compare with the difference of the value and its floor, potentially leading to an additional increase in that stat.

Example with numbers: A generic male archer has a skill growth of .40. If it gets 5 bonus levels, 5 * .40 is 2.0. The 7/8 to 9/8 range would be 1.75-2.25. The RNG decides this Archer's growth is 1.82 by some method. That means the Archer gains 1 skill for sure, and a random number is generated. If this number is below .82, the Archer gains another point of skill.

For a more concrete example, Raven would gain 5 male merc levels at growth rates (0.80,0.40,0.40,0.32,0.30,0.18,0.20), meaning modified values of (4.0,2.0,2.0,1.60,1.2,.90,1.0). This means on average he will have 4 more HP, 2 more Strength, Skill, and Speed, and he will have 1 more Luck, Defense, and Resistance. However, there's a small caveat. For some reason in FE7 enemies do not grow luck at all, so there is no bonus to luck, and you will see that the +4, +2, +2, +2, +0, +1, +1 calculated here match exactly with the values seen on this page. However, using the formulae provided you can see what sort of spread of values are possible (due both to the 7/8 to 9/8 effect and the resulting leftover growth RN calculation) and how likely it would be to be deviant, and not get any bonus to Defense, or get a higher than expected Strength bonus. For instance if the HP value was its full 9/8 that growth would be 4.5, meaning the +4 is guaranteed, and there's a 50% chance it's actually a +5. On the flip side, the defense growth could be at 7/8 meaning ~.79, at which point he would have a one in five chance of growing no extra defense. The odds of things conspiring that poorly against you aren't great, but they're not insignificant. In 10,000 trials, nearly one in ten Raven's failed to proc Defense.

ravenhmlv05defense.png

Also, since that result seems anticlimatic and expected, just by looking at the base .90 growth rate before spread calculations, consider instead the Power growth. At a flat 2.0 you would expect +2 every time, however 1 in 20 will only grow +1, while 1 in 20 will grow +3.

ravenhmlv05power.png

Edit: Also no need to apologize. While this was previously discussed, I do believe the time warp last year ate almost everything. Luckily, I retained all of my private notes on the matter.

Edited by Balcerzak
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...