Jump to content

EW: +1 willpower every sucessful mission?


Ulfius

Recommended Posts

I kinda hate that soldiers stagnate after colonel, never gaining any new willpower or stat increases after their final promotion, they just sit there soaking up the kills and xp your rookies could have snagged and gaining no benefit from it.

 

In enemy within The council medal of honor has a really nice mechanic where the soldier gains +1 willpower and +1 aim for each sucessful mission he has taken part in without any casualties. I was wondering if it was possible to somehow implement a +1 willpower award to soldiers on misison completion.

 

it makes a lot of sense that a 30 mission hardboiled combat veteran would have an extra 30 willpower, they've seen it all and

lived through worse situations. it'd even give them a way to (slowly) recover from the trauma of critical injuries. I have no idea if this is even possible with the current tools, and I have no scripting/technical ability to attempt it with. something tied onto the mission XP reward function would be my only guess, I just thought i'd share the idea for discussion with you and see if it starts any clever modders ticking.

Edited by Ulfius
Link to comment
Share on other sites

It looks relatively simple to implement.

 

XGBattle.Done.AdditionalBonuses:

...
if(noDeadSoldiers)
      {
        kSoldier.AddXP(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.CalcXP(kUnit, 6, none));
        // End:0x507
        if((kSoldier.m_kChar.aUpgrades[158] > 0) && kSoldier.m_kChar.aStats[6] < XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.COUNCIL_STAT_MAX)
        {
          kSoldier.m_kChar.aStats[6] += 1;
          kSoldier.m_kChar.aStats[1] += XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.COUNCIL_STAT_BONUS;
          kSoldier.m_kChar.aStats[7] += XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.COUNCIL_STAT_BONUS;
        }
      }
...

aUpgrades[158] is > 0 when soldier has been given the council medal

aStats[6] is a counter how many times council medal has been used by soldier

aStats[1] is soldiers aim

aStats[7] is soldiers will

 

So all that is really needed is to move the line which increase will a few lines up (directly above the check if no dead soldiers)... And while at it perhaps increase the aim bonus for the medal as it would otherwise seem like a pretty crappy medal.

 

Edit: If combined with somewhere between 5 and 10 lower starting will for rookies I think it could be a good addition to the game and it would counter the critically wounded soldiers are not worth saving factor.

Edited by Bertilsson
Link to comment
Share on other sites

I kinda hate that soldiers stagnate after colonel, never gaining any new willpower or stat increases after their final promotion, they just sit there soaking up the kills and xp your rookies could have snagged and gaining no benefit from it.

If hard-coding the medals will/aim increase to 1 instead of XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.COUNCIL_STAT_BONUS it saves enough space to leave the medal working exactly like before and to specify that soldiers of a minimum rank receive the 1 extra will per mission bonus.

 

I will most likely create a mini mod for this before playing the game next time.

Link to comment
Share on other sites

It is interesting idea and good logic. But would be good to set some upper floor to keep it balanced. Imagine soldiers with very high will, with neural feedback gene mod. Aliens using pisonic attacks wouldn't stand a chance.

 

I can think of changing Council Medal of Honor, that is awarded for completing a council mission, even it is not the functionality you desire.

 

Default values are:

  • Power A: +10 Aim and Critical Chance if not within 7 tiles of an allied unit
  • Power B: +1 Aim and +1 Will for each mission without any soldier deaths (to a maximum of +10 each)
  • Maximum awards: 2

The medal is set in XComGame.upk, class XGFacility_Barracks. Here can be maximum awards changed.

function BuildMedals()
{
<snip>
    BuildMedal(4, 158, 159, 2, 10);
<snip>
}

// 4   - eMedal_Council (Council Medal of Honor)
// 158 - ePerk_Medal_CouncilA (power A)
// 159 - ePerk_Medal_CouncilB (power B)
// 2   - iMaxAwards (maximum of 2 awards)
// 10  - iMissions (thanks for clarification Bertilsson - number of missions of required type necessary to complete before being offered a new medal of the given type)

Stat increase and other values can be tweaked in DefaultGameCore.ini.

// Power A - aim and crit bonus
COUNCIL_FIGHT_BONUS=10
// Power A - distance in tiles from any allied unit
COUNCIL_FIGHT_TILES=7

// Power B - will and aim increase per mission
COUNCIL_STAT_BONUS=1 
// Power B - max increase allowed (a value of 0 or less means no bonus will ever accrue)
COUNCIL_STAT_MAX=10

In DefaultGameData.ini is a number of various special missions that must be won before receiving the medal.

NUM_MEDALOFHONOR_MISSIONS=3

Terror, covert ops extraction, capture and hold, and council missions are counted as "special" mission. Maybe XCOM HQ, Alien Base and DLC counts too.

 

 

I'd propose to increase maximum awards of the medal to 10 so there is enough medals. NUM_MEDALOFHONOR_MISSIONS can be lowered to 0 or 1 to start earning the bonus earlier. Increasing of COUNCIL_STAT_MAX or COUNCIL_STAT_BONUS is also possible. Downside is that such approach applies to aim as well.

 

 

XComGame.upk, class XGBattle, simulated state Done is responsible for increase of stats of Power B. Here can be eliminated or altered aim increase. I see Bertilsson was faster :smile:

function AdditionalBonuses()
{
<snip>
    noDeadSoldiers = NoDeadSoldiersBonus();
    kSquad = XGBattle_SP(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle).GetHumanPlayer().GetSquad();
        if(I < kSquad.GetNumMembers())
        {
            kUnit = kSquad.GetMemberAt(I);
            if(kUnit.IsAlive())
            {
                kSoldier = XGCharacter_Soldier(kUnit.GetCharacter());
                kSoldier.AddXP(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.CalcXP(kUnit, missionEvent, none));
                if(noDeadSoldiers)
                {
                    kSoldier.AddXP(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.CalcXP(kUnit, 6, none));
                    if((kSoldier.m_kChar.aUpgrades[158] > 0) && kSoldier.m_kChar.aStats[6] < XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.COUNCIL_STAT_MAX)
                    {
                        kSoldier.m_kChar.aStats[6] += 1;
                        kSoldier.m_kChar.aStats[1] += XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.COUNCIL_STAT_BONUS;
                        kSoldier.m_kChar.aStats[7] += XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.COUNCIL_STAT_BONUS;
                    }
                }
<snip>
}

// aStats[1] - eStat_Offense (aim)
// aStats[6] - eStat_CouncilMedalAccrued
// aStats[7] - eStat_Will (will)

Anyhow, thanks to recent discoveries by wghost81, it should be possible to expand AdditionalBonus function and include code like:

if(noDeadSoldiers)
    {
    // If is soldier's will lower than control value, that will be our upper floor
    if (kSoldier.m_kChar.aStats[7] < control value)
    {
        // Increase will by 1
        kSoldier.m_kChar.aStats[7] += 1;
    }
    // If was a soldier critically wounded
    if (kSoldier.m_kChar.aStats[15] > 0)
    {
        // decrease the counter by 1
        kSoldier.m_kChar.aStats[15] -= 1;
    }
}

// aStats[15] - eStat_CriticalWoundsReceived

Considering, I'd feel bad after a mission, where some of my team mates died or were gravely injured, maybe it is worth to use GetNumDeadOrCriticallyWounded == 0 in the conditional. It is native function in XGSquadNativeBase.

Edited by Drakous79
Link to comment
Share on other sites

So, my biggest problem with the proposal is that you get Psionic Gods from grinding with this in play.

Not really...

How many missions do you have left when you start hitting colonel level?

How much will did the first colonels miss out due to the fact that you could buy the OTS will increase on promotion thing?

How many missions are left when you finally get second generation colonels who had OTS will increase on promotion?

Did any of the colonels get critically wounded?

 

By adding +rand(1) instead of +1 you can effectively lower the bonus to 0.5 per mission to make it less overpowered.

 

But yes if completely unlimited +1 for every mission, then yes, I agree you would end up with psionic gods soon enough :smile:

 

Edit: And as drakous suggested you could also set an upper limit on will bonus added in total.

Edited by Bertilsson
Link to comment
Share on other sites

 

So, my biggest problem with the proposal is that you get Psionic Gods from grinding with this in play.

Not really...

How many missions do you have left when you start hitting colonel level?

How much will did the first colonels miss out due to the fact that you could buy the OTS will increase on promotion thing?

How many missions are left when you finally get second generation colonels who had OTS will increase on promotion?

Did any of the colonels get critically wounded?

 

By adding +rand(1) instead of +1 you can effectively lower the bonus to 0.5 per mission to make it less overpowered.

 

But yes if completely unlimited +1 for every mission, then yes, I agree you would end up with psionic gods soon enough :smile:

 

Edit: And as drakous suggested you could also set an upper limit on will bonus added in total.

 

 

You could also follow the OG X-COM progression system and use something like:

if(kSoldier.GetRank() == 7) // only applies to Colonels
{
    if(Roll(iCap-kSoldier.m_aCurrentStats[6]))
    {
        kSoldier.m_aCurrentStats[6]++;
    }
}

So it would:

  • only apply to maximum rank soldiers -- other soldiers get gains by increasing rank
  • Chance of increasing decreases as Will stat increases
    • With Cap of 100, a soldier with 80 will would have a 20% chance to increase, for example
  • Implements a maximum cap

To fully follow the OG-style would require keeping track of number of will-using events (i.e. psionic attack/defense and morale events), but that system had issues of its own I won't go into. :)

Link to comment
Share on other sites

Wow thanks for the response! Very informative - I had no idea the medal attributes weren't hardcoded beyond variables in the gamecore ini. I should also clarify that I was thinking of a possible stat bonus on mission completion that was independant of any medals, for example say when mission reward xp gets doled out, there could aldo be a % chance of +1 will or aim awarded. I've no idea if mission reward is hardcoded though

 

A percentage chance with diminishing returns seems very smart to prevent psions Perhaps a formula like

(100-soldiers willpower)+20 = % chance - I.e. (100-61)+20 = 71% chance of willpower increase.

Although if what you are discussing is only possible through the use of medals that would cause problems, especially if the medal of honor is a shared buff, i.e. all medal of honor recipients recieve +9 will and aim from sucessful missions.

 

I'd be happy to see even a rudimentary stat growth system for colonels, thanks for the interest and feedback.

I've also got an idea the permanent critcal wound debuff but i'll start a new thread for it, as i dont want to derail this discussion

Edited by Ulfius
Link to comment
Share on other sites

No need for affecting medals unless wanted to. By putting the code outside the check if soldier has medal it can be added to any living (or even dead) soldier at end of each mission.

 

I agree with both you and amineri that a gradually diminishing model would probably be preferable.

 

Perhaps if someone could define what is a good but not extremely good will for a colonel then we could simply allow +1 for every mission and put a stop to it when that level is reached?

 

It wouldn't really give any perk to colonels who already have high will but it would allow a critically wounded colonel to recover in the course of 15 missions.

 

Edit: We could also add a very tiny chance for colonels to receive a random improved other skill.

Like 1% chance to have increased mobility.

2% chance to have increased health (1 health in 50 missons)

3% chance to have increased aim

 

Or even reverse some attributes... a tiny chance to lose mobility, aim, etc :)

Edited by Bertilsson
Link to comment
Share on other sites

  • Recently Browsing   0 members

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