Git Product home page Git Product logo

clevergirl's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

clevergirl's Issues

Make sure AI understands mines

LRM Thunder mines do very little damage and are likely to miss. Make sure the AI understands that placing them is valuable. Because ones that miss but land near a target are actually more valuable.

If possible it should value them higher when several enemies are close together.

CG provides ranged attack order but melee results when attacker has no melee choices

Unexpected hang on enemy melee attacking one of my units, I thought it didn't roll the attack at all after I got control again, but looking at the combat log again I'm just blind and dumb
Attachment file type: archive
RogueLogs.zip
10.10 MB
Realized that after I opened the ticket though, so uh... Sorry. Only issue here is moderate hanging, which is pretty normal in my experience
Harkonnen — 06/04/2021
@FrostRaptor it wasnt a lock here, but:
2021-06-04T01:51:13 [WARNING] 05:51:13.626 Could not select a valid attack for the selected sequence - this should NEVER happen!
2021-06-04T01:51:44 CombatLog.AttackSequence [ERROR] Anim timeout for melee attack NotSet, time: 30.01322, timeout: 30, attacker: Jenner JR7-K, target: Bellerophon BEL-1X
and again no evalution in CG
FrostRaptor — Today at 9:57 PM
Actually... things look confused, but I think there is an attack eval in here.
What's strange is that during the 05:50 mark, CG is evaluating attacks from:
05:50:39.507 Gathering damage predictions for weapon: SnubNose PPC from attacker: UrbanMech UM-R80_Recruit_5E693AE8 to target: Wolverine WVR-1R_Flycatcher_EC1A10DE
05:50:39.507 -- Done!
Then at 05:51:13 it has:
05:51:13.140 CJMCN:T - === actor:Jenner JR7-K_Private_BDB3FEEE has currentHeat:0 and acceptableHeat:66
05:51:13.140 CJMCN:T - calculating 0 nodes
The last unit to activate is the Jenner:
2021-06-04T01:51:13 MissionControl [DEBUG] [AI] [Round '10' Phase '29' Unit Action '1'] ['TargetTeam' unit 'Jenner JR7-K' AI type 'CoreAITree'] Log Node
2021-06-04T01:51:13 MissionControl [DEBUG] [AI] [HasFollowLanceTargetNode] False
The animation times out:
2021-06-04T01:51:31 AudioEvents [DEBUG] Suspending Audio Engine. Still proccess? True
2021-06-04T01:51:44 CombatLog.AttackSequence [ERROR] Anim timeout for melee attack NotSet, time: 30.01322, timeout: 30, attacker: Jenner JR7-K, target: Bellerophon BEL-1X
Melee log keeps spamming:
05:51:13.163 Medium Laser
05:51:13.163 Modifying Jenner JR7-K_Private_BDB3FEEE's melee attack damage for utility
05:51:13.164 Failed to find a valid melee state, marking melee weapons as 1 damage.
Here's the real meat - the Jenner could not pick any valid attack pattern, despite having legtimate nodes:
05:51:13.204 -- sorting nodes by raw distance
05:51:13.204 -- attacker less than 10m from target, allowing one node only!
05:51:13.204 -- removing pathnode as we already have : 3 selections.
05:51:13.204 -- removing pathnode as we already have : 2 selections.
05:51:13.204 Building CHARGE state for attacker: Jenner JR7-K_Private_BDB3FEEE @ attackPos: (108.0, 81.9, -103.9) vs. target: Bellerophon BEL-1X_Vortex_57245CBC
05:51:13.204 Attacker cannot charge, skipping.
05:51:13.204 Building DFA state for attacker: Jenner JR7-K_Private_BDB3FEEE @ attackPos: (108.0, 81.9, -103.9) vs. target: Bellerophon BEL-1X_Vortex_57245CBC
05:51:13.204 Attacker cannot DFA, skipping.
05:51:13.204 Building KICK state for attacker: Jenner JR7-K_Private_BDB3FEEE @ attackPos: (108.0, 81.9, -103.9) vs. target: Bellerophon BEL-1X_Vortex_57245CBC
05:51:13.204 Attacker cannot kick, skipping.
05:51:13.204 Building PHYSICAL WEAPON state for attacker: Jenner JR7-K_Private_BDB3FEEE @ attackPos: (108.0, 81.9, -103.9) vs. target: Bellerophon BEL-1X_Vortex_57245CBC
05:51:13.204 Attacker cannot make a physical attack, skipping.
05:51:13.204 Building PUNCH state for attacker: Jenner JR7-K_Private_BDB3FEEE @ attackPos: (108.0, 81.9, -103.9) vs. target: Bellerophon BEL-1X_Vortex_57245CBC
05:51:13.204 Attacker cannot punch, skipping.
05:51:13.205 Building melee pathing from attacker: Jenner JR7-K_Private_BDB3FEEE to target: Wolverine WVR-1R_Flycatcher_EC1A10DE
05:51:13.205 found 0 nodes that are not blocked and within height
Looks like kick was excluded as an anim... for some reason?
05:51:13.204 ValidMeleeHeights => Ground, Low, Medium, High
05:51:13.204 - chassis requires right arm for punch anim, but is missing - cannot punch
05:51:13.204 - Adding tackle
05:51:13.204 - Returning 1 available attack animations
The Jenner stands up at the 01:50 mark:
2021-06-04T01:50:07 CombatLog.ActorActivation [LOG] Actor Jenner JR7-K standing up
Looks like the Jenner lost a leg at 01:49:

2021-06-04T01:49:07 CombatLog.Attacking [WARNING] OnAttackSequenceImpact is dealing <= 0 damage: base dmg: 60, total: 0
2021-06-04T01:49:07 CombatLog.Attacking [LOG] Actor Jenner JR7-K (9e2d0fed-3d92-42ee-92d0-2cc595709f2a.0) - Jenner JR7-K (9e2d0fed-3d92-42ee-92d0-2cc595709f2a.0) FLAGGED FOR KNOCKDOWN!
2021-06-04T01:49:07 CombatLog.AbilitiesAndEffects [LOG] Jenner JR7-K loses effect Intact Actuator due to cancellation or removal
2021-06-04T01:49:07 CombatLog.AbilitiesAndEffects [LOG] Jenner JR7-K loses effect Intact Actuator due to cancellation or removal
2021-06-04T01:49:07 CombatLog.AbilitiesAndEffects [LOG] Jenner JR7-K loses effect Intact Actuator due to cancellation or removal
2021-06-04T01:49:07 CombatLog.AbilitiesAndEffects [LOG] Jenner JR7-K loses effect Intact Actuator due to cancellation or removal
Expand
message.txt
3 KB
So what happens is... Jenner has no leg, so cannot charge or kick.
It has no arm for the punch animation:
05:51:13.204 ValidMeleeHeights => Ground, Low, Medium, High
05:51:13.204 - chassis requires right arm for punch anim, but is missing - cannot punch
So it cannot punch. It has no physical weapon. So it cannot attack.
So basically... the game thinks it should melee even though it cannot by CBTBE rules.
Idget — Today at 10:24 PM
😐
Poor Jenner.
FrostRaptor — Today at 10:33 PM
The thing is... CleverGirl is clearly telling the AI to make a shooting attack against the Wolverine:
05:50:11.242 AEHelper found 2 different attack solutions after evaluating attacks
05:50:11.242 evaluated attack of type Shooting with 1 weapons, damage EV of 3.92, heat -27
05:50:11.242 evaluated attack of type Shooting with 0 weapons, damage EV of 0, heat -36
05:50:11.242 best shooting: 3.92 melee: 0 dfa: 0
05:50:11.242 BehVars => ExistingTargetDamageForDFAAttack: 0.2 OwnMaxLegDamageForDFAAttack: 0.9
05:50:11.242 ==== Evaluating attack solution #0 vs target: Wolverine WVR-1R_Flycatcher_EC1A10DE
05:50:11.242 Weapons: ('M Laser', )
05:50:11.242 heat generated: -27 current: 6 acceptable: 66 willOverheat: False
05:50:11.242 attack order: using attack type: Shooting against: Wolverine WVR-1R
05:50:11.243 Target will suffer: 3.92 with firepower reduction: 12.5
05:50:11.243 Comparing damage - opportunity: 3.92 > designated: * threshold: 1.1
05:50:11.243 Comparing firepower reduction - opportunity: 12.5 vs. designated: 0 * threshold: 2.1
So WTF did it end up as a melee attack?

NRE with CalculateWeaponDamageEV

Reported by Xeryx, this stack trace occurs frequently for him:

System.NullReferenceException: Object reference not set to an instance of an object
  at CleverGirl.AIHelper.CalculateWeaponDamageEV (CleverGirl.CondensedWeapon cWeapon, BehaviorTree bTree, CleverGirl.AIHelper+AttackParams attackParams, BattleTech.AbstractActor attacker, UnityEngine.Vector3 attackerPos, BattleTech.ICombatant target, UnityEngine.Vector3 targetPos) [0x00330] in <abd10031d9114de2a78a9b43f20fa197>:0 
  at CleverGirl.AIHelper.ExpectedDamageForAttack (BattleTech.AbstractActor unit, AIUtil+AttackType attackType, System.Collections.Generic.List`1[T] weaponList, BattleTech.ICombatant target, UnityEngine.Vector3 attackPosition, UnityEngine.Vector3 targetPosition, System.Boolean useRevengeBonus, BattleTech.AbstractActor unitForBVContext) [0x00092] in <abd10031d9114de2a78a9b43f20fa197>:0 
  at CleverGirl.AEHelper.EvaluateAttacks (BattleTech.AbstractActor unit, BattleTech.ICombatant target, System.Collections.Generic.List`1[System.Collections.Generic.List`1[CleverGirl.CondensedWeapon]][] weaponSetListByAttack, UnityEngine.Vector3 attackPosition, UnityEngine.Vector3 targetPosition, System.Boolean targetIsEvasive) [0x000ef] in <abd10031d9114de2a78a9b43f20fa197>:0 
  at CleverGirl.Helper.AOHelper.MakeAttackOrderForTarget (BattleTech.AbstractActor attackerAA, BattleTech.ICombatant target, System.Boolean isStationary, BehaviorTreeResults& order) [0x002ad] in <abd10031d9114de2a78a9b43f20fa197>:0 
  at CleverGirl.Patches.AttackEvaluator_MakeAttackOrder.Prefix (BattleTech.AbstractActor unit, System.Boolean isStationary, BehaviorTreeResults& __result) [0x001c9] in <abd10031d9114de2a78a9b43f20fa197>:0 

Punchbots not always using melee appropriately

Reported by Harkonnen in closed-3437 on RT discord:

~400 dmg punchbot decided not to melee ~900 dmg punchbot
2020-04-09 01:14:13.706 -  meleeDamageRatio: 0.2453977 = target: 240.4846 / attacker: 59.01437 vs. cap: 1.1
2020-04-09 01:14:13.706 -  potential melee damage too high, skipping melee.
It was still by far the best action it could have taken

Double ammo usage on melee glitch

Reported in BTA ticket-0075:

Double ammo use on melee glitch. Note the Rocket Launcher only was allowed to fire once.  Also check the gauss and plasma ammo usage.
Attachment file type: archive
MeleeGlitch733.zip
4.14 MB
I've also seen this glitch on MRMs. Hoping to replicate it with AC20s eventually, but my AC20 mechs are sloooh.
Ok, just reran the mission with that DLL. It correctly stops me from using the Gauss
But I'm still using 4 shots of plasma ammo instead of 2. It looks like one tick when I hit execute, and one tick after the melee attack.
No worries. Now that I know how it works I can play around it. Doesn't bother me at all.
But what I should try is fire one batch of rockets then do a melee and see if it fires the last 40

CG does not evaluate range based off CAC weapons, only vanilla code

From rogueticket-3372 -

Several enemy units stopped acting in this battle.
The first one was the Kit fox, after being knock down it never attempted to stand up:
The the Wasp LAM. It did lose both torsos, it didn't fall down. Even if it had functioning legs it never tried to land and walt.
At that point I saved the following logs:
Attachment file type: archive
RogueLogs.zip
16.78 MB
Continuing the battle, in the last turns, a Hunter stopped acting, it had still working missiles and mech in its frontal arc. Second set of logs.
Attachment file type: archive
RogueLogs2.zip
17.55 MB
All three units had the possibility to do something, eve if it wasn't really useful.
Harkonnen — 05/03/2021
hmmm.... ok, this is really interesting, two different bugs
1st log - NRE at BattleTech.PreferExposedAlonePositionalFactor.EvaluateInfluenceMapFactorAtPosition_Patch0
@kmission
2nd log. If i am reading the log correctly, there is a serioius logic lapse in CleverGirl. It reject weapons due to been in minRange before the point where its should evalute Ammo/Modes. So while LRM20 could be Hotloaded, its not getting to a point where its should check this
@FrostRaptor
KMiSSioN — 05/03/2021
@Harkonnen i'm a victim here
Harkonnen — 05/03/2021
so CleverGirl.Helper.AOHelper.MakeAttackOrderForTarget makes wrong call?
FrostRaptor — 05/03/2021
So if I'm reading the transpiler on WeightedFactorHelper correctly, this log line in the CU logs:

patching class BattleTech.PreferExposedAlonePositionalFactor
can't find WeightedFactorHelper.CollectMasksForCellAndPathNode call
Indicates that the transpile is effectively a no-op, correct? Since that immediately returns the instructions unchanged.
Thus the error is in the raw HBS code.
If that's the case... NRE candidates are pretty thin. Would have to be BehaviorTree or maybe enemyUnits
Jago — 05/04/2021
I don't know if it is the same bug, but the Firefly in these logs did spent its last turns moving around without firing. It wasn't overheated and had weapons.
Attachment file type: archive
RogueLogsFirefly.zip
10.48 MB
Harkonnen — Today at 12:59 AM
@FrostRaptor did you fix the 2nd issue here? i dont remember you mentioning it CG changes...
FrostRaptor — Today at 8:32 AM
This firefly looks like it only has medium pulses, and in all cases it was either out of range or had no LOS to the target
Last round it was out of range to the Stalker, Uziel, Valkyrie. It was in range to the Bushwacker, but it couldn't get LOS (willFireAtTarget: False)
If I had to guess, it's got a weak melee attack but good move, so the AI is taking nodes that are outside enemy retaliation range. But that puts it outside MPulse range.
My thought is that this is WAD, but the role needs to be customized to allow the Firefly with it's short range weapons? Presumably something like a Flea with lots of SLas would have a similar flaw.
I could also put logic in the PreferAvoidMeleeWhenOutTonned influenceMap Factor to say if all weapons are out of range, move into melee ragne
Which is I think the correct solution here.
It won't fix it, fix it - but won't make it worse.
Interactive Rubber Dolphin — Today at 8:40 AM
@FrostRaptor I think harkonnen was asking about the other thing
It reject weapons due to been in minRange before the point where its should evalute Ammo/Modes. So while LRM20 could be Hotloaded, its not getting to a point where its should check this
not the firefly logs, but the second issue in first logs
FrostRaptor — Today at 9:01 AM
No, I didn't change that.
It's a pretty substantial rewrite as the API KMission exposes for me to use doesn't directly let me access modes/ammoPairs until I've calculated expected damage for the target
So I have what I need, but the structure of CG code - based off HBS code - doesn't lend itself well to introducing this check at the position I need it checked, without slowing down the process with multiple damage evaluation checks

WeaponSets calculate with evasion stripping

Default HBS logic is to separate weapons into different sets based upon evasive and non-evasive targets. Most RT / BTA units have enough ammo that this doesn't matter, so don't hold back against evasive targets except for heat issues.

I cannot get this version to work with 1.9.1

Version 4.0 does not load under any circumstance. I have the latest IRBT MOD UTILS installed which loads fine once you fix the mod.json error, an extra bracket in it. I do not have many mods that I use.

Here are my logs. I have turned off every other DLL mod and your mod will not load. I have also tried removing the IRBT requirement and it will not load. I think there is an error! Can you please check.

harmony_summary.log
ModTek.log
ModTek_runtime_log.txt
output_log.txt

Direstar issue - limit condensed groups to X heat

The DireStar has 11 ER PPCs; condensing them into a single unit makes the heat high enough the unit will not fire. Ideally the logic is that they only fire one or two PPCs as they close, until they hit a high hit % and go 'lol, heat' and fire them all.

Does not predict endmoveheat effect of movement

Reported by Harkonnen in closed-3437 on RT discord:

It seems there is a problem with laser heatsinks and melee attacks - CG does not predict endmoveheat effect of movement
2020-04-09 01:26:32.728 - Weapons:
2020-04-09 01:26:32.728 - Weapon: TSEMP Damios
2020-04-09 01:26:32.728 - Weapon: TSEMP Damios
2020-04-09 01:26:32.728 - Weapon: Melee
2020-04-09 01:26:32.728 - heat generated for attack solution: 60
2020-04-09 01:26:32.728 - current heat: 27
2020-04-09 01:26:32.728 - acceptable heat: 31.5
2020-04-09 01:26:32.728 - will overheat? True
2020-04-09 01:26:32.728 - but enough damage for overheat attack? False
2020-04-09 01:26:32.728 - but enough accuracy for overheat attack? False
2020-04-09 01:26:32.728 - rejecting attack for not enough damage or accuracy on an attack that will overheat
2020-04-09 01:26:32.728 - evaluating attack solution #1
2020-04-09 01:26:32.728 - ------
2020-04-09 01:26:32.728 - Weapons:
2020-04-09 01:26:32.728 - Weapon: Melee
2020-04-09 01:26:32.728 - heat generated for attack solution: 0
2020-04-09 01:26:32.728 - current heat: 27
2020-04-09 01:26:32.728 - acceptable heat: 31.5
2020-04-09 01:26:32.728 - will overheat? False
2020-04-09 01:26:32.728 - but enough damage for overheat attack? False
2020-04-09 01:26:32.728 - but enough accuracy for overheat attack? True
2020-04-09 01:26:32.730 - attack order: Archangel C-ANG-O using attack type: Melee against: Mauler MAL-B-H
here it decided not to fire weapons during melee when it was percfectly acceptable and even desirable to do so
i also suspect that it would behave similary if mech has acepilot

NRE with ExpectedDamageForAttack

Reported in RT #ticket-3249:

log is full of this
[ERROR]  Source:CleverGirl  StackTrace:  at CleverGirl.AIHelper.CalculateWeaponDamageEV (CleverGirl.CondensedWeapon cWeapon, BehaviorTree bTree, CleverGirl.AIHelper+AttackParams attackParams, BattleTech.AbstractActor attacker, UnityEngine.Vector3 attackerPos, BattleTech.ICombatant target, UnityEngine.Vector3 targetPos) [0x00330] in <8f44473afe474fc99d7aa62291a8f59f>:0
  at CleverGirl.AIHelper.ExpectedDamageForAttack (BattleTech.AbstractActor unit, AIUtil+AttackType attackType, System.Collections.Generic.List1[T] weaponList, BattleTech.ICombatant target, UnityEngine.Vector3 attackPosition, UnityEngine.Vector3 targetPosition, System.Boolean useRevengeBonus, BattleTech.AbstractActor unitForBVContext) [0x00092] in <8f44473afe474fc99d7aa62291a8f59f>:0
  at CleverGirl.AttackEvaluatorHelper.EvaluateAttacks (BattleTech.AbstractActor unit, BattleTech.ICombatant target, System.Collections.Generic.List1[System.Collections.Generic.List`1[CleverGirl.CondensedWeapon]][] weaponSetListByAttack, UnityEngine.Vector3 attackPosition, UnityEngine.Vector3 targetPosition, System.Boolean targetIsEvasive) [0x000ef] in <8f44473afe474fc99d7aa62291a8f59f>:0
  at CleverGirl.Patches.AttackEvaluator_MakeAttackOrderForTarget.Original (BattleTech.AbstractActor attackerAA, BattleTech.ICombatant target, System.Int32 enemyUnitIndex, System.Boolean isStationary, BehaviorTreeResults& order) [0x0030b] in <8f44473afe474fc99d7aa62291a8f59f>:0
  at CleverGirl.Patches.AttackEvaluator_MakeAttackOrderForTarget.Prefix (BattleTech.AbstractActor unit, BattleTech.ICombatant target, System.Int32 enemyUnitIndex, System.Boolean isStationary, BehaviorTreeResults& order, System.Single& __result) [0x0000f] in <8f44473afe474fc99d7aa62291a8f59f>:0

Sometimes does not log execution

Attached logs show a case where CBTBE AI log shows evaluation of expected attack and melee invocation, but there's no corresponding log in CleverGirl to show the AttackOrder creation. In theory this implies either a MeleeSequence is being created outside of CleverGirl (maybe b/c of load order?) or somewhere else. Huh.

RogueLogs.zip

AI not accounting for heat cost when rollup occurs

From Harkonnen in closed-3437 on RT discord:

It looks like that evalution identical weapons as one has a nasty side effect - if firing all of them causes overheat CG does not evalute the possibility of firing obly some of them

NRE when player selected attack

Flashpoint Coronation day, after a melee attack the game soft locked.
The turn won't end, the melee attack didn't execute.
Happened after the last units spawned with the objective to get to the dropship
Harkonnen — 07/17/2021
hmm... i cant make sense of the logs, your performed a melee or ai?
AdamBlade — 07/17/2021
I performed melee on a tank that had just landed.
Harkonnen — 07/17/2021
@AdamBlade wtf.... did it showed you some type of melee attack as avalable, or allowed you to attack without selecting melee type?
@FrostRaptor melee NRE on player action. CBTBE logs shows all attacks are invalidated and no state is set 🤷‍♀️
AdamBlade — 07/17/2021
I think so? I remember going in for melee, don't quite recall if i selected kick punch or charge.
I think i just pressed V and then clicked attack
One of my mechs was close to the drop zone
The last one before you go up to the shuttle
I mean dropship

Prevent attacks with < % of EV based upon heat

i mean, EV of 1.63 is incredibly low, getting into ANY overheat for this is ricidulously stupid
i understand that iy followed the logic it has, the point is that logic is stupid
FrostRaptor — Today at 12:50 PM
If there was a check that said the EV was less than X percent of 100% damage, reject it, would that be better?
As I can't base it on raw damage output, since light mechs may have crap gear
Float_AccuracyNeededForOverheatAttack = 22, exists and I could gate on that possibly
Harkonnen — Today at 12:54 PM
it comes back to the hardcap on overhet too
basicalyy, instead of "EV was less than X percent of 100% damage, reject it" it should have something like a curve
f.e.
less then 20% - target 0 heat
20-30% - taget slight oveteht
30-50%- target redline
50-90 - grdadualy allowed to go above redline to taget heat for behvars
over 90% - allowed to go oabive behvar....
yeas, Float_AccuracyNeededForOverheatAttack could be used to decied at what perventage its ok to go above behvar tatget heat
FrostRaptor — Today at 12:57 PM
This will cause the AI to brace when they have shot % < 20%
Like against stealth mechs at range, is that okay?
I don't know of an easy way to prevent it
Because the behavior tree has already decided that we should shoot at this point, instead of move
Harkonnen — Today at 12:58 PM
no, this will make ai only perform heat neitral attacks at <20%
barce if yjey are alredy hot
FrostRaptor — Today at 12:59 PM
So this attack would have been the desired outcome:

15:11:25.937 evaluated attack of type Shooting with 3 weapons, damage EV of 0.7039995, heat -9
Harkonnen — Today at 12:59 PM
yep
FrostRaptor — Today at 12:59 PM
K
I think I can do that. Thanks for talking with me about it.

BUG: Calculates WillFireAtTarget using currentPosition instead of meleePosition

Bug in the condensed weapon logic - uses the attacker's current position, instead of the attack position. See this snippet:

            // Evaluate being able to hit the target
            bool willFireAtTarget = cWeapon.First.WillFireAtTargetFromPosition(target, attacker.CurrentPosition, attacker.CurrentRotation);
            bool withinRange = distance <= cWeapon.First.MaxRange;
            Mod.Log.Debug?.Write($" -- willFireAtTarget: {willFireAtTarget}  withinRange: {withinRange}");
            if (willFireAtTarget && withinRange)
            {
                Mod.Log.Debug?.Write($" -- has LOF and is within range, adding to ranged set");
                RangedWeapons.Add(cWeapon);
            }                

This will fail if the target is out of firing range at the start, but can charge into melee. Need to fix this.

LRM Hotloading

I'm still getting scattered reports of the AI units hotloading their LRM launchers even when it's detrimental. Maybe double check that code. I'll keep an eye out and try to acquire logs.

Streak Heat

AI should be aware that streak weapons may not fire and therefore may not produce heat.
If they don't account for the heat efficiency of streak weapons units with several of them may underuse them.

Perhaps an Expected Value calculation for the heat. 70% chance of generating 10 heat if it locks and fires considered 7 heat.
So they treat streaks as high value weapons when heat is at a premium.

AI bypasses CleverGirl

In some situations, the AI will by-pass CG logic and issue a charge command. This causes a lockup as CBTBE has no concept of why this happened or what's happening. CG/CBTBE should capture more of these cases and close this bug.

NRE in CalculateWeaponDamageEV

From RT ticket-4023:

2020-08-27T17:58:16 FYLS [ERROR] <mod>Failed to modify AttackOrder evaluation due to error: Object reference not set to an instance of an object
2020-08-27T17:58:16 FYLS [ERROR] <mod>  Source:CleverGirl  StackTrace:  at CleverGirl.AIHelper.CalculateWeaponDamageEV (CleverGirl.CondensedWeapon cWeapon, BehaviorTree bTree, CleverGirl.AIHelper+AttackParams attackParams, BattleTech.AbstractActor attacker, UnityEngine.Vector3 attackerPos, BattleTech.ICombatant target, UnityEngine.Vector3 targetPos) [0x00330] in <8f44473afe474fc99d7aa62291a8f59f>:0 
  at CleverGirl.AIHelper.ExpectedDamageForAttack (BattleTech.AbstractActor unit, AIUtil+AttackType attackType, System.Collections.Generic.List`1[T] weaponList, BattleTech.ICombatant target, UnityEngine.Vector3 attackPosition, UnityEngine.Vector3 targetPosition, System.Boolean useRevengeBonus, BattleTech.AbstractActor unitForBVContext) [0x00092] in <8f44473afe474fc99d7aa62291a8f59f>:0 
  at CleverGirl.AttackEvaluatorHelper.EvaluateAttacks (BattleTech.AbstractActor unit, BattleTech.ICombatant target, System.Collections.Generic.List`1[System.Collections.Generic.List`1[CleverGirl.CondensedWeapon]][] weaponSetListByAttack, UnityEngine.Vector3 attackPosition, UnityEngine.Vector3 targetPosition, System.Boolean targetIsEvasive) [0x000ef] in <8f44473afe474fc99d7aa62291a8f59f>:0 
  at CleverGirl.Patches.AttackEvaluator_MakeAttackOrderForTarget.Original (BattleTech.AbstractActor attackerAA, BattleTech.ICombatant target, System.Int32 enemyUnitIndex, System.Boolean isStationary, BehaviorTreeResults& order) [0x0030b] in <8f44473afe474fc99d7aa62291a8f59f>:0 
  at CleverGirl.Patches.AttackEvaluator_MakeAttackOrderForTarget.Prefix (BattleTech.AbstractActor unit, BattleTech.ICombatant target, System.Int32 enemyUnitIndex, System.Boolean isStationary, BehaviorTreeResults& order, System.Single& __result) [0x0000f] in <8f44473afe474fc99d7aa62291a8f59f>:0

AI doesn't account for TSM when calculating acceptable heat

Reported by Harkonnen in closed-3437 on RT discord:

acceptable heat: 31.5 
while this is probably a good value for most mech, there is TSM. this basicaly means that AI purposely avoids activating TSM on punchbots, wich is wrong as fuck

Inconsistency when building weapon sets for melee attacks

Reported by Harkonnen in closed-3437 on RT discord:

1. It seems that whenever weapon fires in melee is hardcoded to Antipersonall
2020-04-09 01:11:53.876 -  (Weapon_Laser_LargeLaserPulse_CLAN) is out of range (MaxRange: 840 vs 184.4063) or has no LOF, skipping.
2020-04-09 01:11:53.876 -  (Weapon_SRM_SRM_NARC_CLAN) is out of range (MaxRange: 480 vs 184.4063) or has no LOF, skipping.
2020-04-09 01:11:53.876 -  (Weapon_SRM_SRM_NARC_CLAN) is anti-personnel, adding to melee and DFA sets.
2020-04-09 01:11:53.876 -  (Weapon_Laser_Light_TAG_CLAN) is out of range (MaxRange: 510 vs 184.4063) or has no LOF, skipping.
2020-04-09 01:11:53.876 -  (Weapon_Laser_Light_TAG_CLAN) is anti-personnel, adding to melee and DFA sets.
2020-04-09 01:11:53.876 -  (Weapon_Elite_2_Chainsword) is out of range (MaxRange: 40 vs 184.4063) or has no LOF, skipping.
It added NARC nad TAG which dont fire in melle into melee sets, but didnt added Weapon_Elite_2_Chainsword which is a melee firing weapon

AttackOrders may not prioritize ranged attacks due to rotation conflicts

Another sucide charge from the AI in round one
Hellound charged at the King Crab with spawn protection still on
Attachment file type: archive
RogueLogs.zip
18.91 MB
Harkonnen — 05/28/2021
@FrostRaptor CG decided that charge is the best move here, with ToHit:0.275. maybe there is some logic lapse?
Interactive Rubber Dolphin — 05/28/2021
maybe evasion remove is weighted that much?
FrostRaptor — Today at 9:46 AM
I think it's a combination of things
Looks like all the ranged weapons were marked as wilLFireAtTarget=false in the evaluation
1:30:16.961 Checking range 172.2269 and LOF from attacker: ((384.0, 199.2, -540.4)) to target: ((300.0, 161.3, -685.9))
21:30:16.961 -- weapon => 'M. i. Heavy Laser (C)'
21:30:16.961 -- can be used in melee, adding to melee sets.
21:30:16.961 -- willFireAtTarget: False withinRange: True
21:30:16.961 -- weapon => 'Repeating TSEMP'
21:30:16.961 -- can be used in melee, adding to melee sets.
21:30:16.961 -- willFireAtTarget: False withinRange: True
21:30:16.961 -- weapon => 'SRM6 Streak MKII'
21:30:16.961 -- can be used in melee, adding to melee sets.
21:30:16.961 -- willFireAtTarget: False withinRange: True
21:30:16.961 -- weapon => 'AMS (C)'
21:30:16.961 -- can be used in melee, adding to melee sets.
21:30:16.961 -- willFireAtTarget: False withinRange: False
21:30:16.961 -- weapon => 'Grenade Launcher'
21:30:16.961 -- can be used in melee, adding to melee sets.
21:30:16.962 -- willFireAtTarget: False withinRange: True
Which results in CG thinking the unit is a melee bot
21:30:16.974 == Creating melee weaponSets for attacker: Hellhound HND-RX_Lieutenant_A3C9A6F1 versus target: King Crab KGC-666_Poet_2B0CDE33
21:30:16.974 Unit isMeleeMech due to rawMelee: 153 >= rawRanged: 0 x 2
I evaluates its choices and figures out melee is the only thing that yields damage
21:30:16.980 AEHelper found 2 different attack solutions after evaluating attacks
21:30:16.980 evaluated attack of type Melee with 1 weapons, damage EV of 47.025, heat -81
21:30:16.980 evaluated attack of type Shooting with 0 weapons, damage EV of 0, heat -81
21:30:16.980 best shooting: 0 melee: 47.025 dfa: 0
So it goes for it
Harkonnen — Today at 9:49 AM
so its basically back to the question why " willFireAtTarget: False"
FrostRaptor — Today at 9:50 AM
Yup
I can think of two things off the top of my head
First is that being the first turn, sensors are offline - so pilot might be outside visual range
Harkonnen — Today at 9:51 AM
it was able to charge, caanot be
FrostRaptor — Today at 9:51 AM
Yup
Plus LV logs have this:
21:28:01.349 MH:PCM Parsing current map.
21:28:01.360 Calculating vision range as Math.Ceil(baseVision:40 * 30.0 * visionMulti:0.8) = visRange:961.
21:28:01.360 MapHelper: Vision range for map will be ==> 960m (normalized from 961m)
So shouldn't be a signature/vision issue
Harkonnen — Today at 9:52 AM
lloking at your other explanation.... could it be that yore are checking this from the unit intial position and there is no LoS?
FrostRaptor — Today at 9:52 AM
Wrong element, there's two missions in this log
Yup
That's the second idea. That the current rotation may be what's throwing it off.
Basically if HellHound had KGC in rear arc... most weapons would not figure from current rotation
This is probably a bug in HBS code that I've carried over.
Yeah, that's seeming more and more likely
HBS code:
bool flag = weapon.WillFireAtTargetFromPosition(target, unit.CurrentPosition, unit.CurrentRotation);
bool flag2 = unit.Combat.LOFCache.UnitHasLOFToTarget(unit, target, weapon);
bool flag3 = (target.CurrentPosition - unit.CurrentPosition).magnitude <= weapon.MaxRange;
It's not setup to consider that you can freely rotate from a stationary attack.
In most cases it works because the influenceMap will direct you to a different position before this logic kicks in
KGC sprints in phase 11:
2021-05-27T23:13:07 CombatLog.ActorActivation [LOG] Actor King Crab KGC-666 (ec9d2280-ca9a-4d90-8a20-963d8a4c0a39.1) - Activated by Team Player 1
2021-05-27T23:13:07 CombatLog.ActorActivation [LOG] Actor King Crab KGC-666 (ec9d2280-ca9a-4d90-8a20-963d8a4c0a39.1) - sprinting

(related: HTF is a KGC going on phase 11?!? That's round 19, WTF!)
That's wrong, that is previous mission
Harkonnen — Today at 10:03 AM
actualy, LoS from current explains all weirdness in Ai reported.... stupid melee attacks, mechs running from player....
FrostRaptor — Today at 10:03 AM
@Interactive Rubber Dolphin to your question - the attack is weighted highly because of evasion break:
21:30:16.974 Evaluating damage for state: CHARGE
21:30:16.974 -- Checking ranged weapons
21:30:16.974 - Calculating utility based upon total projected instab of: 200
21:30:16.974 Adding 60 virtual damage to EV from evasivePips: 6 x bonusDamagePerPip: 10
21:30:16.974 Reducing virtual damage by 30 due to potential loss of 6 pips.
21:30:16.974 Reducing virtual damage by 50 due to attacker damage on attack.
21:30:16.974 Virtual damage calculated as -20 = evasionBreakUtility: 60 + knockdownUtility: 0 - selfDamage: 50 - selfEvasionDamage: 30
21:30:16.974 State CHARGE exceeds previous state damages, adding it as highest damage state
Interactive Rubber Dolphin — Today at 10:04 AM
wait

-20
wouldn't that be instead low?
FrostRaptor — Today at 10:04 AM
Yes, that's applied to the EV of the charge attack
The point being without the +60 the charge would probably go negative in this case, and end up being a 0 damage attack - AI would have braced instead
Interactive Rubber Dolphin — Today at 10:05 AM
Ah
I see
FrostRaptor — Today at 10:07 AM
Actually, at a different attack position it's even higher:
21:30:15.193 === Calculating expectedDamage for Hellhound HND-RX_Lieutenant_A3C9A6F1 melee attack from position: (384.0, 199.3, -540.4) against target: King Crab KGC-666_Poet_2B0CDE33 at position: (300.0, 161.3, -685.9)
21:30:15.193 useRevengeBonus: True
...
21:30:15.194 Virtual damage calculated as 180 = totalDamage: 200 + evasionBreakUtility: 60 + knockdownUtility: 0 - selfDamage: 50 - selfEvasionDamage: 30
21:30:15.194 Setting weapon: Melee to virtual damage: 180 for EV calculation
Another factor that could be complicating this
There are multiple enemies:
21:30:16.961 Evaluating all actors for hostility to Hellhound HND-RX_Lieutenant_A3C9A6F1
21:30:16.961 -- actor: King Crab KGC-666_Poet_2B0CDE33 is an enemy.
21:30:16.961 -- actor: Corsair COR-RA_Raven_F9FAE558 is an enemy.
21:30:16.961 -- actor: Mauler MAL-RX_Ronin_9D156E66 is an enemy.
21:30:16.961 -- actor: Munin LAM MN-1B_Tinker_E325BAAE is an enemy.
The AI logic looks for 'opportunity fire' shots against targets, and so long as it finds one that beats the threshold it takes it.
If the influenceMap logic results in a node position & rotation that is facing say the Munin, but the KGC evaluates first in the list and beats the threshold - you'd see behavior like this.
It picks the KGC as the first opportunity fire candidate instead of evaluating all of them, as a performance boost.
This one will be a bitch to fix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.