aliens

Author Topic: [DONE] Units afraid to pathfind through fire now moddable  (Read 12052 times)

Offline Rangerh

  • Colonel
  • ****
  • Posts: 126
    • View Profile
[DONE] Units afraid to pathfind through fire now moddable
« on: November 20, 2022, 04:38:42 pm »
As i noticed the leeroyjenkins-ed units simply don't do mindless charging at all in 40K Rosigma (using OXCE 7.7.3) , i made a mini test with this
unit (necrons i reconfigured as khorne berserkers, because i used a terror mission that popped up and hash necron inside as my test mission) :
Spoiler:
Quote
  - type: STR_NECRON_WARRIOR #STR_NECRON_WARRIOR_ARMOR                        RANK 5 weapons done
    race: STR_NECRON
    rank: STR_LIVE_SOLDIER
    isLeeroyJenkins: true
    spotter: -1 #this so they communicate to each other their enemy position lasting amount of turns = Intelligence
    sniper: 100 #this so they decide to always attack 100 percent of the time once they know position
    stats:
      tu: 200
      stamina: 96
      health: 100
      bravery: 110
      reactions: 90 #increased this to see if it help reduce the possible hesitations
      firing: 74
      throwing: 80
      strength: 65
      psiStrength: 100
      psiSkill: 0
      melee: 85
    armor: STR_MUTON_ARMORB
    standHeight: 20
    kneelHeight: 15
    value: 50
    deathSound: [723, 724, 725, 726, 727, 728, 729, 730, 731, 732]
    aggroSound: 808
    intelligence: 3 #upped slightly so they remember enemy location a bit more
    aggression: 8  #slight increase to see if it helps them go at it
    energyRecovery: 60
    livingWeapon: true
    canBeMindControlled: false
    moraleLossWhenKilled: 75 #expected to die
    builtInWeaponSets:
      - - STR_AXE
      - - STR_AXE
      - - STR_AXE
armor :
Quote
  - type: STR_MUTON_ARMORB #KHRONE BESERKER
    visibilityAtDay: 40
    visibilityAtDark: 20
    heatVision: 30
    allowInv: true
    frontArmor: 110
    sideArmor: 100
    rearArmor: 70
    underArmor: 70
    drawingRoutine: 0
    spriteSheet: MUTON2.PCK
    spriteInv: CHBINV
    corpseBattle:
      - STR_BERSERKER_CORPSE
    frontArmor: 100
    sideArmor: 80
    rearArmor: 70
    underArmor: 70
    drawingRoutine: 0
    damageModifier: #CHAOS ARMOR
      - 1.0 #none
      - 0.8 #AP
      - 0.8 #FLAMES
      - 1.0 #HE
      - 0.9 #LASCANON
      - 1.1 #PLASMA
      - 1.1 #STUN
      - 1.1 #MELEE
      - 1.0 #ACID
      - 0.0 #SMOKE
      - 1.0 #IMPACT
      - 1.2 #MELTA
    loftempsSet: [ 4 ]
(oops seems i doubled the armor front/side/etc.. entries, just noticed now after copy pasting , but quickly tested after removed the doubled entries and it made no difference in the problem at hands)

Observed ingame multiple time :

- a berserker will move toward its target for a few steps, stop, a few more steps, stop, it goes to another berserker that will then move, then it comes back to the original berserker that resume its move, and even when the turn is ended, there's no way it moved a distance up to the 200TU the berserker had, that's very odd

- a berserker will never ever move by itself through dangerous terrain to reach its target, i setup fire to the ground on large areas to see (flamer weapons) and no berserker ever tried to move through those tiles, it will instead choose to move all the way around the fire, even if it means it will never reach its target before 3 or 4 turns , while if he had moved through he would have reached target on its 1st turn

- at least once in contact to its target, it will attack even if it's from the front, so at least that part of leeroyjenkins seems to work.

So is there anything in the configuration i posted that would break :
Quote
Charge is mostly vanilla/OXCE, with the following differences:
 - ignore remaining TUs (charge even if not enough TUs to attack now)
 - ignore dangerous tiles (grenades? pfff!)


edit : another observation regarding burning tiles :
The leeroyjenkis can cross burning tiles to reach its target ONLY if there is absolutely no other way (like if you surround totally the target with rivers of fire)
But if there is a non burning/safe path to reach its target the leeroyjenkins will instead always choose it regardless of how many turns it will take instead of directly go and murder its target on the same turn.
« Last Edit: April 22, 2023, 04:43:13 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Units afraid to pathfind through fire now moddable
« Reply #1 on: November 20, 2022, 06:10:13 pm »
leeroys don't ignore fire, nobody ignores fire (EDIT: except bio-drones)
"dangerous tiles" in openxcom are the ones with primed grenades on them

as for whether your unit works or not, I'd need:
- exact version number of 40k
- exact version number of rosigma
- your changes packed in a minimod
- a save which demonstrates that it doesn't work with a short description what doesn't work and what you would expect instead
« Last Edit: April 22, 2023, 04:44:51 pm by Meridian »

Offline Rangerh

  • Colonel
  • ****
  • Posts: 126
    • View Profile
Re: Units afraid to pathfind through fire now moddable
« Reply #2 on: November 20, 2022, 06:40:40 pm »
Well, in that case it's not really mindless charging if berserked/leeryjenkinsed units are afraid of a very minor amount of damage from crossing burning tiles (minor considering how much health and protection those units have in the mod), that break their usefulness for the AI attacks.

To reproduce the case i have been testing
* latest 40k (0.33) + Rosigma (2.0)
* reproducible saves attached to this post (one is before starting the mission so you can decide to use different troops, the other is at player's turn on the mission itself with his terminators just deployed)
* minimod required attached to this post (that has the necron units reconfigured as leeroyjenkinsed khorne bersekers as described in my previous posts)

2 of the terminators in the drop pods have heavy flamers, they're usefull to quickly lay down a large area in fire, allowing to test the AI pathing when fire is involved

expected :
when berserker decide to target one of the player's terminators, he will charge without interruption toward it using its full TU
observed :
berserker move toward the target for a few steps, stop, move toward it again, stop, as if it was hesitating for some reason, then before the AI complete its TU usage the game will then the focus goes to another berserker that does its move similarly, then the game will focus come back to original berserker that continue its move until its done
noticed additionally :
It "feels" that those AI units move distance do not seem to fit the 200TU

expected :
when a berserker decide to target one of the player terminator, he will charge on the direct path to attack it as immediately as possible (usually on the same turn it spotted its target), regardless how fire on the ground doing some very weak damage to it.
observed :
berserker will move around the fire, will spend probably 2 or 3 turns until it can reach on the safest possible path its target, meanwhile he will probably be dead to various player troops easily shooting at it for 2 or 3 turns with their guns from the "safety" of the wall of burning tiles
noticed additionally :
berserker can cross river of fire to reach its target in the most direct path ONLY if there is absolutely no other path (meaning you fully surrounded the targeted unit with fire by example)
« Last Edit: November 20, 2022, 06:42:22 pm by Rangerh »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Units afraid to pathfind through fire now moddable
« Reply #3 on: November 20, 2022, 06:44:21 pm »
I can look into adding support for units ignoring fire

thanks for the save, I'll look at it in the next 1-4 days

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Units afraid to pathfind through fire now moddable
« Reply #4 on: November 20, 2022, 06:48:14 pm »
burning tiles have boosted move cost for AI during move calculation, AI always try find path that have lowest cost, this cause AI to avoid tiles with fire.
In corner case AI could think that better path is move long path around fire or skip reaching given point because theoretical cost (inflated by fire) is too big.

Some units by default ignore this penalty, adding other to it should be relative simple.

Offline Rangerh

  • Colonel
  • ****
  • Posts: 126
    • View Profile
Re: Units afraid to pathfind through fire now moddable
« Reply #5 on: November 20, 2022, 08:07:38 pm »
Quote
I can look into adding support for units ignoring fire
Thank you very much, i think a lot of people would love such change (maybe the players troops will like it a lot less when berserkers emerge from the fire with such murder intent :D )
« Last Edit: November 20, 2022, 08:11:00 pm by Rangerh »

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: Units afraid to pathfind through fire now moddable
« Reply #6 on: November 22, 2022, 01:31:14 pm »
More important (IMHO) is:
do leeroys use spotter mechanic? Looks like no. If they will be able to charge to your unit, spotted by any of them, it will be possible to create real zombie rush.
Or melee attack wave.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Units afraid to pathfind through fire now moddable
« Reply #7 on: April 10, 2023, 03:38:15 pm »
thanks for the save, I'll look at it in the next 1-4 days

Took me a lot longer (sorry), but I have checked it now and can confirm that leeroy works as intended.

Now I will check how easy is to teach them to ignore fire...

More important (IMHO) is:
do leeroys use spotter mechanic? Looks like no. If they will be able to charge to your unit, spotted by any of them, it will be possible to create real zombie rush.
Or melee attack wave.

No, they don't use the spotter mechanic, only snipers use the spotter mechanic.

But it is something we should be able to teach them, if there's a need for it.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Units afraid to pathfind through fire now moddable
« Reply #8 on: April 22, 2023, 04:41:29 pm »
Attached a video.

First 10 seconds is normal.
Other 10 seconds is with new ruleset that removes the pathfinding penalty through fire:

Code: [Select]
units:
  - type: STR_NECRON_IMORTAL_REVIVES #STR_NECRON_WARRIOR_ARMOR                        RANK 5 weapons done
    avoidsFire: false