Author Topic: [WIP][SOURCEMOD][OXCE] Brutal-AI  (Read 20178 times)

Offline Rangerh

  • Colonel
  • ****
  • Posts: 126
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #15 on: November 12, 2022, 05:31:30 pm »
Tested it with my modded 40Kmod+Rosgima (the modded part is the maxviewdistance that i reduced from the default 60 to 30, and adjusted all the visibilityAtDay and visibilityAtDark accordingly for all units , as in default mod and expansion would go up to 120 )

With my Rhino (it's a normal ground transport, i mean it get you to start on turn 1) i got into a fight with an Ork wagon that saw a lot of grenades thrown my way.
Couldn't see the other differences as in that map my Rhino had spawned right next the Ork vehicle, so everyone was nearly already at weapon range of each other.
Seems like BrutalAI ignore the "turnAIUseGrenade" setting (that i had set up high as i wanted to see how the AI navigate with the Brutal AI)

Now on a medium UFO landing, i sent my Drop Pods (it's a transport that only have you landing and starting on turn 2, meaning turn 1 is AI only).
And it seems the BrutalAI gets stuck on that turn 1  "Hidden Movement", the game regularly freeze and unfreeze, sometime i can hear a door, but after near of a dozen of minute the turn 1 is still not resolved.

With the regular OXCE 7.8 , that fight works correctly so it seems the way the Drop Pods transport works put a huge strain on the BrutalAI

EDIT : gave a try with the newer version of BrutalAI (as i noticed there was one newer than the one i downloaded yesterday).
And this time it works.
I reloaded and retried the save i did multiple time and there is no more problem, the AI only turn 1 always complete this time , that's great tough i have no idea what was wrong previously.

EDIT 2 : completed that medium UFO battle and it was quite intense as i didn't had to move all over the map to find enemies (Night Raptors chaos marines), they were flying and running around my troops, attacking when they could (when my troops weren't shooting them down as i was using rather strong units and weaponry) .
There's only the case of the UFO that had 4 enemies in it and that stayed inside for the whole duration of the battle.


It wasn't a problem as it got me into a nice assault , but i wonder if it was normal that some AI were staying in the ship because apparently the doors were on the 2nd floor instead of the 1st one as in most classic ships :

I  just made my own entrance by destroying a wall personnally and killed them all.

edit 3 : oh damn after checking the options i noticed BrutalAI was OFF :/ as i was testing with the save on and off and forgot at some point to turn it on again
i guess that intense battle was only played with normal AI then, must have been lucky to have the enemies spawning close to my landing zone then :/
Will have to test further

« Last Edit: November 12, 2022, 07:10:39 pm by Rangerh »

Offline Rangerh

  • Colonel
  • ****
  • Posts: 126
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #16 on: November 12, 2022, 06:57:02 pm »
And the bug/problem is back, in fact it's because i had turned off the BrutalAI accidentally that the mission worked, as now after turning it back ON and loading my save : the turn1 "hidden movement" never resolve anymore and the game stay stuck.

Attached the save to my post if you want to try (only need the 40k and its Rosigma expansion mods, nothing else), just select the landed UFO that is at some distance above one of my bases and intercept it with the Drop Pods from the list.
After the mission load, your troops are in the drop pods somewhere in the air so press the End of Turn to get the AI play its own turn, it's there that the game will be stuck, sometime you'll hear a door opening or two but it will never end if BrutalAI is on.


« Last Edit: November 12, 2022, 06:58:41 pm by Rangerh »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #17 on: November 12, 2022, 11:03:02 pm »
it's there that the game will be stuck, sometime you'll hear a door opening or two but it will never end if BrutalAI is on.
May I ask what the dimensions of these maps are, how many opponents, how many of your own units and if any (or all) of the opponents can fly?

My hypothesis about is that there's an exponential growth in turn-times. It scales with UnitsĀ² * accessible tiles. Accessible tiles usually being much more when the enemy can fly.

Turn-processing is also not so fast for me when there are Floaters for example. It is still kinda bearable but that's on standard 50x50x4 Maps.

I guess I have to make some cuts regarding expensive algorithms. Otherwise I doubt turns will resolve in an acceptable amount of time in mods where the map-size and unit-count is significantly larger than vanilla.

Offline Rangerh

  • Colonel
  • ****
  • Posts: 126
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #18 on: November 12, 2022, 11:44:18 pm »
To test if it was the too many fliers that was responsible potentially or if it was the special way Drop Pods deploy, i edited the Rhino transport (as it's in term of transport it's a classic -> start mission -> deploy on turn one, unlike the drop pod that keep your troops in the sky on the 1st turn while the AI play its turn and only deploy on turn 2) to have the same speed as the drop pods (so it can reach the landed medium UFO before it takes off.

When the mission started, i deployed a few of my marines to kill the (they were landed, not flying) enemies that were close to the Rhinos.
The Rhinos own guns helped to clean the  insertion zone.

Then pressed End Turn and the AI turn got stuck again during the "hidden movement" that never seemed to resolve, so at least it confirms this problem has nothing to do with the special way Drop Pods make their insertion on turn 2.

For the map it does seem to be standard 50x50 , with BrutalAI enabled after a debug kill on my turn 1, it shows there were 28 enemy units (when i did the mission with BrutalAI turned to OFF there were only 25 but a couple of enemies were taken alive) but 40k/Rosigma has usually more enemies in maps than other mods (but most mods have higher enemy density than default UFO and TFTD)
Nearly all of the enemies featured in that mission are flyiers (Night Raptors and War Talons, along with their officers) , there was a Neverborn but they don't fly.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #19 on: November 13, 2022, 12:17:52 am »
Then pressed End Turn and the AI turn got stuck again during the "hidden movement" that never seemed to resolve
Well, the question is: Does it never resolve or is it just really, really slow.
I recommend using debug-mode to figure that out:

In options.cfg find the enty "debug:" and set it to "debug: true".

Then before you hit end-turn press ctrl+d, which gives you map-hack.

Really slow would mean stuff happens but between every unit there's a very significant delay where the camera is centered on that unit.
Completely stuck means that stuff is happening but in the end it keeps trying to order a unit to do an impossible command. If you can scroll normally at some point (in debug mode you still have to end the AI-turn manually) the turn has finished.
If it lags while scrolling while the arrow remains above one unit, it means it's stuck and tries to give a command to that unit.

Ideally you could also enable "traceAI" in the same config I mentioned above. When it's stuck the "openxcom.log" will have repeating entries of always the same unit trying to act.

Then you could copy&paste a block of that repeating cycle for me, which could help me resolve the issue.

Anyways, if it's a speed-issue I have just changed it from unitsĀ²*map-tiles to 2*units*map-tiles, which is way faster than it was before. And on several test-saves the result of the alien-move was almost the same regardless of that change.

Offline Rangerh

  • Colonel
  • ****
  • Posts: 126
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #20 on: November 13, 2022, 02:27:44 pm »
after debug and trace AI what i could observe :

- the game isn't stuck, it in fact just take a long time to process a single AI move (and repeated with 28 AI that probably is why i thought the turn was never resolving )
- i used the Rhino for the test so the battle start classically with my turn 1
- the game isn't stuck indeed
- the screen move to an AI and  (as i play windowed so it's easy to see the mention of this happening) the game executable stop responding (can't move the arrow, etc...) for +/- 10 seconds (sometime more to near 20 seconds)
- the AI move  then sometime after another +/- 10 seconds of freezing, the screen move to another AI and the game stop responding again for +/- 10 seconds, then that AI move.
- sometime the game does not stop responding directly but there's nothing happening for +/-10 seconds (then it stop responding again for +/-10 seconds before the AI move)

I left the game running and finally the turn ended (i mean there was no more AI to move, so i could finally move the arrow again and end the turn manually).

Here's a sample of the log , interesting that the time stamps shows that there were those +/- 10 seconds freezing , seems to happen after the last "checking LOF" and the "best position to attack" everytime
Spoiler:
Quote
[13-11-2022_13-13-03]   [INFO]   Brutal-AI final got-position from (18,26,7) to (18,26,7)
[13-11-2022_13-13-03]   [INFO]   BattlescapeGame::popState() #1 with 43 TU
[13-11-2022_13-13-03]   [INFO]   #1000011--STR_NIGHTLORDS_RAPTOR_SOLDIER
[13-11-2022_13-13-03]   [INFO]   Unit has 0/2 known enemies visible, 0 of whom are spotting him.
[13-11-2022_13-13-03]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-13-03]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-03]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-03]   [INFO]   Explosion with radius 5 at (45,44,1) affected AoE targets: 1
[13-11-2022_13-13-03]   [INFO]   STR_SCARE_GRENADE checking LOF
[13-11-2022_13-13-03]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-03]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-03]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-03]   [INFO]   Explosion with radius 5 at (43,54,1) affected AoE targets: 1
[13-11-2022_13-13-03]   [INFO]   STR_SCARE_GRENADE checking LOF
[13-11-2022_13-13-03]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-19]   [INFO]   best positon to attack from (33,19,8) score: 300 need to flee: 0
[13-11-2022_13-13-19]   [INFO]   Distance to (45,44,1): 158 max distance to run: 192 allowedToSpendAllTimeUnits: 0
[13-11-2022_13-13-19]   [INFO]   Brutal-AI wants to go from (27,17,0) to (33,19,8) travel-target: (33,19,8) Remaining TUs: 125 TU-cost: 106 friendswithLoS: 1
[13-11-2022_13-13-19]   [INFO]   Brutal-AI final got-position from (27,17,0) to (33,19,6)
[13-11-2022_13-13-19]   [INFO]   Walking from: (27,17,0), to (33,19,6)
[13-11-2022_13-13-19]   [WARN]   No free channels available
[13-11-2022_13-13-19]   [INFO]   BattlescapeGame::popState() #0 with 35 TU
[13-11-2022_13-13-19]   [INFO]   #1000011--STR_NIGHTLORDS_RAPTOR_SOLDIER
[13-11-2022_13-13-19]   [INFO]   Unit has 0/2 known enemies visible, 0 of whom are spotting him.
[13-11-2022_13-13-19]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-13-20]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-20]   [INFO]   STR_PLASMA_CARBINE_CHAOS accuracy: -115 numberOfShots: 1 tuCost: 29
[13-11-2022_13-13-20]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-20]   [INFO]   STR_PLASMA_CARBINE_CHAOS accuracy: 0 numberOfShots: 1 tuCost: 18
[13-11-2022_13-13-20]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-20]   [INFO]   STR_PLASMA_CARBINE_CHAOS checking LOF
[13-11-2022_13-13-36]   [INFO]   best positon to attack from (33,19,8) score: 300 need to flee: 0
[13-11-2022_13-13-36]   [INFO]   Distance to (45,44,1): 160 max distance to run: 192 allowedToSpendAllTimeUnits: 0
[13-11-2022_13-13-36]   [INFO]   Brutal-AI wants to go from (33,19,6) to (33,19,8) travel-target: (33,19,8) Remaining TUs: 35 TU-cost: 16 friendswithLoS: 1
[13-11-2022_13-13-36]   [INFO]   Brutal-AI final got-position from (33,19,6) to (33,19,6)
[13-11-2022_13-13-36]   [INFO]   BattlescapeGame::popState() #1 with 35 TU
[13-11-2022_13-13-36]   [INFO]   #1000012--STR_NIGHTLORDS_RAPTOR_SOLDIER
[13-11-2022_13-13-36]   [INFO]   Unit has 0/2 known enemies visible, 0 of whom are spotting him.
[13-11-2022_13-13-36]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-13-36]   [INFO]   STR_PLASMA_PISTOL checking LOF
[13-11-2022_13-13-36]   [INFO]   Explosion with radius 5 at (45,44,1) affected AoE targets: 1
[13-11-2022_13-13-36]   [INFO]   STR_SCARE_GRENADE checking LOF
[13-11-2022_13-13-36]   [INFO]   STR_PLASMA_PISTOL checking LOF
[13-11-2022_13-13-36]   [INFO]   Explosion with radius 5 at (43,54,1) affected AoE targets: 1
[13-11-2022_13-13-36]   [INFO]   STR_SCARE_GRENADE checking LOF
[13-11-2022_13-13-52]   [INFO]   best positon to attack from (25,32,8) score: 300 need to flee: 0
[13-11-2022_13-13-52]   [INFO]   Distance to (45,44,1): 142 max distance to run: 192 allowedToSpendAllTimeUnits: 0
[13-11-2022_13-13-52]   [INFO]   Brutal-AI wants to go from (24,24,3) to (25,32,8) travel-target: (25,32,8) Remaining TUs: 125 TU-cost: 90 friendswithLoS: 1
[13-11-2022_13-13-52]   [INFO]   Brutal-AI final got-position from (24,24,3) to (25,32,7)
[13-11-2022_13-13-52]   [INFO]   Walking from: (24,24,3), to (25,32,7)
[13-11-2022_13-13-53]   [WARN]   No free channels available
[13-11-2022_13-13-53]   [WARN]   No free channels available
[13-11-2022_13-13-53]   [INFO]   BattlescapeGame::popState() #0 with 43 TU
[13-11-2022_13-13-53]   [INFO]   #1000012--STR_NIGHTLORDS_RAPTOR_SOLDIER
[13-11-2022_13-13-53]   [INFO]   Unit has 0/2 known enemies visible, 0 of whom are spotting him.
[13-11-2022_13-13-53]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-13-53]   [INFO]   STR_PLASMA_PISTOL checking LOF
[13-11-2022_13-13-53]   [INFO]   STR_PLASMA_PISTOL accuracy: -43 numberOfShots: 1 tuCost: 41
[13-11-2022_13-13-53]   [INFO]   STR_PLASMA_PISTOL checking LOF
[13-11-2022_13-13-53]   [INFO]   STR_PLASMA_PISTOL accuracy: -68 numberOfShots: 1 tuCost: 41
[13-11-2022_13-14-09]   [INFO]   best positon to attack from (26,32,8) score: 300 need to flee: 0
[13-11-2022_13-14-09]   [INFO]   Distance to (45,44,1): 148 max distance to run: 192 allowedToSpendAllTimeUnits: 0
[13-11-2022_13-14-09]   [INFO]   Brutal-AI wants to go from (25,32,7) to (26,32,8) travel-target: (26,32,8) Remaining TUs: 43 TU-cost: 12 friendswithLoS: 1
[13-11-2022_13-14-09]   [INFO]   Brutal-AI final got-position from (25,32,7) to (25,32,7)
[13-11-2022_13-14-09]   [INFO]   BattlescapeGame::popState() #1 with 43 TU
[13-11-2022_13-14-09]   [INFO]   #1000013--STR_NIGHTLORDS_RAPTOR_NAVIGATOR
[13-11-2022_13-14-09]   [INFO]   Unit has 0/2 known enemies visible, 0 of whom are spotting him.
[13-11-2022_13-14-09]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-14-09]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-14-09]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-14-09]   [INFO]   Explosion with radius 5 at (45,44,1) affected AoE targets: 1
[13-11-2022_13-14-09]   [INFO]   STR_SCARE_GRENADE checking LOF
[13-11-2022_13-14-09]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-14-09]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-14-10]   [INFO]   Explosion with radius 5 at (43,54,1) affected AoE targets: 1
[13-11-2022_13-14-10]   [INFO]   STR_SCARE_GRENADE checking LOF
[13-11-2022_13-14-25]   [INFO]   best positon to attack from (26,53,8) score: 300 need to flee: 0
[13-11-2022_13-14-25]   [INFO]   Distance to (45,45,0): 62 max distance to run: 268 allowedToSpendAllTimeUnits: 0
[13-11-2022_13-14-25]   [INFO]   Brutal-AI wants to go from (31,48,1) to (26,53,8) travel-target: (26,53,8) Remaining TUs: 120 TU-cost: 88 friendswithLoS: 1
[13-11-2022_13-14-25]   [INFO]   Brutal-AI final got-position from (31,48,1) to (26,53,7)
[13-11-2022_13-14-25]   [INFO]   Walking from: (31,48,1), to (26,53,7)
[13-11-2022_13-14-27]   [INFO]   BattlescapeGame::popState() #0 with 38 TU
[13-11-2022_13-14-27]   [INFO]   #1000013--STR_NIGHTLORDS_RAPTOR_NAVIGATOR
[13-11-2022_13-14-27]   [INFO]   Unit has 0/2 known enemies visible, 1 of whom are spotting him.
[13-11-2022_13-14-27]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-14-27]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-14-27]   [INFO]   STR_PLASMA_GUN_TWINCORE accuracy: 27 numberOfShots: 1 tuCost: 35
[13-11-2022_13-14-27]   [INFO]   Evaluate option 8 against 1000030 at (45,44,1) with weapon STR_PLASMA_GUN_TWINCORE, score = 92
[13-11-2022_13-14-27]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-14-27]   [INFO]   STR_PLASMA_GUN_TWINCORE accuracy: 27 numberOfShots: 1 tuCost: 36
[13-11-2022_13-14-27]   [INFO]   Evaluate option 8 against 1000031 at (43,54,1) with weapon STR_PLASMA_GUN_TWINCORE, score = 90
[13-11-2022_13-14-27]   [INFO]   BattlescapeGame::popState() #0 with 38 TU
[13-11-2022_13-14-28]   [INFO]   BattlescapeGame::popState() #0 with 5 TU
[13-11-2022_13-14-29]   [INFO]   BattlescapeGame::popState() #0 with 5 TU
[13-11-2022_13-14-29]   [INFO]   BattlescapeGame::popState() #0 with 5 TU
[13-11-2022_13-14-29]   [INFO]   #1000014--STR_NIGHTLORDS_RAPTOR_NAVIGATOR
[13-11-2022_13-14-29]   [INFO]   Unit has 0/1 known enemies visible, 0 of whom are spotting him.
[13-11-2022_13-14-29]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-14-29]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-14-29]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-14-29]   [INFO]   Explosion with radius 5 at (45,44,1) affected AoE targets: 1
[13-11-2022_13-14-29]   [INFO]   STR_SCARE_GRENADE checking LOF
[13-11-2022_13-14-42]   [INFO]   best positon to attack from (19,11,8) score: 300 need to flee: 0
[13-11-2022_13-14-42]   [INFO]   Distance to (45,44,1): 212 max distance to run: 192 allowedToSpendAllTimeUnits: 1
[13-11-2022_13-14-42]   [INFO]   Brutal-AI wants to go from (23,3,2) to (19,11,8) travel-target: (19,11,8) Remaining TUs: 120 TU-cost: 88 friendswithLoS: 1
[13-11-2022_13-14-42]   [INFO]   Brutal-AI final got-position from (23,3,2) to (19,11,7)
[13-11-2022_13-14-42]   [INFO]   Walking from: (23,3,2), to (19,11,7)
[13-11-2022_13-14-43]   [INFO]   BattlescapeGame::popState() #0 with 40 TU
[13-11-2022_13-14-43]   [INFO]   #1000014--STR_NIGHTLORDS_RAPTOR_NAVIGATOR
[13-11-2022_13-14-43]   [INFO]   Unit has 0/1 known enemies visible, 0 of whom are spotting him.
[13-11-2022_13-14-43]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-14-43]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-14-56]   [INFO]   best positon to attack from (19,10,8) score: 300 need to flee: 0
[13-11-2022_13-14-56]   [INFO]   Distance to (45,44,1): 228 max distance to run: 192 allowedToSpendAllTimeUnits: 1
[13-11-2022_13-14-56]   [INFO]   Brutal-AI wants to go from (19,11,7) to (19,10,8) travel-target: (19,10,8) Remaining TUs: 40 TU-cost: 12 friendswithLoS: 1
[13-11-2022_13-14-56]   [INFO]   Brutal-AI final got-position from (19,11,7) to (19,10,7)
[13-11-2022_13-14-56]   [INFO]   Walking from: (19,11,7), to (19,10,7)
[13-11-2022_13-14-57]   [INFO]   BattlescapeGame::popState() #0 with 36 TU
[13-11-2022_13-14-57]   [INFO]   #1000014--STR_NIGHTLORDS_RAPTOR_NAVIGATOR
[13-11-2022_13-14-57]   [INFO]   Unit has 0/1 known enemies visible, 0 of whom are spotting him.
[13-11-2022_13-14-57]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-14-57]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-15-11]   [INFO]   best positon to attack from (20,10,8) score: 300 need to flee: 0
[13-11-2022_13-15-11]   [INFO]   Distance to (45,44,1): 228 max distance to run: 192 allowedToSpendAllTimeUnits: 1
[13-11-2022_13-15-11]   [INFO]   Brutal-AI wants to go from (19,10,7) to (20,10,8) travel-target: (20,10,8) Remaining TUs: 36 TU-cost: 12 friendswithLoS: 1
[13-11-2022_13-15-11]   [INFO]   Brutal-AI final got-position from (19,10,7) to (19,10,7)
[13-11-2022_13-15-11]   [INFO]   BattlescapeGame::popState() #1 with 36 TU
[13-11-2022_13-15-11]   [INFO]   #1000015--STR_NIGHTLORDS_RAPTOR_NAVIGATOR
[13-11-2022_13-15-11]   [INFO]   Unit has 0/1 known enemies visible, 0 of whom are spotting him.
[13-11-2022_13-15-11]   [INFO]   Currently using Patrol behaviour
[13-11-2022_13-15-11]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-15-11]   [INFO]   STR_PLASMA_GUN_TWINCORE checking LOF
[13-11-2022_13-15-11]   [INFO]   Explosion with radius 5 at (45,44,1) affected AoE targets: 1
[13-11-2022_13-15-11]   [INFO]   STR_SCARE_GRENADE checking LOF
[13-11-2022_13-15-25]   [INFO]   best positon to attack from (28,50,8) score: 300 need to flee: 0
[13-11-2022_13-15-25]   [INFO]   Distance to (43,54,0): 124 max distance to run: 264 allowedToSpendAllTimeUnits: 0
[13-11-2022_13-15-25]   [INFO]   Brutal-AI wants to go from (35,49,0) to (28,50,8) travel-target: (28,50,8) Remaining TUs: 120 TU-cost: 136 friendswithLoS: 1
« Last Edit: November 13, 2022, 02:31:14 pm by Rangerh »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #21 on: November 13, 2022, 05:40:03 pm »
- the game isn't stuck, it in fact just take a long time to process a single AI move
Yeah, that's kinda what I suspected. So having done something about that was a good idea and speed optimization needs to be taken into account for decisions I make in the future.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #22 on: November 14, 2022, 10:29:21 pm »
Here's a video of me doing a mission with the latest in-development-version:


Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #23 on: November 18, 2022, 12:49:46 am »
I uploaded a new version of this on github:

https://github.com/Xilmi/OpenXcom/releases/tag/v_1_0_0

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #24 on: November 18, 2022, 02:47:24 am »
Here's an "advertisment" for it.
I thought this was pretty hilarious:

https://youtu.be/yim1kG_ddpQ

Offline psavola

  • Commander
  • *****
  • Posts: 832
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #25 on: November 18, 2022, 07:08:03 am »
I uploaded a new version of this on github:

https://github.com/Xilmi/OpenXcom/releases/tag/v_1_0_0

It would be nice to have it pushed to the new-ai branch, in particular so that versions for various platforms would be built on the build farm.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #26 on: November 18, 2022, 11:28:23 am »
It would be nice to have it pushed to the new-ai branch, in particular so that versions for various platforms would be built on the build farm.
Wait, does this happen automatically, as soon as they accept the PR?
I was looking for a way of distributing my Mod without having to bother Meridian and battle with my misconceptions about how GitHub is supposed to be used.
I felt bad for bothering them. That's why I looked into how I need to structure the package and created the zip-file to upload manually. :o
Of course with the massive caveat that it would only run on the OS that I'm using myself.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #27 on: November 19, 2022, 11:49:23 am »
This fixes two issues that came up during testing:

https://github.com/Xilmi/OpenXcom/releases

1. Non-moving-units are now supported and no longer cause an endless loop.
2. Arcing-shot-validation is now in line with what the engine-does. This both fixes a rare but possible endless-loop but also also makes units with arcing-shots much more likely to actually shoot at all.

Offline Rangerh

  • Colonel
  • ****
  • Posts: 126
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #28 on: November 19, 2022, 03:17:11 pm »
Used the new version from github, i noticed there are a bunch of dll in there, while for my test i moved them into my openxcom folder just in case they're required, are they really needed (i ask because by default there's no dll in Meridian's OXCE directory usually) ?

I used the same save i posted there previously :
https://openxcom.org/forum/index.php/topic,10854.msg150565.html#msg150565
(using the 40K mod + its Rosigma Expansion) standard 50x50 , there were 28 enemy units that all have flying ability and a medium sized UFO of 3 levels high

Intercepted the landed UFO in the north with my Drop Pods
Pressed End Turn once the battle truly start (as my troops are stuck in altitude in drop pods so nothing to do in turn 1 for me)

Test with OXCE 7.7.3 : 1st turn "hidden movements" takes 18 seconds before it's my turn to play
Test with Brutal AI OXCE 7.8.4, but Brutal AI turned off : 1st turn "hidden movements" takes 20 seconds before it's my turn to play
Test with Brutal AI OXCE 7.8.4, but Brutal AI turned on :  1st turn "hidden movements" takes 258 seconds before it's my turn to play.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [WIP][SOURCEMOD][OXCE] Brutal-AI
« Reply #29 on: November 20, 2022, 01:17:54 pm »
New version available:

https://github.com/Xilmi/OpenXcom/releases

Changelog:

Modders can now set "isBrutal: true" for separate units in units.rul. This allows using Brutal-AI for specific units in addition to the still existing option of enforcing it for everyone.
If both "isBrutal" and "isLeeroyJenkins" are set, "isBrutal" will take priority.

New end of turn and unit-is-ready-mechanism that works the same for brutal- and vanilla AI and was necessary to allow brutal and non-brutal-units in the same mission while keeping brutal-AI's capability to manipulate move-order.
This should also put an end towards all potential issues of the AI getting stuck in an endless-loop of trying and failing to do the same action over and over. Instead of the game freezing there will now simply be a message in openxcom.log if _traceAI is enabled and the unit will end their turn.

AI will no longer try to move units that have no energy.
Energy is now considered by AI for determining how far we can walk.
Fixed an issue in AI that caused melee-attacks not being considered when the unit didn't look into the right direction.

Brutal-AI-version is now mentioned on the Menu-screen.