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

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 643
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 5.0.4
« Reply #135 on: May 09, 2023, 01:49:38 pm »
As I said before and as panzer already pointed out:

My primary goal is to improve the AI's decision making in a way that increases it's playing-strength. I'm okay with providing some customization-options for that in order to disable extremely frustrating behaviors.
However, adding all sorts of arbitrary play-styles just because someone thought that this might make it more fun to play against is not something that I'm willing to spend my time on.

And when it comes to randomness in the decision-making:

I'd ask the randomness-proponents to describe their own play-styles. I for one follow certain principles when playing and they have nothing to do with randomness. When I send my soldiers to go to certain tiles, there's always a reason why it's that tile and not a random one. The algorithms of my AI reflect my own way of thinking about my tactical decisions and since my own way of thinking doesn't include randomness, it's also unreasonable to expect that from my AI's.

Offline MaxMahem

  • Captain
  • ***
  • Posts: 60
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 5.0.6
« Reply #136 on: May 11, 2023, 03:17:56 am »
You might implement randomness to help combat various ways the AI can be "cheesed." If the AI's behavior is entirely deterministic, then it can be possible to predict its behavior in advance and exploit that. By adding a random factor to the AI's behavior, you can help prevent that.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 643
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 5.0.6
« Reply #137 on: May 11, 2023, 10:50:35 am »
You might implement randomness to help combat various ways the AI can be "cheesed." If the AI's behavior is entirely deterministic, then it can be possible to predict its behavior in advance and exploit that. By adding a random factor to the AI's behavior, you can help prevent that.
Can you give me some explicit examples of exploitable behaviors in the current version and then elaborate in what way randomness could be introduced to counteract these?

I watched Speedislife playing X-Com-Files with Brutal-AI yesterday and saw how he could exploit the peeking-behavior of the AI. The reason why it was exploitable was because the enemies all had very crappy short-range weaponry and upon establishing visual contact via peeking couldn't attack back towards his units that were doing reaction-shots with long-range-weaponry. The behavior was optimized for the base-game where all weapons have prettymuch the same range.

My idea to make this less exploitable is that I want to limit the peeking when the units suspect enemies outside of their operational range. So basically adding a new algorithm that comes to the conclusion that in cases like this peaking is not a good idea.

What I cannot come up with is a way to use randomness to prevent this scenario. If they would randomly decide for or against peaking or randomly select a location to walk to for peaking instead of a location from where they think they can see the enemy, this wouldn't shift the advantage in their favor. It would just make the siege take longer until they eventually roll "walk into the enemies line of fire while not being able to shoot back".

I'd say there is an optimal behavior for each situation. And I'd rather add algorithms that detect the kind of situation we are in so we can choose the correct response instead of leaving it to chance.

To me it seems obvious that an enemy that is bad at taking a fight over long ranges should try to force me into a short-distance-fight. And knowing that they will do that will not really help me counteract it. Sure, I can still use it to my advantage that they won't peek and surprise them. But that still is more risky and suspenseful than killing them without any risk.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 643
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 5.2.0
« Reply #138 on: May 16, 2023, 08:30:17 pm »
Brutal-OXCE 5.2.0 - Cover Master Algorithm

Updated to OXCE 7.9.5

In order to determine the best tile to go to when cover is desired but great cover cannot be reached there is now a new algorithm in place:

Similarly to the recognition of great cover there will be a tile-vision-check from all supposed enemy-reachable tiles to all potential tiles to go to. A score is determined where the starting value is the amount of supposed enemy-reachable tiles and where for each successfull tile-vision-check one is subtracted. The resulting target-tile is the one that had the highest remaining score, meaning it will be the one that will be hardest and least likely to discover.

The cuddleAvoidModifier is not applied to this kind of score.

Walking through someone's line of sight while seeking cover will no longer reduce the score of the target-tile as this often resulted in units just staying where they are in order to avoid reaction-fire just to get killed anyways for standing in a terribly exposed-position.

The results of the tile-visibility-checks are now cached. This cache is reset every time terrain gets destroyed or doors are opened.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 643
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #139 on: May 22, 2023, 08:36:11 pm »
Brutal-OXCE 6.0.0 - Bravery in Unity: The Aggressiveness Evolution

Updated to OXCE 7.9.6.

When an AI unit reveals new enemies while turning it will now also inform its friends who have already skipped their turn about it so they can consider acting again. This was already the case for revealing why walking and not doing so for turning was an oversight.

Added a new option and changed 2 existing ones.
The aggression for enemies and autoplay now has 3 steps instead of two and are called "Enemy aggressiveness" and "Autoplay aggressiveness".
The meaning of each are as follows:
1> Values being in good cover over advancing towards the enemy.
2> A balanced approach between moving forward and being in cover.
3> Always move forwards without any sense of self-preservation.

The new option "Inherit unit-aggression" will use the aggression of the unit from the units.rul-file to determine the aggressiveness.

AI should now try to avoid ending their turn too close to doors.

The cache for the reachable-locations of a unit will now also contain the amount of timeunits the unit will have on each position.

This allows for a more nuanced evaluation of the potential threat a unit causes towards specific tiles.

When deciding which enemy-unit to look for, the turn that unit was last spotted always took precedence. This allowed to distract the AI with a unit that is very far away.

Now it uses distance and turn at the same time for the scoring. Each turn that has passed adding the maximum amount of time-units a unit has to their perceived pathfinding-distance when it comes to how close it likely is.

Fixed an issue with going back and forth while hiding caused by forcing the AI to ignore the tile it currently stands on for its considerations.

The cover-scores now use some sort of heat-map around the supposed enemy-locations instead of the previous more binary approach. Meaning a tile is considered as safer depending on how many time-units an enemy would have after moving to a tile from where they can look at the AI's unit. The distance also flows into the formula for that.

Basically the AI will push towards the player's units as long as it is safe and will compromise a bit of the safety in order to get closer. However, the weights are still favoring better cover over being closer as this generally showed better results in testing.

If nearby allied units could also reach a tile their remaining time-units will be subtracted from the fear of being discovered on that tile. This makes AI-units more willing to venture towards enemies when they have a numerical advantage as fewer enemies also project less fear to be discovered.

Fixed an issue where an explosion with an efficacy of less than 1 would be considered as not worth causing. The explosion-efficacy now got it's own factor for the score and was separated from the number of shots, which was rounded down to the next full number.

The least aggressive variant now once again tries to make itself undiscoverable and doesn't become more courageous in higher numbers.

So now the three levels of aggressiveness shall all be pretty distinct.

Offline panzer

  • Sergeant
  • **
  • Posts: 28
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #140 on: May 23, 2023, 05:27:31 am »
The "Inherit Unit aggression" option is really cool! But for this, the third option of aggression is too suicidal :(

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 643
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #141 on: May 23, 2023, 12:26:23 pm »
The suicidal option is something that I'll be keeping for benchmarking-purposes. Something that always works the same way and is very simple.

I'm not completely happy with the other options either. Watched a stream yesterday and even on #2 there was a lot of enemies letting themselves be caught out in the open.

I mean the goals are:

1. Maximizing the chance for the AI to discover your units on their turn.
2. Taking positions from where they can quickly join into the action once an enemy-unit gets discovered and having enough TUs to do so.
3. Minimizing the chance for you to discover the units of the AI on their turn.

Maximizing the chance to discover units was very simple. Walking as far as possible towards the location where you think the enemy is will basically do that.
Minimizing the chance to get discovered was tough. But by coming up with good (and unfortunately computationally quite expensive) algorithms this is kinda possible now.

One idea was going as far ahead as possible with half of your TUs and then going to the best cover with the other half. The issue here is that leaves you with no TUs and also is half-assed and will often lead to predictability due to doing the same every turn, which would be kinda okay if you'd still have plenty TUs and don't emit cues about your whereabouts.

So I have a bunch of great helper-algorithms and a good structure to use them. What I'm still trying to find is the best way to use them for the ideal way of behaving for the enemies.

So if anyone has some good advice, I'm all ears. :D

Offline panzer

  • Sergeant
  • **
  • Posts: 28
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #142 on: May 23, 2023, 08:13:14 pm »


I mean that with this option, you can configure different behaviors for soldiers in a single battle depending on their level of aggression. For example, the leader and commander of the "Snake Man" have an aggression level of 1 because in their "units" file, aggression = 0. Their soldiers have an aggression level of 2, and the Chryssalid has 3.

In fact, an aggression level of 2 or higher is considered the most aggressive for Brutal-OXCE, but you can manually decrease it by one to balance the behavior of most shooting units. However, even then, in "X-Com Files," many shooting units and most close combat units will have maximum aggression. Of course, you can set aggression levels for all units to 0 and 1 (1,2 for Brutal-OXCE), but then the aggressive behavior model in which some close combat enemies are more effective will be lost. Overall, this adds diversity to enemy behavior.

As stated in the version 6.0.0 description, aggressive units do not care about their safety and will run to the presumed enemy by the shortest path, ignoring potential cover until they run out of action points. This makes them an easy target.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 643
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #143 on: May 25, 2023, 01:34:24 pm »
So if I understand you correctly the problem is that a lot of units in X-Com-Files are set to aggression 2 or higher and this results in a behavior which you consider as too aggressive, when the option to inherit the aggression from the unit is enabled.

The modders coulnd't possibly have known that some day there will be an AI to which the aggression setting has a more profound impact.
And at the same time I couldn't possibly have known what kind of expectation people have about what should happen when the aggression is set to the highest value.

My problem is also that at least one of the settings is supposed to be what I consider "the strongest". I'm aiming for that to be the second one. But that might also dilute the distinctiveness. In 6.0.0 there was a big issue with units just standing out in the open with the balanced setting. That is obviously not strong. So in 6.1.0 that's already different again, which means that the balanced aggression is now closer to the low aggression. This makes the discrepancy between high and balanced even bigger.

Offline panzer

  • Sergeant
  • **
  • Posts: 28
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #144 on: May 26, 2023, 03:53:27 pm »
\ I'm aiming for that to be the second one.
Thank you for your response. I will continue playing on the second difficulty :)
There is another suggestion (although I'm not sure if it's possible to implement). The idea is that aliens could avoid close combat. For example, if my soldier has low TUs and an alien is nearby, I can simply move my soldier close to the alien and end my turn. The alien will most likely start punching my soldier or shooting, but due to the close combat mechanics (especially if it has a big gun), it will lose the close combat and shoot the area around it.

However, if an enemy approaches my unit, I can simply step back and shoot the alien.

So the question is, is it possible to make the aliens, provided that strikes and shooting in close combat are not effective, also take a step back for unhindered shooting?
« Last Edit: May 26, 2023, 04:00:55 pm by panzer »

Offline Abyss

  • Colonel
  • ****
  • Posts: 355
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #145 on: May 26, 2023, 05:38:04 pm »
So if I understand you correctly the problem is that a lot of units in X-Com-Files are set to aggression 2 or higher and this results in a behavior which you consider as too aggressive, when the option to inherit the aggression from the unit is enabled.

Hi, Xilmi!

I think it worth considering to link aggression to the ranks, except cryssalid and zombie behavior, who should be considered as walking weapons. E.g. in the first player's turn AI checks the battlefield ranks and randomizes aggression for each unit, depending which role should they get.
If dog/zombie/cryssalid/degenerate brute - then straight-forward
If it soldier/tank - then some pushing behavior,
If it engineer/medic then some covering behavior,
If it commander, "prefer to keep safe" behavior
If it mind-control unit, then mixed behavior

Nevertheless, it is very intriguing: will you implement at least some frustration between enemy troops given that 70-95% operations are started by X-COM and only 5-30% are started with enemy (the retaliation, terror missions, environmental alerts, gang attacks etc.)
If then modders provide some flags for types of missions, some missions will contain 100% combat-ready enemy AI, and some (that are initiated by X-COM) will contain certain amount of "frustrated/ambushed/wtf is going on' enemies. That will, in it's turn, bring missions closer to real life behavior and somehow get mods possible to play for joy at difficulty level higher than 1.
« Last Edit: May 26, 2023, 05:42:05 pm by Abyss »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11783
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [SOURCEMOD] Brutal-OXCE 6.2.0
« Reply #146 on: May 27, 2023, 12:01:47 pm »
Units marked as STR_LIVE_TERRORIST already have some special rules, like not picking weapons (even if they have normal inventory). Therefore I believe that adding some melee-related behaviours for such units would be okay. Just remember that some such units only have range attack.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 643
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #147 on: May 30, 2023, 01:41:08 am »
The idea is that aliens could avoid close combat. For example, if my soldier has low TUs and an alien is nearby, I can simply move my soldier close to the alien and end my turn. The alien will most likely start punching my soldier or shooting, but due to the close combat mechanics (especially if it has a big gun), it will lose the close combat and shoot the area around it.

However, if an enemy approaches my unit, I can simply step back and shoot the alien.

So the question is, is it possible to make the aliens, provided that strikes and shooting in close combat are not effective, also take a step back for unhindered shooting?
Was this tested with 6.1.0 or higher? I fixed several bugs related to avoiding of close-quarter-combat not working as intended in that version. The AI should avoid attacking from melee-range with ranged-weapons and instead take a step back before doing so. If not, it would be a bug and I'd like to have a save-game where it still happens.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 643
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #148 on: May 30, 2023, 02:03:03 am »
I think it worth considering to link aggression to the ranks
Linking the aggression to the already existing stat called "aggression" seems to be more straightforward to me. It already is possible to assign different aggression-values to different ranks of the same species. Even the base game makes use of this. Note that there also is a flag called "isLeeroyJenkins", which for units with my AI is generally interpreted as maximized aggression.

will you implement at least some frustration between enemy troops
I have no plans to implement frustration between enemy troops.

Offline panzer

  • Sergeant
  • **
  • Posts: 28
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 6.0.0
« Reply #149 on: May 30, 2023, 02:11:59 pm »
Was this tested with 6.1.0 or higher?
I seem to have missed the description of update 6.1.0)) :o
I conducted several test battles and yes, it really works, but only on sectoids (they don't have close combat).
All the rest still think that they will deal more damage in melee and spend all their TUs on futile attempts to penetrate the armor vest.