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

Offline Abyss

  • Colonel
  • ****
  • Posts: 355
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.10.1
« Reply #420 on: November 28, 2023, 01:11:26 pm »
Quote
Rereading what you wrote seems like you mean some sort of replay-mode. That would also help if it existed, I suppose but it would lack the explanatory elements of a narrated video.
Yeah, I believe so. The thing I kept in mind was definitely reply mode, and your comment towards narrative of actions is quite a thing we are always forgetting: no one can read the minds of other, we can only suggest what is real matter behind the words and actions. 
I am thinking of making another playthrough when newest version of XCF or XPZ comes out, with time-to-time videomaking. It will mostly describe in-game logics and will be AI-centered. 

Thank you for the newest releases!

Whow. Actually, things are getting more and more convenient and real.   

Next step proposal for OpenXCOM community will be something like:

Thoughts regarding the balance preservation:
I still think that very best solution for super-immersive BAI gameplay is making manual adjustments for each unit.
- what do you think of some sort of interface (see below) that helps to operate with intelligence balancing?
It parses everything into one table, and able to modify .rul file regarding all intelligence, aggressiveness and other viable stuff. It doesn't need to be updated if new unit is added by modder, because it finds it automatically with each activation. When operator changes values and clicks apply button, interface modifies rule file.
-  for balance issues, if most of the fraction becomes too weak according to unconscious behavior (or strong due to smartfullness), overall spawn amount can be set +1 or -1 on difficulty basis. For example, zombies, megascorpions and other wasteland creatures spawn at +1 or max cap difficulty amount.   
---------------------
- I still think that dogs/zombies etc. shouldn't be smart covering even on highest difficulties.
Difficulty multiplier already affects amounts of spawned creatures, but not only. Modders also include special negative geoscape events. Dioxine, for example, makes special painful experience events for Jack Sparrow users (like, base bombardments, fund&score loses, etc). 
- zombies: stay always vanilla (intel 0 to 1)
- every other creature: for all diff, stable chance of aggression lvl 3/4 each turn can be applied to ensure they not roaming around and actually chase the target.


Offline Abyss

  • Colonel
  • ****
  • Posts: 355
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.10.1
« Reply #421 on: November 28, 2023, 01:41:21 pm »
Quote
It wasn't my idea to have a separate repository. It's the result of the OXCE-team not wanting experimental-changes, even if those are completely optional. These requirements were incompatible with AI-development, which is an iterative process.
I guess the time, when everyone wasn't taking your approach seriously has long passed. You do it consistently and thoughtfully. 
I sincerely apologise to be one who used some cynical/sarcastic tone in some cases.
Now, even if it is still not being included into main fork, your branch decision works well and anyone who wants it can get it.

I think that you lack previous (vanilla) OXCE gamer experience, thus miss some nuances. But overall, gameplay with BAI seems challenging and interestingly different. User experience is the most valuable thing that can be taken from the game. Someone loves random, someone loves challenge. Overall, these are major parts of any game. I believe that random behavior incorporation is a nice shift towards player's user experience. 

By nuances, I mean that some unit behaviors seem too artificial or irrelevant to the story. You know about zombies and misc. creatures. Another one is unit move grid: if they chase and attack, they take precise anti-grenade range from each other. And this is fully frustrating, because player understands that it is true robot behavior. One more thing is AI tends to take and stand the same places where other AI units were killed (iterationally, 2, 3, 4 units). That's also robot behavior. I understand, that AI thinks it is best place for maximum advantage, but deviation is sort of clue for true user experience.     

With best regards,

Offline 0xEBJC

  • Colonel
  • ****
  • Posts: 180
  • Y'all are awesome! Thankful for this community.
    • View Profile
    • My Projects
Re: [SOURCEMOD] Brutal-OXCE 7.7.4
« Reply #422 on: November 28, 2023, 06:19:06 pm »
This sounds too specific and too much like a "one person wants that"-feature to me. So I suggest to make your own fork and implement it like that if you really want it.

I just want to say thank you, for all your work, the new AI, and your time to respond here...thank you, thank you :)

I hope my suggestions are helpful and I don't want you to think I'm expecting anything, just glad for what you've made.


If you only set "isBrutal" in the units.rul, it will use defaults/global-settings for everything else.

It's not per species but per unit-type though. So if a mod has many units across many different files, it might be quite laborious to manually switch it on or off for each individual unit-type.

Thanks for the info, my thought was to make for example waspoids swarm like bees VAI for a few turns then BAI full max or similar with 'pack' animals like werewolves.!  :D, humanoid aliens like floaters, sectoids, mutons use BAI, and snakemen and some other aliens use VAI or somewhere in between with different flags so that you get varied behaviors per alien race.
« Last Edit: November 28, 2023, 06:32:07 pm by 0xEBJC »

Offline 0xEBJC

  • Colonel
  • ****
  • Posts: 180
  • Y'all are awesome! Thankful for this community.
    • View Profile
    • My Projects
Re: [SOURCEMOD] Brutal-OXCE 7.10.1
« Reply #423 on: November 28, 2023, 07:10:35 pm »
This isn't the first QoL-change I made. It's the third one actually:
1. One-click-grenade-priming
2. Manufacturing items only uses workshop-space once you actually start working on it and not alone by queuing it
3. The new smart-inventory usage

Basically whenever something really started to annoy me and could be solved with some code-changes I eventually ended up making these changes.

Here's one that's annoyed me and I thought it should be an easy fix... two things for any ranged weapon in the ufopedia info. Show range values for (snap, auto, aim) and clip size next to the clip icon on the weapon page.

I found a solution for the first issue, displaying the weapon ranges for shot types with this mod:
https://openxcom.org/forum/index.php/topic,10723.0.html

A simple language text update, but digging through the git repo, I found that reference, but I don't think showing the clip count on the ufopedia page can be done without code changes.

Offline Abyss

  • Colonel
  • ****
  • Posts: 355
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.10.1
« Reply #424 on: November 29, 2023, 12:03:24 pm »
I have a suggestion, for discussion:
AI units be destroying surroundings, if later weak.
For example, player units covered in wooden house.
If explosives are strong enough to breach the walls, and newly opened terrain brings advantage in combat, then why not toss a couple of grenades/dynamites  near to it? 

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 641
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.10.1
« Reply #425 on: November 29, 2023, 02:52:35 pm »
I am thinking of making another playthrough when newest version of XCF or XPZ comes out, with time-to-time videomaking. It will mostly describe in-game logics and will be AI-centered.
Yesterday I made some further small improvements in playing-strength especially at lower aggression-levels but also in general due to better hiding after shooting. This makes it harder to successfully throw a grenade to where the shots came from.
I don't even think that tactical insights that increase playing-strength further are necessary. When I play vanilla or a mod that is supposed to be a little easier I already do get beaten up really badly. And the scene of super-hardcore-players who are actually looking fore a challenge like that doesn't really seem to exist.

It's still fun to find further improvements but there isn't really a target audience and thus no outside incentive. The only players who pushed me have stopped doing so. So until someone comes around and shows me how to beat/exploit it, I now actually can look into options to "make it play worse but in interesting ways".

I still think that very best solution for super-immersive BAI gameplay is making manual adjustments for each unit.
- what do you think of some sort of interface (see below) that helps to operate with intelligence balancing?
It parses everything into one table, and able to modify .rul file regarding all intelligence, aggressiveness and other viable stuff. It doesn't need to be updated if new unit is added by modder, because it finds it automatically with each activation. When operator changes values and clicks apply button, interface modifies rule file.
Sure, manually tweaking each unit individually probably will show the best results. And whether this is done in a text-editor or with the help of a yet to be developed tool, doesn't change that this would be a rather laborious task. I don't see myself writing a modding-tool. If someone else does so, then fine. Wouldn't be surprised something like that already exists, considering tools to edit MCD-Files also exist.

I'd personally look for ways that can conclude a play-style for a unit based on something that is already available, like their stats.

So instead of adjusting spawn-rate based on enemy-difficulty, the reverse approach could be used and enemy-difficulty could be adjusted based on spawn rate.

An idea would be to determine some sort of power-ratio by iterating through all units, determining a power-value based on their stats, doing the same for the player-units and then calculating a ratio of that. Similar to the table you posted before but also considering the amount. The power ratio could be used to determine intelligence and other values relevant for the AI.
Of course this kind of approach would not necessarily be the most immersive but it's only one idea and other ideas could be explored as well. Ideas that don't require someone to manually configure the AI for every unit.

Offline Abyss

  • Colonel
  • ****
  • Posts: 355
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.10.2
« Reply #426 on: November 29, 2023, 07:34:28 pm »
Quote
So instead of adjusting spawn-rate based on enemy-difficulty,
You most probably took me wrong. I was suggesting that if intelligent units are now harder to beat up, non-intelligent units, that are supposed to keep vanilla-behavior should spawn more to compensate the difficulty reducing gap. And, personally, I would prefer such tool because max (like, 100 units on map from diff 4/4) spawn is unachievable, as only BAI diff 2/4 and 3/4 are actually beatable by players, depending on their skills.

Remember, that spawn rate is affected by difficulty you take in the beginning of the game.
4/4 gives you 4 cultists to fight vs on the first battles of XCF,
3/4 gives you only 2 cultists on the same map
0/4 gives you 1 cultist.
 
Quote
the reverse approach could be used and enemy-difficulty could be adjusted based on spawn rate
In short, I don't see how that would make true experience.
90/100 units would work as semiautistic wave, while 10 will actually make precise tactical threat?
I haven't tested new balance yet. Probably, I will try plain 40% and 60% randomness checks, they seem quite interesting.
Also, these 40% and 60% randomness could make mods be doable on 4/4 BAI difficulty (as it was quite easy with vanilla).
Ok, I think I will go for 4/4 difficulty with 60% randomness for the beginning.

Quote
Sure, manually tweaking each unit individually probably will show the best results. And whether this is done in a text-editor or with the help of a yet to be developed tool, doesn't change that this would be a rather laborious task
If anyone will solve the parsing option and basic interface, I can tweak them to be most psychologically veracious. It's not that much of units. Like, 150-200, or so. And we can better call Sol for XCF insights. Right?)
« Last Edit: November 29, 2023, 07:40:11 pm by Abyss »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 641
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.10.1
« Reply #427 on: November 30, 2023, 10:53:51 am »
I think that you lack previous (vanilla) OXCE gamer experience, thus miss some nuances.
Well, this is definitely true. I played through the base-game twice when I was a teenager and this is it, when it comes to my experience with it.
After downloading OXCE I just played a few missions before I felt the strong urge to improve the AI.

By nuances, I mean that some unit behaviors seem too artificial or irrelevant to the story.
Can you give me an example for behavior that is "relevant to the story"?

Another one is unit move grid: if they chase and attack, they take precise anti-grenade range from each other. And this is fully frustrating, because player understands that it is true robot behavior.
Well, this is something I incorpoarted in my own play aswell. But it's also something that I could easily put behind another option. Maybe even the same one that avoids stepping onto proxies. Or maybe I could put all the bool-options into one and call it "Advanced tactics" -  "The AI is smarter about using and playing against explosives". This would be preprime-grenades, greandes on turn 1, avoid proxies and the "cuddle-avoid-modifier", which is what makes them keep these gaps that makes it hard to kill several at once with explosives.

One more thing is AI tends to take and stand the same places where other AI units were killed (iterationally, 2, 3, 4 units). That's also robot behavior. I understand, that AI thinks it is best place for maximum advantage, but deviation is sort of clue for true user experience.     
Yeah, this is definitely something I'd like to find a solution for as it's also obviously bad play. I tried to multiply the scores with a random-modifier but this leads to the AI finding different best spots in different passes and thus waste all their TUs changing positions. It also looks stupid.
But of course there's a solution to that, which is to mark the unit to skip their turn after it first moved to a coverspot.
Another idea would simply be to devalue the locations that contain corpses.

I think a score-deviation-mode where they mark to pass their turn if the action was a hiding-action sounds like a good idea. I was thinking of using a multiplier of 0.75-1.25 or even make it configurable. This should vastly diversify their behavior without costing a lot of playing-strength as the basis of the decision is still a good one.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 641
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.7.4
« Reply #428 on: December 01, 2023, 10:32:58 am »
Thanks for the info, my thought was to make for example waspoids swarm like bees VAI for a few turns then BAI full max or similar with 'pack' animals like werewolves.!  :D, humanoid aliens like floaters, sectoids, mutons use BAI, and snakemen and some other aliens use VAI or somewhere in between with different flags so that you get varied behaviors per alien race.
I've recently worked on ways to have gradual nerfs to the AI so that stuff like "swtiching between VAI and BAI" doesn't appear as best option anymore. But even with those in place I'm still trying to look at elegant ways of putting them to use. Ways that don't require modders to add new variables all over their rule-files.

The intelligence-stat does seem to be the most logical way to do it.

For varied behavior per race we'd need to first define in what way the behavior should be impacted and then how the AI should recognize which behavior to employ.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 641
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.10.1
« Reply #429 on: December 01, 2023, 10:47:53 am »
I have a suggestion, for discussion:
AI units be destroying surroundings, if later weak.
For example, player units covered in wooden house.
If explosives are strong enough to breach the walls, and newly opened terrain brings advantage in combat, then why not toss a couple of grenades/dynamites  near to it?
I thought about ways of how to realize it and if I'm correct there should be a way that's pretty easy. But I need to look at the code to determine whether it's actually easy.
Basically there is code that already scans all tiles in the blast-radius of an explosive. It checks whether an obstacle would eat up the blast and thus only considers it when enough of the blast could pass through the object.
When I was implementing the feature that allows you to make the Skyranger destructible and change the durability of all sorts of map-objects I learned that it could easily be determined whether an obstacle would be destroyed by a nearby explosion or resist it. So instead of the grenade-code saying "no, there's an object in the way, grenade is not worth it", it could say: ""There's an object in the way but it would be removed by the grenade, so let's act like it wasn't there".

Could even go further than that and apply the same logic to shooting too. Currently there's just a boolean line-of-fire-check. But the algorithm already does all the calculations to determine what kinds of obstacles are blocking the shot, as can be seen when you as a player try to take a shot like this. Then could subtract the objects armor from the shots assumed damage to get a new score. Currently the engine doesn't allow the AI to take shots without line of sight. But that can probably easily be overruled.
However, this also needs some considerations in the sense of ammo-preservation and destroying their own cover. So maybe should only be done with auto-shot.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 641
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.10.1
« Reply #430 on: December 01, 2023, 11:09:06 am »
I think a score-deviation-mode where they mark to pass their turn if the action was a hiding-action sounds like a good idea. I was thinking of using a multiplier of 0.75-1.25 or even make it configurable. This should vastly diversify their behavior without costing a lot of playing-strength as the basis of the decision is still a good one.
Btw. this feature is now already implemented in 7.11.0.

I noticed that configurable multipliers weren't all that noticeable. So I just made it 0.0-1.0. Due to the high amount of tiles this usually is applied to, on average the result is still decent and much more diverse in outcome.

So this application of randomization actually has much less impact on the playing-strength than reduced intelligence. And the little impact it has gets counter-balanced by a reduction in behavioral predictability. Also it is deliberately not applied to positioning for attacks. Only for scouting and hiding. So the attack-positions are still ideal.

I had a very humbling experience during testing. I played with dynamic aggressiveness and the new weigthed randomization. Was soldiers with basic equipment against a medium sectoid-vessel.
I first let autoplay on aggressiveness 4 handle it. Result was 7 kills for X-Com until everyone was dead. Then I played myself... Result was 2 kills for X-Com.
So in the same situation I did worse than the AI.

I had seen that the AI lost 3 people to reaction-fire on turn 1, so I first put out smoke and wanted to move out more carefully next turn.
But due to adaptive aggressiveness starting at the highest level the enemy walked right into the smoke and got a glimpse on a lot of my soldiers and attacked from all sorts of directions. The autoplay after losing these 3 people killed all of the sectoids that were out in the open on turn 1.

It also shows that it's highly situational when more aggressiveness is better.

Offline Scamps

  • Captain
  • ***
  • Posts: 84
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.11.0
« Reply #431 on: December 01, 2023, 11:18:04 am »
Do more intelligent units still know exact enemy location for several turns? I played a couple months old version, and I believe it is the case. I guess it was done to make OXCE AI smarter, but is it still necessary with Brutal-AI? New AI is sometimes efficient to the point of being unrealistic. (Now that will probably interfere with above explosives suggestion...)

Offline Finnik

  • Commander
  • *****
  • Posts: 505
  • Finnik#0257
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.10.1
« Reply #432 on: December 01, 2023, 12:25:59 pm »


Next step proposal for OpenXCOM community will be something like:
- what do you think of some sort of interface (see below) that helps to operate with intelligence balancing?
Not actually necessary, there is a Linker VS Code extension by Pedro, that inherits yaml to csv conversion. Thus you can edit ruleset data (each unit in this case) as a line in the table with sheet tools, like MS Excel. Linker can convert csv back to ruleset.
I use it to butch edit or update some data with formulas (like updating weapons power) or calculate some analysis data from rulesets.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 641
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.11.0
« Reply #433 on: December 01, 2023, 12:35:55 pm »
Do more intelligent units still know exact enemy location for several turns? I played a couple months old version, and I believe it is the case. I guess it was done to make OXCE AI smarter, but is it still necessary with Brutal-AI? New AI is sometimes efficient to the point of being unrealistic. (Now that will probably interfere with above explosives suggestion...)
No. There is an option called: "Bug hunt mode for brutal-AI". This one is disabled by default since probably half a year now. If you already had an older version where it wasn't disabled by default, you need to disable it manually. I recently tried whether it still works. It does and in combination with some of the new algorithms developed since it's deactivation as default, it's just super-brutal, especially on lower aggressiveness. There's almost 0 chance you'll find them on your turn but they will definitely find you on theirs, when possible.

The AI without this mode enabled has a kind of memory for each enemy unit. Basically it stores where and when each unit was seen last and has an algorithm to update this information with guesses if the information contradicts their scouting-information. Basically: When they assume your unit is at certain coordinates and looks at these coordinates, it will run this algorithm that takes a guess where your unit could have gone. I recently improved this algorithm as it was not working as intended before, so it should now do a much better job with the guesses.

This will, of course never be as good as actually knowing where your units exactly are but it still pretty decent.

Earlier in the project having the AI know where your units are was helpful for the AI. But with all the improvements in other regards it is indeed no longer necessary and instead more like massive overkill.

Edit: I just checked something in the code: It's not even currently optimized for abusing this mode to it's fullest extend as it still performs scouting-behavior, as if it didn't know the enemies' positions. This scouting-behavior could be disabled in this case so they don't needlessly run the risk of giving away their position and having more TUs for reaction-fire.
« Last Edit: December 01, 2023, 12:46:43 pm by Xilmi »

Offline Ronios

  • Sergeant
  • **
  • Posts: 27
    • View Profile
Re: [SOURCEMOD] Brutal-OXCE 7.7.4
« Reply #434 on: December 01, 2023, 04:11:46 pm »

The files to edit for that is "units.rul"
You can add the following:
"isBrutal" (true/false)
"isCheatOnMovement" (true/false) (equivalent to omniscience bug-hunt-mode for brutal-AI)
"aiTargetMode" (equivalent to Targeting behaviour for Brutal AI)

The global Brutal-AI option needs to be switched off for that as otherwise it would take precendence.

Edit2: It's not per species but per unit-type though. So if a mod has many units across many different files, it might be quite laborious to manually switch it on or off for each individual unit-type.
I'm returning to fights with mixed opponents (monsters and people). As far as I understand, I can turn off the global Brutal AI and manually add “isBrutal: true” to each unit so that it is smart. This option does not work in the opposite direction, as stated above (at first I doubted that “isBrutal” even works in unit.rul, because I started with the opposite option). If I'm wrong, please clarify.

So here the main question arises. There are, say, 150-200 different opponents. Of these, there are about 25 monsters, almost all of which have no inventory and “Brutal Brutes = false” disables their brutal ai. There are only a few monsters left that need to turn off brutal ai manually. How can this be done?

If the global Brutal AI is enabled, then "isBrutal: false" will not work for these individual units. And sorting through almost 200 units is not the most fun thing to do.

And I am very grateful and thank you for the brutal ai, because it greatly diversifies the game and makes the battles really interesting, less chaotic and more difficult.