Jump to content

R&D AI Improvements


Amineri

Recommended Posts

  • Replies 144
  • Created
  • Last Reply

Top Posters In This Topic

I've tried to enable overmind debug info, but had no luck either. :sad:

 

DebugOvermind does nothing and various AI debugging functions are not showing overmind state info. And I need to know in what state it is, as I suspect it gets pushed into "Fight" state on Council missions.

 

UPD: Overmind actually should go into "Fight" state and it does. Seems, patrols get deactivated somewhere else.

 

BTW, alien player is represented by XGAIPlayer. Overmind and PodManager are managed by it. For whatever reason Overmind is accessed via intermediate handler class, which makes tracing function calls even more painful.

Edited by wghost81
Link to comment
Share on other sites

On the "AI tweaking" front, I've modified that "HasPotentialKillShot" to take into account critical damage. The vanilla version only looks at the based possible damage. This function is primarily used to determine "Predetermined" ability and to choose the best target. Currently I've got it hard-coded for the x1.5 damage without the Damage Roulette second wave option.

 

Here is the file in UPKmodder format (I had to size up the function a bit to get it to fit) :

 

  Reveal hidden contents

 

 

The new code looks like so as decompiled by UE Explorer :

simulated function bool HasPotentialKillShot(out XGAbility_Targeted kAbility_Out)
{
    local XGUnit kTarget;
    local int iBestHitChance, iHitChance, iAttackAbility, iHP;
    local XGAbility_Targeted kBestAbility, kAbility;

    foreach m_kUnit.m_arrVisibleEnemies(kTarget,)
    {
        kAbility = XGAbility_Targeted(m_kAbilityDM.GetBestAbilityOption(GetPrimaryAttackType(), kTarget));
        if((kAbility != none) && kAbility.CheckAvailable())
        {
            iAttackAbility = kAbility.GetPossibleDamage();
            if(kAbility.GetCriticalChance() >= 50)
            {
                iAttackAbility *= 1.50;
                iAttackAbility += 1;
            }
            if(kTarget.GetUnitHP() <= iAttackAbility)
            {
                iHitChance = kAbility.GetHitChance();
                if(iHitChance > iBestHitChance)
                {
                    iBestHitChance = iHitChance;
                    kBestAbility = kAbility;
                }
            }
        }        
    }    
    kAbility_Out = kBestAbility;
    return iBestHitChance > 50;
    //return ReturnValue;    
}
Link to comment
Share on other sites

  • 2 months later...

Converted AI Improvements to PatchUPK pseudo-code, as all old AI bugs are still present in EU, including flanked+overwatched=freeze bug. :sad: Added it to "Interface and Gameplay Tweaks" collection.

 

Just wanted to say: Amineri, this mod is a piece of art. So much is done without any of the modding tools we have today. Great job!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...