aliens

Author Topic: [SOURCEMOD] Brutal-OXCE 7.12.1  (Read 126483 times)

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.1.0
« Reply #45 on: January 27, 2023, 11:33:41 pm »
You've been working hard since I finished my first Brutal AI playthrough. It's nice to see the non-cheating AI be even more brutal. I also like seeing the friendly AI get in on the action of not being retarded gibbons. That said, I did see another game crash - but this time it was actually caught with the crash handler. Either you've properly hooked your code into it (good man if true!) or Bradford (it's now canon that using your XCOM AI puts Bradford in charge. No, you shut up. I don't care that he's from another continuity.) managed to trigger a crash in OXC (or Extended) all by himself!

I was playing with the setting that forced XCOM to be aggressive off (I wanted to see what the AI would do without being forced to do other stuff) so I'll comment on how good Bradford is after I try with that setting on, but for now, here's the crash dump. No save file, sorry. I keep autosaves off because I like Ironman, and am just fine with manual saving if I ever want to come back to a Battle Mode skirmish for some reason.
I don't really know what all that talk about "Bradford" is supposed to mean. Who is that and why is he synonyomous with autoplay? And I also don't know how to debug a dump-file. I think the openxcom.log from right after the crash would have been more helpful with pointing me towards what method to look at.

Offline Juku121

  • Commander
  • *****
  • Posts: 1799
  • We're all mad here.
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.1.0
« Reply #46 on: January 28, 2023, 01:43:22 am »
I don't really know what all that talk about "Bradford" is supposed to mean. Who is that and why is he synonyomous with autoplay?
It's an in-joke of sorts. Central Officer Bradford is the face of (parts of) the UI for the nuCom games.

After watching another two XCF streamers putz around using largely braindead tactics, occasionally savescumming and winning pretty handily, I'd really like some brutal AI for a change. Alas, them shaders make me dread to try again. :(

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.3.0
« Reply #47 on: January 28, 2023, 12:14:17 pm »
Here's some AI self-play-test-results:
X-Com: 14 Soldiers, 14 Rifles, 28 Rifle Clips, 14 Grenades
Aliens: 11 SH Sectoids all with Plasma-Pistol

Reference game where I played XCom and AI was brutal:
X-Com KDR: 1

Test 1: X-Com careful, Aliens brutal
X-Com KDR: 0.36

Test 2: X-Com aggressive, Aliens brutal
X-Com KDR: 0.29

Test 3: X-Com careful, Aliens brutal + omniscient
X-Com KDR: 0.07

Test 4: X-Com aggressive, Aliens brutal + omniscient
X-Com KDR: 0.07

Test 5: X-Com careful, Aliens base-AI
X-Com KDR: 2.2

Test 6: X-com aggressive, Aliens base-AI
X-Com KDR: 2.75

Conclusion:
Brutal-AI with no cheating is about 10 times more difficult than base-AI.
Brutal-AI with omniscience is about 40 times more difficult than base-AI.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9104
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.3.0
« Reply #48 on: January 28, 2023, 12:40:19 pm »
Here's some AI self-play-test-results:
X-Com: 14 Soldiers, 1 Rifle, 2 Rifle Clips, 0 Grenades
Aliens: 11 SH Sectoids all no weapons

Reference game where I played XCom and AI was brutal:
X-Com KDR: infinity

Test 1: X-Com careful, Aliens brutal
X-Com KDR: infinity

Test 2: X-Com aggressive, Aliens brutal
X-Com KDR: infinity

Test 3: X-Com careful, Aliens brutal + omniscient
X-Com KDR: infinity

Test 4: X-Com aggressive, Aliens brutal + omniscient
X-Com KDR: infinity

Test 5: X-Com careful, Aliens base-AI
X-Com KDR: infinity

Test 6: X-com aggressive, Aliens base-AI
X-Com KDR: infinity

Conclusion:
base-AI is infinitely more difficult than Brutal-AI with no cheating.
base-AI is infinitely more difficult than Brutal-AI with omniscience.


Please forgive the obviously bad test case, it is meant as a joke and intentionally over-exaggerated to make a point that your test case is not much better :)

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.3.0
« Reply #49 on: January 28, 2023, 01:12:15 pm »
You could argue that the data from my test-case is rather limited and probably not enough to draw any exhaustive conclusions. But at least it is the result of an honest attempt of quantifying something otherwise purely subjective.

I think that comparing a constant behaviour, as what autoplay generates against a changing challenge does indeed allow some conclusions. At least way more than something that allows no conclusions whatesover as it is based on the undefined division of infinity. Choosing a scenario that generates a non-infinite and non-zero result was kinda important for the ability to draw any conclusions.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9104
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.3.0
« Reply #50 on: January 28, 2023, 01:25:05 pm »
I specifically said that the example is overexaggerated. But ok, if you have a problem with infinity, replace it with an example where plasma pistols do 7 damage or where xcom wears power armor. Same result.

In any case, your example is for 1 situation, 1 map, 1 mod, 1 everything and no generic conclusion can be derived from it.

Who knows, maybe if you do 1000 more tests, it will turn out that brutalAI is in average 40000x more difficult than baseAI. Maybe, probably?

« Last Edit: January 28, 2023, 01:27:29 pm by Meridian »

Offline N7Kopper

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.1.0
« Reply #51 on: February 04, 2023, 10:12:49 pm »
It's an in-joke of sorts. Central Officer Bradford is the face of (parts of) the UI for the nuCom games.

After watching another two XCF streamers putz around using largely braindead tactics, occasionally savescumming and winning pretty handily, I'd really like some brutal AI for a change. Alas, them shaders make me dread to try again. :(

Quote
savescumming

https://www.youtube.com/watch?v=SaXj3Z_tao8

Bradford also leads XCOM while the Commander (you) is in captivity between the canonical Base Defence loss and the beginning of XCOM 2. He notes that he's not as good at it as the Commander. Hence the "autobattle is Bradford" joke. It's certainly better than a lot of players, but it still does some dumb things. One more thing (aside from more crashing with AI XCOM - why do I always find ways to break your stuff!? I'm playing Vanilla+ while other people are playing ROSIGMA and XCF! This time I have an autosave along with the dump at least.) that I noticed is that psionic units aren't that good at saving their TUs for potential mind control opportunities. Half of my men are fidgeting in the Avenger when "their turn" rolls around, meanwhile my tanks and mind-controlled enemies still have lots of TUs to scout with. This is likely responsible for the relative lack of PSI attacks that your AI makes compared to vanilla (when it's not cheating at least)

If the Chryssalid demo mission mod is responsible for breaking things I'll laugh.

Off-topic, some might disagree, but I think the new XCOMs are good fun. More "tactical RPG with strategy elements" than "strategic wargame with RPG elements" but it's got the spirit and doesn't seek to replace the classics. They're not abominations like Enforcer at any rate. The X-Com Files guys agree with me clearly, given how they have EXALT and named NPCs in your employ.
« Last Edit: February 04, 2023, 10:17:16 pm by N7Kopper »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.1.0
« Reply #52 on: February 05, 2023, 01:20:11 pm »
Off-topic, some might disagree, but I think the new XCOMs are good fun. More "tactical RPG with strategy elements" than "strategic wargame with RPG elements" but it's got the spirit and doesn't seek to replace the classics. They're not abominations like Enforcer at any rate. The X-Com Files guys agree with me clearly, given how they have EXALT and named NPCs in your employ.
Mod have "Enforcer" too, this mean its endorsed by mod author too? :>

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11731
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [SOURCEMOD] Brutal-AI 3.1.0
« Reply #53 on: February 05, 2023, 01:57:28 pm »
Mod have "Enforcer" too, this mean its endorsed by mod author too? :>

I played it a little, and for me personally it was much more fun than the new X-Com. :)

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.1.0
« Reply #54 on: February 06, 2023, 12:57:26 pm »
aside from more crashing with AI XCOM
For the crashing: Do you mean that the game actually crashes as in it closes and creates an exception? Or do you mean more like a lock-up, where it stops doing stuff and you can't continue? That's an important distinction because the latter case is something that I've only recently fixed.
From the notes of 3.3.1:
"Fixed an issue where panicking player-units with autoplay enabled could lead to the game getting stuck in an undefined state."
This actually happened quite frequently when auto-playing against brutal-AI as it was related to panicking. But considering you talking about a dump-file makes it sound more like an actual crash.

I noticed is that psionic units aren't that good at saving their TUs for potential mind control opportunities. Half of my men are fidgeting in the Avenger when "their turn" rolls around, meanwhile my tanks and mind-controlled enemies still have lots of TUs to scout with. This is likely responsible for the relative lack of PSI attacks that your AI makes compared to vanilla (when it's not cheating at least)
There's several issues at play here. But I'd say it primarily comes down to the way the AI determines when to wait for other units. This needs a clear priority to work. Currently there's two things at play: How many enemies do they see and how many tiles can they currently reach. When the amount of enemies they see increases the units are automatically stopped by the engine and request a new decision from the AI. Which now says: Let's move someone else first.
Not using Psi-attacks, despite someone on the team having spotted enemies usually is the result of a failed psi-simulation. They might then pick a target tile to walk to and walk there without trying again. It can also be argued that using psi-attacks with lower chance to succeed is definitely better than skipping the turn because they are blocked.
So one thing I could do is that both psi- and blaster-users have a lower move-priority than anyone else before considering reachable tiles. That should help against them wasting their TUs when other unis still could scout enemies.
The other thing could be to call the psi-action-code again at the place where the unit would otherwise decide to skip and pass a parameter that tells it to do it as long as the simulation gave a better than 0 chance at max-roll.

If the Chryssalid demo mission mod is responsible for breaking things I'll laugh.
If the Chryssalid demo mission mod is responsible for breaking things I'll need it to reproduce and fix the errors. I still, every now and then stumble upon some things that mods do that I had not anticipated in my AI. Latest example was something called "Close quarter combat", which basically means that you can't shoot at someone point blank because the unit that you shoot at basically grabs your gun-barrel and points it away from it.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.5.2
« Reply #55 on: February 13, 2023, 11:34:59 am »
Haven't really posted any updates here despite quietly increasing the version in the subject.

3.5 was quite significant in impact on how the AI plays.

The non-cheating-variant got the algorithm by which it makes assumptions about the whereabouts of player-units reworked. The AI now keeps track for every single tile on the map how many turns ago it was scouted last. The assumption of where the enemy units could have gone, when it sees it's no longer where it was seen last uses this information in the following way: Assume the unit to be at a tile that's exploration was the longest time ago that is closest to the unit making the assumption but also only consider tiles that the enemy could theoretically have reached.

The bigger and more important change was how the AI deals with the player camping the starting location. Crafts like the Triton are extremely difficult to attack fortresses due to its impenetrable walls and a door that closes automatically at the end of the players turn. A direct assault on it often lead to heavy losses on the aliens side as the player could walk out, deal damage and then hide again.

So now, when the AI assumes (non-cheating) or knows that the closest enemy unit is on a tile that has the floor-property of being a start-tile, it will stay clear of that tile. And by stay clear I mean it'll either pick a tile to walk to that is not visible and at a greater distance from what a unit coming out from there could walk to. And if no such tile exists, it will go into flee-mode, where it wants to increase the distance as much as possible.

Basically: If you try to camp there, the aliens will scatter far away and hide. If the aliens have seen (non-cheating) or know (omniscient) that you left, they'll play as they used to play before. Which is trying to get closer to you while trying to remain hidden, peak at where they think you are and if they see you, launch an assault with all forces that can get to a position where they have a line of fire.

The idea is that they let you leave the safety of your fortress and then collapse onto your position when you are out in the open.

They still keep track of your morale and will go into sweep-mode, where they also chase you down into your craft, when they think it's low enough for your units to keep panicking.

Overall I think this is a pretty sound tactical approach for the side that is defending. Note that you can always set it to the frontal-assault-play-style by setting "Charging behaviour for Brutal-AI" to "2".

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.5.2
« Reply #56 on: February 13, 2023, 12:34:04 pm »
btw Triton is more coffin than fortresses if you use correct strategy, you need two units, one open doors and other on same turn kill units inside (like throwing grenade or blaster launcher), it will be hard to implement as multiple units need to coordinate and "killers" need consider opened doors when finding best positions.
Even more this logic is need too to fix camping outside ufo, as you can camp exit door and if aliens leave it one by one then you can easy kill every alien.

To make it not cheating, I think it should require 3 units.
first unit is normal unit that simply try move somewhere on map. When after opening doors its get killed, you mark given doors as "deadly", then AI try play around it like placing second unit on spot where it can shoot through doors but do not get close to it, then third unit try breach this doors.
If third unit die, then second one try blast solders on other side of door.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.5.2
« Reply #57 on: February 13, 2023, 05:14:34 pm »
Well, I thought so too but the way Trauson played showed me that this would rely a lot on hopeful play. Getting close enough to make the dash for the door without having been spotted by the player on their turn might be possible in some scenarios but usually it's not. It's like taking a gamble. Sure it can be really efficient if you manage to catch them all in there. But trying to do so is rather risky. And if they really spawn close enough to do that, then they will still do it. But not if they would need more than one turn to the door.

The player camping outside of UFOs is not really a thing against my AI. At least not as an effective exploitable strategy. There's no trigger forcing the aliens to start moving out. They'll do what they think is best.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.5.2
« Reply #58 on: February 13, 2023, 05:23:56 pm »
You missed one aspect of my strategy, "executor" alien do not need dash anywhere, only placed on strategic place that can hit pass doors opened by other unit.
And two other units are more a sacrificial pawns, and can be spotted and killed by player, only thing need is that doors get opened and "executor" can blast other side.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 3.5.2
« Reply #59 on: February 14, 2023, 11:16:59 am »
When I was testing a lot with the auto-play-option I made a change to the Move-order algorithm so that the move-order is primarily determined by the amount of tiles a unit can reach.
This was necessary to make it possible the units properly exit the Skyranger and will also help aliens trying to leave the UFO to move in an appropriate order.

The prior algorithm was simply using the average distance to enemy-units. Ideal would be using the path-finding-distance as that would resolve both issues. But doing that just to determine move-order made it slow down quite a bit.

The current algorithm does, however, have the pitfall that guaranteeing something like the "executor" acting last doesn't work. But that was exactly the intention of using distances for the move-order.

I think I need to come up with a way to determine that if the remaining TUs at the furthest reachable tile is < move-cost, then we are not blocked by anything and thus should use enemy-distances again. This should make sure that our "executor" hasn't moved before the door-opener.

Anyways, this is more of a general idea for improvement based on your suggestion. It doesn't resolve the main problem of the idea, which is making sure to get the door-opener close enough to the door without being killed. 2 sacrificial pawns do not guarantee that the player can't kill those pawns and the one who would open the door. Sure, the more tanky the aliens are, the more viable that idea would become but the way the currently act doesn't have any real disadvantages other than taking longer.

But still, improving the move-order-algorithm would certainly be very helpful anyways. And if aliens spawn close enough to the Triton and the player fails to kill them, they should try to execute this kind of idea and the correct move-order is important for that.

The other problem is: I've now done 3 or 4 attempts at TFTD with version 3.5 and it already is incredibly hard. In my last and longest playthrough I made it to May 1st. I've won 2 out of 10 missions. Both of them against the smallest kind of craft. But then again I wouldn't have to play on Superhuman and considerations like that shouldn't be in the way of the betterment of the AI. :D