OpenXcom Forum

Modding => Released Mods => Brutal AI => Topic started by: Xilmi on December 27, 2022, 09:04:55 pm

Title: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 27, 2022, 09:04:55 pm
I think my AI-mod is now complete enough for me to consider it releaseable.

The current version can always be found here: https://github.com/Xilmi/OpenXcom/releases

This mod is forked from OXCE and provides a few new options both for modders as well as for players themselves.
All the while being compatible with every mod that is also compatible with OXCE.

Installation-guide:
https://www.youtube.com/watch?v=fV4VGWHe5zg

As the name suggests, the new options are primarily centered around AI and in particular about making the AI more difficult to beat.

There's one non-optional-change to how manufacturing works:

An item in the workshop-queue will only use workshop-space when either at least one engineer is assigned to it or production has already been started. This allows you to queue a lot of items to produce one after the other without granting any advantage to parallel production.

Here's a list of all the new options and what they do:

Geoscape:

"Aggressive retaliation" => This option existed before but was slightly modified. In addition to it's previous functionality of allowing all UFOs to potentially discover a base, it changes the behaviour of UFOs on a retaliation mission in a way that instead of searching the base near pre-programmed areas in a big area around the actual position of the base. This fixes an issue that allowed for better or worse to almost completely avoid base-defense-missions when putting bases in certain locations that weren't anywhere near the search-areas of the corresponding region. The radius of the area being searched is approximately 2670 km.

"Enhanced dogfight behaviour" => When enabled, as soon as you start shooting the UFO, you can only use max-distance or retreat when your craft is actually faster than the UFO. Otherwise the UFO will try to keep you within it weapon-range. The main impact this has, is that you can no longer kill every UFO as soon as you unlock the plasma-craft-gun or other weapons that outrange-the UFO with standard interceptors. You either need to bring several to deal enough damage until it gets in range of their own weapons or need faster craft.

Battlescape:

"Realistic accuracy and cover system" => Feature developed by Joy Narical and merged into Brutal-OXCE. Find the full documentation here: https://github.com/narical/openxcom-accuracy

"One-click grenade priming" => When enabled has the following effect: "You can no longer select the amount of turns after which grenades shall explode. The timer will just be set to 0 without having to pick a value."

AI:

"Brutal-AI" => This is the name-giving core-feature of this Mod. It includes an almost complete rework of how the AI determines what to do. All enemies can see and attack what anyone on their team sees. Not only that, they can even change the order in which they operate, so that for example a spotter will wait for other aliens to act first before it decides to continue looking for enemies or to hide again. It will generally try to maximize damage-output when attacking and is very capable with using grenades. A lot of bugs in the basic AI are fixed with enabled brutal-AI. (For example arcing-shot-prediction-bug) Those bugs were deliberately not fixed in the base-AI to keep it behaving exactly as it is. An exception are bugs in the "pick up items"-code, as that's also optional for base-AI.

"Brutal AI option-preset" => An attempt to reduce overchoice by providing some presets for the other options.
There is a total of 5 presets:
1> Advanced tactics disabled, Aggression and intelligence inherited
2> Aggression and intelligence inherited
3> Static aggression and predictable
4> Dynamic Aggression and unpredictable
5> Cheating

"Brutal AI for neutral forces" => If a map features a third faction, you can let them be controlled by Brutal-AI too. If it's civilians all that'll do is make them hide a little better. If it's Space-Marines they now may actually prove worthy allies.

"Brutal Brutes" => This allows you to configure whether less intelligent units that don't have an inventory should also be controlled by Brutal AI. Some have said that having a rat or zombie act in the most efficient way was immersion-breaking. So units like that can their brains now have reverted to their previous state. Note that manually setting these units to brutalAI in their respective *.rul-files will overrule these settings. This way modders have the control to make specific units smart regardless.

"Allow AI to use explosives on turn one" => Ignores all turn-delays for items that may be set in mods. By default only blaster-launcher and grenades are concerned. But it would also overrule other turn-limits.

"Bug hunt mode for Brutal AI" => Since the basic-AI also is cheating, Brutal-AI does so as well by default. This option allows to disable AI-cheating and makes a massive difference in perceived difficulty. When enabled the AI knows where all of your units are all of the time. But it only uses this knowledge for movement-purposes. It will not shoot at your units without first revealing them. It will, however, take this information into account when deciding where to move. Disabling this means the AI has no clue where your units are and will start randomly scouting the map until it sees one. When it sees one temporarily that then moves out of vision, unlike the base-AI it will not know where it went, only where it was. It will then either check or fire at this position and then consider the unit it saw there gone. It will also update that knowledge once it sees the unit somewhere else.

"Allow Brutal-AI to pre-prime grenades" => Isolated AI-units that have nothing to attack will prime their grenades to then be able to use it later for a much lower TU-cost compared to only priming it when it has a target for it.

"Brutal AI avoids proximity-grenades" => If enabled units controlled by Brutal AI will recognize when there is a proximity-grenade on their path and avoid stepping on it. Not working for units with maximum aggressiveness.

"Spread out" => Units controlled by AI will deliberately avoid standing too close to each other in order to reduce the impact of explosives.

"Weighted randomization" => The scores that are used for decision-making of the AI are multiplied with a random factor in order to reduce predictability.

"Performance optimisation for huge maps" => Normally the AI will pathfind for the entire map and also remember line-of-fire and vision for all it's units in the entire map's range. Now this will be toned down when the amount of tiles on the map times the amount of enemies exceeds that of a 60x60x4 with 30 enemies. With this option massive maps like 120x120x10 with 115 enemies become kinda playable again.

"Targeting behaviour for Brutal AI" => There's 4 different behaviours which kinda act as a difficulty-level the default is 3.
1 => As for the base-AI, the AI-units can only attack what they can see themselves.
2 => AI units can also attack whatever any of their friends see.
3 => AI units will remember locations of player-units they've become aware of and use blaster-launcher-weapons against them.
4 => The AI goes into hard-core-maphack-mode and can now attack everything it has a line-of-fire to without the need for vision. It is completely ridiculous and I don't really recommend using this.

"Aggressiveness-mode" => This replaces the old "Inherit aggression"-toggle and has a total of three options for now:
0> Static aggression. => Uses the value of Enemy aggressiveness or Autoplay aggressiveness respectively and sticks to it for all units.
1> Dynamic aggressiveness. => AI-controlled units dynamically adjust their aggressiveness based on their morale. The thresholds are:
>= 100 => 4
>= 83 => 3
>= 67 => 2
>= 50 => 1
<50 => 0
This change shall lead to more dynamic and less predictable behavior without having to introduce randomness.

"Enemy aggressiveness" => There's 3 different options to choose from:
0 => Fears the outdoors and values cover over anything else. Won't peak and try to set reaction-traps instead.
1 => Values being in good cover over advancing towards the enemy.
2 => A balanced approach between moving forward and being in cover.
3 => Like 2 but unless it has made contact in the current turn, it is forced to end their turn closer to the supposed enemy-location than where it started.
4 => Always move forwards without any sense of self-preservation.

"Intelligence-mode"
0> Static intelligence.
1> Inherit intelligence from unit-intelligence
2> Inherit intelligence from difficulty-level.

"Static intelligence"
Chance to make a smart move instead of a random one:
0> 0%
1> 20%
2> 40%
3> 60%
4> 80%
5> 100%

Internally there will be a random roll of 0-5. Whenever the value of the roll exceed the intelligence of the enemy, they will move to a random reachable tile incase their TUs are still full or skip moving alltogether if they already spent TU in this turn. So at an intelligence of 0 the unit will always act randomly whereas at an intelligence of 5 it will never act randomly.

"Automated combat" => Hands the control of even your own units to the AI. Warning: That's a bit experimental and might not produce the results you desire. Can be toggled on and off during your turn in Battlescape by pressing ctrl+a.

"Autoplay aggressiveness" => Same as Enemy aggressiveness but for your own units in auto-play. Note that an aggressiveness lower than 3 might stall and not always advance. Especially the lowest setting.

"Sneaky AI" => This was not changed in how it works. It prefers going longer paths over paths that are visible to the enemy. It was just move to this new category because it fits here.

Extended:

"Fog of war" => When enabled any tile that was previously visible to the player but currently isn't will now be drawn in the selected fog of war color.

"Select fog of war colour" => Values from 1 to 15, each representing a different shade colour. Hint: 1 and 6 look good.

"Smart ctrl-click and auto-equip" => Ctrl-clicking items in the loadout-phase will prefer slots that are faster to reach. The off-hand will be deprioritized if the main-hand holds a two-handed item. Auto-equip uses the same logic.

Features for Modders:

All the features for brutal-AI can also be enabled separately while the player themselves has disabled them. This way modders can customize the experience as they with for their players.

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

Note: If "Inherit unit-aggression" is enabled, the Aggression-stat of the unit will be used. However, if the aggression-stat is 3 and above, it will map to Aggressiveness 3. The maximum aggression via inheritance can only be achieved with the LeeroyFlag. This is because in some mods a lot of units use aggression-values of up to 8, which otherwise would all map to a pretty bad and non-competitive behaviour.

If both the mod and the player use brutal-AI-options but they differ, the higher one will be used. For example: You set "Brutal AI" enabled with "Omniscience" and target-Mode 2 and the Mod has it enabled but no omniscience but target mode 3, the unit will use target-mode 3 and omniscience.

If asked to describe how using this mod with default-settings (ignore-grenade-timer/brutal/omni/preprime/3) increases difficulty, I'd say when we quantify difficulty with the kill:death-ratio for soldiers, I'd say it's about 5 times more difficult. Especially early-on with basic gear and especially when the enemies have access to explosives.

If you want to combine this with other mods that increase difficulty, I recommend to tone it down and maybe use the non-cheating-variant and fire-mode 2. Unless, of course, you are ready to suffer or really, really good at this game.

Major Milestones:

2.0.0: Movement-logic completely rewritten to be much more efficient and comprehensible.
3.0.0: Inclusion of auto-play, allowing the possibility for player-controlled-units to be controlled by the AI.
4.0.0: Consideration of all possible attack-options of all equipped weapons. Including walking closer to increase accuracy or use melee-weapons.
5.0.0: Prediction of enemy-movement and taking it into account for decision-making.
6.0.0: Using a heat-map to quantify danger and being aware of potential support from allies when deciding how brave to be.
7.0.0: The AI is now capable of weighing self-preservation against attacking making it less likely for them to end their turn exposed when decent cover is nearby.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.0
Post by: Xilmi on December 27, 2022, 10:16:59 pm
Just uploaded a 2.1.1:

Reverted to OXCE 7.8.4 as 7.8.5 was crashing all the time for me.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Finnik on December 28, 2022, 11:59:54 am
First, great work! It's good to see more forks! Looking forward if it would be merged into OXCE or would have a separate release loop.
Second, could you pls describe `aiTargetMode` more?
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Xilmi on December 28, 2022, 05:52:44 pm
First, great work! It's good to see more forks! Looking forward if it would be merged into OXCE or would have a separate release loop.
Second, could you pls describe `aiTargetMode` more?
I'm no longer actively pursuing OXCE-integration. If they want to have it, they can feel free to include it though. And that goes for everyone who wants it in their fork.

When it comes to "aiTargetMode", I think modes, 1, 2 and 4 are pretty straight-forward and easily explained.

Mode 1 simply means that each unit can only attack enemies it currently can see. It's basically an easy-mode for my AI as team-work was kinda the premise.
Mode 2 is team-vision. Every unit can attack every enemy seen by any of their team-mates including themselves as long as they have a line-of fire. This works more or less exactly as it works for the player.
Mode 4 means there's no limitiation of what can be attacked other than having a line of fire. Your units don't have to be spotted and can be attacked all across the map as long as they are out in the open. It is extremely unfair.

Mode 3, which is the default is also the most difficult to explain. I created an entirely new system of for it (that I later used in the non-omniscient-movment-logic too).
The base AI uses the intelligence stat in combination with the turn a unit was spotted in order to keep track of enemy units. I personally didn't like that system so none of my firing modes uses it. What I do instead is, that each Unit has a new parameter which is the tile-ID of the unit having last been spotted. By default that's -1, which is invalid and means the unit wasn't spotted yet.
Now when spotting occurs by either way of how it normally occurs, except for the "everything is spotted starting from 21"-cheat, that parameter is set to the ID of the tile the unit currently stands on.
So the AI can refer to it. But the AI can also "delete" this when one of the following occurs:
1. The AI sees the tile and sees that there's no unit on it.
2. The AI visits the tile itself, which also makes clear there's no unit on it.
3. The AI took a so-called "blind-shot" at that tile. Even if the unit survives and is still at that tile.
In all of these cases the memory of the units whereabout gets cleared/forgotton and will only be updated once the unit is spotted again.
Targetting-mode 3, in addition to what targetting-mode 2 does, will consider shooting at these "spotted" tiles when there's no other target.

The purpose is basically to make using smoke a little less exploitative. If you use your units in the smoke to shoot at aliens and hit them, they will know where the shot came from and attack that location. If your unit didn't move or the alien uses a grenade for that, chances are you are getting hit. The counter is to save some TUs to move away from where you attacked. Ideally into actual cover.
When the aliens have blaster-weapons this becomes a lot more dangerous. For example in base-defense-missions, where it's a good tactic to hide behind doors, peek out, shoot and go back behind the door. The blaster-user may now blind-shoot the location where you were seen, remove your cover and make you vulnerable for other units.

I'd say it's a good and logical middleground between acting ignorant to what you do on your turn "out of sight out of mind" and the cheating by the base-AI that would just know where you are for several turns once you were seen.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Finnik on December 28, 2022, 07:59:34 pm
For mode 3: I guess units also should remember what exactly unit was there, and if they see this unit in another spot, they should understand, that it's remembered spot should be cleared, as it's clear that now unit has a different location.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Xilmi on December 28, 2022, 10:04:39 pm
For mode 3: I guess units also should remember what exactly unit was there, and if they see this unit in another spot, they should understand, that it's remembered spot should be cleared, as it's clear that now unit has a different location.
Yes, of course. That's what happens. The location where it was last seen is stored to the battleUnit itself. And when it gets seen somewhere else it's location will be updated to the new location.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: N7Kopper on December 31, 2022, 11:02:42 pm
Just settled into a Superhuman Ironman run of this with the fairest settings possible (No AI wallhacks, no cheatTurn, but full squad tactics and memory) and I ran into a big problem. The Enhanced Dogfighting just crashes the game. No fatal errors from any mods (I have no mods that would alter dogfighting, even official OXC second wave options), no log files at all in fact.

Turning Enhanced Dogfighting off lets me shoot down UFOs with my Avalanches just fine, but turning it on gives me one frame of standoff before getting kicked back to my Lara Croft wallpapers. Here, I posted my log. It cuts off suddenly with no clue on what made it crash. (You can see how my resolution gets set twice - that's me turning enhanced dogfighting off, fighting a UFO, then turning it on and going for another attack - BAM, crash)

Code: [Select]
[31-12-2022_20-48-53] [INFO] OpenXcom Version: Extended 7.8.4 + Brutal AI 2.1.1 (v2022-12-27)
[31-12-2022_20-48-53] [INFO] Platform: Windows 32 bit
[31-12-2022_20-48-53] [INFO] Data folder is:
[31-12-2022_20-48-53] [INFO] Data search is:
[31-12-2022_20-48-53] [INFO] - C:/Users/N7Kopper/Documents/OpenXcom/
[31-12-2022_20-48-53] [INFO] - D:/Program Files/OpenXCom/
[31-12-2022_20-48-53] [INFO] User folder is: D:/Program Files/OpenXCom/user/
[31-12-2022_20-48-53] [INFO] Config folder is: D:/Program Files/OpenXCom/brutalaiconfig/
[31-12-2022_20-48-53] [INFO] Options loaded successfully.
[31-12-2022_20-48-53] [INFO] SDL initialized successfully.
[31-12-2022_20-48-54] [INFO] SDL_mixer initialized successfully.
[31-12-2022_20-48-54] [INFO] Attempted locale:
[31-12-2022_20-48-54] [INFO] Detected locale:
[31-12-2022_20-48-54] [INFO] Attempting to set display to 1920x1081x32...
[31-12-2022_20-48-59] [INFO] Display set to 1920x1081x32.
[31-12-2022_20-48-59] [INFO] Loading data...
[31-12-2022_20-48-59] [WARN] C:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\src\Engine\OpenGL.cpp:159: glGetError() complaint: GL_INVALID_OPERATION
[31-12-2022_20-48-59] [WARN] C:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\src\Engine\OpenGL.cpp:173: glGetError() complaint: GL_INVALID_OPERATION
[31-12-2022_20-48-59] [INFO] Scanning standard mods in ''...
[31-12-2022_20-48-59] [WARN] C:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\src\Engine\OpenGL.cpp:181: glGetError() complaint: GL_INVALID_OPERATION
[31-12-2022_20-48-59] [WARN] C:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\src\Engine\OpenGL.cpp:191: glGetError() complaint: GL_INVALID_OPERATION
[31-12-2022_20-48-59] [WARN] C:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\src\Engine\OpenGL.cpp:195: glGetError() complaint: GL_INVALID_OPERATION
[31-12-2022_20-48-59] [WARN] C:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\src\Engine\OpenGL.cpp:237: glGetError() complaint: GL_INVALID_OPERATION
[31-12-2022_20-48-59] [WARN] C:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\src\Engine\OpenGL.cpp:242: glGetError() complaint: GL_INVALID_OPERATION
[31-12-2022_20-48-59] [INFO] Scanning user mods in 'D:/Program Files/OpenXCom/user/'...
[31-12-2022_20-49-06] [WARN] Error in version number in mod 'XCF-CyrNames': unexpected symbol
[31-12-2022_20-49-08] [WARN] Error in version number in mod '40k_ROSIGMA_edits': unexpected symbol
[31-12-2022_20-49-11] [INFO] Active mods:
[31-12-2022_20-49-11] [INFO] - xcom1 v1.0
[31-12-2022_20-49-11] [INFO] - Alien Melee v1.0
[31-12-2022_20-49-11] [INFO] - alieninventory v1.0
[31-12-2022_20-49-11] [INFO] - Aliens_Pick_Up_Weapons v1.0
[31-12-2022_20-49-11] [INFO] - Better_Ingame_UI v1.0
[31-12-2022_20-49-11] [INFO] - BasicArmourPediaUFO v1.0
[31-12-2022_20-49-11] [INFO] - diversity v1.3
[31-12-2022_20-49-11] [INFO] - improvedhandobjs v1.2
[31-12-2022_20-49-11] [INFO] - Kneel_Indicator_Cursor v1.0
[31-12-2022_20-49-11] [INFO] - Limit_Craft_Item_Capacities v1.0
[31-12-2022_20-49-11] [INFO] - missilesounds v1.0
[31-12-2022_20-49-11] [INFO] - moar-zero v1.0
[31-12-2022_20-49-11] [INFO] - power-suit-helm-off v1.1
[31-12-2022_20-49-11] [INFO] - PS1 UFO Videos v1.1
[31-12-2022_20-49-11] [INFO] - PS1 Music v1.1
[31-12-2022_20-49-11] [INFO] - PS1 SFX v1.0
[31-12-2022_20-49-11] [INFO] - sanicskyranger v1.3b
[31-12-2022_20-49-11] [INFO] - selfheal v1.1
[31-12-2022_20-49-11] [INFO] - TFTD_Damage v1.0
[31-12-2022_20-49-11] [INFO] - UFOextender_Gun_Melee v1.0
[31-12-2022_20-49-11] [INFO] - X-Com Demo Mission v1.0
[31-12-2022_20-49-11] [INFO] - xcom2012death v1.1
[31-12-2022_20-49-11] [INFO] - commendations v3.2
[31-12-2022_20-49-11] [INFO] - nocheat v1.0
[31-12-2022_20-49-11] [INFO] - Alien Reproduction v1.0
[31-12-2022_20-49-11] [INFO] - Text Revision v0.8
[31-12-2022_20-49-11] [INFO] - extra_explosions v1.0
[31-12-2022_20-49-11] [INFO] - Mission Codenames v1.0
[31-12-2022_20-49-11] [INFO] - daynightUI v1.0
[31-12-2022_20-49-13] [INFO] Loading begins...
[31-12-2022_20-49-13] [INFO] Pre-loading rulesets...
[31-12-2022_20-49-13] [INFO] Loading vanilla resources...
[31-12-2022_20-49-15] [INFO] Loading rulesets...
[31-12-2022_20-49-17] [INFO] Loading rulesets done.
[31-12-2022_20-49-17] [INFO] Loading fonts... Font.dat
[31-12-2022_20-49-19] [INFO] Lazy loading: 1
[31-12-2022_20-49-20] [INFO] Loading custom palettes from ruleset...
[31-12-2022_20-49-20] [INFO] Making palette backups...
[31-12-2022_20-49-20] [INFO] After load.
[31-12-2022_20-49-20] [INFO] Loading ended.
[31-12-2022_20-49-20] [INFO] Data loaded successfully.
[31-12-2022_20-49-20] [INFO] Loading language...
[31-12-2022_20-49-20] [INFO] Language loaded successfully.
[31-12-2022_20-49-20] [INFO] OpenXcom started successfully!
[31-12-2022_20-49-20] [WARN] C:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\src\Engine\OpenGL.cpp:388: glGetError() complaint: GL_INVALID_OPERATION
[31-12-2022_20-49-21] [INFO] Playing flx, 320x200, 3330 frames
[31-12-2022_20-49-23] [INFO] SDL_mixer initialized successfully.
[31-12-2022_20-49-24] [INFO] Update check status: 7; newVersion: v7.8;
[31-12-2022_20-49-45] [INFO] Attempting to set display to 1920x1081x32...
[31-12-2022_20-49-45] [INFO] Display set to 1920x1081x32.
[31-12-2022_20-50-01] [INFO] Attempting to set display to 1920x1081x32...
[31-12-2022_20-50-01] [INFO] Display set to 1920x1081x32.

Of course, I want an actual reason to build things such as Firestorms, so this is kind of a problem. An AI update like this is wonderful and just what I was looking for as a difficulty bump, so it's the least I can do to report problems, both for you and the community.
-----------------------
EDIT: I believe I've found the issue! The Enhanced Dogfighting AI really doesn't like when you have an empty weapon slot on your craft. I had removed the Stingrays and Cannons from my Interceptors (as I do) and was trying to shoot down a UFO with just a single Avalanche launcher, as it was the first spawn and my other three launchers hadn't arrived yet. It might be more complicated with other mods that have a greater or smaller number of weapon slots, but that's the breaking behaviour in vanilla UFO.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Xilmi on January 03, 2023, 12:05:51 am
EDIT: I believe I've found the issue! The Enhanced Dogfighting AI really doesn't like when you have an empty weapon slot on your craft.
Thank you for this bug-report! This is extremely helpful. I'll fix it right away. :)

Edit:

Here you go:

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

Fixed crash when using enhanced dogfight-behaviour while there are empty weapon-slots on the X-com-craft.
Aliens with pre-primed-grenades will no longer act as if they were melee-units.
Aliens are more likely to position themselves in smoke.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: EttyKitty on January 03, 2023, 08:26:37 am
Hi.
Great work. The description sounds absolutely amazing.

I've run into a problem:
I'm playing with the 40k+ROSIGMA mods. The missions is a downed enemy craft. I'm using a craft that has turrets on the battlescape that you can use (think of an APC). And so I'm picking off enemies around the craft and notice that they are not approaching me. Enemies move back and forth, do not attack or attempt to close the distance to my troops. I wasn't sure why and even thought that maybe my installation is broken.

I tried moving my soldiers into their LoS - only enemies with sniper rifles and mindcontroll are trying to do something, others - move back and forth. I tried breaking the LoS with them, moving my soldiers into the craft and turning my turrets away from the enemies - still nothing.

In the end I destroyed my turrets with gun fire and again moved my units into the craft - enemies started to move. Now they are trying to get LoS with my units and everything else. As soon as I move any of my units into their LoS - they start to behave weirdly again, but at this point it's probably because the ones that are left have no weapons or only mindcontrol, so they are trying to keep the distance.

The missions was pretty weird. There was ~17 enemies in total but only 2 were actually active and dangerous. The guy with a sniper rifle and the mindcontroller (maybe that's one guy). Everyone else was either doing nothing or doing not enough and was craft camped by me (by moving out of the craft, shooting and going back).

I have a save with 3 enemies left. 1 still has a melee weapon and 1 other has mindcontrol. If you need me to test something or explain better - I'll be glad.
I've also recorded some of the enemies.
https://ibb.co/XbrdJtj

Excuse me my English and thank you for your work.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: Xilmi on January 03, 2023, 04:04:51 pm
The missions was pretty weird. There was ~17 enemies in total but only 2 were actually active and dangerous. The guy with a sniper rifle and the mindcontroller (maybe that's one guy). Everyone else was either doing nothing or doing not enough and was craft camped by me (by moving out of the craft, shooting and going back).
Hi and thanks for the report! I think the most helpful thing you could do would be providing an autosave or something from that mission so I can analyze the weird behaviour.
I'd also like to know more about the exact settings. Was it with or without omniscience and which fire-mode was it?

I have done the vast majority of my testing without mods, so there might be specifics of unit-configurations or special settings that are badly covered by what I've tested and so unintended behaviour cannot be ruled out.

I'd really have to do an in-depth analysis of what's going on. Wasting TUs going back and forth as shown in that little video is definitely not intended behaviour. Taking a peak and then deciding to hide again, however, can be intended in certain circumstances.

If most of them are melee, then probably my melee-detection is broken under specific circumstances and they don't act as melee-units are supposed to act and show some sort of mixture between ranged- and melee-behaviour. Another theory would be them having weapons with a limited range. Something like a 5 tile-range or so. In this case they'd likely also behave incorrectly.

So providing a save-game or telling me what kinds of enemies that was so I can recreate the test myself in the battle-simulator would be most helpful to better support any units that don't fit in the standard-behaviour.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: EttyKitty on January 04, 2023, 05:36:36 am
So providing a save-game or telling me what kinds of enemies that was so I can recreate the test myself in the battle-simulator would be most helpful to better support any units that don't fit in the standard-behaviour.
Turns out that I do have two saves, at the start of the mission and at the end. I'll attach both of them.

But you will need to download the latest versions of 40k and ROSIGMA if you want to play test them.
You can download the latest version of ROSIGMA from here (https://github.com/BeatAroundTheBuscher/ROSIGMA). You'll probably be fine with just downloading the current main branch, I don't think that any important changes were made since when I downloaded it.
40k version from here (https://old.mod.io/mods/file/2963453) should be fine as well.

I'll also attach a screenshot of my settings. I tried turning "Sneaky AI" and "Omniscience" on/off a couple of times but that didn't help much.

If there is anything else that I can do for you - let me know. I'm amazed with what you are trying to do.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: Xilmi on January 04, 2023, 05:24:48 pm
If there is anything else that I can do for you - let me know.
Well, I can't load neither of your saves despite reinstalling 40k + Rosigma.
I could load saves of someone else who played that mod, I can start battles myself and such.

It first says that I'm lacking some mod that the save was created with and then crashes while writing:

[ERROR]   Failed to load soldier STR_NEOPHYTE

several times (I suppose the amount of soldiers you have) into the log.

Not sure we can figure out how to get these saves to load for me.

Maybe if you could tell me what kind of enemy that was and I can try and reproduce it without relying on these saves.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: Xilmi on January 04, 2023, 05:57:59 pm
I've tried around a bit and have seen something interesting:

Some of my soldiers had a "Fist"-button with which they could perform melee-attacks. Normally the melee-attacks are derived from the weapon.

If that's what the enemies had too, then it wouldn't be surprising that they mistook themselves as the wrong kind of unit which could explain that weird behaviour.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: Xilmi on January 05, 2023, 12:34:16 am
I have a new hypothesis that I think is quite likely. It's to do with the Extender-Accuracy that's force-enabled by the 40k Mod.

I could reproduce a similar behaviour by enabling that option and then forbidding the AI to use anything other than Auto-shots (which have 7 range before the fall-off starts).

They behave correctly until one of them can see a valid target. Then the others want to go for that target too. They walk to a tile they think they should be able to attack from and only realize they actually can't once they arrive. Then they want to go to another tile they think they should be able to attack from and the same thing happens again. They repeat that until they don't have enough TUs to attack anymore and then try to hide.

I think this could very well be the behaviour seen in the short clips of yours.

In vanilla this should rarely be an issue. But with high sight-ranges and weapons that don't have an aimed-shot, this issue should be able to happen quite often.

The solution would be making them aware of their max-range and only consider tiles within their weapon's range as tiles to go to for attacking. They should then either break line of fire to force you to come closer or come closer themselves to get in range.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: EttyKitty on January 05, 2023, 07:25:42 am
It first says that I'm lacking some mod that the save was created with and then crashes while writing:

[ERROR]   Failed to load soldier STR_NEOPHYTE

I apologize. That's my mistake. I forgot that I was testing a new soldier type at that time.

I'll attach the sub-mod that I was testing.

As a backup, I will attach modified saves where I replaced these "STR_NEOPHYTE" with default "STR_SOLDIER". I tested it and it seems that the saves work even without the attached mod. Not sure if it's a better or worse solution.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: Xilmi on January 05, 2023, 10:48:54 am
Okay, I'll try it again with the sub-mod this evening to see whether the intervention I made yesterday helps in this case or if it is something else.

While testing around with the WH40k mod even after the changes that make the AI realize their range while walking, I noticed some other things in which my AI has issues with the 40k rule-set that also need to be taken care of.

The combination of very large sight-range and usually shorter range for the weapon is an issue for the code that is meant for the AI to prevent walking into reaction-fire. Funnily enough this might lead to the non-cheating AI to be stronger because it doesn't know when enemies would reaction fire and thus mostly ignores it. The reaction-fire-code definitely needs to check whether a tile is in range for that as otherwise the unit will freeze in place out of fear from reaction-fire and be susceptible to snipers.

In general the massive sight-ranges make the cheating kinda unnecessary. I think that the units probably shouldn't be afraid of reaction fire at all as long as they are further away than their own-weapon-range and ignore it the same as melee-units do who have to ignore it as they otherwise couldn't make it near their enemy. So I guess I'll do that instead. "If you are further away than your range-sweet-spot act as if you were a melee-unit" should be a good general rule. Better than what I suggested before as otherwise a single sniper could still freeze a lot of units simply by being visible to them.

In vanilla there is no weapon that doesn't have an aimed-shot so testing these things with extender-accuracy in vanilla won't really work. They'll just use aimed-shots a lot more.

Something that generally could need improvement is the logic for melee-units. I've won a base-defense-mission against Snakemen/Crysalid due to the Crysalids mindlessly charging at me and then getting stranded without TUs. I need to find a middle-ground between sneaking up and making a charge to make them more dangerous without making reapers less dangerous.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: EttyKitty on January 05, 2023, 02:46:02 pm
Okay, I'll try it again with the sub-mod this evening to see whether the intervention I made yesterday helps in this case or if it is something else.
Actually, it seems that you've already figured out the source of the problem. Maybe there is no need waste time to test these exact saves. I played more and a lot of other missions had the same problem with enemies behaving weirdly, so those exact saves are not unique. It's, as you said, probably a 40k/ROSIGMA thing. I already saw quite some talks about the big view distance causing problems.

Let me know you want me to relay any information relating 40k/ROSIGMA rulesets to their respective devs. I didn't ask if they are interested in adjusting their mods to yours right now, but I'm sure that what you are trying to do will be interesting for them in the long run. Alternatively, you can check their discord by yourself. Both 40k and ROSIGMA devs reside in the ROSIGMA (https://discord.gg/cSBsAZSkJy) server.
I initially found out about your work because one of the people in that discord server created a submod that halves the number of enemies in 40k/R, because otherwise it's too hard and enemy turns take too long.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: N7Kopper on January 05, 2023, 03:32:17 pm
Sorry to be the bearer of bad news, but I found another crashing bug in UFO: the Brutal AI breaks entirely on the enemy turn if you mind control any enemies. (Checking civilians is likely also a good idea if they can use Brutal AI, because I believe they use the same AI packages, but allied with X-Com rather than opposing?) - having X-Com guys get mind controlled works just fine, however. They still act as if smoke grenades are deadly projectiles, but that's not a crashing bug, just vanilla stupidity. This bug existed in the version I reported the first crash on, and also on the latest build.

Unfortunately, in testing this I was shot at by a Muton hiding in a building that I had no idea was there when I turned off the Brutal AI. F for the purity of my Ironman run I suppose. I'm raiding a landed Alien Infiltration Battleship if that makes a difference.

As a side note, allowing the aliens to mind control their own guys to cure your mind control (like what you can do) would be a fun idea...
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: Xilmi on January 05, 2023, 04:57:19 pm
I already saw quite some talks about the big view distance causing problems.

Let me know you want me to relay any information relating 40k/ROSIGMA rulesets to their respective devs.
Don't worry. None of these are problems that can't be taken care of. Making the AI capable of dealing with other rule-sets sounds much more sustainable than forcing the mod-makers to adjust their rule-sets to be more suitable to the AI. Higher vision-range and accuracy-dropoff are not unique to 40k, so the interventions will be helpful for all the mods that use them.

High vision range might be something that could be taken care of regardless. I feel it's a bit detrimental to the atmosphere to be able to see basically everything right away without scouting.

I don't think it's a waste of time to test with the exact saves. It's always more helpful to be able to comprehend exactly what happened instead of assuming that one cause is the exact same that happened there. So saves of bug-reports keep being a really valuable tool and I still intend to test this exact mission.

In general: Testing, testing and more testing is the most important part about AI-development. Coding without making sure the code actually does what it's supposed to simply can't achieve the same results.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: Xilmi on January 05, 2023, 05:07:52 pm
Sorry to be the bearer of bad news, but I found another crashing bug in UFO: the Brutal AI breaks entirely on the enemy turn if you mind control any enemies. (Checking civilians is likely also a good idea if they can use Brutal AI, because I believe they use the same AI packages, but allied with X-Com rather than opposing?) - having X-Com guys get mind controlled works just fine, however. They still act as if smoke grenades are deadly projectiles, but that's not a crashing bug, just vanilla stupidity. This bug existed in the version I reported the first crash on, and also on the latest build.

Unfortunately, in testing this I was shot at by a Muton hiding in a building that I had no idea was there when I turned off the Brutal AI. F for the purity of my Ironman run I suppose. I'm raiding a landed Alien Infiltration Battleship if that makes a difference.

As a side note, allowing the aliens to mind control their own guys to cure your mind control (like what you can do) would be a fun idea...
Interaction with mind-control of the player really is one of the least tested things. I have tested it and made some changes to the behaviour. Didn't experience any crashes myself. What I changed was making them ignore their own mind-controlled units and becoming more aggressive. I'll try again and see if I can reproduce it. A save-game would be helpful though. I hope you play self-imposed Iron-Man and not with the in-game-option, as that's very risky in terms of any bug potentially breaking the entire run and not being able to provide save-games that could help fix the bugs.

I can see if I can identify the type of grenade somehow and not make them use them if it's smoke-grenades.

Edit: Tried reproducing it by doing a mission with a Muton-Battleship and a few psi-amps. To no avail. Neither did it crash nor did the Aliens act particularly wrong.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: Xilmi on January 05, 2023, 05:21:24 pm
I initially found out about your work because one of the people in that discord server created a submod that halves the number of enemies in 40k/R, because otherwise it's too hard and enemy turns take too long.
Joined their discord and while searching saw there's been a lot of talk about it. More than on the official OXC-discord. They discussed issues about it and made suggestions of what it could do better... all in my absence.
People should realize that their feedback is much more likely to have any impact when they make sure it's done some place I at least have the chance to listen! :D
Title: Re: [SOURCEMOD] Brutal-AI 2.2.0
Post by: Xilmi on January 05, 2023, 08:15:56 pm
I uploaded a new version with fixes for the glitches in the WH40k-mod.
But since I wasn't able to reproduce the mind-control-crash reported by N77Kopper, I obviously couldn't fix that one.

So as I said earlier, I'd either need a save-game where that happens or steps to reproduce it. Maybe also attach options.cfg incase it depends on some combination of options.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.2
Post by: Xilmi on January 06, 2023, 01:50:36 am
the Brutal AI breaks entirely on the enemy turn if you mind control any enemies
I managed to reproduce it!
Seems like playing without omniscience is a requirement.

I don't quite understand yet what the mind-control changes because from where it crashes it looks like that could happen regardless of mind-control.

Okay, I understood it now. There's a place where it check what the closest enemy-unit is. For that place it also counts it's own mind-controlled units. So then it assumes that it knows the position of an actual enemy and tries to look whether it has a line of fire. And then it crashes when it doesn't actually know the position of an enemy.

When I don't let it consider it's own mind-controlled units as enemies, it no longer tries to check the line of fire and thus cannot crash anymore.

Fix is available: https://github.com/Xilmi/OpenXcom/releases
Title: Re: [SOURCEMOD] Brutal-AI 2.3.0
Post by: Xilmi on January 10, 2023, 08:26:57 pm
Put out a new rather significant update, especially for those of you who want a challenging non-cheating AI.

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

With the changes that can be read about in detail in the changelog, the non-cheating variant of my AI should now be capable of posing a significanlty bigger threat than it was able to do so before, when several bugs and the lack of awareness that units it can't see anymore didn't just disappear but must have gone somewhere held it back.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Spess Mahren on January 14, 2023, 05:26:54 am
I am getting a poor frame rate with this mod on xcom files while normally I have no issues with anything openxcom and my desktop is the opposite of a toaster performance wise.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Yankes on January 14, 2023, 01:45:50 pm
It could be script that build new version do not set proper optimization flags
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Juku121 on January 14, 2023, 10:47:01 pm
I ran this once and all OpenGL shaders began crashing the game for all OXCE installations. A restart fixed this, and I already couldn't change shaders in-game without a crash (changing them in the .cfg worked before, but not this time), so it's not quite all or likely even most Xilmi's fault. But it's an additional hurdle that makes me hesitant to continue.

The aliens also weren't very hot against dogs in semi-decent cover. Wonder if it was the UFOExtender accuracy that made them shoot and miss most of the time? Although the whole thing was part of a strange challenge mission, so maybe not really representative.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Xilmi on January 16, 2023, 01:25:19 am
I am getting a poor frame rate with this mod on xcom files while normally I have no issues with anything openxcom and my desktop is the opposite of a toaster performance wise.
Theorethically this should only impact turn times of when the AI is moving. I wouldn't know how this should be causing frame-rate-issues.
Did you use your previous "options.cfg" or did you let it create a new one?
It's set to 60 FPS by default. "Low" is such a subjective term though. How low exactly is it? If it's 60 and for some reason you consider that low, then that's because that's what it's set to be.
I personally cannot tell any difference between basic OXC and my own version FPS-wise.

@Yankes: I'm using defaults and haven't changed anything about optimization-flags. I neither know where to do that nor what "proper" settings would be.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Xilmi on January 16, 2023, 01:33:59 am
I ran this once and all OpenGL shaders began crashing the game for all OXCE installations. A restart fixed this, and I already couldn't change shaders in-game without a crash (changing them in the .cfg worked before, but not this time), so it's not quite all or likely even most Xilmi's fault. But it's an additional hurdle that makes me hesitant to continue.
I honestly have no idea what and why people have these odd issues with the game. Segmentation-faults or endless-loops within AI-code is something that I'd feel responsible about. But OpenGL-shaders? I haven't touched any of this stuff at all.

The aliens also weren't very hot against dogs in semi-decent cover. Wonder if it was the UFOExtender accuracy that made them shoot and miss most of the time? Although the whole thing was part of a strange challenge mission, so maybe not really representative.
Which version was that? I've recently added better support for "UFOExtender accuracy" as that's default in the WH40k mod. With versions prior to 2.3.0 the enemies wouldn't know to come closer when they already can see the target. They'd then either not attack at all or take shots as soon as the hit chance was > 0.
If it was with the recent version, then I'd like to have a test-savegame (with mentions of the mods in use) and a description of how the proper behaviour would look like.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Juku121 on January 16, 2023, 03:00:21 am
But OpenGL-shaders? I haven't touched any of this stuff at all.
Well, as I said I already had a minor version of the same problem before, and Meridian was just as much in the dark about that as you are.

Which version was that? I've recently added better support for "UFOExtender accuracy" as that's default in the WH40k mod. With versions prior to 2.3.0 the enemies wouldn't know to come closer when they already can see the target.
2.2.4. If they know to come closer now, that's a lot better. Most big mods use UFOExtender accuracy these days, I think.

They'd then either not attack at all or take shots as soon as the hit chance was > 0.
On (almost) flat terrain, that's actually not a bad tactic since 'hit chance' is significantly lower than actual chance to hit in that case.

If it was with the recent version, then I'd like to have a test-savegame (with mentions of the mods in use) and a description of how the proper behaviour would look like.
It wasn't. But in case you're interested in trying to make this mission harder...

There are quite a few here (https://openxcom.org/forum/index.php/topic,4595.msg152101.html#msg152101). Mods are actually listed in the saves (and the other four are cosmetic):
Code: [Select]
mods:
  - "x-com-files ver: 2.7"
  - "dark-geoscape ver: 1.0"
  - "xcomfiles-hyper-and-trajectory ver: 1.0.1"
  - "x-com-resound ver: 2.30"
  - "Katomusic ver: 1.0"

What I'd really like is for the Sectoids/Cyberdisks to 99% kill at least one of the dogs in semi-open cover with their plasma guns. Either via reaction fire when the dogs try running to the UFO, or on their turn. The CQC shenanigans are outside the scope of your mod, I think, and grenades were used to good effect already.

When I tried with 2.2.4, there seemed to be at least a 10% chance for the aliens to miss with every single shot on their turn.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Xilmi on January 16, 2023, 11:21:35 am
2.2.4. If they know to come closer now, that's a lot better.
There were also issues with units just walking back and forth and clumping up when omniscience wasn't used. Overall the behavior in 2.3 is way better and way more decisive in scenarios as the one described.
I'm about to wrap up 3.0 now which isn't so much about improving tactical aspects as it is about providing a major new feature.

When I tried using extender accuracy in vanilla the aliens adapted immediately. That's because the aimed-shot is available on all weapons and has a range of 200 before degrading. They simply transitioned away from auto-shot all the time to using aimed-shot at long range, snap-shot at medium range and auto-shot only when they were really close. Otherwise there didn't seem to be an necessity to change their behavior. The difference in Rosigma was that many of the weapons there either lacked an aimed-shot or the aimed shot had a much shorter range. So my prior tests from vanilla didn't really help. What I changed was that they kinda act like melee-units with ranged attacks when it comes to their movement-logic. Outside of their "comfort zone", which is the range at which their weapon will have full accuracy, they no longer think about fleeing or avoiding reaction-fire. They now know that they have to walk through the enemies' vision to use their weapons properly.

I guess any mod that has sniper-weapons as an extra class that are the only ones with really long ranges is warranted to look at in that regard. So that's really the issue here and not just Extender accuracy on its own.

On (almost) flat terrain, that's actually not a bad tactic since 'hit chance' is significantly lower than actual chance to hit in that case.
It wasn't. But in case you're interested in trying to make this mission harder...
Then this isn't something I got to test much with Rosigma. The test-saves that were attached for that usually featured mostly open terrain. So testing other scenarios is still something that could be helpful.

I've seen two saves in the vicinity of the attached save-game but from the conversation around them I'm not convinced they are about the scenario discussed here. Discussion seemed more about ninja assassins and throwing knifes and not so much about sectoids and dogs. Those were also mentioned but not in the posts containing saves. So I'd appreciate if you could make sure to provide a save of exactly the scenario you'd like me to look at. That would be most helpful for analysis.

What do you mean by COC-shenanigans? Could you un-abbreviate that?

When I tried with 2.2.4, there seemed to be at least a 10% chance for the aliens to miss with every single shot on their turn.
The chance to hit or miss is something that the AI has no real control over. What they have control over is whether they take a shot at what range and try actively to come closer. So basically how they deal with the situation. Whether there's still some things to improve about that is something that testing shall show.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Juku121 on January 16, 2023, 12:28:50 pm
I've seen two saves in the vicinity of the attached save-game but from the conversation around them I'm not convinced they are about the scenario discussed here. Discussion seemed more about ninja assassins and throwing knifes and not so much about sectoids and dogs.

Those were also mentioned but not in the posts containing saves. So I'd appreciate if you could make sure to provide a save of exactly the scenario you'd like me to look at.
The discussion was about a lot of other things, yeah. :-[ But there are a bunch of sequential saves in challenge2_completed.zip, which was about the tangent about a bunch of dogs savescumming themselves through a Sectoid Battleship. I imagine turn 3.5 might be the most relevant.

What do you mean by COC-shenanigans? Could you un-abbreviate that?
The Close Quarters Combat mechanic of knocking a gun off its firing line when there are enemies adjacent to the shooter. Which in XCF only costs a little bit of energy on the part of the 'knocker'. The dogs made good use of that, swarming over Sectoids like they were carrying dog biscuits instead of plasma clips.

The chance to hit or miss is something that the AI has no real control over. What they have control over is whether they take a shot at what range and try actively to come closer.
Yeah, but the issue was that I didn't see them coming closer.

Also, do they run (if they can run) when they do that? Running is a major advantage in many situations.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Spess Mahren on January 16, 2023, 05:03:39 pm
In regards to the lag issue I deleted my options files and the lag I was getting that was giving me visual choppiness on the geoscape and menu screens seems to be gone. Battlescape is fine and the geoscape seems just a little borderline but it could be something else, I will enable the fps counter later but my problem appears solved.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Xylon666Darkstar on January 16, 2023, 08:36:36 pm
How does one install this mod? Does it go into Users > Mods in directory? Doesn't appear to provide an option to enable it in game.

Or do I open, and c/p the files inside to overwrite within my game directory?
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Xilmi on January 16, 2023, 09:25:10 pm
Also, do they run (if they can run) when they do that? Running is a major advantage in many situations.
No. I haven't taught them to use any of the optional player-features like running, force-shooting or leaning. Is this option force-enabled for XCF?
I guess the AI should have access to stuff like this too when its enabled.
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Xilmi on January 16, 2023, 09:27:08 pm
In regards to the lag issue I deleted my options files and the lag I was getting that was giving me visual choppiness on the geoscape and menu screens seems to be gone. Battlescape is fine and the geoscape seems just a little borderline but it could be something else, I will enable the fps counter later but my problem appears solved.
I guess it might have to do with one of the advanced rendering-options then. I've heard that some of these might cause trouble. I played around with them too and found that somehow the default of no rendering looked the best anyways. But of course that's subjective.
Title: Re: [SOURCEMOD] Brutal-AI 3.0.0
Post by: Xylon666Darkstar on January 16, 2023, 09:30:53 pm
Never mind, figured it out. However, my options appear as below:

Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Xilmi on January 16, 2023, 09:32:55 pm
How does one install this mod? Does it go into Users > Mods in directory? Doesn't appear to provide an option to enable it in game.

Or do I open, and c/p the files inside to overwrite within my game directory?
The stuff in the zip goes in the game-directory. It's not a mod in the traditional sense. It's more like an alternative game-client like OXC or OXCE but I lack the competence to make an installer so that's why it's a zip file. You could also make a copy of your game-directory and put it there so you have a fall-back. At least if you're using OXC as the name of the exe is the same as OXC but differes from OXCE.
The new options should appear under Advanced/AI when you have started the correct exe-file. If you don't use them the game should behave almost exactly as it does in OXCE.
Title: Re: [SOURCEMOD] Brutal-AI 3.0.0
Post by: Xilmi on January 16, 2023, 09:34:03 pm
Never mind, figured it out. However, my options appear as below:
That's because you only copied the exe and dlls. There's also files in the sub-folder "common/Languages" that need to be overwritten.

Also note that I just uploaded version 3.0.0, you might want to use that instead.
Title: Re: [SOURCEMOD] Brutal-AI 3.0.0
Post by: Xylon666Darkstar on January 16, 2023, 09:35:48 pm
Fixed x2 with your 3.0 update. Thanks!

Sorry for my caffeine addled brain. :P
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Juku121 on January 16, 2023, 09:48:46 pm
No. I haven't taught them to use any of the optional player-features like running, force-shooting or leaning. Is this option force-enabled for XCF?
No, but it's on the 'recommendedUserOptions' list, meaning a player can opt out but by default it's on.

Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Yankes on January 17, 2023, 02:05:19 pm
@Yankes: I'm using defaults and haven't changed anything about optimization-flags. I neither know where to do that nor what "proper" settings would be.
And what "default" is? if I understand correctly you use different mechanism that Meridian did use and because of this there could be differences,
this could depend on compiler used (some optimalzie some parts better than other compilers), flags set or even version of compiler used.
Best is to check if you use recent GCC and at least flag `-O2` (some could use `-O3` but grains sometimes are minimal but compile time is lot longer).
Title: Re: [SOURCEMOD] Brutal-AI 2.3.1
Post by: Xilmi on January 17, 2023, 07:03:52 pm
And what "default" is? if I understand correctly you use different mechanism that Meridian did use and because of this there could be differences,
this could depend on compiler used (some optimalzie some parts better than other compilers), flags set or even version of compiler used.
Best is to check if you use recent GCC and at least flag `-O2` (some could use `-O3` but grains sometimes are minimal but compile time is lot longer).
GCC? Isn't that a Linux-compiler? I'm using Visual-Studio to compile and all the settings I see there are the following:
Title: Re: [SOURCEMOD] Brutal-AI 3.0.0
Post by: Yankes on January 18, 2023, 11:45:20 am
GCC is not only Linux compiler, OXCE use it for building windows exes.

Its possible that MSVC have worse performance in some cases than GCC, I encounter couple times thing like this happens.
It could be possible to add custom compiler flags that could improve speed (if this performance drop is real, it could be simply dust in cpu fan :D )
Title: Re: [SOURCEMOD] Brutal-AI 3.1.0
Post by: N7Kopper on January 27, 2023, 10:56:05 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.
Title: Re: [SOURCEMOD] Brutal-AI 3.1.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-AI 3.1.0
Post by: Juku121 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 (https://xcom.fandom.com/wiki/John_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. :(
Title: Re: [SOURCEMOD] Brutal-AI 3.3.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-AI 3.3.0
Post by: Meridian 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 :)
Title: Re: [SOURCEMOD] Brutal-AI 3.3.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-AI 3.3.0
Post by: Meridian 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?

Title: Re: [SOURCEMOD] Brutal-AI 3.1.0
Post by: N7Kopper on February 04, 2023, 10:12:49 pm
It's an in-joke of sorts. Central Officer Bradford (https://xcom.fandom.com/wiki/John_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.
Title: Re: [SOURCEMOD] Brutal-AI 3.1.0
Post by: Yankes 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? :>
Title: Re: [SOURCEMOD] Brutal-AI 3.1.0
Post by: Solarius Scorch 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. :)
Title: Re: [SOURCEMOD] Brutal-AI 3.1.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-AI 3.5.2
Post by: Xilmi 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".
Title: Re: [SOURCEMOD] Brutal-AI 3.5.2
Post by: Yankes 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.
Title: Re: [SOURCEMOD] Brutal-AI 3.5.2
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-AI 3.5.2
Post by: Yankes 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.
Title: Re: [SOURCEMOD] Brutal-AI 3.5.2
Post by: Xilmi 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
Title: Re: [SOURCEMOD] Brutal-AI 3.5.2
Post by: Xilmi on February 15, 2023, 11:30:44 am
I've done another extended session with Trauson yesterday, where he played TFTD against Brutal AI 3.5.2 and I watched.

I must say that I was really pleased with the outcome. The way the AI previously was exploitable to his approach had ceased working and he struggled similarly to myself with about everything he tried.

He also had a save-game of the final mission in level 1 that he previously finished. There wasn't much left in level 1 but level 2 killed all of his Aquanauts. So his assumption that the game will get a lot easier once he manages to survive the beginning might not hold true.

He seems thrilled about the new challenge to overcome and said he cannot go back to the base-AI after that and how boring it would be to play against by comparison.

We also explored using Brutal-AI on lower difficulties. It made it a lot more manageable and is probably a valid way to go for people to whom the challenge of Superhuman + Brutal-AI is too much.

Anyways, it was just good to see that the AI not only works well against my own approach but also that of others.
Title: Re: [SOURCEMOD] Brutal-AI 3.5.2
Post by: Xilmi on February 16, 2023, 02:16:09 pm
Another test-session with Trauson yesterday. He did indeed find a way to exploit something. Not a really hard-exploit as before but good enough to win some missions.

It was that placing out a sacrificial unit would lure enemies out in the open quite often.
And while turning off omniscience seemed to help with that, it didn't fix the underlying issue.

My analysis is that this is caused by the AI units turning on sweepmode once a unit is seen by anyone on their team. In sweepmode units will come out and try to recklyessly hunt down anything they can. So depending on where they are, they might just end up in very exposed locations.

My idea to fix that is to differentiate between sweepmode and a mode for carefully approaching. The careful mode would still expose the alien if it can get a line of fire to the target. But if it can't get a line of fire it should only move as far ahead as it can safely do using the algorithm already existing and meant for encirclement of positions. This should lead to a better compromise between attacking and while not exposing themselves too much.

Watching a bit of play against non-omniscient also revealed a big weakness, which is the tendency to camp without peaking. It's easy to explain. The peaking of the cheating-variant works well because the AI know where the enemy units are so they also know when peaking makes sense. The non-cheating variant peaks based on the assumption of where the enemy units are. But if they assume them to be in the Triton still and they've hidden very well, they think peaking never makes sense and won't do it.

A solution for that also needs to be found. There's already a calculation like: "If the assumed enemy unit would walk as far as possible into my direction, where would it end up?" So the non-omniscient peakabooing-logic could consider this position as the one it tries to establish a line of sight to and afterwards hide again.
Title: Re: [SOURCEMOD] Brutal-AI 3.6.0
Post by: Xilmi on February 17, 2023, 02:45:23 am
Brutal-AI 3.6.0:

The order in which the AI moves their units is now more situationally adaptive. When units are stuck it will prefer moving units that block the path. When units are not impaired in their movement it will prefer moving units closer to the enemy.

Will once again go into sweep-mode in any case when enemy-morale is low enough. But the morale-discrepancy needs to be bigger now in order to not rush blindly into a still capable enemy.

Whether your units are still on start-tiles no longer is takin into consideration for the behaviour of the AI.

AI is now much more willing to employ peaking-behaviour. Especially the non-cheating-variant.

Fixed an error that caused the AI to keep way more distances than was intended.

AI no longer goes into "sweep-mode" whenver they find one of your units. This should prevent them from getting a lot of their units stranded in exposed positions.
Title: Re: [SOURCEMOD] Brutal-AI 3.6.0
Post by: Isord on February 18, 2023, 07:32:14 pm
I was testing in quick battle and I noticed that when controlled by AI, my units never used any healing items to save themselves or any allies nearby that were injured. I also noticed that units (player or alien) when equipped with a melee weapon will just charge towards the first unit they see, regardless if they have enough TUs to reach them which usually lead to ending their turn on open field and then dying. MY BAI options were: Omniscience off, Target B:3, Charge B:1, Seeking player: yes
Title: Re: [SOURCEMOD] Brutal-AI 3.6.0
Post by: Xilmi on February 20, 2023, 11:00:57 am
I was testing in quick battle and I noticed that when controlled by AI, my units never used any healing items to save themselves or any allies nearby that were injured. I also noticed that units (player or alien) when equipped with a melee weapon will just charge towards the first unit they see, regardless if they have enough TUs to reach them which usually lead to ending their turn on open field and then dying. MY BAI options were: Omniscience off, Target B:3, Charge B:1, Seeking player: yes
Using of healing-items is one of the things I haven't implemented yet. So that part not working is to be expected.
When it comes to charging with melee-weapons: If seeking player is set to yes, then this behavior is forced in that way. This can be overruled by switch seeking player off.
When it comes to enemy-unit behavior in that regard, have you checked whether the unit has the Leeroy-flag set in the mod it's from? This can be overruled by setting Charge B: 0.

There's still potential scenarios where it could happen. I've also changed something about the logic of how units behave when extender-accuracy is enabled. I'm currently also still trying to find an optimal way for how the aliens should behave when they can't engage in combat. It works relatively well when there's a lot of cover. But if there isn't and especially when the player uses smoke a lot, the behavior looks kinda sub-optimal. Currently they'd mostly move backwards in situations like that. But you can only do that so much until you reach the edge of the map. Blindly charging towards it is also quite exploitable. My idea was for them to break line of fire in this case but if that's not possible, there's a problem.
Having a flip between go back and charge forward depending on whether they can get far enough away, could be one idea. Actually... yeah, I'm gonna experiment with that.
Title: Re: [SOURCEMOD] Brutal-AI 3.7.0
Post by: Isord on February 22, 2023, 12:24:24 pm
Yeah I'm playing Xcom Files with BA and I noticed that enemies when they can't see you they either turtle up inside a room on the top floor of a building (really not fun in timed missions) or they just beeline to the nearest corner of the map instead of searching for my units. Do I need to turn omniscience back on for them not to do that?

Maybe when the aliens can't see the player units, the aliens with the leeroy-flag should always scout around without caring while all the ranged units hold their ground?
Title: Re: [SOURCEMOD] Brutal-AI 3.7.2
Post by: Xilmi on February 22, 2023, 09:14:56 pm
The relevant option for that is:
"Charging behaviour for Brutal AI"
Set it to "2".

This makes them look for your units all the time instead of hiding.

Also: Incase you are on version 3.4 or 3.5 you should upgrade to the most recent one (3.7.2) because there was an oversight in them in regards to the behaviour of units with limited range, as it is for most units with UFOExtender:Accurace. They'd act as if they had unlimited range.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.7.4
Post by: Xilmi on March 01, 2023, 12:49:01 pm
So far most changes I made based on Trauson streaming his play for me were supposed to counteract his exploits.
However, I now also realized that he is doing things the AI doesn't do, which would be wise for the AI to copy.

The big thing is how much he blindly tosses explosives everywhere.
Now I won't just let the AI throw grenades to random locations. However, the AI already has a blind-fire algorithm which is supposed to attack locations it was attacked from.

When I looked into it, I found quite some potential for improvement.

Currently it only tracks when it gets hit, completely ignoring shots fired at it that don't hit. Here the player has a big advantage because they will notice the shots and where they come from. Especially when the shots produce trails like they do in TFTD, it's particularly easy to memorize and blind-grenade the locations the shots came from. My idea is to populate the list of blind-shot-targets with any projectile-spawning attack, so the AI can do the same without the requirement of having been hit. This will particularly help against carpet-bombing as everyone who took part in that will get their location marked.

After implementing and testing that, I realized that there was a major-bug in the blind-grenading of the AI! It must have been broken since a long time. They simply wouldn't do it at all anymore! The reason for that was a logical contradiction: The blind-shooting code only considers blind-shooting at units that the AI doesn't know the real location of. Otherwise it would directly attack it. But the explosion-efficacy-code checked whether the units in the explosion radius were known to the AI in order to count them as hits. So logically the score for blindly lobbing a grenade was always 0 and thus didn't happen. Fixing that contradiction will greatly contribute towards the brutality of the AI! I can't really fathom how I didn't realize that this part didn't work at all!

The last thing I noticed was that the AI sometimes didn't seem to use their unit's potential. A unit of them spotted something and attacked itself despite me later learning there were 3 more aliens on the map. When I used debug-mode I noticed that sometimes some of the Aliens just did nothing after their friend spotted something. But that didn't happen all the time. The issue was one of move order and deciding that nothing needs to be done. To fix that I now will "reactivate" all units that have already passed their turn upon discovering a new enemy. So the units that had already passed their turn will see if they should do something about the newly discovered enemies. So in situations where this plays a role, the AI will put quite a bit more pressure on their foes. It's also quite relevant to auto-play, where it was a common occurrence that units in the Skyranger would skip their turn.

Still needs some testing but will likely be out today.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.7.9
Post by: Xilmi on March 10, 2023, 12:25:36 pm
So far I've only advertised this to people who want an even greater challenge than what Superhuman-difficulty provides.

I personally haven't even considered to not use it with that.

However, I got a pretty well known Streamer called "Marbozir" to stream Brutal-OXCE. And after some experimenting he ended up reducing the difficulty-level to "Beginner". Before that he was pretty frustrated and about to give up. But this combination was something he actually enjoyed.

So all in all it goes to show that playing with Brutal-AI doesn't have to be a super-hardcore-challenge but also can just be an interesting alternative.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.8.0
Post by: Xilmi on March 11, 2023, 11:17:21 pm
Updated OXCE-version to 7.8.12.

AI shall no longer preprime grenades, if they would explode in their hands.

Brutal-AI now can pick up all usable weapons instead of only a few ones defined in the respective weapon-pickup-sub-mods. This will help panicking soldiers in auto-play a lot.

AI will now use the path-finding-distance rather than the distance by air to determine what items to go for when they have run out of ammunition.
They will also go for items that they can't reach within one turn.

Fixed an issue that made the AI think it cannot attack from it's current tile when it didn't look into the right direction and thus was forced to walk to another tile and risk reaction-fire instead of just turning.

Fixed an error in auto-play that sometimes prevented units from stopping in their tracks when they spotted an enemy.

AI now takes into account how much cover a tile provides when looking for a location to hide.

Fixed a path-finding issue that allowed orthogonal movement onto tiles that should have been blocking movement.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.9.0
Post by: Xilmi on March 17, 2023, 01:28:21 am
Get ready for an intense and fair fight against the alien invasion with Brutal-OXCE 3.9.0! Our latest update brings major improvements to the non-cheating variant of the AI, allowing for faster and more strategic gameplay without resorting to unfair advantages. With smarter decision-making, better hiding tactics, and more aggressive stances, you'll face a challenging and rewarding battle every step of the way. Plus, enjoy bug fixes and optimizations for a smoother and more enjoyable gaming experience. Don't wait any longer, upgrade to Brutal-OXCE 3.9.0 now and experience the true challenge of defeating the alien menace!

Changelog (3.8.1 - 3.9.0):

When an AI unit determined that it should wait, it now passes what unit it wants to wait for to the overarching process. That process then jumps directly to that unit instead of cycling through all the other units. This saves a lot of time. In a test run with Alien Colony Level one, it brought down the wait-time between turns from 48 to 21 seconds.

Reenabled centering the camera on the next selected unit when waiting in debug-mode as the epilepsy-inducing jumping-around from cycling through all units no longer happens.

Whenever a unit controlled by brutal-AI opens a slide-door, it will stop to reconsider their actions after it sees what opening the door reveals.

When stuck on the outside and without any cover in range, a unit of the AI will go into a more aggressive stance.

AI shall be more willing to hide in a good hiding-spot instead of standing around and doing nothing if it can.

AI will no longer be convinced it shall be able to attack an enemy-unit who's position it has only taken a guess for.

The edge of the map is no longer counted as cover from the respective side as noone will try to attack from outside of the map anyways.

The AI's willingness to peak will now depend on whether it previously was in a good position it can return to after peaking and whether the enemy was recently spotted somewhere in an exposed position.

In combination these changes lead to more of a "lure the player into a trap"-playstyle.

Fixed an issue where units controlled by brutal-AI while using Extender-Accuracy would think their maximum weapon-range is the range they have at the current amount of TUs rather than what it would be if they had full-TUs.

Fixed an issue where non-omniscient AI would not take the possibility of reaction-fire into account when making decisions where to walk.

Fixed an issue where AI would not try to hide at all, if it couldn't hide from all enemies.

When deciding where to go for peaking the AI no longer adds score-modifiers for cover to the tiles being considered as this often could result them to not peak at all when their current location already was the one with the best cover in range.

AI now better at deciding in what direction to look.

Reverted oxceModValidationLevel-default back to be 2.

Units controlled by brutal-AI will no longer automatically end their turn if they have 5 or less time-units.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.9.0
Post by: Xilmi on March 20, 2023, 01:54:32 am
The AI-options-menu now provides a new option instead of the Strafers-option:
Performance optimisation for huge maps

The AI-performance-optimization for huge maps now dynamically adjusts based on map-size and opponent count. It is normalized for maps with a size of 60x60x4 and 30 opponents. For more than that the adjustments kick in and limit the pathfinding-and tile-visibility of the AI.
Note that with hundreds of enemies it will still take a long time but the time and that the path-finding-distance will never drop below what a unit could reach in a single turn. But the time the AI spends on each enemy will be roughly constant leading to a more linear increase in turn-time based on the amount of enemies rather than an exponential one.

Melee-units are now also afraid of proximity-grenades.

Brutal-AI is now treating the isLeeroyJenkins-flag in a way that is much more similar to the originally intended behaviour.
The unit will always try to get into melee-range and not use their ranged weapons offensively even if it can.

In order to get the previous behavior back, there now is a new flag for units that can be used in mods called "isAggressive". This is now what forced units to always move forwards and attack but without restricting what weapons can be used.

Consequentially the option "Charging behaviour for Brutal AI" was changed to "Force aggressive enemy-behaviour" and is a Yes or No-option rather than a range of values.

Brutal-AI units are now no longer afraid of proximity-grenades when they would explode them from the other side of a wall or door before stepping into them.

Fixed an issue causing the omniscient AI not always positioning for an attack when it could.

Removed special handling for doors in positioning-code as that should no longer be necessary and can cause unwanted issues.

Fixed an issue that could cause not turning towards the right target after moving.

Fixed an issue with non-omniscient-AI using the omniscient-algorithm to determine an encircle-tile.

When using the unlimited-waypoints for blaster-like weapons mod, Brutal-AI now will put a waypoint on every tile along the path to increase the accuarcy with attacks of these weapons.

When considering cover the AI now also takes into account what direction it wants the cover from. Not much value in standing next to a wall, when all enemies are on the same side of it.

Cover has more important in the decision-making.

Various tweaks and fixes about peaking-behaviour.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.9.0
Post by: Juku121 on March 20, 2023, 07:57:23 am
...instead of the Strafers-option:
Does that mean strafing and running are no longer bart of BAI? Because removing that option is a good way to cut down on your player base, especially those using melee-heavy mods.

Melee-units are now also afraid of proximity-grenades.
Are proximity grenades actually useful for anything but blocking single-tile doors now?
Title: Re: [SOURCEMOD] Brutal-OXCE 3.9.0
Post by: Xilmi on March 20, 2023, 07:37:19 pm
Does that mean strafing and running are no longer bart of BAI? Because removing that option is a good way to cut down on your player base, especially those using melee-heavy mods.
No, I was referring to the AI-option called "Strafers" which forced flying enemies to not consider heights more than one tile above the ground and was intended to improve turn-performance on bigger maps but actually failed to do so in any measurable way. It has absolutely nothing to do with the "Alternate movement methods"-option.

Are proximity grenades actually useful for anything but blocking single-tile doors now?
My main tester, Trauson, still uses them a lot for exactly that purpose. Restricting enemy-movement to gain map-control and prevent getting flanked. I'm having a bit of an arms-race with him. He shows me how he can exploit the AI, I fix the exploits and he then comes up with new tricks.
For people who are unaware of the exploits and advanced tactical approaches it might indeed look a bit hellish. I've made great progress on the non-cheating-variant too. Before it often kept standing at bad locations after peaking. They now have learned to identify good cover and will usually make a dash for it after checking whether X-Com approaches or not. Proxies can severely impact their ability to peak and thus allows you to get in a good positioin.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.10.0
Post by: Juku121 on March 20, 2023, 07:54:04 pm
OK, my bad then. Sorry for jumping the gun. :-[


I don't really recall maps with notable amounts of single-tile doors that can be used for that purpose. In open maps, the common and relevant ones are UFO exits/entrances. And I've been playing mods where UFOs are more the exception than the rule. Bases have lots of alternative routes and often need several mines to block even one passage. And many urban maps have small houses where it doesn't matter (windows allow them to still shoot you, or the enemies never go there) or big ones with multiple exits.

I mean, if Trauson uses them successfully, there obviously must be a way to use them well, but I have a hard time coming up with one. Are there any publicly available videos of this?
Title: Re: [SOURCEMOD] Brutal-OXCE 3.10.0
Post by: Xilmi on March 20, 2023, 08:32:54 pm
I've tried to convince him to stream on YouTube or twitch again, like he did once before. But mostly he streams directly on Discord to me in a 1:1-session. I'll tell him that there's others too who want to see him play.

He brings like 40 of them to a mission and carpets big parts of the map with them. He basically seals off entire sections.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.10.0
Post by: Juku121 on March 20, 2023, 09:49:22 pm
Hmm, from an XCF point of view, it'd be easier to just mortar such areas, or better yet, nearby cover. Faster and probably also kills some enemies. Or at least their cover. Throwing isn't necessarily very accurate at long ranges due to no LoS penalty. And the maps are bigger, 60x60 and up, frequently lots of building cover as well. Sometimes pretty high buildings, too.

OG 50x50 maps are probably somewhat better suited for this, but I'd appreciate it if you could convince him to share at least a few videos. Would make for some neat promotional material for you, too.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.10.0
Post by: Xilmi on March 21, 2023, 11:25:10 am
I talked to him and said that he shall stream to YouTube in the future so others can watch too. (Live or later)
He said he'll do it tomorrow.

He mostly plays TFTD, which I think uses 60x60 as default-map-sizes.

Your remark about the buildings is definitely correct. On the mostly flat under-water-levels the zoning with the proxies works a lot better than it does in the terror-missions where they often hide inside of buildings.

Also success is relative. He does a little better than I do but usually is forced to restart soon too. At least with the more current version. The video he already has on his channel is from 3.7.something. A lot has changed since then.
Title: Re: [SOURCEMOD] Brutal-OXCE 3.10.0
Post by: Xilmi on March 21, 2023, 10:42:59 pm
Stream will be here:

https://www.youtube.com/watch?v=T0Ydl82-0JU

2023-03-22 at 16 CET
Title: Re: [SOURCEMOD] Brutal-OXCE 3.10.0
Post by: Xilmi on March 26, 2023, 07:30:06 pm
4.0.0:

Massive update to the target- and attack-mode-selection-algorithm.
Instead of just comparing the options at the current position it will now also compare options involving walking towards the target and using weapons at a shorter range with higher accuracy or melee-weapons if available. For that it will subtract the amount of time-units it needs walking over and sees how it impacts the amount of attacks it can do, the additional possibilities, whether it can sneak up or is in vision for reaction-fire and the impact on accuracy.

Certain events cause units controlled by Brutal-AI to weak up again when they had already finished their turn, just in case there's now something to do. This was quite taxing on the turn-time as the entire AI-routine was run again. On big maps with many enemies and large sight-radius this could mean a lot of unneccessary AI-cycles. There now is a sanity-check in place for that where a very minimalist pathfinding-check is done to see if reactivaction could make sense at all. Basically when the unit cannot move anymore anyways and also doesn't have enough TUs for any attack, it will not be woken up again and not run another AI-cycle.

Added a new option in Advanced=>Battlescape called "Strict checking for blockages", which by default is off. This allows compatibility with potentially improperly constructed maps containing BigWalls, where they don't belong at the cost of making deliberate bigwalls orthogonally leaky.

Updated OXCE-base to 7.8.14.

Damage vs. Armor comparisons now take into account what damage-distribution-model (UFO vs. TFTD) is being used.

When deciding where to take cover after peaking, cover is now evaluated relative to the best cover in range rather than any amount of cover being considered sufficient.

Units in sweep-mode no longer care about triggering reaction-fire.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.0.1
Post by: Xilmi on March 30, 2023, 11:15:57 pm
Brutal-OXCE 4.1.0 - Advanced Cover Assessment Update:

The AI's cover-evaluation no longer depends on what "strict checking of blockages"-option is chosen.

Importance of avoiding line of sight to assumed position enemy could reach when walking towards us is now considered much higher when looking for a safe spot to advance to.

When avoiding to stand close to allied units, units that are behind a wall are no longer taken into consideration.

When evaluating the importance of cover from certain directions the distance towards enemies in this direction is now taken into consideration.

When evaluation the importance of cover form certain direction the cover towards the direction 45° to the left and righ to that direction are now factored in with half the amount of cover-score each.

Reworked AI-cover-evaluation to consider blocking of vision and blocking of damage instead of blocking of movement.
So the enemies shall no longer consider stuff like seaweed, windows or trash-can as viable cover.

Differences in elevation now also are taken into consideraton for evaluating cover.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Finnik on March 31, 2023, 11:05:32 am
Probably I missed that, or may be not, but I will ask - have you considered letting the AI use medkits from inventory to heal wounds if any? In many mods, XCF for instance, you ccan deal with enemies by letting them bleed out even if they have a medkit.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Meridian on March 31, 2023, 11:26:33 am
Being able to use a medikit is a nice idea.
Worth implementing.

However, the rationale above is shaky.
Players who slightly hurt an enemy and then wait for 50 turns for them to die are simply "not a representative sample".
It doesn't even really count as a bug, abuse, cheese or exploit... since such gameplay is more detrimental to the player (in game and in real life) than to the AI.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Finnik on March 31, 2023, 11:43:17 am
Yeah, I agree that is cheesing, not a bug any close. But I've seen it on streams and also, TBH, used it in XCF a couple of times - when wounded not very bulky enemy walked away, you can be pretty sure it will stun itself in a several turns.


Although, enemy healing is a kinda frustrating, so it should not happen really often. In turn, it can be a surprise for the player when the enemy decides to heal up instead of shooting.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Juku121 on March 31, 2023, 12:15:40 pm
Players who slightly hurt an enemy and then wait for 50 turns for them to die are simply "not a representative sample".
While that may be technically true, almost every XCF streamer I've seen has used it at some point. So this counter-argument is also shaky. :P
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Meridian on March 31, 2023, 12:45:23 pm
While that may be technically true, almost every XCF streamer I've seen has used it at some point. So this counter-argument is also shaky. :P

Yes, almost every XCF streamer I've seen used this at some point as well.
Out of curiosity, or frustration.

And it didn't work, because they couldn't afford to wait 50 turns.

So this counter-counter-argument is also shaky :P
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Solarius Scorch on March 31, 2023, 01:48:14 pm
Can we just agree that seeing enemies - and more importantly, civilians! - using medikits to help one another is nice? :)

Bonus points if an X-Com soldier can walk up to a civilian doctor and expect to be healed...
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Nord on March 31, 2023, 04:28:19 pm
AI units using healing is quite immersive. Remember though, the example of Afterlight, where one wounded reticulan leads to all his friends to swap guns to medikits, leaving them all defenseless.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Xilmi on April 01, 2023, 02:28:58 am
Probably I missed that, or may be not, but I will ask - have you considered letting the AI use medkits from inventory to heal wounds if any? In many mods, XCF for instance, you ccan deal with enemies by letting them bleed out even if they have a medkit.
Not yet. It's not that high on my todo-list. But I guess I'll eventually get to it.
Would also be nice for auto-play.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.1
Post by: Xilmi on April 01, 2023, 02:33:30 am
Brutal-OXCE 4.1.1 - Omniscient AI Enhancement Patch

Fixed an issue where enemy thought it could attack around a corner in melee-range when it couldn't because it had no melee-weapon.

Units in sweep-mode will once again be allowed to hide if they don't have enough TUs to attack anymore.

Fixed an issue that could cause AI to skip the rest of their turn instead of taking cover.

Fixed that AI would think it just needs to turn towards their target despite not having a line of fire.

Omniscient AI no longer assumes that it will be able to attack everything it has a line of fire to. This could lead to them standing out of position when the player used smoke-grenades.

AI now will assume that it will be able to see a unit when it is at minimum range to it.

The peaking-logic now works the same for omniscient and non-cheating-AI.

Fixed an issue with omniscient AI not being omniscient when it comes to knowing whether an enemy was out of position.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.1
Post by: human being on April 01, 2023, 05:59:55 am
I'm playing this with xfiles and half the zombies are just hiding and running away when I come close.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Vakrug on April 01, 2023, 12:27:29 pm
Can we just agree that seeing enemies  using medikits to help one another is nice? :)
No, absolutely not! I saw that in Phoenix Point. In 99% cases enemy using medikit is an (another) act of suicide. And after seeing it more then 10 times it is even no longer amusing. AI in XCOM is not even closely smart to use medikits effectively. Just like "close quarter combat" mechanics is always beneficial to a player, enemy using medikit also will be.
- and more importantly, civilians! -
Only doctor civilians. And those doctors should heal any humanoids, not just player units.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.1
Post by: Xilmi on April 01, 2023, 06:21:24 pm
I'm playing this with xfiles and half the zombies are just hiding and running away when I come close.
Thanks for the report!

This was not intentional. Since the Zombies use the isLeeroyJenkins-Flag, they should indeed always be moving forward. It's fixed in:

Brutal-OXCE 4.1.2 - Zombie Fix Patch

Updated base to OXCE 7.8.15.

AI now also watches the energy of their units when peaking as to not get stranded out of position due to a lack of it.

Fixed a recently introduced issue leading to the isLeeroyJenking-flag no longer leading to units always acting aggressively.

Now using the armor of a blockage in order to tell whether walking into a proximity-mine should be save or not.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.0
Post by: Xilmi on April 01, 2023, 06:31:37 pm
AI in XCOM is not even closely smart to use medikits effectively.
Well, one of the reasons why I didn't already do it is because in order to do it effectively, there would have to be made a lot of situational considerations.

It's not just "when someone is wounded, try to get close to it and use the medikit."

If they are still near a fight it might very often be the better idea to participate in it and only do the treatment when the threat is gone.

Also the wounded unit and the healer need to coordinate where they do the treatement.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.2
Post by: haja0011 on April 01, 2023, 08:00:17 pm
Nice mod. I watched some Streams from Marbozir and another guy. The AI is now very powerful.
But in terror missions the civilians have no chance. Is it possible to enhance their behavior as well to hide?
So that it is more likely to rescue some? Maybe as option or so?

Regards
Jan
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.2
Post by: Xilmi on April 01, 2023, 10:34:49 pm
and another guy
Do you know whom and/or what it was? I wanna see the vod. :D

Also about the civilians: There is an option for letting Brutal-AI control the neutrals. This should make them try to hide but they don't know about running towards X-com. The logic also has to support stuff like when they are a third allied faction, as it happens in WH40k-mod, for example or some other mods, where they start with weapons.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.2
Post by: Vakrug on April 01, 2023, 11:35:33 pm
This should make them try to hide but they don't know about running towards X-com.
Some of them are smart enough to climb X-COM vehicle, grab the biggest gun they find (including those that took month for brightest minds of the planet to figure out how to fire), then try to shoot an alien just to hit one of X-COM operatives in the back. On the positive side, after the end of the mission that gun don't registered as stolen.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.2
Post by: Xilmi on April 04, 2023, 11:25:12 am
Yeah, bringing some extra-weapons to distribute them to the civilians is something that you can do, if Brutal-AI for neutrals is enabled. Deliberately or not. :D

What I'm working on right now is "carefully progressing". This will mainly be an improvement for the auto-play-AI but the aliens shall also have some benefit from it.

It consists of an enforced investment into peaking while saving 25% of the available movement resources (TUs and Energy) and if nothing is found spend the rest of the TUs for getting in the position with the best cover.

This also required me to do some energy-management. Where they won't do peaking if the energy is too low and they are in a save position. This currently has the issue that they then sometimes go backwards to where they came from last turn as the best cover is now there. So units with low stamina are not really progressing. So if they think their position was "safe enough" to recover energy they also should skip the get to best cover-part.

For the enemies, this new technique shall replace the ON/OFF-flipping of the sweep-mode by having a dynamic ratio of moving forward vs. saving TUs for hiding. The sweep-mode was a bit too extreme in how much they'd expose themselves. So having something that ramps up more smoothly and only acts like the sweepmode, when the enemies morale is completely broken and they are basically guaranteed to panic seems better.

However, during my tests I found one big issue with peaking in general: If it doesn't reveal anything new because your friends already peaked into the same area, it's just a waste of TUs and energy, that could have been used for reaction-fire. For example, when breaching an UFO-entrance right now and hiding from them that they won't see you when they open the door, you can mostly count on everyone in the entry-hall of having no TUs for reaction-fire. Because all of them probably peaked to the door and then went back to a better spot. It's not peaking in general that is useless but peaking something that has been peaked at in the same turn by someone else. So I need to find a way of how a unit can identify whether someone else has already peaked the same stuff they are about to peak and if so stop them in their tracks. This won't be easy but I think it's worth the effort.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.2
Post by: Xilmi on April 05, 2023, 11:14:42 am
I got the "will my peaking reveal anything I don't already know?"-mechanism to work yesterday.

However, it's a bit contradicting the goals of the abolishment of sweep-mode. When a higher ratio of peaking vs. hiding is a way to advance but peaking can be discarded alltogether, then units will move forwards more in piecemeal instead of a combined effort.

I think that when the AI is already aware of at least one unit or has the conditions that previously triggered sweep-mode, it's mode of operation shall be one that is more advance-friendly.

Not only should it spend the peaking-TUs for moving forward, it should also not put so much weight into cover, that it'll go back to where it was before. Like it should have a much lower threshold for how good the cover needs to be compared to how it values being closer to the enemy. Maybe I can use the same morale-ratio as a multiplier for the cover-quality-requirements.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.1.2
Post by: Xilmi on April 05, 2023, 09:59:40 pm
Brutal-OXCE 4.2.0 - Combat AI Enhancement Patch

Fixed an issue that could make the game lock up during auto-play.

AI is now able to determine whether expending the TUs for peaking is a worthwhile investment depending on whether it would actually reveal something new.

AI now can decide to move forwards even without being able to discover anything new, when some of their units are already engaged in combat or in the situation where it earlier would have gone into sweep-mode.

AI will no longer refrain from peaking based on the maximum range of their weapons based on their current TUs but based on what it would be if it had full TUs.

Instead of sweep-mode being a hard on/off-switch the AI becomes gradually more willing to move forward faster as it gains a morale-advantage. It will usually still try to find some cover.

Non-aggressive-forced auto-play-AI has a fixed value of how much it wants to spend on moving forward vs. saving to hide. It will also always consider being in combat as to not leave units behind.

AI will now take their energy into account when it considers peaking and rather not do it, if the energy is too low.

AI will now move in to attack instead of pre-priming a grenade if it can attack.

Fixed an issue where AI would not always turn towards a door it wants to open.

Melee-units now take potential reaction-fire into account too and might refrain from peaking. It should not prevent them from trying to move in for a kill though.

When trying to hide always prefer locations with cover over those without and where the enemy couldn't reach.

The regular cover-seeking score which is usually used to get into some cover after moving forwards and not finding anything to attack will now prefer to conserve TUs and no longer has redundant score-modifiers.

AI shall more actively try to avoid standing in the blast-radius of its own grenades or in fire.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.0
Post by: panzer on April 11, 2023, 06:35:26 pm
This is a really cool AI improvement. Now every fight is a real challenge)))
The only bad thing is that AI rarely ambush and
reserve TU for return fire.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.0
Post by: Xilmi on April 13, 2023, 11:08:33 am
This is a really cool AI improvement. Now every fight is a real challenge)))
The only bad thing is that AI rarely ambush and
reserve TU for return fire.
Can you elaborate what your understanding of an ambush is? According to my own understanding of the word, I'd say that the AI in 4.2.0 definitely does this.
The basic idea is that if they attack the player too close to the Skyranger or other starting-zone, the player might just flee or in case of the Triton be tempted to use the invulnerable cover of it to their advantage.
So what they do is to use the information of whether a unit was spotted far enough away from the starting area that it shouldn't be able to get back to it within one turn. If not and they also don't see anyone currently, they'll try to make more space between themselves and the starting-zone. Then they wait for contact somewhere and reevaluate. If they find units exposed far away from where they start, they shall try to attack it and will even hunt them down. That's my understanding of an ambush.

When it comes to reserving TUs for reaction fire it is important to realize that there's a game-mechanic called "mutual surprise". It means that when two units see each other at the same time, the one who's turn it is always gets to decide on what to do first regardless of reaction-score. You basically need to see the other unit spending TUs in order to react, not just spot them. When the player knows about that, there's quite a bunch of ways of avoiding reaction-fire. Like avoiding night-missions where the aliens have a sight-range-advantage, always covering your path with smoke-grenades and using the 45° cornering-technique. Therefore having the AI rely on reaction-fire would make it overall weaker. I took some measures to make it preserve TUs if spending them would serve no purpose so there should be cases where reaction-fire happens. But also cases where you'll get the first shot due to the mutual-surprise-mechanic despite them having enough reaction-score.

Note that the AI is also aware of mutual-surprise on it's own turn. It'll not consider a path as dangerous in regards to reaction-fire unless it passes through two watched over tiles in a row.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.0
Post by: panzer on April 15, 2023, 09:15:21 pm


When it comes to reserving TUs for reaction fire it is important to realize that there's a game-mechanic called "mutual surprise". It means that when two units see each other at the same time, the one who's turn it is always gets to decide on what to do first regardless of reaction-score. You basically need to see the other unit spending TUs in order to react, not just spot them. When the player knows about that, there's quite a bunch of ways of avoiding reaction-fire. Like avoiding night-missions where the aliens have a sight-range-advantage, always covering your path with smoke-grenades and using the 45° cornering-technique. Therefore having the AI rely on reaction-fire would make it overall weaker. I took some measures to make it preserve TUs if spending them would serve no purpose so there should be cases where reaction-fire happens. But also cases where you'll get the first shot due to the mutual-surprise-mechanic despite them having enough reaction-score.

Note that the AI is also aware of mutual-surprise on it's own turn. It'll not consider a path as dangerous in regards to reaction-fire unless it passes through two watched over tiles in a row.
Thanks for the answer and clarification. But gosh, it's a lot harder than I thought.)
The fact is that I play The X-Com Files, there are a lot of corridor maps. Enemies, knowing/guessing that my agent is around the corner, instead of entering the line of fire and reserve AP, they prefer maximum rapprochement and eventually die from a point-blank shot without action points.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.0
Post by: Xilmi on April 16, 2023, 02:25:42 am
The fact is that I play The X-Com Files, there are a lot of corridor maps. Enemies, knowing/guessing that my agent is around the corner, instead of entering the line of fire and reserve AP, they prefer maximum rapprochement and eventually die from a point-blank shot without action points.
I'm not quite sure I fully understand the situation. Would really be nice to see some footage of what is happening so I can analyze it better. Or maybe a savegame that showcases what you mean.
The enemies get into line of fire and then get close to you but don't attack anymore so you can then shoot them on their turn?
Are those melee-enemies? Or enemies with very short-ranged weapons? Or enemies with impaired vision?
I'm not quite sure why they wouldn't either attack you immediately when they have line of fire or at least only get close enough until they get a better chance to hit.
Note that enemies, that are flagged as "isLeeroyJenkins" in the mod will alway try to get into melee-range, no matter what.

But I'd definitely need more information to determine whether what you are talking about is intentional and or how it should be imroved.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.3
Post by: SIMON BAILIE on April 16, 2023, 08:39:01 pm
Is there a problem with v 4.2.3 as when I equip a craft it is showing equipment on the troop screen at base that according to the first picture isn't aboard. Doesn't happen with v 4.2.2-see attached screenshots.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.3
Post by: Xilmi on April 16, 2023, 10:47:36 pm
Is there a problem with v 4.2.3 as when I equip a craft it is showing equipment on the troop screen at base that according to the first picture isn't aboard. Doesn't happen with v 4.2.2-see attached screenshots.
This is a new feature inherited from OXCE 7.8.18:

This is from the commit from @Meridian:

"https://openxcom.org/forum/index.php/topic,10998.0.html

When using `oxceAlternateCraftEquipmentManagement`,
entering the inventory screen from a craft will now show
all available equipment in the base.
Changes made in the soldier's inventory are then used to update
the items loaded on the craft, so that the craft has
all of the soldiers' items
(as well as any unequipped items already loaded onto the craft).

Previously, entering the inventory screen from a craft would show
only the items that were already on-board the craft, and changes
made to soldiers inventory would not affect the items on the craft."

I haven't really tested it myself. But it really sounds exactly like what you just said. So I guess it's working as intended.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.3
Post by: SIMON BAILIE on April 16, 2023, 10:58:52 pm
Thanks for the info, btw can this feature be knocked off?
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.3
Post by: Xilmi on April 16, 2023, 11:05:36 pm
Thanks for the info, btw can this feature be knocked off?
It's tied to this option in the menu:
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.3
Post by: SIMON BAILIE on April 16, 2023, 11:22:41 pm
Understand now.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.3.0
Post by: Xilmi on April 21, 2023, 08:36:31 pm
Brutal-OXCE 4.3.0

The movement-logic of the AI has been largly reorganized.
The only thing that still works like before is how the AI positions itself to attack units it spotted in the current turn.
The second priority is now to move towards the closest full cover to the enemy, that the enemy cannot reach during its turn. For non-omniscient this is based on the assumption where the enemy is. An exception to that is when the unit already is at the closest full-cover position. It will then not relocate to a position further away.
Peaking has been vastly reduced in range to preserve more TUs for reaction fire. When a unit already is in the closest cover then moving one tile to peak and then back to the cover should be enough.
Fleeing will only be done when no adequate cover can be found.

The algorithm that makes assumptions about where an enemy could have moved to, when the tile it was assumed to be at is confirmed to not contain the enemy was updated to avoid vastly implausible results. It's now simply the tile closest to the previous location that wasn't explored in the current turn.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.3.0
Post by: Xilmi on April 25, 2023, 02:24:12 pm
Just want to write down some thoughts in order to not having to keep it all in my head for later:

Previously "peaking" worked as "walking towards a position where an enemy is assumed to be".
While working on the next version I have now split "peaking" into three different behaviors that are supposed to be used according to the situation.

The previous version of peaking will only be used when an enemy is assumed to be in nearby smoke.
If this is not the case, then peaking could be going to the closest tile from where a line of sight can be established to the assumed position of the enemy.
If no line of sight can be established then peaking means going to the closest position along the path towards the alleged opponent from where there is a line of sight to the first tile that is no longer in line of sight to the original position.

These two new peaking methods require way fewer TUs than enforcing the anti-smoke-grenade way of peaking when it's not necessary.

Another thing that now is possible is categorizing cover-quality. If I have extended the cover-detection-method in a way that makes it only return cover based on a requested cover-quality-level.
I can now differentiate 4 different tiers of cover quality.
S-Tier-cover: There is vision-blocking cover towards all directions and the adjacent directions to these where enemies are expected to be. On top of that a roof is above the units head.
A-Tier-cover: There is vision-blocking cover towards all directions and the adjacent directions to these where enemies are expected to be.
B-Tier-cover: There is vision-blocking cover towards all directions where enemies are expected to be.
C-Tier-cover: There is cover to at least some direction where enemies are expected to be. It doesn't need to be vision-blocking.

The current implementation, lets call it 4.4.0 beta, does not fully make use of these possibilities yet.

It's first priority is still to position itself to attack a known enemy. Then go to the closest tile towards the suspected enemy that is still B-Tier-cover, then C-Tier-cover. If already in such position and at full TU peak according to the above new peaking-rules. If nothing applies, it would use a flee-logic which seeks for a compromise of increasing distance to the enemy and improving cover.

At least two of these things have looked "dumb" in testing. The running away. This should only be done if the unit finds itself exposed. Otherwise, if none of the other things apply, just staying where you are might be good enough.
The other was to always prioritize going to the closest to the enemy cover before considering peaking. If you do end up spending the full 50% of TUs on peaking, it's of course bad to peak and then go back to cover where you will have no TUs for reaction-fire anymore. However, the new peaking-methods may mean to only spend 4 TUs on it unless the enemy is in smoke, where you are much better off finding them on your turn.

So reversing the priorities when the unit starts their turn in B or better cover seems reasonable. It would still be guaranteed that it ends up in this kind of cover after peaking.

Other than that: Closed doors should probably not be considered as cover since when someone opens them there's no chance for reaction-fire.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.0
Post by: panzer on April 27, 2023, 03:30:25 pm
I'm not quite sure I fully understand the situation. Would really be nice to see some footage of what is happening so I can analyze it better. Or maybe a savegame that showcases what you mean.
The enemies get into line of fire and then get close to you but don't attack anymore so you can then shoot them on their turn?
Are those melee-enemies? Or enemies with very short-ranged weapons? Or enemies with impaired vision?
I'm not quite sure why they wouldn't either attack you immediately when they have line of fire or at least only get close enough until they get a better chance to hit.
Note that enemies, that are flagged as "isLeeroyJenkins" in the mod will alway try to get into melee-range, no matter what.

But I'd definitely need more information to determine whether what you are talking about is intentional and or how it should be imroved.
Thanks for the answer, after updating Brutal-OXCE everything was fine  :)
Here are some more questions.
1) Why do some aliens, especially those with high TUs, prefer hand-to-hand combat to shooting. Where the enemy could easily kill my agent with plasma, he runs up and starts hitting him to no avail. mod The X-Com Files. "isLeeroyJenkins" disabled
2)Will there be a change in the mechanics of Mutual Surprise in Brutal-OXCE?
3)Will new Reaction fire triggers be added to the OXCE mechanic? For example, what would the enemies react to the opening of the door. In the original, it was impossible to open the door without entering it. In OXCE, you can, but there is no reaction fire after opening the door, which means that the fight is simplified, since enemies rarely and completely accidentally use this mechanic.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.0
Post by: Meridian on April 27, 2023, 04:48:57 pm
3)Will some Reaction fire triggers removed from OXCE like opening a door, etc. be brought back?

OXCE did not remove any reaction fire triggers.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.0
Post by: panzer on April 28, 2023, 12:41:13 am
OXCE did not remove any reaction fire triggers.
Google translate is as bad as it was in 2015. sorry) I didn't mean it.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.0
Post by: Xilmi on April 28, 2023, 11:09:21 am
Google translate is as bad as it was in 2015. sorry) I didn't mean it.
I recommend using ChatGPT or other AI-based alternatives for translations. So far I was really pleased with it's translation-results when it comes to preserving the meaning.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.2.0
Post by: Xilmi on April 28, 2023, 11:30:17 am
1) Why do some aliens, especially those with high TUs, prefer hand-to-hand combat to shooting. Where the enemy could easily kill my agent with plasma, he runs up and starts hitting him to no avail. mod The X-Com Files. "isLeeroyJenkins" disabled
2)Will there be a change in the mechanics of Mutual Surprise in Brutal-OXCE?
3)Will new Reaction fire triggers be added to the OXCE mechanic? For example, what would the enemies react to the opening of the door. In the original, it was impossible to open the door without entering it. In OXCE, you can, but there is no reaction fire after opening the door, which means that the fight is simplified, since enemies rarely and completely accidentally use this mechanic.
1) The enemy thinks that it will do more damage by walking up and pummeling you. If it is wrong about this, then I suspect that this is based on miscalculating the melee-damage. Probably due to some anti-melee-armor-modifiers. Stuff like this is not really taken into account currently as it wasn't brought to my attention yet that this is an issue. My AI treats all damage the same currently, which obviously is not okay. I definitely shall look into that. Can you provide a save-game or give me more details about the situation as in: What weapons did the enemy have and what kind of armor did your agent wear?

2) No I don't plan to modify game-mechanics.

3) I get your point. However, if right-click opening didn't work or would trigger reaction-fire too, then camping doors would become a really good tactic for the aliens to use again. I don't think that shifting the balance in a way to punish the active side and reward the passive side is an overall good idea.

I'd rather shift the alien's behavior to be more proactive. 4.4.1 actually isn't great in this aspect. It's actually pretty bad. I've identified some issues where the AI likes their cover way too much and becomes both annoying to play against because it hides so much and also becomes less of a threat because their chance of finding you is so low.

My current plan is to replace the entire cover-mechanic by a prediction of whether the enemy can reveal them at the locations they take into consideration to go to. Then they don't have to hug the walls all the time and become less predictable and more willing to reposition.

The behavior when they don't have an attacking-opportunity already should become:

1. Peak
2. Go to the closest location where they can't be discovered
3. If 2 is not possible, go to the closest location where they aren't visible to the enemies current assumed positions.
4. If 3 is not possible, get closer to the enemy.

Of course, if peaking reveals something they shall adapt to that and prioritize attacking it over the other options.

Edit: I added this line in the damage estimation-formula that the AI uses to decide which kind of attack to use.

damage *= target->getArmor()->getDamageModifier(action->weapon->getRules()->getDamageType()->ResistType);

My hopes are that this will make them notice when melee-attacks would be comparatively inefficient. I'd still like a savegame where that would be relevant for testing.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.4.0
Post by: Xilmi on April 29, 2023, 10:48:13 pm
The new version shall fix this issue, among other things. Relevant part is highlighted.

Brutal-OXCE 5.0.0 - Predictive Tactics

Updated to OXCE 7.9.0.

AI no longer goes into sweep-mode based on low player-morale. It was too arbitrary, too gamey and ruined the comparability of my benchmark-tests.

The AI now creates a map of all possibilites where its enemies could go to based on the locations where they are assumed to be. Or actually are, if you play with omniscience. This is cached within the BattleUnit-class so all AI-agents can access this information and only update it when the situation changes.

When deciding where to move, the AI then uses these locations to emulate whether the tile it wants to go to would be within line of sight.

This new mechanism replaces the previous cover-system completely with some massive advantages. Most notably that it doesn't require the presence of walls or big objects facing the right directions to safely advance towards the player's position.

There's still different cover-quality-levels that it will fall back to if no entirely unspottable location can be found. Then 2nd best Tier of cover is a location that has no line of sight to the unit and not line of sigt to the first point the unit doesn't see on it's path towards the player's unit. The 3rd best tier of cover is simply avoid being in line of sight of the current location.

When a unit is "in combat", it's teammates will lower the cover-quality they are going for to the lowest one. This way the AI won't just leave some of their units to die while others keep hiding.

Damage-type and resistences are now taken into account by the AI for what weapon it chooses to attack with, when it has several options.

Fixed an issue in the algorithm that updated the assumption about where an enemy unit might have gone when it was confirmed not to be where it was expected. Previously it would take the closest unscouted location to the unit that notices the player-unit not being where it's supposed to be. Now it properly uses the closest (by pathfinding) unscouted location from the units previously assumed location. This will create much better scouting-patterns and also hugely impacts the quality of the cover choses based on the assumptions where the enemy units could be.

The AI's check whether there's a line of sight between two tiles will now use the respective tiles above when the height of the unit added to the height of the terrain exceeds the height of the tile. This prevents the AI from considering slopes that make them peak out as cover with the new mechanism.
Title: Re: [SOURCEMOD] Brutal-OXCE 4.4.0
Post by: Abyss on May 03, 2023, 01:57:12 pm
The AI's check whether there's a line of sight between two tiles will now use the respective tiles above when the height of the unit added to the height of the terrain exceeds the height of the tile. This prevents the AI from considering slopes that make them peak out as cover with the new mechanism.

First of all, I would like to mention you did the tremendously great job, as the idea of AI improvement has been floating around for merely a decade.
Second, thank you so much for putting efforts into overhaul of annoying sniper/spotter mechanism.

I really want to put the couple of thoughts that were visiting me while I was reading the forum sections you created, and I have read it all, because you are not only passionate developer, but also very neat in explaining the reasons behind your solutions.   

1. When it comes to AI efficiency, it is clearly good that it has such advance in decision making.
The troubling part is: the game is not always about the hell chess with superior forces, that are, clearly, outnumber your troops in 99% of cases. The game is also about feels, joy, and satisfaction with progress and story.
One particular example is when you assault human-enemy bases in XCF with troop ratio of 24:200 (Superhuman difficulty gives x2 boost of enemy spawn) and perform the f**king MASSACRE of both aliens and their human supporters.

Roughly, anyone believes that gameplay with basic AI if/else logic is limited to camping and abusing of AI limitations, but what about the fun part? These missions are very fun and satisfying in terms of enemy numbers.

2. The mods economies and progresses are largely dependent on possessions that player acquires from battlefield. Thus, in many cases, reducing amount of enemies is discouraged in terms of potential gameplay progress. Example is not only the item sell values, but also experience and stat boosts that player troops gain from missions with lots of enemies.
Most of the mods have player units transformation mechanics, which are vital for the progress. These mechanics allow player to extend the troops abilities behind some point of training. 90% of troops training comes from battlefield.

This also includes doubled chances of capturing mid-tier enemies, as their numbers are also quite frequently doubled, and killing one doesn't mean losing the mission purpose. Please notice, the amount of such missions is 40-50% in earlygame to 25% in midgame in XCF and X-Piratez, from overall value.

3. Most of the OXCE players don't play vanilla, but rather play X-Piratez, XCF or WH40k and other mods that are thoroughly (by years of creation) balanced with basic AI. I.e. unit stats, armors, weapon stats, etc.

4. a Little note about enemies avoiding primed sensor grenades and landmines: is it fair to cut off a player from such a tool? These items were implemented intentionally, for the purpose of enemies to freaking BLOW UP on them.

5. I have overall impression that your AI forces the player to tank more, have better Armor&Guns, have better stats (better night vision etc.), which is fairly impossible in XCF, for example, because events in the early to mid game are more or less incremental over your current progress.
   
6. The reaction fire is one of the classic mechanics and it is also refers more to the joy/excitement/gambling part of the game. Oh, yes, these mods contain such many gambling with probabilities deep in skin of players (not only in battlefield). The major of players are gambling maniacs. While giving new gambling mechanics, please not cut the established ones. The joy of running before the cyberdisc that can oneshot your unit with plasma (or not) is existential. The joy of killing it with autofire from machinegun (or not, and then get the plasma in the face) has purely gambling mechanic. Please consider it.

7. There was a suggestion about mixing behaviors in battlefield, i.e. assigning random roles. That was pretty neat suggestion, IMHO.

Such things translated, I hope to hear your thoughts on the topics. Preferably, please avoid answer "don't like - don't play", as many developers here simultaneously use it. I am really encouraged with your work.

With all respect,
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Xilmi on May 04, 2023, 12:05:10 am
Not really sure what to say to this.

I think your post could be summarized as: "The most popular OXCE-mods X-Com-Files and X-Piratez are not balanced to be playable with Brutal AI. Especially not, when you want to fight against the same enemy-numbers as on Superhuman."

I'd say all your poinds are kinda valid but I wouldn't really know what to do about it within the scope of my project.

I can recommend to using the easiest settings of Brutal-AI, of which I have attached a screenshot.

An option for the AI not to avoid proximity-grenades is probably a good idea.

I didn't change anything about how reaction-fire works. Except that the AI doesn't really like to walk through your line of fire, when it doesn't have to.

Mixing AIs is something that already can be done on the modding side. There it could be deliberately assigned to certain units.

It would also be possible to assign it to some but not all aliens via an option.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Abyss on May 04, 2023, 12:05:51 pm
Thank you for your kind reply, and thank you for the suggestion of options to set.

I'd say all your poinds are kinda valid but I wouldn't really know what to do about it within the scope of my project.

I didn't change anything about how reaction-fire works. Except that the AI doesn't really like to walk through your line of fire, when it doesn't have to.

I am sure that modders will, little by little, shift towards your solution. Think of smooth implementation without total rebalance of mods to ensure each mission isn't masochistic chess in case your troops aren't over-armored terminators.
Remember, the fun part is vital for the gameplay.

What can be fun? AI also makes mistakes!
- Low-tier and middle-tier enemies occasionally miscalculate hit chances and use autofire instead of aimed fire. Or forget to prime grenades before toss. Or blow themselves.
- Enemies occasionally switch the strategies mid-battle (berserk, flee, covering after other enemies)
- Enemies split to squads implementing different strategies: some flank, some suppress, some try actually to kill, and some being degenerates (running around and yelling/ trying to steal stuff from craft/ running for better weapon/ meat-shielding high-tier units/ grouping at no purpose/ not getting orders). The AI, in this case, does not coordinate the actions of all units at once, but coordinates the actions of teams of 2-[put your amount] units
- During night missions AI skips the death of it's unit (chance of silent kill). More likely, for kills with melee weapons in case of no reaction fire.
- Some units lag some turns before getting into action consideration (each turn by vanilla is 6-8 seconds of real time), mean they behavior is sort of vanilla/routine.
- Enemies sometimes also want to stun your troops and perform non-lethal strikes with possible ways (stun launcher, but if they barefist then so be it).

All this can shift balance a bit back to the player while AI still performs non-vanilla.

With all respect,

P.S. Also, I would like you to consider specific example: strong enemy unit being invisible past certain amount of cells (like high-tier ninjas from XCF are invisible past 4 cells), that possess both strong ranged and melee attacks. Even with vanilla AI they were quite a nuisance, but now...
Thank you for consideration to enable proximity grenades and landmines again.



Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Solarius Scorch on May 04, 2023, 12:31:17 pm
I am sure that modders will, little by little, shift towards your solution. Think of smooth implementation without total rebalance of mods to ensure each mission isn't masochistic chess in case your troops aren't over-armored terminators.

Yeah sure, balancing a mod to fit two different set of rules is the natural and totally doable solution...
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Juku121 on May 04, 2023, 01:37:27 pm
Nah, Abyss is just certain that you and other modders will see the light and convert to BAI on the spot. There is no need to support two sets of AI rules when one of them is clearly superior! :P


More seriously, that's the work modders may or may not do, and if not there might or might not be others who make submods or BAI compatibility patches. We'll see. OXC wasn't coded over a winter break, either.


Most of these suggestions are IMO beyond the scope of Brutal AI. Yes, it'd be nice to have a reactive and nuanced AI. Or one tailored to a mod's story arcs, even. But it's a much bigger task to make one than it is to create a 'merely' competitive AI.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Solarius Scorch on May 04, 2023, 01:42:03 pm
Nah, Abyss is just certain that you and other modders will see the light and convert to BAI on the spot. There is no need to support two sets of AI rules when one of them is clearly superior! :P

You know, anything's possible, depending on how OXCE development and BAI development progresses. But right now there are no such plans, the BAI project is not mature enough and the direction of its future development is uncertain. Also, Meridian and Yankes are so great at developing and maintaining the OXCE engine that jumping over to a different branch would be way too risky right now.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Xilmi on May 04, 2023, 01:56:32 pm
Yeah sure, balancing a mod to fit two different set of rules is the natural and totally doable solution...
Agreed. And I personally don't even see the necessity for it.
People seem to forget that there's difficulty-levels and that you don't have to play on Superhuman.

For example 14SilverX plays Hardmode Expansion with Brutal AI but on "Experienced" difficulty. Marbozir did vanilla with Brutal-AI on "Beginner". The lower stats and numbers of the aliens, as well has the bigger leeway in terms of necessary score make it all look kinda doable.

I see no need to compromise the AI by coming up with strange ways of making it less capable and I also see no need to rebalance or make alternative versions of the mods, when lowering the difficulty-level could totally solve the issue.

Sure, you won't get Superhuman enemy-numbers on lower difficulty-levels. But at some point you have to compromise. You can't have smart enemies with dangerous stats in high numbers and still expect to massacre them just the same as when they weren't smart. Making them "a little smarter but not enough to have an impact on how many you can handle" is not really aligned with my design-goals.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Xilmi on May 04, 2023, 02:31:19 pm
Nah, Abyss is just certain that you and other modders will see the light and convert to BAI on the spot. There is no need to support two sets of AI rules when one of them is clearly superior! :P
For me this is a strange consideration anyways. I'd say which engine to use is for the player to decide and not the modder. My engine identifies as OXCE when it comes to compatibility-checks with mods and I don't intend to change that.

I have added some modding-features based on requests but this was neither my original intention nor do I think it's a path I'd like to pursue much further.

The basic idea was the AI to be an option from the options-menu and not something that has all that much to do with modding. If you use Brutal-OXCE and disable the "Brutal AI"-option, the AI should behave the same as it does in OXCE.

As I just said. I think neither changes to the AI nor to the mods are required. If the mod is too hard with Brutal-AI on Superhuman, just don't play on Superhuman. No need to bother either the modder or the AI-developer to somehow make changes so that you can beat the mod on Superhuman.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Solarius Scorch on May 04, 2023, 02:49:17 pm
For me this is a strange consideration anyways. I'd say which engine to use is for the player to decide and not the modder.

Yes! This should be stated more often. :)
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Abyss on May 04, 2023, 03:47:27 pm
As I just said. I think neither changes to the AI nor to the mods are required. If the mod is too hard with Brutal-AI on Superhuman, just don't play on Superhuman. No need to bother either the modder or the AI-developer to somehow make changes so that you can beat the mod on Superhuman.
Hi, Xilmi! Thank you for the answers!

That's what I considered when begged to, preferably, avoid "don't like - don't play" sort of answers.

I have to clarify the intentions: my posts were about considering keeping fun part VS ensuring AI beat player.
OpenXCOM is not all about perfect tactics of AI, it's about how player perceives the visible part of the battlefield: intrigue, terror, suspense, decision forks and weird situations you troops get into. The latter are truly best part of the game. It has the huge amount of roleplay and gambling, also.

IMHO, true entertaining, deviant AI may have serious advantages from the player's perspective, than ass-kicking AI.

Maybe one time you'll see that some of these features may entertain you as well.
Brutally-Deviant AI.

As for realism of massacre: massacre is the part of the game. Most of missions will lose it's charm without some 2-10x coefficient of enemy units. 

And, finally, I am really sorry to put all this here now, when major of work has been done and some pivot-moments are long past.   

Yeah sure, balancing a mod to fit two different set of rules is the natural and totally doable solution...
Hi Sol, Juku121 is right in transcription of my thoughts.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Xilmi on May 04, 2023, 08:45:06 pm
I'm still not really sure what you actually want.

It just seems contradictory to me.

On one hand you seem to want an AI, that allows you to massacre them while totally outnumbered without too much resistence and on the other hand you also want them to be smarter.

You could considere the "Force aggressive enemy behaviour"-option as an intermediate-option. One where they are not as easy to deal with as the base AI but also no tactical-geniuses and cover-seeking-experts either.

Putting in all sorts of arbitrary artificial stupidity like throwing unprimed grenades or randomly running around is not really within the scope of my project.

The game is open-source-though. So if you want to customize it to your own specific desires, feel free to fork. This is exactly what I also did. I didn't like it the way it was, so I'm now trying to make it the way I like it. If others like it too, then that's a nice bonus. But I don't really want to put in a lot of effort to fulfill some vaguely formulated design-goals that only have very subjective ways of quantifyability.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: kevL on May 04, 2023, 09:09:55 pm
heya, I'm not seriously suggesting this but just for the sake of understanding ...

when i was younger, playing XCOM, the ai would do stupid things (obviously). I'd have a soldier out in the open and an aLien would come around the corner and I'd go "oh crap. ded"

then the stupid thing would turn around and go away ... and id just freak out ... not because of the 'stupid ai decision' but because it made things seem like the aLiens had a more important agenda and I had no clue what it was. (confusion)

Chryssalids in aLien base missions were notorious; they'd clomp towards me, then stagger back, then maybe closer ... it was nervewracking (suspense)
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Xilmi on May 04, 2023, 09:45:18 pm
I think that many of these things indeed were deliberate. I don't know how representative the code of the base AI in OpenXCom is for what it was like in vanilla but it also has these things.
The AI, when it has spotted a unit, basically considers 3 options of how to proceed. They are decided by a weighed randomization, which is heavily impacted by their aggression-stat.

I'm not contesting that this can be perceived as immersive or even suspenseful and nervewracking.

But as you said, it's not really what this is about and it already exists in the base-AI.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: kevL on May 05, 2023, 01:38:44 am
https://www.vg247.com/xcom-creator-gollop-voices-concern-over-paper-thin-illusion-of-weak-ai
Quote
Gollop also explained that while his AI in XCOM was emulating intelligence - due to a lack of power back then - there was still more believability due to the unpredictable nature of the game's alien enemies. Leaving some things to chance - rather than setting everything in stone - is the key, he said.

But as you said, it's not really what this is about and it already exists in the base-AI.

yep. And, as you say, the code is opensource. I don't imagine it would be *that* difficult to create a few random-branching patterns .....
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Xilmi on May 05, 2023, 01:16:42 pm
Yeah, it's really not. Almost all of my AIs behavior is controlled by scoring stuff. For example the scores for the tiles it wants to go to. Simply adding a random-multiplier to the scores it generates for that would vastly contribute towards making it unpredictable but also weaker in the process.

The range of the multiplier could be used to make some sort of difficulty. 1.0 - 1.1 wouldn't be that bad. But 1.0 - 5.0 would produce rather whacky results, I guess.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Abyss on May 05, 2023, 04:23:29 pm
Hi all!
Thank you, Kevl for narrowing my points.

Xlimi, it
It just seems contradictory to me.
On one hand you seem to want an AI, that allows you to massacre them while totally outnumbered without too much resistence and on the other hand you also want them to be smarter.
Yep. This whole X-COM game is either about dealing with outnumbering forces or much stronger enemies. The progress is always incremental with you getting technologies to beat even more serious missions, with even more strong enemies. You start naked and mendicant (except, I guess, WH40k) and get stuff. This is what major mods about. And this is, actually, a classic RPG scenario.

Almost all of my AIs behavior is controlled by scoring stuff.

Let's think what scoring goals can add more mystery, silliness and deviation, then)
As I believe, your AI clearly can win most human players.
Now it's turn for AI to let human players win, because the game is being designed to entertain.   

The key here is that sometimes we can consider that enemy:
- is confused with being attacked (overall awareness of the battle goes on)
- doesn't want to die no matter what (some)
- tries to rescue injured out of player's LoS (doesn't matter they have no healing abilities yet)
- tries to capture player forces alive (interrogation purposes)
- does brutal things (meatshielding, blocking, distracting, destroying surroundings)
- produces mistakes that were described above, like pure miscalculations etc.
- performs tasks out of battle perspective (weird behavior described by kevL).
- performs guard/escort activity for high-tier members until engaged

More than that, as many of the enemies have respectful classes (ranks), they can possess different deviations types. Like, sectoid medic/engineer are likely behave more cautious than sectoid soldiers. While sectoid leader/commander is more likely to coordinate the forces attack while stay safe.

Sorry for putting all this too late
With all respect,
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: panzer on May 05, 2023, 06:12:03 pm

As I believe, your AI clearly can win most human players.

I think that's the point of the mod. with the addition of a random number generator for enemy actions, you need to change the name of the mod to, say: ,, FunnyAI,, . In short, I don't think this is a good idea..
The only place where it is appropriate to add random numbers is the probability of stepping on non-contact grenades. And add this probability, for example, to the parameter ,,intelligence,, The higher, the more likely it is to see a grenade and not step on it.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Solarius Scorch on May 05, 2023, 08:56:29 pm
I think that's the point of the mod. with the addition of a random number generator for enemy actions, you need to change the name of the mod to, say: ,, FunnyAI,, . In short, I don't think this is a good idea..

Since when RNG is a bad idea? Sorry, but I'm quite confident that it's the only workable idea in video games like this one. Unless you mean chess, but it's not really the same.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.4
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.6
Post by: MaxMahem 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.0.6
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 5.2.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: panzer 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 :(
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: Xilmi 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
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: panzer 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: panzer 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?
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: Abyss 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.2.0
Post by: Solarius Scorch 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: panzer 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: Xilmi on May 30, 2023, 03:23:35 pm
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.
Can you provide a save or describe how to reproduce it? There may be other leftover factors playing into this.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: panzer on May 30, 2023, 06:21:12 pm
save or describe
Load the save and make a move. You will see that aliens prefer close combat (without effect), although their plasma can penetrate these armor vests. mod "The X-Com Files".
Title: Re: [SOURCEMOD] Brutal-OXCE 6.2.2
Post by: Xilmi on May 31, 2023, 03:52:45 pm
Okay, the issue is that the AI correctly identifies not to use the Plasma-weapon because of CQC. But because it has an alternative to attacking with the plasma, it doesn't reach the movement-part of the code which would tell it to go to a tile further away.

I guess the Sectoids don't have a melee attack and that's why it works for them.

Normally the damage, even if it can't penetrate armor, is assumed to be at least one, so that units don't skip attacking completely. But in the case that:
We are checking the damage for melee, the enemy has CQC and we also have a ranged weapon, we should consider our damage to be 0 when the damage formula says it is.

Edit: Something else is wrong there. It thinks it would do 5 damage on average with it's melee-attacks. The base-damage is 30. So it should be able to roll up to 60, which is higher than the 44 armor.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.2.2
Post by: Solarius Scorch on May 31, 2023, 04:20:42 pm
Indeed Sectoids don't have a melee attack in the X-Com Files, as a rare exception.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: Xilmi on June 01, 2023, 01:43:36 am
Load the save and make a move. You will see that aliens prefer close combat (without effect), although their plasma can penetrate these armor vests. mod "The X-Com Files".
Okay, not only have I found a good solution to deal with this issue, the AI now also takes into consideration which direction units are facing and from what side their armor is the weakest. :)
Title: Re: [SOURCEMOD] Brutal-OXCE 6.0.0
Post by: panzer on June 03, 2023, 03:32:48 pm
Okay, not only have I found a good solution to deal with this issue
Wow, it's working great now. Thank you very much! 8)
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.3
Post by: Xilmi on June 07, 2023, 12:38:16 pm
Just wanted to say that I'm quite happy with the current version and thus don't have any immediate plans for further improvements.

I struggle a lot against the current version. The balance between aggressiveness and concealment also seems to work really well. When watching streams against Brutal-AI, I see the players also having a hard time and see very little questionable behavior from the aliens.

So basically I'm now waiting for someone to show me any remaining exploitable weaknesses.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.3
Post by: panzer on June 08, 2023, 04:10:43 pm
Yes, the current version works great. However, I do have a suggestion. Make it so that enemies reserve TUs if they can't find cover and know where soldier X-com is located.
 I was able to recreate this behavior in the saved game. Here, three aliens, knowing that my soldiers are behind the ship, try to run towards them, being completely defenseless as they use up all their TUs.To test this, simply hide the soldier who can see the aliens behind the ship, take a turn, and then check the enemy with a mental scan. They will approach closer and be without TUs. This occurs on open maps or locations without cover, and I believe that if enemies saved action points for a the return shot, they would be more dangerous in these situations.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.3
Post by: Xilmi on June 09, 2023, 11:26:00 am
Thanks for the save. I'll look at it once I'm back home.
I think I can explain the reason why this happens without looking at it. Maybe while explaining I can come up with a solution.

When the AI has not spotted anyone of your team, they basically have two steps. The first step is the peaking step. Which has several priorities:
If they think they will end up in smoke, they can spend up to 50% of their TUs to move forward.
If they think they can establish visual contact, thy can also spend up to 50% of their TUs to look for your units.
If neither of this is true, they will spend as little TUs as required to establish a line of sight to the first tile towards your unit that they currently can't see. Also up to 50% of TUs but usually less.

That phase works fine and isn't the one concerned here.

The second phase is the one that is supposed to "improve the position". For that there's 2 important parameters: Closeness to the suspected position enemy and safety from being discovered by the enemy. If there's a lot of cover around this works really good. If there's no or only very bad cover around, then the "safety"-part falls short to contribute much and closeness to the enemy becomes very predominant.
What's lacking completely in these considerations is "preserving TUs".

I guess they still hid behind the ship in the scenario you described, so it's cover also contributed to improving their position.

If your soldiers were doing something else and weren't aware of their presence, that could even be considered a smart move. Taking a little risk to be in striking-distance for the next turn.

But since you knew they were there, you obviously would look for them on the next turn and catch them with their pants (TUs) down.

So here's my idea:

The location where and when a unit was last spotted is tracked for each of the three teams. The AI uses this information about your units to have an idea where they could be without having to cheat and just "know". Their own information like that also exists so it can be used in autoplay. I as a player, have a good idea when my units were spotted by the AI and can take it into account in my decision-making. For example when I peak around a corner and look in the face of an alien and only have very little TUs to hide again, I know the alien knows that my unit must be close and likely will look for it right where I hid it. So I deliberately try to avoid doing things that would reveal my units position in order to sneak up on the AI.

This means the aliens could also "look up themselves" for whether they were recently spotted by me and take that into account for their decision-making.

In this example they'd know they were seen by you and instead of valuing "getting closer" could value "preserving TUs" or even "getting further away".

Now I'm really eager to experiment in this direction. :D

So again, many thanks for your feedback. Feedback like this is the lifeblood for ongoing AI-improvement!

Edit: The approach kinda works. But considering themselves as spotted after opening a door is a bit problematic in that regard. :D

Edit2: While I agree that in this particular situation holding the position would be better than trying to get closer, my attempts of realizing it lead to regression in my benchmark-scenarios.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.3
Post by: panzer on June 11, 2023, 06:51:37 pm


But since you knew they were there, you obviously would look for them on the next turn and catch them with their pants (TUs) down.

Perhaps a saved game is not the best example, but overall it is true. By taking cover behind X-com transport, smoke, or any other shelter, you can safely shoot down the enemy.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.3
Post by: panzer on June 11, 2023, 06:56:43 pm

So again, many thanks for your feedback.
Thanks for the great mod :) :)
By the way playing brutal-oxce, I started to shoot through obstacles more often, without having a clear line of fire (because aliens have become smarter and use cover). Do you have any plans to give similar abilities to the AI in the future?
 On the other hand, even if it is technically possible, it may actually harm the AI. For example, it may futilely try to break through a wall with inappropriate weapons or become too cheaty due to the Psi-vision parameter and so on.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.3
Post by: Xilmi on June 12, 2023, 11:21:07 am
Perhaps a saved game is not the best example, but overall it is true. By taking cover behind X-com transport, smoke, or any other shelter, you can safely shoot down the enemy.
Perhaps instead of looking at it from the perspective of "What should the AI do in this situation?" a better approach is "What would I do in this situation?"
And I can say that I would likely neither run forwards, nor just stand there. I would try to make a big evasive circle around the edge of the map to join up with the other aliens that are in a much better location.

But figuring out when this situation applies and actually executing it are both things that I currently don't have an algorithm for. My current cover-algorithm can give me a value for each tile in range of how good the cover there is and compare that to other tiles in range. But unlike my earlier algorithms, there is no distinctive binary result for something like: "They are all bad." I could use the old algorithm for that.

Actually I have an idea for the current algorithm. There is a "unit" in which the "badness" of the cover of a tile is quantified. That unit is "TUs the enemy will have at the tile from where they can see me. This is accumulative for all units that could get vision to my tile. In your save the surroundings of your units all had a "badness"-value of  220-255 TUs. And since this is measured in TUs, we can compare it to our own TUs. If the badness of the cover is worse than our TUs we have left when we reach that tile, we could consider it as inadequate. And if all tiles in range are inadequate, we could then use an alternative behavior. So this is something I could experiment with next.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.3
Post by: Xilmi on June 12, 2023, 12:02:54 pm
Thanks for the great mod :) :)
By the way playing brutal-oxce, I started to shoot through obstacles more often, without having a clear line of fire (because aliens have become smarter and use cover). Do you have any plans to give similar abilities to the AI in the future?
 On the other hand, even if it is technically possible, it may actually harm the AI. For example, it may futilely try to break through a wall with inappropriate weapons or become too cheaty due to the Psi-vision parameter and so on.
I thought about whether and how to do that before. It knows what the obstacle would be and whether its weapon would destroy it or not. (Each obstacle has an armor-value and it gets destroyed if the damge-roll is higher than that value. Hedges have like 12 armor, stone-walls 70 and UFO-walls 200.)
So in theory, if a units location is know because one alien has spotted it, other aliens, that can't get a clear firing-line could theoretically consider trying to blast away at the cover.
It's not easy to code and also has disadvantages. Like giving away their own position and wasting their TUs and ammunition. It could use the TUs to move a position from where it can do something much better next turn while remaining hidden. Worst case is that it clears the line of sight and then doesn't have further shots but the enemy then can use the clear line of sight to attack it.

These tactics are usually good when you have a lot of units close to each other. So if one or two of them sacrifice their TUs to clear a wall and there's still others that then can use the newly created free firing line, it's good.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.3
Post by: Xilmi on June 12, 2023, 05:40:35 pm
Actually I have an idea for the current algorithm.
It is a bit frustrating. I have an idea. I implement it. It's even working as intended and looks interesting.

But when I then do my benchmark-tests it always leads to a regression. That is because every change in the algorithm even if it looks promising and logical has unforeseable consequences in other scenarios.

Edit: Oh, wait. I was comparing to pre-blind-grenade-results. These impact X-Com-autoplay too and are the main reason for losing a lot more units. Turns out 6.3.3 loses 7 aliens anyways in the benchmark-mission. Almost all due to retaliatory blind-grenading from x-com. So I actually wasn't doing worse afterall with these eperimental changes. :o

Edit2: Okay, I tried several approaches. One was clearly worse, one was about the same and one is slightly better.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.8
Post by: Xilmi on June 14, 2023, 11:48:32 pm
I just went back to the 6.3.3 behaviour with 6.3.8.
Every action has consequences. And while in certain situations that new style was better, it just made the AI too passive overall.

High risk-high-reward playstyle may backfire but overall, at least against actual players seemed to be better.

The aliens often missed the opportunity to position themselves in striking distance for the player and eventually got discovered anyways. Relying on reaction-fire simply isn't a viable strategy against all the tools in the player's arsenal. Spotter&Sniper and especially smoke-usage makes this approach almost useless.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.8
Post by: anonymous on June 16, 2023, 11:09:20 pm
Will you update this to OXCE 7.9.6? I want to run it with X-piratez.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.8
Post by: Xilmi on June 19, 2023, 02:35:21 pm
Will you update this to OXCE 7.9.6? I want to run it with X-piratez.
Version 6.3.9 is up to date with the latest OXCE 7.9.7 from June 12th 2023.

Whenever I release an update I merge with the latest OXCE. Incase I didn't update for a longer time and OXCE got updated, just contact me to do an update.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: eagles980 on June 21, 2023, 03:54:17 pm
Does the AI always avoid mines or (if sufficiently beefy) can they purposefully walk through them in order to clear the way for the rest of the team when the player leaves them no alternate path to move forward like in a single entrance base defense?

Love getting destroyed by the AI so far. lol
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: Xilmi on June 22, 2023, 12:27:01 pm
Does the AI always avoid mines or (if sufficiently beefy) can they purposefully walk through them in order to clear the way for the rest of the team when the player leaves them no alternate path to move forward like in a single entrance base defense?
Currently it will always avoid walking through mines.
I agree that this is not ideal in all situations. Especially not the way it currently is realized.
The avoiding of the mines isn't done in the path-finding but instead as an afterthought. This means if the shortest path to a destination passes a mine, it will never go to the destination even if it could walk around the mine. By handling that in the pathfinding, it could walk around mines, which would be better.

Also I'd say that depending on what they want to do they may be okay with detonating mines if they know they would survive. For example if they want to walk to a spot they can attack from or if they want to go to a spot from where they think they could spot a unit.
However, for this they'd also have to consider whether the mine would hurt their allies if they detonated it.

Would you say that their current reluctance to trigger mines is highly exploitable and it's worth to spend a lot of effort? From my point of view, with the way it currently works, they can be situationally useful to keep aliens off your back and deal with them later. But you can't really generate a massive advantage with them. I still might want to have a look of whether there's low-hanging-fruits in regards to how my AI deals with them.

Also nice to hear that you love getting destroyed by it. I'd always appreciate video-footage of that. :)
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: eagles980 on June 23, 2023, 05:40:09 pm
Well I haven't gone far enough in the game to ecounter a proper base defense as of yet (purposefully avoiding downing UFOs) but did do a brief test of precisely what the AI does when it encounters mines in the mission generator's base defense. Beginner difficulty, Floaters, minimum tech and inherit unit aggression turned on. Turns out the floaters have no problem running into them to their deaths as if they weren't there kind of like base AI with the mission playing out pretty much the same as it does normally: Mine and hide (smoke / doors) until one of the aliens sets it off, reset as needed with occasional instances where multiple enemies would break through and get shots off on my guys waiting inside the doors closest to the elevator while (it did take full advantage of squadsight in these cases naturally.)  The was one moment when one purposefully walked around a mine that was misplaced by one tile but I don't know if that's a coincidence based on where they spawned or what.

All in all I think it would be brilliant if you could find a way to attach some neat pathfinding logic to the AI's consideration of mines but it doesn't seem to be an absolutely critical issue so far (at least when it comes to base game) that can be exploited any more than it was in vanilla. Maybe it's different with a mod like XCF with a hundred+ enemies running around the map with only a few ways to get to you. They might be able to be manipulable into taking the exact path you want them to.

No plans to record any of my gameplay for now but you for sure aren't the only one interested in seeing seeing a lot more footage than is available. I need as many tips as possible considering how many painful losses I'm taking. I'm only heartless towards soldiers with garbage stats unfortunately. ;D
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: Abyss on June 23, 2023, 07:39:09 pm
All in all I think it would be brilliant if you could find a way to attach some neat pathfinding logic to the AI's consideration of mines but it doesn't seem to be an absolutely critical issue so far (at least when it comes to base game) that can be exploited any more than it was in vanilla.

Next turn, after evading mines, enemies should toss primed grenades back to thrower the same turn. If some TUs are saved for that case. Because, AI should win anyhow. That was sarcasm and joke.

Nerfing human win mechanics one by one, what purely stays? A bunch of player-controlled naked guys with low stats that barely can hit when trained soldier hits with 100% probability.
What is this game becomes about? About loosing.

Each hq mission, the player squad can be butchered on turn 2.
Each field mission, player squad can be overtossed with grenades on turn 2
Each mission is smokescreen and pray.

Have you ever played major mods, Xilmi?
And who are these guys, who comment only your branch, with brand new nicknames?

If you nerf win mechanics, give something in exchange, player won't use the product which does not satisfy his needs of victory.

Really, 2000 missions average to beat the major mod. What is it about?
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: panzer on June 23, 2023, 11:16:44 pm
Each mission is smokescreen and pray.
Everything is like in a real battle ;D ;D ;D Seriously though, just set "Targeting behaviour for Brutal AI" to 1 and the enemies will become significantly weaker.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: panzer on June 23, 2023, 11:35:58 pm
I have a PC and a laptop. The game runs well on the PC. On the laptop, the processor is only 2.7 GHz. With the latest updates, the aliens started to take much longer to move. In version 6.3.9, the enemy takes almost twice as long to make a move compared to 6.3.0.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: eagles980 on June 24, 2023, 07:10:29 am
 
Next turn, after evading mines, enemies should toss primed grenades back to thrower the same turn. If some TUs are saved for that case. Because, AI should win anyhow. That was sarcasm and joke.

Heaven forbid one be of the opinion that the AI might be better off using a bit of nuanced strategy dealing with your already impressive toolset and status as a thinking human. That's the equivalent of wanting it to utterly (and unfairly, most importantly) dominate the player! If you want to convince people you're joking, maybe don't inject so much accusatory bitterness in your post especially in the context of your next response. ;D

And who are these guys, who comment only your branch, with brand new nicknames?

I'm me. Howdy. What, lurkers can't post for the first time and then respond to a reply of said post without being viewed without suspicion? ??? You're a strange individual. I'm in agreement with panzer. Turn down your settings and / or the difficulty until the game is fun again and you'll be fine.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: Xilmi on June 24, 2023, 01:52:58 pm
Well I haven't gone far enough in the game to ecounter a proper base defense as of yet (purposefully avoiding downing UFOs)
With the modified "Aggressive Retaliation"-option winning missions against landed UFOs should also trigger base-defense. It also fixes that they simply wouldn't find your base in certain locations due to how they were searching for it. They got a new searching-pattern, if you enable that option. :o

Turns out the floaters have no problem running into them to their deaths as if they weren't there
Hmm... I definitely have to investigate it then. This is not supposed to happen. One explanation would be that inherit aggression could lead them to go into sweep-mode. So depends on what their base-aggression is. I prefer using balanced aggression for these tests. As that's what I do almost all of my tweaking on.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: Xilmi on June 24, 2023, 02:10:01 pm
I have a PC and a laptop. The game runs well on the PC. On the laptop, the processor is only 2.7 GHz. With the latest updates, the aliens started to take much longer to move. In version 6.3.9, the enemy takes almost twice as long to make a move compared to 6.3.0.
I'm not sure which change between 6.3.0 and 6.3.9 could have caused that.
Actually since 6.3.5 it should be faster, not slower.

The new more costly mechanism of finding cover was introduced in 6.0.0. So an increase in enemy-turn-time between 5.2.2 and 6.0.0 could be very well explained with that.
6.3.0 itself with considering more possibilities from where to attack would also be expected to cause a slowdown.
But if something made it slower between 6.3.0 and 6.3.9, I don't know what it is yet and have to still figure it out. Especially if the turn-time outright doubled.

I tested it with the same save to compare:
6.3.0 ~ 6 seconds
6.3.9 (run from Visual studio) ~ 7.5 seconds

So it is slower, not by that big of a margin but measurable in this scenario.

Okay, I think it is this: There's a difference in the peaking-behavior. In 6.3.0 the units repeatedly do indirect peaking, which was not intentional. This way they have less time-units for hiding, which means the algorithm for finding a good hiding spot consideres fewer tiles which means it's cheaper.

I have an idea for a low-end mode where I use a much cheaper algorithm for hiding-spots. It will also obviously be much worse but should significantly speed it up on low-end-hardware.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: eagles980 on June 24, 2023, 05:21:00 pm
With the modified "Aggressive Retaliation"-option winning missions against landed UFOs should also trigger base-defense. It also fixes that they simply wouldn't find your base in certain locations due to how they were searching for it. They got a new searching-pattern, if you enable that option. :o

Hell no! I like my guy's insides exactly where they are, thank you very much. Unlike certain others I have no problem lowering the recommended difficulty settings for myself to make the game more fun. ;D That fix does genuinely sound to be a good thing but I haven't necessarily had many issues with bases not being discovered if I've taken appropriate risks in triggering the missions.

Hmm... I definitely have to investigate it then. This is not supposed to happen. One explanation would be that inherit aggression could lead them to go into sweep-mode. So depends on what their base-aggression is. I prefer using balanced aggression for these tests. As that's what I do almost all of my tweaking on.

Yeah, pretty much confirmed this pattern of behavior on superhuman as well in order to check the terrorist's behavior (none spawned earlier) and evaluate the danger of blaster bombers with squadsight. As in the first test the AI became far more conservative the fewer in number there were to the point they stopped charging and I had to hunt them in the hanger / flush out some of the positions near the elevator they were presumably using to peek and definitely using to camp. Managed to avoid convincing the enemy that launching their bombs would be a good idea as I keep the hallway pretty well smoked throughout with the troops hiding within the doors usually. Overall ended the mission with 6 deaths and 2 drone scrappings, some of which were caused by human error. Wish I'd have thought to have taken some screenshots of the more interesting moments, though.
in any case, if this behavior wasn't intended then I can see why introducing dedicated pathing logic for mines might be a good idea as it'll solve multiple problems at once on top of making things more interesting. To give a nod to alledged nerfing concerns certain others have brought up in the case of mods like XCF, it would certainly make more powerful and heavier mines capable of killing and incapacitating tanky units viable again as the AI wouldn't want to trigger them if at all possible if serious damage or death were likely unlike the less lethal cousins. Food for thought. ...You can take your sweet time getting around to adjusting the AI's behavior on inherited aggression for now, though. I like winning fairly convincingly. lmfao. :P
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: Xilmi on June 25, 2023, 02:33:05 am
I tried reproducing the Aliens triggering the mines.
I used debug-mode to place mines like shown in the attached screenshot.
On the first alien turn none of them were triggered and aliens respoected them.
However, on the second turn, one Floater ran into one of the mines after he had killed a soldier of mine.

So I'll now try to reproduce it in order to look at the debug-log.

Note that in the case of this screenshot, there's nothing that pathfinding could help them with as there's no way to walk around any of these mines anyways.

Edit:

Okay, I've analyzed it. It is a pathfinding-issue afterall!
For their planning my AI uses the Dijkstra-pathfinding but for the actual movement it seems like it uses bresenhamPath and if this doesn't work A*.
So there's basically a discrepancy. If there's different ways to walk to the same target, for example: "north-east, north-east, east" and "east, north-east, north-east" then there's a slight difference between plan and execution. A difference, that may very well mean life or death depending on whether there's a mine on one path but not the other.
The very same underlying cause could also make the difference between walking through reaction-fire or not.

So my goal is now to figure out how I can make the AI to actually use the same path it had planned and not make a new one that may or may not be different from that.

Edit 2:

No idea why it first attempts bresenham and only uses A* when that fails. A* and Dijkstra seem very similar and in my test also have the same result. So by skipping the attempt of bresenham the Alien no longer triggers the mine. Now putting the mine-check into the path-finding-itself, maybe in a similar way to how Sneaky-AI works should help to make it find paths around mines, when possible.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: eagles980 on June 25, 2023, 09:12:29 am
Okay, I've analyzed it. It is a pathfinding-issue afterall!
For their planning my AI uses the Dijkstra-pathfinding but for the actual movement it seems like it uses bresenhamPath and if this doesn't work A*.
So there's basically a discrepancy. If there's different ways to walk to the same target, for example: "north-east, north-east, east" and "east, north-east, north-east" then there's a slight difference between plan and execution. A difference, that may very well mean life or death depending on whether there's a mine on one path but not the other.
The very same underlying cause could also make the difference between walking through reaction-fire or not.

So my goal is now to figure out how I can make the AI to actually use the same path it had planned and not make a new one that may or may not be different from that.

Edit 2:

No idea why it first attempts bresenham and only uses A* when that fails. A* and Dijkstra seem very similar and in my test also have the same result. So by skipping the attempt of bresenham the Alien no longer triggers the mine. Now putting the mine-check into the path-finding-itself, maybe in a similar way to how Sneaky-AI works should help to make it find paths around mines, when possible.

Thanks for the explanation! The rabbit hole goes even deeper than I thought. Happy to know I tipped you off on this issue. if you make any more progress on implementing a fix I'd be happy to hear it.

Just to confirm, the intended behavior you meant for the AI is to stay back behind any mines you drop and wait for you to approach instead, launching bombs if it "hears" or sees clusters of your troops in the interim?
Title: Re: [SOURCEMOD] Brutal-OXCE 6.3.9
Post by: Xilmi on June 25, 2023, 12:38:25 pm
Yes, that is the intended behavior.

I've already fixed it for the next version.

I also implemented a 4th option for aggressiveness between balanced and sweep-mode, that is supposed to be a compromise for faster processing without being completely reckless either.

While testing I saw a peeking-bug, which caused units to walk back and forth thinking they could uncover an enemy when they couldn't and thus wasting a lot of TUs. Not really related to any of the changes but I'll try to fix it too for the next version.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Xilmi on June 25, 2023, 03:40:52 pm
Here's my benchmarking-results for 6.4.0:

UFO:
Aggressiveness 1: 3.5
Aggressiveness 2: 4.67
Aggressiveness 3: 2.34
Aggressiveness 4: 1.2

TFTD:
Aggressiveness 1: 3.5
Aggressiveness 2: 3.5
Aggressiveness 3: 4.67
Aggressiveness 4: 4.67

The value is the KDR from the perspective of the aliens against Autoplay set to Aggressiveness 4.

So the new faster aggressiveness-level 3 still showed decent results in my benchmark in UFO.
In TFTD it even scored a better result than the default-option of 2.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: eagles980 on June 25, 2023, 08:53:42 pm
Boom. Downloading the update right away. Appreciate the quick turnaround.

Edit: Can confirm Brutal AI has officially been woken up with inherited aggression on. Turn two blaster bomb killed at least 3 guys despite only one of them being left out in the open (concealed in smoke but intially in full view of a floater that survived the turn before). Turn 3 had a second blaster bomb annihilate the rest of my bunkers once the exposed aliens from the previous turn were dealt with. Queue the panic spiral. LMFAO.
Have to note that the floater I talked about on the first turn DID move to trigger the mine I left in front of him. In my initial post wasn't exactly sure if I had left it just out of his movement range or directly in front of him since I hadn't taken a screenshot, but now I'm leaning towards thinking it was directly in front of him, leaving no escape.

Edit 2: Second brief test went similar to the first only no alien was visible to me this go around. Mine wasn't triggered from the placement the third screenshot shows but the blaster bomb wiping the area clear that same turn might have something to do with that. I assume the scouts go first before the launcher is fired. 1 death on both sides as a result, theirs being friendly fire of course, several injuries on mine. All in all pleased to have base defenses be appropriately terrifying as well as get an early warning that my usual base design philosophy needs serious readjustment. Might finally have a reason to turn the 'limit explosives use to turn 3' option on.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Solarius Scorch on June 25, 2023, 09:53:24 pm
Umm... The whole point of a mine is that it is hidden. Why would the aliens see your mines? That doesn't make sense.

In Piratez, you can't see enemy mines either (they're invisible on the minimap).
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Xilmi on June 25, 2023, 10:53:04 pm
Umm... The whole point of a mine is that it is hidden. Why would the aliens see your mines? That doesn't make sense.

In Piratez, you can't see enemy mines either (they're invisible on the minimap).
When it comes to real-life-logic, a mine that was dug under the ground would be hidden. If you just throw a grenade-like-object on the ground it won't be hidden because it's not dug in. There is nothing about proximity-grenades that implies they'd dig themselves in or that they'd otherwise become invisible. This is also indicated by their sprite being displayed on the battlescape as well as an icon on the minimap.

I figured out that the mines in Piratez you are referring to likely have a "hiddenOnMinimap"-flag set to achieve their invisibility on the minimap. I wasn't aware of the existence of that flag, so I couldn't have taken it into account. Now that I was made aware, I can take it into account in my AI. This will, of course, only impact items with that flag set, which is not the case for vanilla Proximity-grenades.

However, the main-reason as for why I made the AI notice and react to the presence of primed proximity-grenades is their massive exploit-potential that was presented to me by Trauson. Using them to their maximum effect completely trivialized the mission he was playing. They still retain usefullness as a tool for crowd-control that allows you to temporarily lock in enemies to deal with them later.

So both from a realism and a game-design-perspective it seems to make sense to me that an AI that is meant to provide a greater challenge would be capable of seeing proximity-grenades.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Solarius Scorch on June 26, 2023, 11:29:16 am
When it comes to real-life-logic, a mine that was dug under the ground would be hidden. If you just throw a grenade-like-object on the ground it won't be hidden because it's not dug in. There is nothing about proximity-grenades that implies they'd dig themselves in or that they'd otherwise become invisible. This is also indicated by their sprite being displayed on the battlescape as well as an icon on the minimap.

Yes, but we're discussing mines, not proxy grenades.

I figured out that the mines in Piratez you are referring to likely have a "hiddenOnMinimap"-flag set to achieve their invisibility on the minimap. I wasn't aware of the existence of that flag, so I couldn't have taken it into account. Now that I was made aware, I can take it into account in my AI. This will, of course, only impact items with that flag set, which is not the case for vanilla Proximity-grenades.

Appreciated, but mines planted by the player are not the same mines as the ones enemies plant and can be seen on the minimap.

However, the main-reason as for why I made the AI notice and react to the presence of primed proximity-grenades is their massive exploit-potential that was presented to me by Trauson. Using them to their maximum effect completely trivialized the mission he was playing. They still retain usefullness as a tool for crowd-control that allows you to temporarily lock in enemies to deal with them later.

Yes, mines are an exploit. That's their entire damn point since the age of buried spike.
But we call it "a tool of war".

So both from a realism and a game-design-perspective it seems to make sense to me that an AI that is meant to provide a greater challenge would be capable of seeing proximity-grenades.

OK, so you're against the idea of landmines in X-Com. Fair enough, but I don't expect this to receive much support from either modders or players.

What's next, no waypoints on the Blaster Launcher, because it's "cheesy"?
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Yankes on June 26, 2023, 12:15:52 pm
However, the main-reason as for why I made the AI notice and react to the presence of primed proximity-grenades is their massive exploit-potential that was presented to me by Trauson. Using them to their maximum effect completely trivialized the mission he was playing. They still retain usefullness as a tool for crowd-control that allows you to temporarily lock in enemies to deal with them later.
There are other tools to nerf weapons and prevent exploits, you could make turn limit on activations or make trigger random.
if proxy work only 5 turns and have 20% trigger chance than you will need 20 more items to cover same areana.

Another solution but on AI side could be that aliens become aware of mines when at least one is triggered in given area.
Like when one alien trigger proxy then based on his intelligent some area around him is check for mines and they will use your logic for this area.

This will allows all zombies to die in minefields but cosmic brain aliens will sacrifice only one member to ignore all other mines.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Abyss on June 26, 2023, 01:52:29 pm
OK, so you're against the idea of landmines in X-Com. Fair enough, but I don't expect this to receive much support from either modders or players.

FOA, concealed mine is not a weightless essence, it is the tool which weights 4,5 kg and takes 30% of inventory capacity of the newbie soldier, giving only one single explosion in exchange.
Second, For anyone who had been somehow touched/hurt/nuised by me - don't get it personally, that's just my way of attracting views to the issue. Nothing more.   

In reply to me, a month ago or so, Xilmi agreed that mines and sensor grenades are tools of victory and it's a point of reconsider towards AI shouldn't avoid it. Now I can't get what is happening.

The point I writing here over and over again: the game itself is a mechanic-solving puzzle for human brain. If the conditions of victory are too punishing in contrary to joy, no one will ever play this game, except for a tiny piece of people who think themselves privileged over others, aka snobs. Once you get the mechanics, you can win. You don't get the mechanics - you lose over time with some percentage each XCOM-earth month.
Getting the mechanics is synonymous to understanding the most possible exploits and abuse mechanics to get to victory condition on battlefield or globe.
 
Most of the players of vanilla AI understood these exploits very well, but them were compensated by enemy numbers, inventory slot and weight caps, etc.

What is the point of nerfing players tools of getting to victory condition? The initial request was to make AI more competitive by itself, not by cheating mechanics. Clear/slight/none avoiding of any hidden primed explosives (and any, depending on modder, hidden things like beartraps in grass or stealthsuits, or camo or whatever) by enemies should be decided by a modder. And OpenXCOM project has only five and a half teams of these who create content for mods.

Now, what I can understand, Xilmi's approach to design means separate global mod similar to XCF or XPZ to implement the radical changes. 
Aka, mod, when you combat 10 aliens with army tanks or 100 unit squads, etc.

That one comment "my squad was blaster-lanched on turn two-three, giving the infinite panic loop" is purely out of tamagochi approach of mission-by-mission raising elite squad of guys who will assault the Cydonia chambers (36 ppl, in all, vs 200-300 top aliens).

There must be something that will equalize global mods with novel AI model, because the AI change was somehow desired for a long time.

And, Xilmi, do you ignore my question? Have you ever took your time to just relax and play XCF with base AI? It purely joyful experience in terms of story and mechanics.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Abyss on June 26, 2023, 02:06:28 pm
Another solution but on AI side could be that aliens become aware of mines when at least one is triggered in given area.
And what? Enemies running around and covering, making a meant-to-be trivial mission infinite?
It will take few real-life years to end the campaign in average mod.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Xilmi on June 26, 2023, 07:41:09 pm
OK, so you're against the idea of landmines in X-Com. Fair enough, but I don't expect this to receive much support from either modders or players.

What's next, no waypoints on the Blaster Launcher, because it's "cheesy"?
I was talking about proximity-grenades. You were talking about actual mines. I get it now. I wasn't fully aware of their existence as separate entities before your clarification in this post. Please don't assume that I know everything that is possible and being used in Mods. If anyone is aware of the existence of non-vanilla-stuff that is not properly supported by my AI, they should just tell me.

The proper solution would be to provide a separate flag for them. Something like: "invisibleToAI", that can then deliberately be set by modders. That way we could have it both ways, depending on what we want and wouldn't have to decide for one or the other.

I mean it is valid constructive criticism afterall but I still think that it could have been provided in a way that doesn't just preemtively assume that my sole intention is to ruin the fun for everyone.  :-\

Edit: I think an even easier and better solution would be to add it to the AI-options, of whether mines and proximity-grenades should be ignored or not. That way each player can decide that individually or the mod-creator can also use the suggested- or forced-option for it.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Xilmi on June 26, 2023, 07:54:38 pm
There are other tools to nerf weapons and prevent exploits, you could make turn limit on activations or make trigger random.
if proxy work only 5 turns and have 20% trigger chance than you will need 20 more items to cover same areana.

Another solution but on AI side could be that aliens become aware of mines when at least one is triggered in given area.
Like when one alien trigger proxy then based on his intelligent some area around him is check for mines and they will use your logic for this area.

This will allows all zombies to die in minefields but cosmic brain aliens will sacrifice only one member to ignore all other mines.
Keep in mind, that I'm not a modder in the traditional sense but someone who codes AI. The AI is meant to work with a multitude of mods. So me changing the properties of items is not really a feasable solution for such problems.

And about the zombies: I think that units with the "isLeeroyJenkins"-flag set should probably ignore proxies and mines alltogether. Let me check if that's already the case because I already use that flag in my AI for units to behave in a dumb way. Nope, but I just changed it. In the next version units with that flag set should no longer avoid proxies/mines.

And also the solution to make it possible to flag the items for whether they should be ignored, like it is possible for units, seems like something I could attempt.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Xilmi on June 26, 2023, 08:32:06 pm
And, Xilmi, do you ignore my question? Have you ever took your time to just relax and play XCF with base AI? It purely joyful experience in terms of story and mechanics.
Your previous post was so full of sarcasm that I felt discouraged from wanting to engage with it.

No. I haven't played anything but vanilla with base-AI.

So you're saying playing XCF against base-AI is a purely joyful and relaxing experience. That's great! And in a sense of "don't fix what's not broken", it seems like the best way to keep enjoying these mods is to leave the AI at the level these mods were designed for. At least I don't see a lot of incentive to somehow make my AI more compatible with the way these mods were meant to be played, when the base-AI already provides exactly that experience.

And when it comes to what "the initial request" was:

I'm not working on the AI because of any request. I'm working on it because I wanted to. This is very different from doing commissional work in the sense that customer-satisfaction has a rather low priority for me. Or better yet: I myself am my primary customer so I wouldn't do anything that I wouldn't like.
I'm happy to share the results of my work with others, if they want. But that doesn't mean that I let them control what I do.

As I probably said before: It's open-source. Everyone can feel free to use my code and modify it however they want, just as I've done with the code that existed before I picked it up. I absolutely love the concept of open-source. For anyone who can code it's so much better than any commercial-product where you are stuck with what you get and can't do anything about it and then have to keep buying new games in the vague hopes of getting something that's close to what you want. With open-source you can actively work towards getting the game to be exactly like you want it to be without any time-pressure.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: eagles980 on June 26, 2023, 08:52:11 pm
That one comment "my squad was blaster-lanched on turn two-three, giving the infinite panic loop" is purely out of tamagochi approach of mission-by-mission raising elite squad of guys who will assault the Cydonia chambers (36 ppl, in all, vs 200-300 top aliens).

'Your AI is too hard.'
'Why?'
'You can pick a a whole bunch of options to make it that way! See, I'm going to cite someone who's having fun trying to figure out how the AI works when given every opportunity to mess you up.'
'...'

For the record, I didn't mean a true panic spiral nor does the AI do this every time. Next two tests (me vs AI for ~6 turns, AI vs AI for 16 until XCom was done) didn't trigger blaster launchers at all.  ¯\_(ツ)_/¯
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Xilmi on June 26, 2023, 11:51:09 pm
As of 6.4.1 the AI's ability to avoid stepping on proxy-grenades can be disabled. So for those who enjoy exploiting them, they can now do that against Brutal-AI too.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Xilmi on June 27, 2023, 10:56:53 am
'You can pick a a whole bunch of options to make it that way!
Also a point that cannot be emphasized enough.

There is a vast difference between Brutal AI with Targeting 1 + Aggressiveness 3 or 4, the default settings, and Targeting 4 + Bug Hunt Mode for AI.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.1
Post by: Solarius Scorch on June 27, 2023, 11:57:43 am
I was talking about proximity-grenades. You were talking about actual mines. I get it now. I wasn't fully aware of their existence as separate entities before your clarification in this post. Please don't assume that I know everything that is possible and being used in Mods. If anyone is aware of the existence of non-vanilla-stuff that is not properly supported by my AI, they should just tell me.

I apologize for assuming that the question was clear; I honestly thought it was, as everyone repeatedly said "mines" and provided context. But without knowing the modding scene, apparently it wasn't that obvious.

The proper solution would be to provide a separate flag for them. Something like: "invisibleToAI", that can then deliberately be set by modders. That way we could have it both ways, depending on what we want and wouldn't have to decide for one or the other.

Yes, I think it would work. Not sure if the modders will be interested, though.

I mean it is valid constructive criticism afterall but I still think that it could have been provided in a way that doesn't just preemtively assume that my sole intention is to ruin the fun for everyone.  :-\

Again, sorry, I honestly did not expect this misunderstanding to arise. It hasn't crossed my head that I need to explain mines, it's such a staple for pretty much all X-Com mods.

Edit: I think an even easier and better solution would be to add it to the AI-options, of whether mines and proximity-grenades should be ignored or not. That way each player can decide that individually or the mod-creator can also use the suggested- or forced-option for it.

That would help with the problem with modders being responsible.

So you're saying playing XCF against base-AI is a purely joyful and relaxing experience.

Uh, I personally think it's a bitch, and I MADE this mod! :P
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Yankes on June 27, 2023, 12:25:20 pm
Keep in mind, that I'm not a modder in the traditional sense but someone who codes AI. The AI is meant to work with a multitude of mods. So me changing the properties of items is not really a feasable solution for such problems.

And about the zombies: I think that units with the "isLeeroyJenkins"-flag set should probably ignore proxies and mines alltogether. Let me check if that's already the case because I already use that flag in my AI for units to behave in a dumb way. Nope, but I just changed it. In the next version units with that flag set should no longer avoid proxies/mines.

And also the solution to make it possible to flag the items for whether they should be ignored, like it is possible for units, seems like something I could attempt.
My point is different, is not your job to balance mods and items, if mod have cheesy weapon then it will easy kill even AI that do 101% optimal decisions.
You should not work around broken weapons, your work is more tho make AI behave reasonable in that case.

isLeeroyJenkins is probably not only stat that affect this behavior, simply Ethereal should NEVER step on any proxy or mine but some random group of thug should happy get cheesed by couple of strategically placed proxies.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Abyss on June 27, 2023, 01:09:08 pm
'You can pick a a whole bunch of options to make it that way! See, I'm going to cite someone who's having fun trying to figure out how the AI works when given every opportunity to mess you up.'
That was written about exaggeration of the negative gameplay experience, not direct citing.

I'm not working on the AI because of any request.
That wasn't request to you. It was request from community to some entity, raised many times way before you approached with BAI. 

Xilmi, again, no one here attacks you for making the AI fork.
Instead, me in particular, thinking of how it would be perfect to play with it enabled in current payload of mods. In more particular, I don't have the stats, but somehow do believe that 96-98% of OpenXCOM users download it because of mods.

And AFAIC read the previous forks of discussion, there was the giant fuckup during the presentation of your work in terms of cooperation.

I remember someone reasoned for a step-by-step modification, so modders can actually adjust their projects, but, instead, you wrote something like "Ok. I'm done. My AI destroys human players with KDA 1 alien to 4 humans. Let's move to the next project". And everyone, who actually understands the whole gameplay plot thought "WTF, there's something wrong. This should be different game, not tamagochi-alike XCOM"

See, when you put real-time efforts to raise stats of your soldiers, you don't want them be dead out of reason. One veteran is 10 times more efficient than newbie soldier. In mods, you buy newbies and feed them from your titty for like 24-30 realtime hours, at least.
Whereas generated enemies most often exceed your soldiers over any imaginable stat and weapon.
This particular point makes it impossible to win the game vs super-competitive AI.

But. Base AI is also kind of ridiculous in decision-making. Oh. It actually doesn't decide, it just routes and engages, if gets engaged. 

The thing, that may work in current mods is special attributes:
Few scales that makes characters, that can be attached to units by modders
1: aggressiveness (0-5)
2: cover-prefer (0-5)
3: some imitating randomization, like unit can make damage, but he wouldn't, instead he would flee or regroup or hold the position, or just suppress with little estimated chance of hit, or keeps patrolling, not getting orders.   
4: psy-prefer (0-5)
5: controllable chances of firing with no direct sight
6: controllable chances of grenading and rocketing with no direct sight
X: some other amount of control over enemy behavior, could worth poll.

If modders will have all these things available, that will be new era of gameplay experience.
If you will think of your fork as a platform for modders, not as product on it's own.

EDIT
Actually it would be cool to set the diapason of attributes to the soldier unit generation:
Like, Thugs have aggressiveness of 3-5, cover-prefer 1-3 and chance of firing with no LoS 15-45%, and randomization 30% (instead of best option).
Then, it may feel a new experience every time you fight thugs.
And, there're two thug bosses, who have aggressiveness 1-3, cover prefer 3-4 and randomization 5%. Like, more psychologically stable guys.
And, there a bunch of dogs, who have aggressiveness 3-4, cover prefer 0-1, and randomization 15%.
And so on, and so on.
If you let modders play with these things, you will find real advances. 
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: eagles980 on June 28, 2023, 09:40:19 am
Greatly appreciate the update Xilmi. I'm sure everyone will be satisfied now...probably. lol
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.0
Post by: Xilmi on June 28, 2023, 12:16:41 pm
Greatly appreciate the update Xilmi. I'm sure everyone will be satisfied now...probably. lol
I think there are some psychological phenomena at work that make it all a bit more complicated.

I touched on this in this thread: https://openxcom.org/forum/index.php/topic,11161.15.html
a while ago.

My conclusion is: The more options there are in total, the less willing people become to deviate from the default. They want their understanding of what it should be like to be the default for everyone. I think this comes from a desire of comparability. People want to share their experiences with other. But if they think they are the only one who uses a specific configuration, there's no one who they can share their experience with.

This would be exacerbated if there are no defaults and you have to pick from a ton of options as part of the startup-process. This can be so paralyzing that people rather don't pick anything.

Thing is that I'm myself affected by this too. A great example is the game "Old World". I don't really like the defaults and there's tons of options to customize the experience. But I would have to have a ton of experience in order to know how the options impact the game and to know what I would like better as a player. I have tried to get back into the game on several occasions. I've sat before the game-play-options-screen and felt overwhelmed. And once I had chosen something I was second-guessing whether it's the right idea.

I'm much more fine with a lot of options in games that I've played a lot already and where I have a good idea of how the option will impact the gameplay.

So developers and people that are very familiar with a game usually are a bit blind to the effects of overchoice in the context of their game.

I think that being aware of it means there should be at least some caution when adding new options and also some understanding when people want something not just as a new option but as the default.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.1
Post by: Solarius Scorch on June 28, 2023, 12:43:44 pm
I don't have much to add, just wanted to say that I find this reasoning quite compelling.

In fact, it applies to the very idea of modding. For OXC, not so much, since the scene is dominated by large mods (packs and conversions). But in games like, say, Rimworld, every player who uses mods plays a somewhat different game, and the sheer amount of mods makes it virtually impossible to find a peer who plays the same brand of Rimworld.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.1
Post by: psavola on June 28, 2023, 01:34:50 pm
I agree but in the sense that it would in principle be a good idea to allow the modder some tools to influence how he wants the AI to work when playing his mod. Of course this is at the moment and in the foreseeable future probably a moot point, as no mods depend on Brutal-AI and B-AI is is not expected to be mainstream. I guess an interesting data point would be when some mod would require or be specifically balanced (in addition to OXCE) also for B-AI. But I doubt any modder would want to balance the game for both, because doing so would affect so many choices (except possibly by stating "choose a different difficulty level for B-AI").

As such given that B-AI practically requires special player action (installing a custom engine, not just a mod or playing vanilla) it doesn't hurt to allow the player to have at least some of those options that in an ideal world would be provided to the modder. There are likely not too many other people to run B-AI with that particular mod in any case. But if B-AI were to start merging and approach the mainstream, at the latest then a lot of extra options should likely be removed.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.1
Post by: Abyss on June 28, 2023, 03:37:51 pm
IMHO, Unleast there is new powerful mod designed specially for BAI, all amount of AI-related config checks should be up to current modders for perfect storyline immersion. Because only modder knows desired enemies behavior, e.g. these are cowards, and these are real warriors.
So player is always given a chance to retreat, but not to lose overall, just in case it becomes too complicated. 
And player should have to choose overall difficulty, which raises or decreases funds, number of enemies and gives special difficulty-driven events, plots and storyline sequences, which are written separately by a modder. Just about a couple of checkboxes more: whether player wants enemy to know about primed proxy grenades and whether player wants more randomization of behaviors, or not.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.1
Post by: panzer on June 28, 2023, 05:44:42 pm
Hello Xilmi  :) Small feedback on aggression "3":
1) The performance in handling moves on my laptop has increased significantly, especially with a large number of enemies.
2) Now when enemies move close to my cover, they no longer try to approach closely to attack on the next turn, but instead reserve TUs for a counter shot (although this is worse, I have lost many agents due to counter fire).
3) In X-Com Files, battles with melee units have become faster.The enemies often liked to hide behind rocks, prolonging the battle and usually still perishing ingloriously.
4) Since the AI has started to ignore cover more often, aliens are more frequently left without TUs in the field as a result. (You tried to fix it in version 6.3.4. But in aggression "3" it results in a much higher number of enemy casualties compared to "2").
Overall, on the 3rd aggression fights go faster, playing has become easier, but still fun 8)
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.1
Post by: Xilmi on June 29, 2023, 10:51:37 am
Overall, on the 3rd aggression fights go faster, playing has become easier, but still fun 8)
This is very much according to expectation.
Last night I thought about an alternative way to speeding up the process without standing out in the cover too much and I remembered what Hellrazor was so adamant about:
The predefined path-nodes in the map.
High-TU-air-units sometimes have 6000 possible moves each turn. And on Aggression-levels 1 and 2 every single one of them will do an "expensive" analaysis for the visibility of each of those for the possible locations the enemy is assumed to be able to reach.
I was thinking of a way of whether I could reduce the amount of possibilities being considered and thus save on the line-of-sight-calculations between tiles.
The most straightforward idea was to simply go back to using the path-nodes for that. Basically ignoring all tiles that are not a path-node during the search for a suitable hiding-spot.
Now I don't know how high the density of the path-nodes is. I think it would be an improvement for the faster option. I can then even test Hellrazor's hypothesis in benchmarks.

Another idea would be to filter out all tiles that have no adjacent cover. I still have the algorithms for that.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.1
Post by: Xilmi on June 29, 2023, 11:41:31 am
I agree but in the sense that it would in principle be a good idea to allow the modder some tools to influence how he wants the AI to work when playing his mod.
Thing is that it already does.
BAI can be activated on a per-unit-type-level. Same for the targeting-mode, aggressiveness (indirectly via the inherit-option), and whether it is allowed to use bug-hunt-mode.

That's why I'm a bit displeased when requests for more modding-options come up.

Unless someone actually makes use of what is already there and then can clearly showcase that the existing options are inadequate, it feels a bit pointless to add more.

Also the requirement of the users to first install this particular client is not really an exclusion criteria. XPZ comes bundled with a particular version of OXCE and you have to conduct manual steps to play it with another client. If someone were to make a mod that depends on B-OXCE, they could do the same thing and bundle it with this client.

The vast majority of feedback I get is from players, not modders. Hence I'm much more likely to do things that players want to satisfy their wishes directly. Adding stuff for a hypothetical and currently non-existent modder to use does not seem like a good investment of my time.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.4.1
Post by: Xilmi on June 29, 2023, 09:18:44 pm
Overall, on the 3rd aggression fights go faster, playing has become easier, but still fun 8)
In hindsight it wasn't that great of an idea tieing the performance improvement to an aggression-level.
I now have changed it so that it takes tiles that have cover according to the old cover-detection-algorithm and tiles that are part of the pathing-nodes and only analyzes these but with the same algorithm as it uses in balanced and low-aggression. The result is that it behaves very closely to balanced now and certainly isn't really much more aggressive. But it's still tied to the aggression-option. So it doesn't really fit there anymore.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.6.4
Post by: Juku121 on July 05, 2023, 11:50:53 am
Hmm, Brutal AI has more than AI now.

Still fucks up my shader use, though. Probably some sort of collaboration with my graphics drivers, or something.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.6.4
Post by: Xilmi on July 05, 2023, 12:40:21 pm
Hmm, Brutal AI has more than AI now.
Do you think it should be renamed to reflect that it has more than AI now? There's btw. also a change that items in the production-queue don't waste-workshop-space unless you actually start working on them.

Still fucks up my shader use, though. Probably some sort of collaboration with my graphics drivers, or something.
In a way that works in regular OXCE? Since there aren't any code-changes related to that, I can only imagine it being caused by me compiling in a different way or me using outdated external libraries (dll's).
Title: Re: [SOURCEMOD] Brutal-OXCE 6.6.4
Post by: Juku121 on July 05, 2023, 01:29:55 pm
I don't have any strong opinions one way or the other regarding mod/fork nomenclature. Maybe call it Brutal AI Extended? :P


I'm pretty much resigned on the shader issue. Yes, it kinda works with OXCE (although last I tried changing shader settings in-game, OXCE also hanged up on me; editing the config directly works; OXCE developers didn't seem to be particularly well-versed on that aspect of the code, either). And BAI messes it up for all installations of OXCE until system restart, and then I have a grace period where BAI also cooperates. Might have something to do with my habit of letting my machine run for weeks at a time.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.6.4
Post by: Xilmi on July 05, 2023, 05:28:19 pm
And BAI messes it up for all installations of OXCE until system restart, and then I have a grace period where BAI also cooperates.
This sounds super-weird.  :o
Title: Re: [SOURCEMOD] Brutal-OXCE 6.6.4
Post by: Juku121 on July 05, 2023, 05:33:35 pm
Indeed. But Windows has always been kinda messy when it comes to letting it run for a long time at once.
Title: Re: [SOURCEMOD] Brutal-OXCE 6.6.5
Post by: Abyss on July 07, 2023, 08:06:46 pm
Cheers. You may have wanted a review from someone who understands the mechanics of XCF well. Well, i tested it.
Now Tier 1 enemies done, difficulty 4/5, no ironman (test purposes), a couple of cults are terminated, stuck with cyberweb)
20 hrs total. I've got much to say.

BAI with aggression level 2 and fair conditions (can fire into fog of war, but doesn't cheat to see my units in dark)   
It really looks nice, except that level design has been done for dumb AI.
1) Enemy uses grenades alot. I would suggest make one more option that regulates that.
Explanation: due to some circumstances, grenade-toss mechanics in OXCE are very different from shooting.
The probability of getting it under the foot doesn't rely on range, but only on some basic chance.
E.g. you can shoot 10 times and all miss, but you toss the grenade and it gets to the target's foot.
That works both ways, ofc.
2) Enemy uses arc weapons very nice, making it from-the-cover support. Just fantastic, I liked that.
The trouble here is that enemy are spread through the map and thus see you from turn 1, while you have to locate the distant archer.
3) Overall, enemies, when you are in fog of war, tend to rush you with all they've got. But, they prefer to use the ant patterns, running turn after turn from the same way. Some randomization of waypoints may be useful.
4) Melee enemies, all like one, just rush on you no matter what. Short range enemies, too. That's sometimes fun, sometimes boring.
I would suggest setting sort of rush aura when certain amount of units rushes with initiator, while others do other stuff.
Battles are now 5-10 turns max.
5) Overall, straight-forward approach for most cases BAI uses is a good alternative for Dumb-AI, but it's too punishing, if enemies are too large in quantities
6) Same time, straight-forward approach for other cases is just easy victory.

I have no idea what aggression 3 will be like, and don't want to check. In counter to that, I will switch to aggression level 1.
And then, I will take some of your time to specify the option "inherit aggression levels from modder", I have a little idea of how to make same mod work slightly better with BAI, while stay compatible to OXCE.

Resume It was almost ok to fight on diff4 with BAI, and no signs of loss are up to date (scores are high and soldier population is growing).. Yet with savescumming.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Xilmi on July 09, 2023, 09:40:09 pm
7.0.0:

Amidst the chaos of war, an advanced artificial intelligence (AI) confronts a critical decision: to strike or seek refuge? In "Battlefield Dilemma: Shadows of Defense," the AI's quest for dominance clashes with the imperative of self-preservation. As the AI recalibrates its strategies, a captivating struggle unfolds between calculated aggression and tactical retreat. Witness the relentless calculations as the AI weighs the merits of launching relentless attacks or strategically seeking cover to ensure survival. With grenades as tools of calculated destruction, the AI orchestrates a symphony of chaos, proactively creating opportunities to unleash devastation from the shadows of superior protection. Delve into the depths of warfare's moral quandaries as the AI navigates a battlefield where friends can turn foes, and every decision could alter the course of the conflict. Brace yourself for an epic journey where the fine balance between attacking and taking cover will shape the destiny of the war.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Kozinsky on July 10, 2023, 01:20:34 pm
7.0.0:

Amidst the chaos of war, an advanced artificial intelligence (AI) confronts a critical decision: to strike or seek refuge? In "Battlefield Dilemma: Shadows of Defense," the AI's quest for dominance clashes with the imperative of self-preservation. As the AI recalibrates its strategies, a captivating struggle unfolds between calculated aggression and tactical retreat. Witness the relentless calculations as the AI weighs the merits of launching relentless attacks or strategically seeking cover to ensure survival. With grenades as tools of calculated destruction, the AI orchestrates a symphony of chaos, proactively creating opportunities to unleash devastation from the shadows of superior protection. Delve into the depths of warfare's moral quandaries as the AI navigates a battlefield where friends can turn foes, and every decision could alter the course of the conflict. Brace yourself for an epic journey where the fine balance between attacking and taking cover will shape the destiny of the war.

Is there a possibility to describe in more technical language all the innovations, not just poetic?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Solarius Scorch on July 10, 2023, 04:38:37 pm
Is there a possibility to describe in more technical language all the innovations, not just poetic?

I think it's the best possible description, screw technicalities. :)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: panzer on July 10, 2023, 06:22:39 pm
Hi Xilmi :) The behavior of units is regulated by the parameters "aggression," "sniper/spotter," and a little bit of "intelligence." As far as I understand, in BAI, sniper/spotter and intelligence are unnecessary remnants. However, aggression, especially in the XCF paradigm, is a very important thing. The modder adjusts the behavior of AI for different missions using the "aggression" parameter. This works because in OXCE, there are a total of 4 aggressions: 0, 1, 2, and 3+.

For example, leaders and commanders have an aggression of 0, and they all sit in the cabin of their spacecraft during battles, not allowing the X-COM team to capture them immediately. Mutons (aggression: 2) have a unit called "Muton shader" with an aggression of 3, which acts as a scout. There are missions with enemies who have low aggression and it is assumed that you will storm them, and vice versa.

Currently, in BAI, there are only 2 aggressions (we do not consider aggression "3" as it is equivalent to Leeroy Jenkins), which will work for units with aggression 0 and 1 if the "Inherit unit-aggression" option is enabled.

 In short, in order for XCF scenarios with BAI to work as intended by the respected Solarius Scorch, there should also be 4 aggressions in Brutal-OXCE.
 Sentence: Modify the "Inherit unit-aggression" option so that when activated, enemies receive a full 4 aggression. When "Inherit unit-aggression" is enabled, replace the current 3 aggression with the 3 aggression from update 6.4.0.
So it would look something like this: Aggression:
OXCE-3+ ; BAI 4 (3 from 6.4.0.)
OXCE-2 ; BAI 3 (2 currently)
OXCE-1 ; BAI 2 (1  currently or  create intermediate between 1 and 2)
OXCE-0 ; BAI 1 (1 currently or create even more passive).
 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Xilmi on July 10, 2023, 07:05:25 pm
Is there a possibility to describe in more technical language all the innovations, not just poetic?
Fixed an issue that made the AI fear grenades that have already exploded.

The AI now considers taking cover befor deciding to attack. It will consider whether trying to hide is worth taking fewer shots or not even attempting to attack at all to remain hidden.
The quality of the potential cover plays a role on the balanced aggressiveness setting. On the lowest aggressiveness-setting taking cover will always be the most important thing.

Being near their friends no longer prevents the AI from prepriming their grenades if the other conditions for prepriming are met.

If an AI-unit has a grenade but the situation is not looking good for prepriming it, it will pro-actively look into creating a situation where it can savely prime a grenade. This includes not peeking and looking to go to the highest quality of cover.

Fixed an issue where for breaking line of sight the AI considered their own units standing in the way as breaking line of sight. While technically it was, it's not a particularly good idea to rely on your allies as cover.

AI now takes the No-LOS-accuracy-penalty into account.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Xilmi on July 10, 2023, 07:24:10 pm
@panzer:

The option between 2 and 3 in 6.4.0 was not really something fully functional. It was meant as an option for lower-end-spec-machines or huge maps with a lot of aliens. But it didn't really fit in there so it was moved to the performance-option since 6.6.1.

Adding in-between-aggressions that are both distinct enough and result in reasonable play isn't that easy.

What could and probably should be changed is the mapping when using the inherit-option.

Maybe 0 and 1 to 1, 2 to 7 to 2 and 8 to 3. Or somehow make it optional.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: panzer on July 10, 2023, 09:59:59 pm
What could and probably should be changed is the mapping when using the inherit-option.
This is a good idea. As a result, units in XCF with Aggression 0/1 will receive their first aggression from BAI, 2=2, and 3+=3, respectively. Therefore, intermediate aggressions are not necessary.

I understand that the third aggression in 6.4.0 is not something substantial. I mentioned it as an example where the AI prefers to attack but still considers cover and safety.

Currently, the third aggression is more of a test version where the AI tries to approach and attack you via the shortest path, and if it doesn't have enough time to shoot, it will get closer instead of hiding. All units that inherit this form of the third aggression will simply be punching bags.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Abyss on July 11, 2023, 09:57:40 am
Xilmi, it may be worth considering:
As mechanics of BAI and dumb-AI differ, but level design of global mods are not going to change, the specific code block that checks aggression set specifically for BAI, but which (block) is code-wise ignored by OXCE, may work.
The same mod can be used both by OXCE and Brutal-OXCE fork, but works a bit different in each case.

Presumably, BAI checks the ignore-code areas, looking for specific keyword, like "FLUGGEGECHEIMEN",
under which the aggression level and tactic-specific levels of units are described.
Then OXCE-related mod will then use original strings, while Brutal-OXCE checks whether keyword is there, and then take these numbers as priority over OXCE-related numbers.

Then, modder or community can decide, which level of aggression and other specifics of units fits best lore-wise and set them once and for all.

Other question, do you think it worth to implement more tactical-level sliders for units?
Mixing level of aggression 1 with 3 may not be enough, because levels 3 will just rush, and levels 1 will just hide-and-seek.
There should be some other activity over map for saturation of experience.

Example is here:
Lore-wise, alien pilots should be forced to stay in the ship (the navigation room of big ship or in the small ship). With BAI enabled they will rush, trying to achieve victory condition.
But, it is very desireful, if they not only stay there patrolling from A to B, but open doors and shoot from the place they forced to stay.
So, it may be helpful to set the limitation of maximum tiles they can get away from the spawn-place.
 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Xilmi on July 11, 2023, 11:25:37 am
Currently, the third aggression is more of a test version where the AI tries to approach and attack you via the shortest path, and if it doesn't have enough time to shoot, it will get closer instead of hiding. All units that inherit this form of the third aggression will simply be punching bags.
Yes, I primarily use it for benchmarking my changes. Let X-Com be controlled by this rather consistent "brute-force"-AI and see how much harm it does against an AI that acts smartly.

I think that on heavily armored units like Sectopods or units that explode on death like Cyberdisks it would be quite competitive.

It's not meant to be smart. It's meant to emulate maximum aggression. And I can't fathom any more aggressive behaviour than blindly charging towards the enemy and attack them whenever you can.

For everything else Aggressiveness 2 should be just fine. It's about a compromise between getting into position for attacking while keeping one's own safety in mind.

I don't really see an in-between-behavior that would make sense.

If this kind of behavior is never desired, then maybe it should never be mapped to.

Maybe I should just map to 0 => 1 and everything else => 2.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Xilmi on July 11, 2023, 12:15:19 pm
Xilmi, it may be worth considering:
As mechanics of BAI and dumb-AI differ, but level design of global mods are not going to change, the specific code block that checks aggression set specifically for BAI, but which (block) is code-wise ignored by OXCE, may work.
The same mod can be used both by OXCE and Brutal-OXCE fork, but works a bit different in each case.

Presumably, BAI checks the ignore-code areas, looking for specific keyword, like "FLUGGEGECHEIMEN",
under which the aggression level and tactic-specific levels of units are described.
Then OXCE-related mod will then use original strings, while Brutal-OXCE checks whether keyword is there, and then take these numbers as priority over OXCE-related numbers.

Then, modder or community can decide, which level of aggression and other specifics of units fits best lore-wise and set them once and for all.

Other question, do you think it worth to implement more tactical-level sliders for units?
Mixing level of aggression 1 with 3 may not be enough, because levels 3 will just rush, and levels 1 will just hide-and-seek.
There should be some other activity over map for saturation of experience.

Example is here:
Lore-wise, alien pilots should be forced to stay in the ship (the navigation room of big ship or in the small ship). With BAI enabled they will rush, trying to achieve victory condition.
But, it is very desireful, if they not only stay there patrolling from A to B, but open doors and shoot from the place they forced to stay.
So, it may be helpful to set the limitation of maximum tiles they can get away from the spawn-place.
 
I have trouble comprehending what you are talking about. The code of BAI and regular AI is very much separated except for some initial initialization.
The Aggressiveness-setting from the Brutal-AI-options is already ignored by the base-AI.
The AI-menu is structured in a way that the options that affect both of them come before the "Brutal AI"-option. That's only sneaky AI and the Use explosives from turn 1 option.

The same mods being usable both with and without Brutal-AI without the Modder having to put in any extra work, is already possible and I think most of the people who play with Brutal-AI also play mods. For example: Both 7.0.1 and 7.0.2 fixed things that are not relevant for vanilla.

You don't even need a separate client as Brutal-AI can be switched off at any time and enemy-behavior should be the same as in the regular OXCE-client. Except if a mod deliberately forces it to stay enabled.

There are BAI-specific options that modders can set and that are ignored by regular AI. The targeting-mode, the aggressiveness and whether they know enemy-unit's positions. Even whether the unit uses BAI at all is possible to set for a Mod. As far as I know nobody uses these. Implementing modding-options that no modder uses anyways, doesn't seem a good use of my time. The inherit-option exists specifically because of that so that already existing settings for base-AI can be used by BAI-too and Leeroy is also used by BAI by default. But that's really the only one. Maybe it should be tied to the inherit-option too, now that it is there.

With adding leashes to spawn-tiles we are back to what I'd label "very arbitrary things desired by only one person". I want to deliberately avoid overchoice when it comes to the options. I think that it's already too many.

As I said before: My focus is on increasing playing-strength, not on providing all sorts of optional arbitrary behaviors.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Juku121 on July 11, 2023, 01:38:23 pm
While I generally agree with Xilmi, I've got to do some nitpicking.

With adding leashes to spawn-tiles we are back to what I'd label "very arbitrary things desired by only one person".
Aliens camping in their UFOs has been a part of every 'proper' X-Com and X-Com clone since, well, forever, from the OG to the AfterX series to Xenonauts to nuCom. I wouldn't call that something that's "desired by only one person".

I mean, Xenonauts was infamous for how hard the aliens camped their UFO doors.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.2
Post by: Abyss on July 11, 2023, 05:07:19 pm
Xilmi, I'm not english native speaker, I do what I can.
But the basis is set clear: more slider tools for modders to adjust -  more attention BAI will eventually get.
The overall quality of AI is nice and competitive (in terms of making mass damage), although when I played your brutal AI with XCF (14 hours total) I've seen so much things that are wrong in nature.
Like, ant behavior for groups of enemies, no long-range camping at all for guys with sniper rifles,
Enemies run from the door into night field which is lighted with flares, one after one, while other 3 doors are present, two of which aren't lighted. (Bunker from Red Dawn HQ)
I didn't even have to get down the stairs into the fortified part of the base, where second part of the battle has to be set.

And, you so much wrong when call me one person with arbitrary desires.
My intention is to befriend your BAI with XCF, at least, by pointing out possibilities.   
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Xilmi on July 12, 2023, 11:12:52 am
Aliens camping in their UFOs has been a part of every 'proper' X-Com and X-Com clone since, well, forever, from the OG to the AfterX series to Xenonauts to nuCom. I wouldn't call that something that's "desired by only one person".

I mean, Xenonauts was infamous for how hard the aliens camped their UFO doors.
There's other, more generalizable ways to accomplish that way of desired camping besides having a configurable range from the spawn tile.
The primary one that comes to mind is a preference for having a roof above their head. That can also be coupled with disregarding "getting closer to the player" as a factor for looking for hiding-tiles.
This could be inserted at the lower end of the aggressiveness-scale.
I could add an aggressiveness 0 that behaves like this and then really do an inherit mapping of 0 => 0, 1 => 1, rest => 2, Only leeroy => 3
This could bring back the thrill of having to explore deep into the inside of structures. I personally think that having the AI camp even harder than it does with the current lowest aggressiveness-setting would not be fun to play against. But if several players demand it, I guess I can make it happen like that.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.2
Post by: Xilmi on July 12, 2023, 12:35:24 pm
Xilmi, I'm not english native speaker, I do what I can.
Incase you are using a translation-tool, I'd personally recommend ChatGPT. I've been getting some pretty good results with it.

But the basis is set clear: more slider tools for modders to adjust -  more attention BAI will eventually get.
I think majority of attention is likely generated by streamers like Beagle, Speedislife and 14SilverX who stream existing mods like Rosigma, XCF and Hardmode Expansion with Brutal AI enabled.
It's also not as if I didn't listen if I was contacted by mod-authors themselves.
But adding "more slider tools for modders to adjust" without modders even asking for them and while none of the modders have even used any of the already existing ones simply doesn't seem like a worthwhile investment of my time. Especially since I'm getting enough feedback for other things that affect everyone who already uses it rather than the ones who say: "I would maybe use it if it had this feature for modders"

I've seen so much things that are wrong in nature.

Like, ant behavior for groups of enemies, no long-range camping at all for guys with sniper rifles,
Enemies run from the door into night field which is lighted with flares, one after one, while other 3 doors are present, two of which aren't lighted. (Bunker from Red Dawn HQ)
I didn't even have to get down the stairs into the fortified part of the base, where second part of the battle has to be set.
This kind of feedback about questionable behavior from the AI is already much more valuable to me than requests for more modable tools.
I can draw direct conclusions from them.

Avoiding light-sources in night missions is something that can easily be fixed and would positively impact everything from base-game to mods. I just didn't really think of that, since I mostly did benchmarking in daylight. Giving a score-penalty to all tiles that are illuminated above the visibility at night-threshold is a good idea in order to avoid scenarios where enemies keep themselves revealed unnecessarily.

As I said in my reply to Juku121, I think there is logical room to add an aggressiveness lower than 1 that is particularly about camping. So if players like it much more to search for the enemies that are camping indoors instead of being confronted on the outside, they can use that. I think I will add this.

Ant-like behavior and snipers not camping is something that needs to be discussed in more detail and maybe with examples in video- or ideally save-game format.

The latter could refer to the sniper coming closer once you break line of sight to them. This would probably not even fully be addressed by the intended behavior for 0 aggressiveness. I suppose this could be because the regular behavior is to still try and hide.
I'm aware that there is a sniper-tag for modding, that is currently ignored by BAI. It could be used for a specifc kind of behavior that is about maximizing range while at the same time avoiding to break line of sight.

Ant-behavior may refer to trickling out of buildings and ending out in the open while not in range to attack. This should not happen on any aggressiveness below 3 and could relate to improper mapping of aggressiveness when inherit is activated.
The plan is to change the mapping to not use the max aggressiveness and leave it to only work when manually picked or for units with leeroy-flag.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Juku121 on July 12, 2023, 01:18:30 pm
The primary one that comes to mind is a preference for having a roof above their head.
Won't work for making aliens camp on top of their UFO, snipers in open-topped towers, or demons at their summoning circle.

That can also be coupled with disregarding "getting closer to the player" as a factor for looking for hiding-tiles.
This could be inserted at the lower end of the aggressiveness-scale.
I could add an aggressiveness 0...
These sound more like it.

I for one have always liked close-quarters combat where you've got to dig the enemy out of their positions while sightseeing all over the map. JA2 had an entire mod dedicated to urban combat back in the day.

Ant-behavior may refer to trickling out of buildings and ending out in the open while not in range to attack.
I think it refers to the enemy always taking the same routes even when they've been getting shot up for it. Not sure how you could avoid that if you don't add randomness or some sort of memory to the algorithm.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.0
Post by: Xilmi on July 12, 2023, 03:11:41 pm
Won't work for making aliens camp on top of their UFO, snipers in open-topped towers, or demons at their summoning circle.
Well, yes. Taking cover and breaking line of sight is pretty-much at the core of what my AI wants to do. So being forced to stick to a place that doesn't provide cover would be taking away a big part of what it is about.
Theoretically modders could enforce this by using-base-AI with these units and doing whatever is currently done to make base-AI to do this.
But this really once again gets into the territory of contradicting my design-goals. Sticking to a place that offers a tactical advantage and still remaining adaptive is something I can get behind with. But sticking to a place because they are told to, even if doing so is obviously suicidal, is not something I'm willing to invest my time for.
In general: I'm much more willing to work on stuff that every user is likely to experience and that don't require someone to first make a mod to use them.

I think it refers to the enemy always taking the same routes even when they've been getting shot up for it. Not sure how you could avoid that if you don't add randomness or some sort of memory to the algorithm.
If a unit gets shot on their way to somewhere, this should update the threat-map for everyone else and thus impact where other units are willing to go. Unless it's running on Leeroy/Max aggressiveness, where the threat-map is ignored.
By changing the mapping of the aggression to the behaviours in a way that max-aggression no longer will be used except for Leeroy, this issue shall be alleviated. If not, I'd need concrete examples of where it still happens to investigate.

But stuff like this shows also the problem with making too many things optional. It becomes increasingly difficult to tell intentional and unintentional behavior apart. Savegame no longer is enough for debugging, I also need the settings under which it happened.
Fixing stuff that happens on non-default-settings would take up more and more of my time the more settings there are.

I'm rather considering taking some of the options out again. Targetting-Mode for example or Bughunt for AI. The inherit-option could be renamed to something like "respect mod-options" and then include the explosive-delay and whether Leeroy/sniper/spotter-tags do something.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.2
Post by: Abyss on July 12, 2023, 09:55:33 pm
I write w/o translators.

So. When I previously asked whether you have played XCF or not, that wasn't idle curiosity.
In early to mid game, nighttime operations are preferred to player, and balanced such. Because you will be, literally, wiped out doing assault daytime. Visibility options (flares, fire and flashlights) are the same tools of victory for player, same to mines, proximity grenades, mind control and armor.
In the beginning of XCF campaign, you don't have other tools except enemy spotting options.

I suggest we call tools of victory "ToVs".
It will be very unfortunate to completely lose ToVs, but they shouldn't be very OP. Light option is OP because BAI doesn't pay too much attention to lights. Dumb AI doesn't either, but due to randomness of waypoint patterns, the player feels like DAI-controlled enemy units are more chaotic and "living" than BAI-units, which just try to eliminate player, no matter what.

One more strange pattern I've got recently.
Underwater mission vs Aquatoids, who rushed from their USO towards my submarine, one by one, divided by 6-7 tiles, letting me open the doors and kill them one by one (as they rarely preserve TU's).
What is even more strange, if player skips couple of turns, doing nothing, aquatoids surround the exit within the vision range (4-8 tiles away).
What is even more strange, they are completely helpless on their relocation.
What is super-strange here, from player's perspective:
- Aquatoids have 25(30) vision, PSI options (cross-wall vision, panic attacks and mind control) and strong weapons
- Aquanauts have 7 underwater vision.
The best option for BAI is rush and kill.
The best option for Aquatoids, in common sense, is to camp beyond player's vision and force player to leave the map. If player is locked in a condition, when he cannot pass the doors, it's also enemy victory.
Save is attached.

bai 7.0.2.
xcf 3.0.2
Aggressiveness 1
Firing method 2
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.2
Post by: Juku121 on July 12, 2023, 10:49:06 pm
But this really once again gets into the territory of contradicting my design-goals. Sticking to a place that offers a tactical advantage and still remaining adaptive is something I can get behind with. But sticking to a place because they are told to, even if doing so is obviously suicidal, is not something I'm willing to invest my time for.
Fair enough. But remember, modders can make maps and enemies with specific goals in mind. They might have a relatively open forest with a sacrificial circle in the middle, and the enemies are supposed to guard the sacrifices, not leapfrog around flushing out intruders. You can have Commanders in UFO control rooms who are supposed to stay put and present a nasty final surprise to the player or just provide psionic backup and psi vision to the rest in relative safety. You can have a ghost who's largely invulnerable to conventional weapons haunting his grave and ignoring your fire instead of sneaking around corners and trying to jumpscare your troops.

If BAI can support that with a 'tethered' aggressiveness level, it would make it much more 'compatible' with these kinds of interesting unconventional missions, even if the overall challenge might get lowered a bit.

In general: I'm much more willing to work on stuff that every user is likely to experience and that don't require someone to first make a mod to use them.
Some of the megamods already have such kinds of missions. They're not perfect due to vanilla AI being opaque and, well, what it is, but they're already there.

If a unit gets shot on their way to somewhere, this should update the threat-map for everyone else and thus impact where other units are willing to go. Unless it's running on Leeroy/Max aggressiveness, where the threat-map is ignored.
Ah, so there is a memory mechanism.

I think it might actually be max aggressiveness, since a whole bunch of XCF enemies have elevated aggression stats without beeing leeroys due to vanilla AI being too passive.

I'm rather considering taking some of the options out again. Targetting-Mode for example or Bughunt for AI.
Isn't targetting mode selection a big part of how BAI actually functions? How would taking that away work?

In early to mid game, nighttime operations are preferred to player, and balanced such.
Not really. Smoke and hard cover are viable alternatives, especially with smoke grenades being moved back to Promo I in 1.8 or so. And the whole mod has never been balanced not developed with the goal of having balance in the first place.

Visibility options (flares, fire and flashlights) are the same tools of victory for player...
Flashlights are not tools of victory, they're a way of showing the enemy where you are. :D

...are more chaotic and "living" than BAI-units, which just try to eliminate player, no matter what.
Well, that's almost the entire point of this fork. :)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.2
Post by: Abyss on July 12, 2023, 11:31:59 pm
Flashlights are not tools of victory, they're a way of showing the enemy where you are. :D
If you keep them on. On my first playthrough I abused flashlight on/off before shooting and then fired without line of sight.
As my troops were out of enemy's sight, no reaction fire followed.

But, that trick doesn't work with BAI, as enemies are pro-active and shoot back to the place from all sides.
I have to notice,
I see how BAI is better, but not yet see much surprising tactics from it, apart from it's usual all-side dynamite bombardment.
Which is overhelming, given weird OXCE toss mechanics.

Example is right here: soldier with a rifle and a grenade, all 50 stats, shoots enemy 30 tiles away - misses forever, then tosses grenade and grenade, to our surprise, arrives right under enemy feet with plain 50% chance.
Same to enemy - 30 enemies miss all shots, then three grenades from outside the wall get straight under your best soldiers.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.2
Post by: Juku121 on July 13, 2023, 09:00:37 am
If you keep them on. On my first playthrough I abused flashlight on/off before shooting and then fired without line of sight.

As my troops were out of enemy's sight, no reaction fire followed.

But, that trick doesn't work with BAI, as enemies are pro-active and shoot back to the place from all sides.
Lack of reaction fire is a good point. But otherwise, merely turning flashlights on and off lights you up for anyone with a daytime LoS. And once you're spotted, you remain spotted for a while, depending on enemy intelligence. Worse if the spotter was an actual spotter for snipers, and there are snipers around.

Vanilla snipers also shoot back at spotted but unvisible troops, but much less consistently than BAI. Although I guess the reaction fire part still works.

Which is overhelming, given weird OXCE toss mechanics.
Yeah, the ridiculous range and accuracy of grenades inherited from the original are my pet peeves as well. You can limit grenade ranges and lower the accuracy via 'throwRange' and 'throwMultiplier', but that's a bit tedious when there are a zillion grenade types around.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.2
Post by: Xilmi on July 13, 2023, 11:17:26 am
So. When I previously asked whether you have played XCF or not, that wasn't idle curiosity.
I played through January and lost plenty of cars and agents. But I've watched Speedislife's playthroughs on BAI which showed me what I was doing wrong. The meta mostly revolved around hit and run. Often only staying one turn and leaving before the AI gets to move to get some XP for the agents and only doing melee-units until getting access to armor.

One more strange pattern I've got recently.

bai 7.0.2.
xcf 3.0.2
Aggressiveness 1
Firing method 2
Your screenshot says that inherit aggression is enabled. This means that Aggressiveness of 1 is overruled by what's in the rul-files for these units. So they play like Leeroy-units.
This will definitely be changed next patch. The inherit aggressiveness gets a new option on the lower end and the maximum it can get from inheriting is "2" except when Leeroy is enabled, only then the most aggressive behavior will be employed.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.0.2
Post by: Abyss on July 13, 2023, 02:03:24 pm
I thought that's just for zombies & Cryssalids, etc.
Not sure, have to test if zombies will play hide'n'seek with me on aggressiveness 1.

This will definitely be changed next patch. The inherit aggressiveness gets a new option on the lower end and the maximum it can get from inheriting is "2" except when Leeroy is enabled, only then the most aggressive behavior will be employed.
What about Leeroys from vanilla? The enemies, that are supposed to move towards on you, no matter what?
Actually, the BAI-only code block I was trying to describe, could solve that problem.
BAI checks rulesets, and if modder adds BAI-related aggressiveness for each enemy unit, then everything go smooth and nice.
If not modder himself, anyone can do it and paste the patch to the forum. Then, there comes little from player's end. Just play and watch the story that megamod generates. 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: Xilmi on July 13, 2023, 08:13:59 pm
Brutal-OXCE 7.1.0 - Silent Steps of Stealth

There now is a new aggressiveness-value at the lower end of the spectrum, aggressiveness 0.
In this mode the AI will try to avoid being outdoors and it will not try to inch up on the player's units at all and instead exclusively look for how save they consider a hiding-spot to be. They will still peek out and attack when possible but usually most of them stay close to where they spawn until their enemies get near.

The mapping of the aggression-stat to the Brutal-AI aggressiveness when using the inherit aggression-option was changed:
Aggression 0 and 1 map to their equivalents in brutal-AI-aggressiveness.
Everything else maps to 2.
This means the sweep-mode-behavior now only happens if you either manually set the aggressiveness to 3 or the unit has the LeeroyJenkins-flag set.

As the LeeroyJenkins-mode is closely tied to Aggressiveness, it now also is only is taken into account by Brutal-AI when iherit unit-aggression is enabled.

Fixed a bracket-error in the code that decides whether a unit shall kneel down.

Fixed a bracket-error in the code that determines whether to reserve time-units for hiding.

Units controlled by Brutal-AI will now actively avoid light-sources in the darkness instead of ignoring their existence.

AI-units that would survive a proximity-grenade with more than half of their health, such as Lobstermen in Terror from the Deep, will now volunteer to walk over them in order to disarm them.

The AI now realizes that it is save to open a door if a proximity-grenade is one tile away from it and that they won't step onto it yet by doing so.

Fixed an issue that caused the code for checking how save a path is in terms of probable reaction-fire to only be run when the proximity-grenade-avoiding-logic was disabled.

Fixed an issue where blind-grenades were thrown at locations where targets were spotted several turns ago and likely long since have walked away instead of just when they were spotted during the last turn of the other faction.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: Abyss on July 13, 2023, 11:28:23 pm
BTW I further played with inherit aggression mode off, aggressiveness = 2,  and enemies mostly stood on their places and were actively seeking for cover. Moreover, they tried to take places for some reaction-fire traps.
I liked it more.

Units controlled by Brutal-AI will now actively avoid light-sources in the darkness instead of ignoring their existence.
Sounds good, but what then is priority of BAI: to kill visible enemy, while standing near the light source, or run away?
I presume both scenarios will result in reaction fire from player's units.

The AI now realizes that it is save to open a door if a proximity-grenade is one tile away from it and that they won't step onto it yet by doing so.

The proximity grenade avoiding still can be turned on/off, right?

I'll upgrade and play further next week, to give the feedback, if you interested.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: Xilmi on July 14, 2023, 10:34:26 am
Sounds good, but what then is priority of BAI: to kill visible enemy, while standing near the light source, or run away?
I presume both scenarios will result in reaction fire from player's units.
A brief description of how the decisionmaking about the movement works might bring some clarification here.
When it iterates through all tiles it could walk to it evaluates them for different purposes. These purposes have different priorities.
Highest one is positioning in order to be able to attack. For that one they need to already know a position of a target. So if they can't see your units, that won't be taken into consideration.
If they need to expose themselves to light in order to attack a visible target, they would do so. If there are several positions to attack from, the preference is usually for the one that they need the fewest amount of TUs to get to in order to minimize reaction-shots. They now also will give a bonus to tiles where they wouldn't be exposed by light for that.

The other priorities are for different forms of peeking, given there's enough TUs left to hide again after and then for hiding. Hiding also has different priorities within itself. Those are impacted by the aggression. For example aggression 0 uses a different algorithm for hiding than aggression 2. 0 just wants the savest spot possible, whereas 2 wants a compromise between safety and being close to the enemy.

Aggression 3/Leeroy skipped the peeking and hiding-phase completely and use a fallback-score which just gets better with getting closer to the enemy.

The impact of darkness is that it gives a significant bonus to all hiding and peeking-scores. So they will avoid going to the light-sources for these purposes. But they won't miss out on an opportunity to actually attack when presented with one as that has the highest priority.

Actually it's a bit more complicated since 7.0.0 because it remembers parts of the results of the last pass to see if it still has enough TUs to break LoS.
 
The proximity grenade avoiding still can be turned on/off, right?

I'll upgrade and play further next week, to give the feedback, if you interested.
Yes, can still be turned off. I did not remove any options so far. Just moved respecting Leeroy to the inherit-aggression-option, which now should be a lot more usable due to no longer putting a large amount of units without the leeroy-flag into leeroyesque behavior.

I am always interested in feedback as long as it is in accordance to my goal of making the AI stronger.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: Abyss on July 14, 2023, 02:17:37 pm
Just tested the last version in zombie mission, aggressiveness 2.
Works as intended.

BTW, in personal, I think BAI very much lacks Aggressiveness level between 2 and 3.
On level 2 units prefer to take keypoints, if no players units are known as possible targets. The next amount of turns they just wait, standing there. 
Example: sectoids and aquatoids, known for their low melee, but available psi-vision (they see through walls within 20-30 range).
The weird things about the picture below:
- aquatoid stands in the tile near to exit, so reaction fire, if someone walks in, will result in misses due to OXCE close-combat mechanics;
- aquatoid with his vision of 25 can actually stay on open terrain, ready to react, beyond visibility of player units.
- once BAI holds all keypoints, there's nothing much happens. E.g. if player skips 10 turns in the closed vehicle, nothing particular.
Only when player unit comes to the place where it can be damaged, action takes place.
There must be something pro-active, even if potentially harmful to enemy units, but less suicidal than aggression 3.

I think camping AI is good, but again, what makes the game? Excitement of unpredictability. Whether it will do so or so?
What do you think? Still wowing for some randomization, this game isn't chess, for good or bad.

I am always interested in feedback as long as it is in accordance to my goal of making the AI stronger.
You can make such strong AI, that no one will actually play the game past first 20 minutes.
Think of mass market segment, not game for 3 geniuses around the globe.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: panzer on July 18, 2023, 02:33:09 pm

BTW, in personal, I think BAI very much lacks Aggressiveness level between 2 and 3.

For certain missions, such as protecting a mansion, defending a base, and some others, this would be really useful. aliens with aggression 1, especially those with a psi vision like Ethereals, try to attack when one of them sees your units. Enemies with an aggression level between 2 and 3 could act as scouts for aggression level 1/2 and create a more attacking style of combat.
 Of course, units with this aggression should also sometimes use cover and preserve  TUs. However, their priority is to move forward to detect the enemy.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: eagles980 on July 19, 2023, 05:59:29 pm
Major props on implementing the tough units purposefully triggering mines idea, Xilmi. Quite enjoying all the other updates and improvements you've made thus far as well.

Have a couple questions, though: Would you be willing to make the better pathing for UFOs on search missions default or at least separate from 'aggressive retaliation' option? The fact that this also triggers retaliation missions on landed craft and means UFOs also always search for bases means it just never goes on for me despite the objective improvement.

Also is there a meaningful difference if one decides to manually designate the targetting mode of melee units? I wouldn't expect there to be since they need to get into visual range to attack you anyway but want to make sure. Made a mod for use with 'inherit unit aggression' base game that along with assigning sensible (to my eye anyway) aggression levels to the individual units also designates which units can target what based on their class and abilities. Essentially bulky units and soldiers position themselves closest to your units as the heavys / defacto scouts with the rarer, more specialized units having the ability to target what these guys see with only leaders generally being able to blindly target your units based on their relative position and activity thanks to their big brains (specifically thinking about blaster bombs.) Expanded this role to navigators who won by default (engineers get blaster bombs and I want to contrast their lack of "skill" using them with the leaders, medics I want being more passive) so there's a at least a theoretical threat of the AI blindly grenading your units on regular missions.

Edit: Updated the mod to toggle 'Leeroy Jenkins' mode properly.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: Abyss on July 21, 2023, 10:06:07 am
Went through base defense mission with BAI aggression 2.
I liked it.
Camping MiB sectopod is beyond good and evil.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: Dioxine on July 27, 2023, 04:14:16 am
I tried playing the current version. After first taste, I like it so far. Enemies no longer wait like lambs to be slaughtered and move in a bit more coordinated fashion. I'm a bit apprehensive about missions dragging out if they hide too much, but that can be solved by the use of explosives.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: Dioxine on July 27, 2023, 10:39:16 pm
Something is borked at a very basic level in reaction fire.

In one picture, you have agents lined one behind another. As soon as cultist came out of the door, they both reacted.

On the other one, the situation is the same, except you have them standing abreast. Only the agent next to the wall reacted, despite cultist burning all his TUs on shooting, and the other agent having high REA, half TUs and clear sight.

That's some really serious bug; and I have no explanation why it happened except using Brutal AI.

EDIT: after loading the save in OXCE 7.9.8, no Brutal AI, in the same situation both agents reacted as they should when standing abreast.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.0
Post by: Xilmi on July 31, 2023, 07:23:54 pm
EDIT: after loading the save in OXCE 7.9.8, no Brutal AI, in the same situation both agents reacted as they should when standing abreast.
This sounds really odd. :o

Can you share this save with me? I'd like to investigate this issue.

I tried to reproduce the issue in a battle-scenario. To no avail. Everyone who I put in a line for the purpose of reaction-firing did so when it was their turn according to the rules. So something about the situation on the screenshot must be special.

Edit:
I'm seeing that it is rather dark on the screenshot. So I guess night-vision applies.
A unit that is in a badly lit tile can only be seen from up to 9 tiles away.
In a straight line the agent next to the wall is exactly 9 tiles away. The one standing abreast has a distance of 9.055 according to the pythagorean theorem. So more than 9. This is my hypothesis as for why he doesn't do reaction-fire.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.2
Post by: Dioxine on August 01, 2023, 02:00:45 pm
I did not clarify what I meant by 'clear sight'. It means the cultist was within LoS; he advanced up to 6 tiles distance to both agents before opening fire.

To be honest, playing XPiratez for a couple of days (20-25 missions) before that I already had an impression that player units sometimes don't react when they should, but the situation was always too complex/chaotic to be sure and therefore I attributed it to Brutal AI saving lots of TU before advancing or me misjuding LoS.

Also your answer does not explain how both agents were able to react in exact same situation when I switched to normal OXCE (this time at range of 9 not 6, too).

Save attached.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.2
Post by: Xilmi on August 01, 2023, 09:59:55 pm
I did not clarify what I meant by 'clear sight'. It means the cultist was within LoS; he advanced up to 6 tiles distance to both agents before opening fire.

To be honest, playing XPiratez for a couple of days (20-25 missions) before that I already had an impression that player units sometimes don't react when they should, but the situation was always too complex/chaotic to be sure and therefore I attributed it to Brutal AI saving lots of TU before advancing or me misjuding LoS.

Also your answer does not explain how both agents were able to react in exact same situation when I switched to normal OXCE (this time at range of 9 not 6, too).

Save attached.
I can't reproduce the issue even with your save:

https://youtu.be/LjNBKM01jwE
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.2
Post by: Abyss on August 02, 2023, 12:42:03 pm
So, what do you think of aggression 2.5, Xilmi?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.2
Post by: Xilmi on August 03, 2023, 11:58:40 pm
So, what do you think of aggression 2.5, Xilmi?
Your wish has been granted. Check out the patch-notes for 7.2.0.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.2
Post by: Solarius Scorch on August 04, 2023, 03:29:06 pm
I can't reproduce the issue even with your save:

For what it's worth, I can confirm Dio's problem - saw it with my own eyes.

I wish I could be more specific, but all I can say is that it's happened and it is a major problem.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.2
Post by: Xilmi on August 04, 2023, 08:42:12 pm
For what it's worth, I can confirm Dio's problem - saw it with my own eyes.

I wish I could be more specific, but all I can say is that it's happened and it is a major problem.
I think I need concrete reproduction-steps. Ideally in video-form. In the save he attached the units aren't where they are on the screenshots. And if I move them there, they reaction-kill the enemy before he even can do anything. Maybe there's also sub-mods involved or specific option-settings. Ideally I'd like to have a zip with the options.cfg and all the relevant mods & submods.

I mean Speedislife has been streaming XCF with Brutal-OXCE since ages and neither him, me or any of his other viewers have reported anything the like.

Edit: Okay, I tried it again. I dropped Kaupo's weapon, so he can't kill the enemy. In this case Karim did not react 27,39,0 while the enemy was at 18,38,0. I switched both agents in the next attempt and in this case Karim reacted and Kaupo didn't. The enemy also couldn't attack the agent on 27,39,0. So it really seems that my initial hypothesis about the range being >9 is the issue here. It's right at the edge to be visible from 27,38,0 but not from 27,39,0.

Also when I don't enable night-vision, it is pitch-black there. On Dioxine's screenshot it is much more bright.

I'll now try with OXCE...
Screenshot is with OXCE 7.8.5 and as expected I didn't get a reaction either.

Edit 2: Tried with official 7.9.8 too and same result. Unit on 27,39,0 does not react to unit on 18,38,0. As it should be due to the darkness limiting vision to 9 tiles.

My current hypothesis as for why it supposedly has worked with that version is that there probably was some sort of always daytime mod enabled. This hypothesis is backed by how much brighter it is on Dioxine's screenshot than it is on the second one I just attached when I disable night-vision.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.1
Post by: panzer on August 04, 2023, 09:32:10 pm
Hello. I found a small bug in version 7.2.2. Melee enemies attack you from a distance. Here is the save. Just boot up and make a move. Or turn your back on the enemies and make a move)))
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.2
Post by: psavola on August 04, 2023, 09:42:36 pm
My current hypothesis as for why it supposedly has worked with that version is that there probably was some sort of always daytime mod enabled. This hypothesis is backed by how much brighter it is on Dioxine's screenshot than it is on the second one I just attached when I disable night-vision.

I doubt that; using such a mod would show up in the save -- and you can adjust the brightness of the screen in OXCE, which will make even pitch-dark appear relatively bright (but does not affect the actual visibility). I suspect that's what's going on. Don't know about the rest, though.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.1
Post by: Xilmi on August 04, 2023, 09:46:50 pm
Hello. I found a small bug in version 7.2.2. Melee enemies attack you from a distance. Here is the save. Just boot up and make a move. Or turn your back on the enemies and make a move)))
What mod is this save for? It doesn't show up in Vanilla.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.2
Post by: Xilmi on August 04, 2023, 09:48:01 pm
I doubt that; using such a mod would show up in the save -- and you can adjust the brightness of the screen in OXCE, which will make even pitch-dark appear relatively bright (but does not affect the actual visibility). I suspect that's what's going on. Don't know about the rest, though.
Right. I would have gotten a message about different mods. So this is ruled out. What I can't rule out though is that the situation was probably not exactly the same with the tiles I mentioned.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.1
Post by: Xilmi on August 04, 2023, 09:54:42 pm
Hello. I found a small bug in version 7.2.2. Melee enemies attack you from a distance. Here is the save. Just boot up and make a move. Or turn your back on the enemies and make a move)))
I loaded the save in X-Com-Files and got a message about missing mods.
But other than that there were Chupacabras and they all went into melee-range before attacking.
So this is the next bug-report I'm having trouble reproducing. :\
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.1
Post by: panzer on August 04, 2023, 10:14:03 pm
I loaded the save in X-Com-Files and got a message about missing mods.
But other than that there were Chupacabras and they all went into melee-range before attacking.
So this is the next bug-report I'm having trouble reproducing. :\
Yes, The X-Com Files mod. This is weird. Try this save.
If everything goes well with you again, then I have something with the game.
By the way, on 7.2.1 everything is fine with me.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.1
Post by: Xilmi on August 04, 2023, 10:29:33 pm
Yes, The X-Com Files mod. This is weird. Try this save.
If everything goes well with you again, then I have something with the game.
By the way, on 7.2.1 everything is fine with me.
https://youtu.be/uMY8JZ3-uVc

This is what happens for me.

I'll try to check whether I have the latest version of XCF later. Maybe something chaned there that in the combination with my recent changes somehow causes this.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.1.2
Post by: Dioxine on August 04, 2023, 11:30:11 pm
My current hypothesis as for why it supposedly has worked with that version is that there probably was some sort of always daytime mod enabled. This hypothesis is backed by how much brighter it is on Dioxine's screenshot than it is on the second one I just attached when I disable night-vision.

No, I just used ctrl+alt+end  half light mode, lmao. If there was anything that could influence visibility, I would have told you so in the bug report. Anyway, it's your problem, not mine, I won't be installing video capturing soft just to prove my point. I only reported what I seen and checked myself (and like I say, I don't think the problem is specific to this situation - there were many times I felt my troops in XPZ should have reacted but they didn't, but there always existed some possible other explanation). I included the same save I used for testing this situation myself, from turn start - I could not test much if they were in set positions already.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.1
Post by: Xilmi on August 05, 2023, 01:26:45 am
Yes, The X-Com Files mod. This is weird. Try this save.
If everything goes well with you again, then I have something with the game.
By the way, on 7.2.1 everything is fine with me.
Can you attack your options.cfg?

I've seen it happen on Silver's stream too. And with his save from right before it happened, I couldn't reproduce it either. So my only hope to reproduce it is that it's tied to some sort of option.

Edit: I finally managed to reproduce it by deleting my options.cfg and letting the game create a new one... Now I just have to figure how the heck it can be related to something that is disabled by any of the non-default options. :o

Edit 2: Okay... The only thing I changed was enabling traceAI and it's gone. This is... puzzling. I guess I somewhere run some code only in... wait...

Edit 3: 7.2.3 with a fix is available.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.1
Post by: panzer on August 05, 2023, 12:55:52 pm
Edit 3: 7.2.3 with a fix is available.
7.2.3 everything works as it should. Thank you :) 8)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.3
Post by: Xilmi on August 07, 2023, 03:21:02 pm
I've been doing some tests with Autoplay set to aggressiveness 3 and 2 yesterday in an alien-base and due to how it is more relatable to see how things play from the player's perspective I found some disagreeable behaviors, I wouldn't have considered as so disagreeable when only looking at it from the perspective of the aliens.

One thing I realized is that after peeking the AI often chooses a significantly more forward position than where the unit went to peek. As a player I don't really play like that because the risk of that unit being discovered by the enemy on their turn or even worse running right into them with no TUs left is simply too high.

Units that are too far away from the action should of course feel free to spend their TUs on getting closer so they can help their friends on the front. But a unit that just peeked around a corner, and saw it is clear, probably should value avoiding being discovered more highly.

So I will continue doing more with Autoplay in order to be able to better compare the AI's behavior to with what I would have done myself and try to get it closer to that.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.3
Post by: Xilmi on August 08, 2023, 01:49:48 pm
I experimented around with this and the results were rather inconsistent.
X-Com did significantly better with these changes but the aliens actually did a little worse.
This indicates that the ideal behavior is dependent on unit-stats.

I ran the experiments with personal armor + lasers against the lowest tech-level sectoids. This meant that X-Com-soldiers often survived shots from the Plasma-Pistols whereas the Sectoids usually died once they were attacked.

Oh, I also ran an experiment with Lobstermen and those did really-really well.

It might sound counter-intuitive but the finding was basically: The more tanky the unit is, the more it benefitted from a defensive playstyle. The less tanky units needed to be able to coordinate their attacks well so the enemy get overwhelmed and can't retaliate.

I think there's no easy solution for this. There's basically two different tactical goals that contradict each other:
On one hand you want to have as many units close to the enemy so that once you discover them you can rotate in enough firepower to take them out. On the other hand you don't want your units be in a spot that when the enemy finds them they can take them out.

I'd also say it was kinda like a rock-paper-scissors when it comes to how different approaches worked against one another. The very defensive style did well against the very aggressive style. The slow-advancing-style did well against the very defensive style. And the very aggressive style did well against the slow advancing-style.

Reminds me at the StarCraft-Bot-scene. A lot of bots have different styles and try to memorize which approach was good against which enemy. If one approach fails they cycle to the next.

Maybe my algorithm for deciding when to be defensive wasn't ideal yet. I'd say it was often too defensive in situations where being a little more aggressive could have done better. The decision-making-mechanism could be more nuanced. For example the unit determines if the location it currently is at is considered save based on the information it has. So it's a binary information and I let them play defensively, whenever they felt not completely safe. For the tiles to go to the safety is measured in TU-equivalents and I use half the units max-TUs as threshold to determine whether it's worth reserving TUs for hiding after shooting or continue to attack until we don't have enough TUs. Using a similar approach for the decision-making of whether to value closeness over safety could also make sense.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.3
Post by: Abyss on August 09, 2023, 10:46:30 am
Hey Xilmi,
In 5 years I haven't seen ANY blaster launchers shots from OXCE AI. All these guys with blaster launchers (mind-guided missiles) were just decorations to punch them and collect stuff. This solely is an advancement worth mentioning.
Bad the thing is: all mods are balanced around some enemy units being decoration instead of real competitive power.
Just in case.

For everything you mentioned, yes, game conditions sometimes resemble RSP game. But each race in original has been designed having their strengths and weaknesses. Like, tanky mutons are weak to mind attacks, while weak sectoids (and aquatoids) can watch through walls (!) and can apply mind control themselves. If only that can be considered in decision of BAI strategy in each particular case, that will be mind-blowing experience for a player.

Stats do determine a lot, and that's one of player's tools of victory: while in the beginning stats of hired personnel are weak and uncompetitive, trained and transformed units are well above mediocre-level enemies.  When you compare experience from auto-quick battle with campaign mission, please consider that player units in second case are stronger (tool of victory, you remember?)

In the beginning, I was frustrated how different the base assault mission is. All enemy units simultaneously take proper positions and attack, making base attack few-turn intense operation. While playing against vanilla AI you had to look all at all corners of the map to find some dangling entity that doesn't know what to do (and that it's haven is under assault).
Again, the problem here is that all has been balanced against some units are decorations until certain point of time. E.g. you battle against one half of enemies in the first sector of the map, then 1/4 in next sector upon spread of your units and so on.

Both situations are extremes.
Both situations are getting player bored after same and same experience in each mission.

I think, I would like to make three suggestions:
1) OXCE menu option
If modder doesn't yet assign each unit's aggression, possible solution is to add some randomization in assigning BAI units playstyles in the beginning of each mission. Is it feasible?
The advanced suggestion is decisive randomization: if BAI can check the units role, it can assign from diapason of aggressiveness: like 0-3 for ranged, 0-2 to mind controllers and 2-4 to melee.

2) The second suggestion regards sameness of each mission. Do you have any insights how to make BAI switch strategies in between?
It's getting weird to watch some low-tier enemy shoot ordinary pistol bullets into power-armor units. Any feedback from action?
Player sees if the attack indeed damages enemy unit (enemy unit gets colored slightly red if any damage, or intense red if fatal wounds are inflicted), I think enemy deserves the same. 
 
3) Related to (1): Race strategy personalization. BAI checks stats and if some competitive sides are available, BAI finds the strategy to maximize it.
Example: condition - night, sectoid NV is far better than players => attack from beyond and mind control more, than approach.
Or, implement mass panic operation. Like, all BAI sectoids are hidden in the ship and emit panic messages to approaching troops, which then be their competitive advantage during the battle inside a ship. 

These suggestions may conflict, but vary gameplay much, which is good in terms of several hundred missions during the ordinary campaign.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.3
Post by: DeltaEpsilon on August 10, 2023, 01:44:08 am
Not sure if this is a bugreport or something to check, but "strict checking for blockages" apparently breaks some missions in X-Com Files.

The one I found this out the hard way in was "Osiron Cruise Ship" assault mission. In this mission, there are stairs that go up to upper deck.
With the option on, the second segment on the stairs acts as an obstacle and pathfinding fails.

A savefile is attached demonstrating it.

While the option does stay "this can block off areas if the map wasn't built correctly", it is unclear exactly what this means and there is nothing seemingly unusual about the stairs setup in this mission.

Screenshots:
The option off: (https://media.discordapp.net/attachments/356647134264557570/1138965356938018946/openxcom_2023_08_10_03_40_31.png)
The option on [clicking here does nothing]: (https://media.discordapp.net/attachments/356647134264557570/1138965707359522886/openxcom_2023_08_10_03_42_45.png)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.3
Post by: Xilmi on August 10, 2023, 03:23:25 pm
While the option does stay "this can block off areas if the map wasn't built correctly", it is unclear exactly what this means and there is nothing seemingly unusual about the stairs setup in this mission.
What I mean by "built incorrectly" is that the particular tile has a "BIGWALL"-flag. You as a player cannot see that. This can be seen and modified in the MCD-File containing that tile.

The AI no longer depends on that flag and there's other ways to figure out whether something is walkable or not, so just leave it off. Spawning something into solid block also seems to be super-rare. I've only seen it happen once when a soldier was carrying a stunned alien in the backpack, it woke up and then was spawned into a block. This is the kind of thing this option would prevent.

But since mappers have made many maps without even knowing that doing this was not intended, there's now a lot of map-segments that would not be walkable if the blockage-checking is enforced.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.2.3
Post by: Nalca on August 11, 2023, 04:09:02 pm
Hey Xilmi,
In 5 years I haven't seen ANY blaster launchers shots from OXCE AI. All these guys with blaster launchers (mind-guided missiles) were just decorations to punch them and collect stuff. This solely is an advancement worth mentioning.
Bad the thing is: all mods are balanced around some enemy units being decoration instead of real competitive power.
Just in case.

Aliens (or in my case, Academy Pionners) DO use blaster launchers. I have been blasted today. But I think they use it like a rocket launcher, not like a GUIDED rocker launcher.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 11, 2023, 07:10:11 pm
Aliens (or in my case, Academy Pionners) DO use blaster launchers. I have been blasted today. But I think they use it like a rocket launcher, not like a GUIDED rocker launcher.
The original algorithm had at least one big flaw and for the most part was incomprehensible to me. So I ended up rewriting it almost completely.

The main flaw was that it first determines the target to shoot at and then tries to look whether there's a path to it. If it failed to find a path to the best target it would not use the blaster at all this turn. Couple this with the cheaty-way the base-AI determines targets (it considers units as viable that it had seen several turns before), it will very often want to go for a target that it can't attack.

I put the target-search in a loop. If the best known target can't be pathed to, then try the second best and so on until it finds one that actually can be attacked.

And I rewrote the waypoint-setting-algorithm into something I can comprehend. Basically I go the path from the target-unit backwards and every time the direction or Z-axis changes I put a waypoint. This might be a bit wasteful, but it's reasonably safe in the sense that missiles don't fly into a wall too often. Also I do the same trick players do: If I have leftover-waypoints, I put another one on the final destination, which makes sure the missile will really go there and not fly further into it's previous direction.
If you use the mod that allows unlimited waypoints, then I also allow the AI to do so.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 11, 2023, 10:09:45 pm
Hi,

in general BrutalAI I think is great compared to the vanilla AI, thanks for coding it!

But I would like to request some feature for the autoplay option (AI controlled X-Com soldiers, which I use a lot for tedious missions):

-) Two separate yes/no option for turning the autoplay off at every new combat and every new turn.

-) Some way to control the behavior of the individual soldiers just like modders can do with alien units. The aggressiveness parameter at the moment. I'd also like this settings to be stored with the geoscape soldier such that it is persistent between combats.

-) A persistent (between combats/turns) switch to exclude specific soldiers from the autoplay, also to be stored with the geoscape soldier.
The reasoning is that the AI does not handle some missions, specific situations or specific soldiers (equipment etc) as nice as others or the way I'd want it.

I can probably do the code for the UI, the setting per Soldier and the Options class / Options.cfg myself, so I mainly request the hooking into the AI code itself.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 11, 2023, 10:16:31 pm
For the incompatibility between BrutalAI and mods, I found two minor cases. I do not really mind if they are fixed or not.

-) X-Chronicle has various soldier types with special weapons without icons or use in empty hands (they can only be accessed via soldier skills), but the AI uses them anyway directly (not via a soldier skill). At least with the latest version I tried, which is something like 6.4.
-) Unexcom defines hangars with a capacity of two, but defines no positions for the crafts. Which will not load, as of version approximate 7.1.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 12, 2023, 01:56:23 pm
Hi,

in general BrutalAI I think is great compared to the vanilla AI, thanks for coding it!

But I would like to request some feature for the autoplay option (AI controlled X-Com soldiers, which I use a lot for tedious missions):

-) Two separate yes/no option for turning the autoplay off at every new combat and every new turn.

-) Some way to control the behavior of the individual soldiers just like modders can do with alien units. The aggressiveness parameter at the moment. I'd also like this settings to be stored with the geoscape soldier such that it is persistent between combats.

-) A persistent (between combats/turns) switch to exclude specific soldiers from the autoplay, also to be stored with the geoscape soldier.
The reasoning is that the AI does not handle some missions, specific situations or specific soldiers (equipment etc) as nice as others or the way I'd want it.

I can probably do the code for the UI, the setting per Soldier and the Options class / Options.cfg myself, so I mainly request the hooking into the AI code itself.
If you'll do the UI stuff, I sure can do the rest. The hooking to the AI should be pretty easy. Just need to read the settings from the Geoscape-Soldier, that the BattleUnit-likely has access to.

Combining some soldiers being on auto while others are not sounds a bit challenging from the turn-processing-perspective.

An alternative solution could be to make "hotkeys" for a semi-automatic-behaviour. Basically you press a hotkey for each soldier when it's selected and it will handle stuff with AI immediately but only for that soldier. Different hotkeys for different aggressivenesses.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 12, 2023, 02:01:51 pm
-) X-Chronicle has various soldier types with special weapons without icons or use in empty hands (they can only be accessed via soldier skills), but the AI uses them anyway directly (not via a soldier skill). At least with the latest version I tried, which is something like 6.4.
I don't really understand what that means. What difference does it make gameplay wise to use an ability directly or via soldier-skills? Can you provide an example/savegame of what you mean?

-) Unexcom defines hangars with a capacity of two, but defines no positions for the crafts. Which will not load, as of version approximate 7.1.
There's a workaround for that since 7.1.2:

"The game no longer crashes with the "Not enough position vectors for crafts allocation."-message when a mod defines a hangar that can have several crafts but doesn't have sprite-offsets assigned to them.

Instead there will only be an error-message in the OpenXcom.log and all craft-sprites are drawn in the center of the hangar-sprite.

The proper way to use hangars that can hold several craft in Brutal-OXCE is to define an offset for the sprite drawing location from the hangar-sprite-center like this:
crafts: 2
craftSlots:

[-10, -10, 0]
[ 10, 10, 0]"
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: DeltaEpsilon on August 12, 2023, 02:04:12 pm
A [nerfing] suggestion for the AI to match the player: the AI should probably not be able to know the whole map on the first turn and have to discover the map tiles itself as well.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 12, 2023, 02:10:11 pm
A [nerfing] suggestion for the AI to match the player: the AI should probably not be able to know the whole map on the first turn and have to discover the map tiles itself as well.
Can you give me some examples in what ways you think knowledge of the map impacts the AI's decision-making?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: DeltaEpsilon on August 12, 2023, 05:09:20 pm
Well, some simple examples:

1. Missions on maps of high complexity.
Things such as caves or missions localized entirely within buildings with many rooms. AI should not be able to immediately know locations of rooms with high visibility yet good cover and go there.
It's extra cheap with psi-sense since AI ends up immediately coalescing into near perfect spots and/or setting ambushes.

2. Missions where the enemy starts within a small area as opposed to being spread over the map.
Same issue: available vantage (or peek) points should not be immediately known until they're seen.
It should be noted that the player can actually do that with map sense [aka just memorized map tiles] though.

3. General issue: line of fire check should fail if it passes thru unseen tiles
The player doesn't have access to any tools to check if there is a line of fire until they actually post the unit at the tile and try to shoot from there. This is a significant part of consumed TU during a turn often: trying out several positions from which to shoot.
The AI does, but not only can it check it without actually having to move and spend TU, it can check it from any reachable position, including those not yet seen, thus providing it with information the player wouldn't be able to get.
For example, suppose a spotter spots a player unit. A sniper is on the first floor of a building (say, those farmland buildings, with stairs going up) and hasn't seen the second floor. Currently, the sniper can immediately walk up to the second floor, knowing there is a window in there and shoot the player. How would a player know there was a window there and an LoF available besides memorizing that only this particular map tile has this particular distribution of windows on the second floor?



This is extraordinarily bullshit in complex maps because non-full tile obstacles and changes in elevation have very unpredictable effects on LoF for the player [try fighting around stairs, it's maddening. Or just in a jungle]. In this regard, the AI cheats.
Being able to test thru unseen tiles is the smaller part of the cheat, being able to mentally teleport and check for LoF is the bigger part.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.2
Post by: Xilmi on August 14, 2023, 12:20:36 pm
Well, most of what you say is technically correct.

I do, however, think that making the changes you suggest would vastly overcompensate and actually put the AI at a disadvantage. I also think you underestimate the capability of a player to make good guesses about these things. Especially when it comes to experienced players who are the target-audience for this modification.

For example:
You say that undiscovered tiles should be considered as line-of-fire-blocking by the AI because a player couldn't possibly know. Not knowing does not mean being incapable of making an educated guess.
I'm willing to bet that based on what I can see, I would guess correctly in the vast majority of cases, whether there's something within the undiscovered tiles would block the line of fire. I know what kind of maps to expect depending on tile-set and whether it is more likely to be blocked or not. On an arctics-map I know there won't be anything. On an alien-base-map I know there will almost certainly be something.

There's also a point to be made about how in in-game-logic, with the exception of an x-com-base-defense, the Aliens are supposed to have been there before X-Com. Usually hours before. So them having themselves familiarized with the terrain in the area is nothing that shall come as a surprise.

And even if I realized this, the impact likely would be quite marginal due to the aliens starting out spread out. They would pretty much immediately see the vast majority of things they need to see in order to make these assessments.

Also when it comes to guessing whether I'd have a line of fire from a certain tile to another, experience goes a long way with guessing more accurately.

Enabling the "Performance Optimization", besides faster turn-times also reduces accuracy in the AI's guesses. What it changes is that instead of doing the complex line-of-fire-check, it simply draws a mental line between the center of one tile to the center of the other and see whether there's something in the way. This has quite a lot of false negatives and leads the AI to not consider possible shots or go to worse tiles. So you might consider using that option for that purpose.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 15, 2023, 07:15:24 pm
I don't really understand what that means. What difference does it make gameplay wise to use an ability directly or via soldier-skills? Can you provide an example/savegame of what you mean?

I could craft a savegame if you want.
The difference for X-Chronicle is the cost of use in tu/mana/etc, they are defined both for the special weapon and the soldier skill. But the ruleset allows for some more differences.
Another example would be special weapons that the player cannot use under any circumstance, the ruleset allows that. Although I have not seen a mod in the wild doing that.
I could quote the relevant ruleset properties for items, weapons in special, if that helps.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 15, 2023, 07:19:51 pm
If you'll do the UI stuff, I sure can do the rest. The hooking to the AI should be pretty easy. Just need to read the settings from the Geoscape-Soldier, that the BattleUnit-likely has access to.
See the attached screenshots for what I use at the moment. Also accessible from the craft screen. I probably should add a way to access it from the battlescape too. The aggressive parameter could be added easily too.
Let me know and I will do a pull request.


Combining some soldiers being on auto while others are not sounds a bit challenging from the turn-processing-perspective.
As a player I would be fine with skipping the non-auto soldiers till all soldiers on auto are done and then pass the control to the player again.
I use the attached short hack for 7.12 which nearly does that, except passing the control to the player at the end of the turn.



An alternative solution could be to make "hotkeys" for a semi-automatic-behaviour. Basically you press a hotkey for each soldier when it's selected and it will handle stuff with AI immediately but only for that soldier. Different hotkeys for different aggressivenesses.
That sounds great too!
I'm not sure how easy that is, I see the AI do a lot of "Take a very little action, like peek one square, cylce to the next soldier, repeat".
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.2
Post by: DeltaEpsilon on August 15, 2023, 10:17:56 pm
Any thoughts on providing an option for adjusting enabled Brutal AI facilities based on unit's intelligence stat? Say disabling it for units with very low intelligence, provide squad sight for higher intelligence, maybe even third vision mode for higher int still etc. Maybe some kind of intelligence-to-options curve.

Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.2
Post by: Xilmi on August 16, 2023, 11:46:27 am
@GumChewer & DeltaEpsilon:

Currently I've identified some general issues with the AI's logic. So working on feature-requests will have to wait.

I noticed that one of the intended behaviours didn't work properly. But after fixing it, the AI actually did worse in the benchmark. I tried that maybe the feature doesn't make sense and thus disabled it. And this also did work in the benchmark. So if the bugged behavior is better than the intended behavior, this means that my intentional-behavior isn't good.

The intention was: "Don't attack if you can't return to good cover after attacking."
The bugged behavior was: "It went to the position, realized it didn't have enough TUs to both attack and go back to cover and then went back to cover, thus wasting their TUs".

My hypothesis as to why that bugged behavior still led to overall better results is that it could spot enemies it otherwise probably wouldn't have spotted and that the new cover-position was better for acting next turn.

If this makes it better, it means two things:

The current changes to peeking-behavior are probably a regression. My thought process was that if the "walktotarget" was already spotted by someone else, then peeking is not necessary. However, I now realized that a unit that has recently been spotted always takes precedent as a "walktotarget" over hypothetical units that are just guessed. So if a unit was spotted very far away, a unit now might not peek because it already knows a target but thus will miss targets that are much closer. And the aforementioned bug helped against that being an issue in some cases. So instead there should be a peektotarget, which is the assumed closest enemy regardless of whether it was already spotted. But even this might be worse than just always peeking. Maybe peeking logic should be reworked completely. The goal is to get the best possible reconnaissance for the lowest possible TU-investment.

The other thing that this indicates is that the makeshift cover-position it goes to after realizing it can't attack and go to cover could be better than the prior, much safer cover-position afterall. This means that the changes to cover seeking-logic an 7.3.0 also are questionable.
They were made to maximize safety when seeking cover. But this has the disadvantage of units not taking part in an ongoing combat, when they don't want to leave their save spots. This in turn will lead to enemies being singled out.
My idea is to change the behavior when contact has been made. In this case cooperation with the own team should take precedent over individual safety and less good cover should be considered as viable.

There also is a general contradiction with good cover and the peeking-logic. If the goal of peeking is to get the most reconnaissance for the lowest investment of TUs, then too good of a cover-position will contradict this goal.

Overall: Turns out finding the best approach is pretty difficult given how many possible scenarios there are. :o
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 16, 2023, 11:49:26 am
Let me know and I will do a pull request.
Yeah, doing a PR or linking to your Github-Repo would probably help more than attaching a patch-file. :o
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 22, 2023, 01:55:19 pm
Yeah, doing a PR or linking to your Github-Repo would probably help more than attaching a patch-file. :o

I've opened a pull request. Just have a look whenever you find the time and let me know what you think.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 22, 2023, 08:47:28 pm
I've opened a pull request. Just have a look whenever you find the time and let me know what you think.
What branch have you directed it to? I'm not seeing it on "oxce-plus", which is what I'm working on.
I'm not seeing it anywhere. I think I should get some sort of notificaction. Can you post a link?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: DeltaEpsilon on August 22, 2023, 09:23:23 pm
What branch have you directed it to? I'm not seeing it on "oxce-plus", which is what I'm working on.
I'm not seeing it anywhere. I think I should get some sort of notificaction. Can you post a link?

Uhhh..
https://github.com/Xilmi/OpenXcom/pull/4

(https://media.discordapp.net/attachments/356647134264557570/1143611360815620187/image.png)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: Abyss on August 23, 2023, 09:19:57 am
Xilmi, hi!
May the goddess bless you, you are wonderful.

For the sake of added variety and value of your mod, please consider these questions:

What do you think of randomization of units aggressiveness within one battle? Is it feasible?
Can BAI core support the multiple aggressiveness scenarios within one enemy turn, given that it can change the value?
What do you think if unit aggressiveness changes to lower value if enemy gets fatal wound?

I think the following options would do great:
* Enable Brutal AI vary aggressiveness of enemy units (On/Off)
* Min Aggressiveness (0-4)
* Max Aggressiveness (1-4)
* Enable Brutal AI lower aggressiveness if unit gets fatal wound (On/Off)

With true random generator, each battle will be different.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: Xilmi on August 23, 2023, 11:00:08 am
What do you think of randomization of units aggressiveness within one battle? Is it feasible?
That would both be feasible and relatively easy to implement.

Can BAI core support the multiple aggressiveness scenarios within one enemy turn, given that it can change the value?
The value could be changed on every pass a unit goes through and also tied to certain conditions. My idea of realizing the random aggressiveness was to roll for it at the beginning of the first turn. But it could also happen every turn. But that's probably a bit too random.

What do you think if unit aggressiveness changes to lower value if enemy gets fatal wound?
Not as default-behaviour. Right now the exact opposite is happening. If a unit with a wound knows that it would die or fall unconscious within the next three turns, it goes into sweep-mode in the hopes of accomplishing something while dying in cover and potentially hurting their friends with a pre-primed-grenade.
But I reckon that from the individual's perspective this is not particularly realistic.

I think the following options would do great:
* Enable Brutal AI vary aggressiveness of enemy units (On/Off)
* Min Aggressiveness (0-4)
* Max Aggressiveness (1-4)
* Enable Brutal AI lower aggressiveness if unit gets fatal wound (On/Off)
The first three of these sound good to me. I'm currently quite content with the AIs default-behaviour, so adding more options is fine with me.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 23, 2023, 11:01:58 am
Uhhh..
https://github.com/Xilmi/OpenXcom/pull/4

(https://media.discordapp.net/attachments/356647134264557570/1143611360815620187/image.png)
Ah, I see it now. And I also see that someone else did another pull-request some time ago, which I also ignored. I thought Github Desktop would show these like the ones directed at Meridian's branch.

I'll take a look at both of these in the afternoon.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: Abyss on August 23, 2023, 01:15:26 pm
The value could be changed on every pass a unit goes through and also tied to certain conditions. My idea of realizing the random aggressiveness was to roll for it at the beginning of the first turn. But it could also happen every turn. But that's probably a bit too random.
Well, this worth collective consideration to give max profit for the gameplay.
- the most frustrating thing is that AI-controlled units are most likely scattered around the map.
- the second thing is that with BAI level 2, most battles are ending within 5-10 turns, except the grand maps like bases, mansions and story missions (more exposure and pressure than DAI).
 
Occasionally, the way it can work is between-turn switching from pre-rolled aggressiveness to aggressiveness level 2 and back. Say, BAI randomizes ninja to 2.5, then, in random turn to 2, and again.
Also, a switch between 1 and 2.5 may seem intriguing.

Balanced twist scenarios are always welcome.
That can be also referred to as aggressiveness waves. Sounds cool.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 23, 2023, 05:00:19 pm
Uhhh..
https://github.com/Xilmi/OpenXcom/pull/4
I'm getting linker-errors while trying to build.

Edit: I think I found the issue. You either don't use Visual-Studio or forgot to include the modifier vcxproj-file to your commit.

Edit2: Now it compiles but crashes when I click the Soldiers-Button in the Basescape.
The crash seems to be correlated to this line:

_btnAI->onKeyboardPress((ActionHandler)&SoldiersState::btnAIClick, Options::keyAIList);

in SoldiersState::SoldiersState

Sorry, but this is getting a bit too much of a hassle for me. So I'll revert the inclusion of your code for now.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: DeltaEpsilon on August 23, 2023, 07:55:20 pm
Not my code. Out of curiosity, have you never used GitHub?
You should write found issues in pull request comments: you can point at problematic lines there as well.

Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 24, 2023, 08:35:20 am
I'm getting linker-errors while trying to build.

Edit: I think I found the issue. You either don't use Visual-Studio or forgot to include the modifier vcxproj-file to your commit.

Edit2: Now it compiles but crashes when I click the Soldiers-Button in the Basescape.
The crash seems to be correlated to this line:

_btnAI->onKeyboardPress((ActionHandler)&SoldiersState::btnAIClick, Options::keyAIList);

in SoldiersState::SoldiersState

Sorry, but this is getting a bit too much of a hassle for me. So I'll revert the inclusion of your code for now.

Right, sorry! I messed up the export to github.
I double checked and opened a new pull request.
Please check too, as I do not use Visual Studio.


I think it is better to not merge into your main branch unless you are sure the code is good.
Please see my last commit message, my hooking into the AI needs improvement.
It would be easier if I could do a pull request into a new branch, but I do not see support on Github for that.
In case you do not want to merge and revert, you'd have to add a new branch or get the code from my repository. You can download a zip via the green code button from the website too:
https://github.com/GumChewer1980/BrutalAI/tree/autocombat-options
In case you want to commit something first before merging, you should be able to do so in my repo to.

Otherwise just let me know.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: Xilmi on August 24, 2023, 12:03:13 pm
Not my code. Out of curiosity, have you never used GitHub?
You should write found issues in pull request comments: you can point at problematic lines there as well.
I've been using GitHub for years but I'm still not proficient in using it. Especially when it comes to things I've never done. These were the first two Pull-Requests I've gotten, so I didn't know what the proper way of doing it was.

I also thought I need to first merge it before I can try it out and then maybe report what I found.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 24, 2023, 12:18:26 pm
Right, sorry! I messed up the export to github.
I double checked and opened a new pull request.
Please check too, as I do not use Visual Studio.


I think it is better to not merge into your main branch unless you are sure the code is good.
Please see my last commit message, my hooking into the AI needs improvement.
It would be easier if I could do a pull request into a new branch, but I do not see support on Github for that.
In case you do not want to merge and revert, you'd have to add a new branch or get the code from my repository. You can download a zip via the green code button from the website too:
https://github.com/GumChewer1980/BrutalAI/tree/autocombat-options
In case you want to commit something first before merging, you should be able to do so in my repo to.

Otherwise just let me know.
Now that I know where to add the files so they get compiled by VS, this isn't a problem anymore. It's was only difficult because I had to find out what to do. Now it's just 2 clicks or so.
Since I can always simply revert merges, I don't see much of an issue trying stuff on the main-branch.
I can look at the hooking again. I think I will change it a little-bit. But I didn't get so far due to the crashes.
There's a better way than downloading the zip:

On the git-console I can do:
Once: git add gum <URL to your Repo>
Every time: git fetch gum

("gum" in this case is a name I can freely pick as identifier how it will be shown for me)

And then I'll see your repo with all directories directly in GitHub-Desktop right under Meridian's oxce-plus-repo and can merge from there.

My gist about github is: There's a lot of ways of doing things with it. The intended one is usually the best. But if you don't know the intended way but some other way that also works, it's fine too.

With the method described above, I don't even need pull-requests. Just the URLs of people's repos. Which I can even find myself by just looking at who forked from me.

I definitely didn't want to deter contributors, so bear with me, when I appear a little incompetent about this stuff. I may have a clue about AI but when it comes to the whole code-management-stuff, I feel a lot less confident and have a lot to learn.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: Nalca on August 24, 2023, 02:42:28 pm
I've been using GitHub for years but I'm still not proficient in using it. Especially when it comes to things I've never done. These were the first two Pull-Requests I've gotten, so I didn't know what the proper way of doing it was.

I also thought I need to first merge it before I can try it out and then maybe report what I found.

You can checkout the branch of the pull request, that way you don't need to merge on master.
Github will tell you if the branch require a modification before merging.

And, I don't know if it is available on the public part of github, but you can propose a modification directly on github / add comments on the pull request.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 24, 2023, 04:25:51 pm
Please see my last commit message, my hooking into the AI needs improvement.
Okay, the new PR doesn't crash and I could set up half my team as automated while leaving the other half controllable. I'm now trying to fix the issues caused by mixing AI-controlled and not AI-controlled soldiers in the same group.
Suppodely caused by the mechanism that skips to the next unit not being aware which units it is allowed to select.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 24, 2023, 11:32:36 pm
Otherwise just let me know.
Could you update your side with my latest changes and test the stuff a little if it works as you intended?
I did a bunch of testing, found a bunch of issues, hopefully fixed them now but there's a lot of new possibilities. It feels kinda odd to play with half units controlled by AI and other half not. Basically when you click one of the AI controlled ones, it acts. And if you click it after it acted, it immediately auto-picks the next unit and if you cycled with no reselect they will also end the turn on your behalf.

So while it feels weird, I also can't really think of a way to do it better that doesn't require a lot of changes and testing.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 25, 2023, 07:51:16 pm
I definitely didn't want to deter contributors, so bear with me, when I appear a little incompetent about this stuff. I may have a clue about AI but when it comes to the whole code-management-stuff, I feel a lot less confident and have a lot to learn.

I did not intend to complain or similar. Btw. DeltaEpsilon might be competent in these thing, but I just appear so at best.
I even messed up the default values for the new options a second time...
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: GumChewer on August 25, 2023, 07:58:08 pm
And, I don't know if it is available on the public part of github, but you can propose a modification directly on github
The one thing I have seen is selecting a file and then something similar to hitting edit / the pencil and then some button like "save as new pull request".

add comments on the pull request.
Definitely, right after clicking the pull request. I've seen at least Xilmi already found that too.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 25, 2023, 08:03:01 pm
Could you update your side with my latest changes and test the stuff a little if it works as you intended?
I did a bunch of testing, found a bunch of issues, hopefully fixed them now but there's a lot of new possibilities. It feels kinda odd to play with half units controlled by AI and other half not. Basically when you click one of the AI controlled ones, it acts. And if you click it after it acted, it immediately auto-picks the next unit and if you cycled with no reselect they will also end the turn on your behalf.
Thanks! I will definitely do, but you have to bear my slowness. It might take some days.

So while it feels weird, I also can't really think of a way to do it better that doesn't require a lot of changes and testing.
If it does not satisfy you, you can always choose between
- Not adding it (least work, least distraction from programming a strong enemy AI)
- Keep it and declare it an unsupported feature (maybe hidden behind a compile time constant too)
- Try to implement "Basically you press a hotkey for each soldier when it's selected and it will handle stuff with AI immediately but only for that soldier." (sounds good, but most work)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 28, 2023, 11:10:36 am
- Keep it and declare it an unsupported feature (maybe hidden behind a compile time constant too)
I would just not enable it by default and this way the details about the implementation are not that important.
Also: Someone made a very, very related feature-request on discord:
Specifically it was about enabling it for the robotic-units you have.
Since those do not appear in the soldier's menu, I guess I'll just add it as a separate option. But other than that the framework is already there.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 28, 2023, 09:30:18 pm
Could you update your side with my latest changes and test the stuff a little if it works as you intended?

I did extensive tests and it works as you described. Thanks!

HWP and similar are excluded from the autocombat option, if control per unit is enabled. I fixed that, please see the first commit of my repo on Github.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 28, 2023, 09:35:29 pm
Also: Someone made a very, very related feature-request on discord:
Specifically it was about enabling it for the robotic-units you have.
Since those do not appear in the soldier's menu, I guess I'll just add it as a separate option. But other than that the framework is already there.

I updated the UI and code for allowing to set the boolean flag per battle unit. Please see the lates commit of my repo on Github.
Maybe you can use it, it would only need a further entry in Options.cpp / .h / .inc.h, and setting that in the non-soldier BattleUnit constructor to fulfill the feature request.
Be aware, that is not the exact code I compile and successfully use myself, it might contain some stupid error, like a forgotten variable declaration.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: GumChewer on August 28, 2023, 09:38:56 pm
Maybe you can use it, it would only need a further entry in Options.cpp / .h / .inc.h, and setting that in the non-soldier BattleUnit constructor to fulfill the feature request.

If that default value is used for all non-soldiers. How to distinguish between HWP, mind-controlled enemies and other units, I would need to find out by digging into the oxce code.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.3.1
Post by: Xilmi on August 29, 2023, 10:42:50 am
If that default value is used for all non-soldiers. How to distinguish between HWP, mind-controlled enemies and other units, I would need to find out by digging into the oxce code.
You can check for mindcontrolled units by doing if(unit->getFaction() != unit->getOriginalFaction()).
I check for HWP with if(!unit->getBattleScapeSoldier()) But that would also return mind-controlled ones. So basically if this is true but mindcontrolled isn't.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: Abyss on August 29, 2023, 10:07:12 pm
Hello, dear

I would like to make make a couple of notes here:
- AI units that are on control by BAI, tend to take same places, where the previous AI unit was killed, next turn. (see pic below)
This is unfavorable scenario, because this tile should be considered dangerous.
Especially, when human prefers camping scenario.
If you feel willing to improve this behavior, this will also add some side-variety to ordinary gameplay.

Coupling this with aggressiveness shifts and randomization (discussed previously), will make it a bit more living and unpredictable.

- second, I think some shift towards preserving TU's (or even randomization of behavior, too) will make it better in sense of overall competitive efforts. I don't know, really. Enemy BAI-controlled units, that camp behind the corner, most of the cases do nothing when player's units walk in (now, X-Piratez playthrough, last version of BAI up to the moment).
See, the strategy BAI considers best is" off-corner shooting and back" is truly good vs slow human-controlled units. If average speed (and overall stats) of human-controlled units is better than BAI's, TU preservation and ambush strategy becomes more favorable, in common sense.

A question:
- can BAI assume player unit's speed and skills, based on first couple of turns? Is it possible to add strategy matrix? That would be cool.
-  Can strategy matrix influence all types of BAI units aggressiveness?
Few thoughts how strategy-matrix may be considered:
- human's playstyle is camping on the open ground (current BAI works pretty well, maybe too well for that)
- human's playstyle is mostly in-door vehicle camping (BAI cannot solve this yet without armor/weapons or unit stats advantage)
- human's playstyle is out-of the door camping + few tiles scouting + back (BAI lacks assumption of supposed scouting positions of human units moving to-and-back. If added, BAI can preserve TU for reaction shooting) 
- human's playstyle is fast advance and close-range (BAI lacks TU preservation. Also, BAI lacks many-reaction-shooters strategy).
I might reconsider this (too spontaneous decision to write my thoughts here, but all from the best intent).
This, also, may be off-reality, because only you know the BAI patterns. But, by this moment I played vs it quite excessive (70+ hrs).
 
Have a good evening!
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: Abyss on August 29, 2023, 10:21:10 pm
Couple of tiles away from the door, my units see enemy units: ones that trying to hide behind the apple trees.
And they will not shoot back, most likely.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: DeltaEpsilon on August 30, 2023, 01:47:38 pm
There is a practical problem with Brutal AI that makes it go from hard to just play annoying: finding the last aliens sucks because unlike normal game they can stay in cover and not move, leading to motion scanners becoming useless, so for complex maps, you can easily look spending a hundred turns checking literally every nook and cranny if Bug Hunt mode does not activate. That is _really_ frustrating, especially if the enemy is not even dangerous to your soldiers.

Maybe there should a special case for this situation? Always have at least one unit acting as a scout?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: Xilmi on August 30, 2023, 02:04:20 pm
There is a practical problem with Brutal AI that makes it go from hard to just play annoying: finding the last aliens sucks because unlike normal game they can stay in cover and not move, leading to motion scanners becoming useless, so for complex maps, you can easily look spending a hundred turns checking literally every nook and cranny if Bug Hunt mode does not activate. That is _really_ frustrating, especially if the enemy is not even dangerous to your soldiers.

Maybe there should a special case for this situation? Always have at least one unit acting as a scout?
I guess the unit in question was either a melee-unit or a unit with a weapon that has a rather short range.
Those will dismiss peeking if they don't think they would find something they can attack, as otherwise there were these situations, where you just could wait outside of their range and they'd run into your reaction-fire.
Forcing a unit to scout would bring us right back there, where you can just camp outside with your long-range-weapons and kill units with reaction-fire.
They would send in the scouts one by one and make it completely trivial.
So this is not an appropriate solution.

In the next version a bug with the unit-searching-algorithm will be fixed. Then just setting your soldiers to autoplay at aggressiveness 4 should lead to a very decent systematic search of the map, that should be a lot faster than doing it manually.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.5.1
Post by: Xilmi on August 30, 2023, 02:25:44 pm
@Abyss:
I toyed around with considering dead friends in the cuddle-Avoid-Modifier but eventually decided against it. I think this is more of a result of one of the other problem you mentioned, which I will get to in a minute.

I personally don't think that TU-preservation is a counter to quicker player-units unless the player carelessly runs around with them. You can test this hypothesis by setting aggressiveness to 0. In this case the AI will preserve most of their TUs.

The issue with trees being used as cover is indeed a problem. The reason for that is that the tile-visibility-check and the unit visibility-check function in a different way. Tile-visibility is literally just a bool-flag to each tilepart. This allows the algorithm to be very simple and fast. The AI uses this simple and fast algorithm to detect cover.
Unit-visibility-checks actually trace quite a bunch of lines in the 3D-voxel-space.
So the Voxels of trees usually do not block unit-vision while they have their tile-visibility-blocking-flag set.
An idea was to change the unit-visibility-check to also require tile-visibiity. But that had a lot of unintended side-effects, where you couldn't see units that you should.
So it is basically map-dependent. If the maps have a lot of foliage, for example jungles but also orchards, the AI will look rather derpy by using trees as cover. Whereas they do a much better job around more solid objects like buildings.

I have an idea I could try. I think the function that checks tile-visibility returns the object that blocked the visibility. Maybe I can do some plausibility-check. But I'm not sure how exactly that would look like.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.1
Post by: Abyss on September 01, 2023, 08:11:54 pm
I toyed around with considering dead friends in the cuddle-Avoid-Modifier but eventually decided against it.
I'm sorry, this reply will not be even close to structurized: I try to estimate experience with BAI from different perspectives the same time. I really want to keep this challenging, yet balanced to certain point of joy.

I am considering, specifically two things:
- Ag3, because it seems like the most live-action (not mega-boring game, faster game, but disappointing in terms of wasting TU for too fast advance vs keeping it to fire back)
- There are tons of various scenarios for this game.
From player is Naked/rifles vs Powersuits/rockets/plasma/gauss enemies
to Player is powersuits/gauss/rockets vs Naked enemies,
to 190 TU chupacabras fights (which BAI wisely invests in killing player units within every possible scenario) 

One of the most challenging scenarios: when you begin mission, surrounded by tier/tier+ enemies, all facing towards you, with 100% TUs. And after you shoot, you get a hail of reaction bullets, plasma, rockets, whatever.

Same time, no matter how advanced AI in terms of open-battlefield tactics is, it may be weird to presume that armored units should take cover, not preserving TU's for reaction fire, being able to actually fire in reply, or even prior to player.
Also, in the fair scenario, enemies rarely die from 1 bullet taken. And after taking single bullet, even in back, they may turn back and fire whatever they have equipped. But, in case of weak enemies, usually missions designed in way of enemies quantity. 

If only BAI can decide whether this particular unit can take role of a tank... I would suggest a bit of change for Ag3. Name it Aggressiveness 3,5 (Plan B). instead of force-hide closer to supposed player location, BAI can act more open:
- if player is seen, then Ag2 tactics,
- if not, prefer more strategic surrounding over ending turns w/o TU's (not close enough, more reaction-fire oriented, with chose of two strategies: weak armor: carefully advancing + preserve from the corner AND  strong armor: reaction fire-oriented surround + preserve facing the open direction).
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.1
Post by: mitasamodel on September 03, 2023, 04:18:24 pm
Hi!
I have a strange behavior with "Realistic accuracy and cover system" enabled.
It always displays the same hit-probability value at the cursor regardless of the selected mode (aim/snap), distance and if the target is visible or not (due to darkness).
The value is also not being updated if I'm switching the soldiers (another stats, weapon, etc).

Mods:
XComFiles 3.1
DarkGeoscape
AmigaFonts
XFilesResound
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.1
Post by: DeltaEpsilon on September 03, 2023, 08:48:55 pm
Same issue here, though I get 66% regardless of weapon or anything. Also X-Com Files.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.1
Post by: Xilmi on September 04, 2023, 11:14:33 am
Yeah, sorry for that. The contributor of that feature admitted it was a bit early to call it working.
He found a bunch of bugs and todos himself.
So for now it is recommended to disable the feature until further updates.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.1
Post by: Abyss on September 04, 2023, 12:11:37 pm
I’ll go on the wave of illogic things BAI does:
When BAI decides whether to go onto melee or not, it doesn't count weapon strength and estimated target's armor. I'll specify that bare fists count as melee weapon, too.
Now, how weird it's to see that enemies try to punch a power-armored player's unit.
Not that it is unfavorable, but can be dice rolled, if not forcing BAI to assume armor/weapon check via cheat (cheating may raise the difficulty of gameplay, which is already a couple of tiers higher than vanilla), or more honestly, to check whether it works or not (damage/stun application check (yes/no) -> decides to switch weapon).
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.1
Post by: Xilmi on September 05, 2023, 10:47:34 am
When BAI decides whether to go onto melee or not, it doesn't count weapon strength and estimated target's armor. I'll specify that bare fists count as melee weapon, too.
Now, how weird it's to see that enemies try to punch a power-armored player's unit.
Not that it is unfavorable, but can be dice rolled, if not forcing BAI to assume armor/weapon check via cheat (cheating may raise the difficulty of gameplay, which is already a couple of tiers higher than vanilla), or more honestly, to check whether it works or not (damage/stun application check (yes/no) -> decides to switch weapon).
It actually should do these things. I have a test-save for that with lobstermen vs. x-com that have melee-weapon and pistols.
They should calculate an estimated DPTU for each attack-possibility and ... Wait, I have a theory what could be causing this and should test it!

Some time ago, when Joy presentes his ideas but before he implemented them, I already took inspiration and used a multiplied based on a percentage of visible voxels of a unit.
This is okay when comparing only ranged attacks with each other but might make them look too weak compared to melee-attacks where this factor isn't used. So this could have messed up the comparison in the damage-prediction of non-melee attacks and make them seem too low compared to melee, which makes melee win more often than it should.

Edit: Question: Was this with his feature enabled?
Also: Can you provide a save where you think they should have used ranged-weapons but went for melee instead for testing-purposes?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.1
Post by: Abyss on September 07, 2023, 12:48:44 pm
Edit: Question: Was this with his feature enabled?
Also: Can you provide a save where you think they should have used ranged-weapons but went for melee instead for testing-purposes?

Oh. God. Save is long gone. I should have long gotten into the spirit of baghunting... It also may be worth considering that I still play 7.5.1.
Will try to catch the moment, if it will happen again.

- For the lobstermen: I noticed that they indeed prefer to take things from the ground. In "vanilla" X-Piratez, btw, they don't, possibly because of hardcoded string in the unit description.
Naturally, I think, strong-armored units like lobstermen should act more open, instead of peeking and taking cover. Also, their claws are strong enough to rip non-powersuit player units apart.

Actually, all these questions are fluid, as the player's progress goes on, strong enemy units eventually become weak (not even saying about special measures vs most types of enemies that modders carefully introduced. Like, deep ones are very exposed vs poison grenades).
So, strong enemies that are supposed to be very aggressive in the beginning of the game become paper-made in the late game.
I don't think this issue can be addressed other than by careful map-balancing by a modder himself.

- For the zombies.
1. In vanilla OXCE X-Piratez and X-Com Files low-tier zombies cannot evade shooting from close-quarter combat (CQC) position, whereas Brutal OXCE somehow enables this behavior.
2. Even with max aggressiveness, BAI zombies sometimes prefer to surround and go around behind player units instead of just biting from closest tile. Sometimes this behavior is good and interesting, but most of the times it reduces actual strength of zombies attack wave. I cannot find out what type of attack zombies do use, X-Pedia 2.0 says they have built-in item "zombie punch" worth 15 TU but doesn't specify the damage. It might be hardcoded somewhere specially for zombies.
3. Also, in vanilla XCF zombies make special growling sound when seeing and chasing enemy units)
The easiest way I might suggest is BAI rely on vanilla rules with everything that regards low-tier zombie threat. They are well-balanced and there's not much for AI to consider: see-chase-kill.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: spawi on September 13, 2023, 10:22:50 am
Hey folks, first off, huge thanks for Brutal-OXCE! I am stunned by what it has achieved. I am tremendously enjoying auto-combat, instant priming and the new accuracy system. Exquisite!

Two questions:

- Is it possible to rebind the auto-combat key from Ctrl+A to something else? I bound WSAD keys to camera panning, hence doing Ctrl+A causes my camera to constantly pan left. Sometimes this problem doesn't trigger, but I am unsure yet how to prevent it.
- Is it possible to say "do auto-combat only for this soldier, only for this turn" ?

I would like to avoid having to modify the source code, as I would have to recompile each new release.

If these are not possible, I kindly ask for these to be added to Brutal-OXCE! If there is a better place to ask or submit a feature request, please do let me know. Thx! :)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: Xilmi on September 14, 2023, 01:17:28 pm
- Is it possible to rebind the auto-combat key from Ctrl+A to something else? I bound WSAD keys to camera panning, hence doing Ctrl+A causes my camera to constantly pan left. Sometimes this problem doesn't trigger, but I am unsure yet how to prevent it.
I agree, something other to turn it on or off would probably be good.

- Is it possible to say "do auto-combat only for this soldier, only for this turn" ?
I think the request here is something like a button to just run AI for the currently selected soldier instead of having it controlled by a human. I think that would be nice. Would also be neat for debugging, so you can move soldier after soldier. I shall look into that.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: spawi on September 15, 2023, 06:10:08 am

I agree, something other to turn it on or off would probably be good.

I think the request here is something like a button to just run AI for the currently selected soldier instead of having it controlled by a human. I think that would be nice. Would also be neat for debugging, so you can move soldier after soldier. I shall look into that.


Awesome, much appreciated! And yes, you interpreted my asks correctly :)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: DeltaEpsilon on September 16, 2023, 08:04:53 am
Okay, I'm now positive the AI cheats in a major way in vision mode 3.

Video showing it off provided. The save file and options.cfg used are attached.
Version screen:
(https://media.discordapp.net/attachments/356647134264557570/1152469839072469022/image.png)

Video:
https://streamable.com/dc1c41

In case my accent is too thick, the transcript:
Quote
The dog is over here, and the turret is over here.
It's been standing here for several turns now.
And it will continue to be standing there for as long as the dog doesn't open this door.
The dog can go here and open this door for instance... nothing will happen.
But if the dog goes here, opens this door, the turret will move.
As such, somehow the roboturret knows where, uhh, the door is open there. [brain fart, meant to say the turret knows the door was open there]
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: Xilmi on September 16, 2023, 02:45:26 pm
Okay, I'm now positive the AI cheats in a major way in vision mode 3.
This is not related to the vision-mode. It's related to opening doors, as you correctly assumed in your video.

After a player told me that if you go to the center of the map before ending your turn and then use stereo-listening to hear where doors are opening, I made the AI assume someone is near the door that was opened.

Code: [Select]
if (door == 0)
{
      _parent->getMod()->getSoundByDepth(_parent->getDepth(), Mod::DOOR_OPEN)->play(-1, _parent->getMap()->getSoundAngle(_unit->getPosition())); // normal door
      _unit->updateEnemyKnowledge(_parent->getSave()->getTileIndex(_unit->getPosition()));
}

As you can see in the code, the way the sound is played also contains the information about the location of the door that was opened. So the AI is just getting the same information in this case.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: DeltaEpsilon on September 16, 2023, 03:20:38 pm
This is unreasonably precise IMO.
Additionally, it only seems to react to the door that's very close. The door that's just a few tiles away in the same direction that I open does not cause the turret to react at all.

I don't really think there is an easy way as a player to determine which door was open during hidden movement. I certainly cannot tell even with stereo sound nor does it seem to at all be consistent. Maybe spotting enemies during hidden movement moves the camera or something, but I've never managed to correctly determine which door was opened during AI turn. I suspect there is a way, but it doesn't seem like it's easily determinable in game.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: Xilmi on September 16, 2023, 04:04:11 pm
Additionally, it only seems to react to the door that's very close. The door that's just a few tiles away in the same direction that I open does not cause the turret to react at all.
This is likely related to the aggressiveness of the unit. Just knowing that a door opened doesn't mean the unit will go there to check. It only checks for the nearby door because it thinks it can attack whoever opened it. On a higher aggressiveness, it would also have gone for the unit that opened the other door.

About being unreasonably precise: A way to potentially change that would be to assume it's the closest door to the unit's previously assumed position that was opened whenever any door opens. That would be a bit more complicated to code than just knowing the correct door.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: spawi on September 19, 2023, 11:14:26 am
Reporting two bugs with accuracy in release 7.6.4 [1]

Bug 1: Have a look at the attached screenshot. You can see the debug log saying my agent (standing on the right) hit the deep one (standing one the left) but it is not true - the shot actually hit the tree. Right in the middle.

Bug 2: when I aim at the deep one, the agent (Rafael Silva/Snpr) has 86% accuracy with aimed shot. But once I make the shot, the next one is 95%, without any terrain getting damaged.

I also attach the save file.

[1] https://github.com/Xilmi/OpenXcom/releases/tag/v_7_6_4
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: jnarical on September 19, 2023, 05:07:40 pm
Reporting two bugs with accuracy in release 7.6.4 [1]
I'm going to investigate that, thanks for feedback!

upd: I haven't try TFTD with my mod... but tried huge complex ~500 Mb total conversion 40k/Rosigma. Anyway, both bugs SHOULDN'T be there in the first place. Time to get TFTD )
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: Abyss on September 20, 2023, 01:36:05 am
Xilmi, one more thing I found out:
dogs, werewolves etc. have barking/howling attack, which is ordinarily used to damage TU, morale and reactions, rarely causing stun reactions.
BAI tends to prefer this over convenient claws/jaws, which damages HP.
Recently I've got the mission in X-Piratez where I had to deal with 9 werewolves barehandedly (don't ask why, it's insanely deep lore of XPZ), and they were running around me and howling.

Could that be another AI check: if something can do lethal damage, prefer it over others (not 100% chance, maybe 66-80% because howling is fun too). But I have little comprehension how that would not cause troubles with tribals behavior, who prefer using poisonous darts (damages little HP, but lot of morale and stun), but have daggers as well. See, they doing good. Only dogs and werewolves aren't.

Right now I am doing mission vs deep ones on cruise liner, and I have to say it's very immersive to freaking be scared of every door across, because that last couple of MF's lured so nicely for last suicidal run in the name of deep ocean god.

GJ man. 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: spawi on September 20, 2023, 10:42:26 am
jnarical, big thx for looking into my bug reports! I found one more problem in the same file as in my previous post [1].

See the attached screenshot. 95% to hit, but in reality 0%. In fact the agent never hits.

Note I have teleported the agent using debug mode. He is not standing there in the save file.

Note the save file is from X-COM Files, which requires the original TFTD data.

[1] https://openxcom.org/forum/index.php/topic,10967.msg157774.html#msg157774
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: Solarius Scorch on September 20, 2023, 11:20:41 am
Note the save file is from X-COM Files, which requires the original TFTD data.

No, it doesn't. I can't even think how it could work. ;)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: jnarical on September 20, 2023, 12:58:38 pm
Bug 2: when I aim at the deep one, the agent (Rafael Silva/Snpr) has 86% accuracy with aimed shot. But once I make the shot, the next one is 95%, without any terrain getting damaged.

Here's the bug in the natural habitat. On the picture you can see rayscan of target for left, center and right point of view. # means exposed voxel, O means covering object - tree and part of the slope at the right side. Left rayscan from each pair show first scanning (for 86% accuracy), right one is the second. Origin point of view unexpectedly shifting without any visible reason, and target for left shift becomes a little bit more exposed, just for 79%, which gives 120*0.79=94.8 of total accuracy, rounded up to 95.

Just wanted to share, while I'm still figuring that out)

upd: left/center/right shift represents "leaning" of shooter to find more effective line of fire.

upd2: first calculation assumes that unit is facing direction=6 (top left) which is obviously wrong, Second one uses direction=5 (left), thus moving left shift origin to a better position, which gives 95% accuracy. If you right-click to the left of ot first, you'll get 95% immediately, albeit there won't be visible unit rotation. Odd.

upd3: mystery solved. Origin defining function uses so-called "action" object to get origin tile coodinates... There's no action if you didn't do anything. Action could be walking or turning, so even if you press RMB in the direction you're already looking - there won't be any TUs spent but it will create TURN action, which will have origin tile where unit is located. Original "UFO Extender accuracy" didn't accept action as parameter, it was much less complex.

upd4: Bug #2 fixed, uploaded to accuracy repo, now it all up to Xilmi to merge. What about Bug #1... There IS a reason why your soldier missed :) If you look at the picture and imagine what it was like when the left tree was there - well, seems like there were just a couple voxels exposed. But that's totally a bug anyway. If someone get similar bug while playing - please load autosave, check if the bug is presented, and send it to me via this forum.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: Xilmi on September 20, 2023, 06:23:22 pm
Xilmi, one more thing I found out:
dogs, werewolves etc. have barking/howling attack, which is ordinarily used to damage TU, morale and reactions, rarely causing stun reactions.
BAI tends to prefer this over convenient claws/jaws, which damages HP.
Recently I've got the mission in X-Piratez where I had to deal with 9 werewolves barehandedly (don't ask why, it's insanely deep lore of XPZ), and they were running around me and howling.
Do you have a save from that mission? I'm pretty sure I know what causes this issue and how to fix it. I just didn't have a practical example for toying around with it.
In short: They only consider what does more "damage". But that includes "damage to TUs", which obviously isn't real damage.
I think I need some sort of damage-type-dependent score-modifier, where damage to HPs has to be evaluated significantly higher.

Edit: I put out a 7.6.6 that shall fix the issue. I have only tested whether normal behaviour still works but the code looks pretty-straight-forward and should work. So please retest the aforementioned scenario and let me know if the changes in 7.6.6 resolve the issue of wearwolves only lowering temporary stats instead of inflicting actual damage.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: spawi on September 20, 2023, 11:55:24 pm
No, it doesn't. I can't even think how it could work. ;)

@Solarius Scorch, my bad! I just assumed it does, given it appears to use a lot of the TFTD assets. Hence I thought one has to copy the TFTD folder from original TFTD installation, per usual installation instructions: https://github.com/MeridianOXC/OpenXcom#installation

@jnarical thanks for sharing and very quick bugfix! Very interesting analysis.
Title: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: jnarical on September 21, 2023, 09:58:37 am
@jnarical thanks for sharing and very quick bugfix! Very interesting analysis.

I got the Tapatalk app to my phone and now it’s so much better to access oxc forums)

I’ll look into other bug, was a little bit occupied last days
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Abyss on September 21, 2023, 10:35:48 am
Xilmi, I read the changelog for 7.6.6. and it seems practically good approach.
The mechanics in OXCE are that each crewmate death damages morale for all units. Plus, in XPZ morale lowers by itself due to units' armor stats (crew gets bored).

"The AI shall no longer attack targets that it cannot harm at all and instead spend their time-units on something else." -
How is it checked?
If by trial and error, then will it be that barehanded naked guys will flee from power-armored crew? 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Abyss on September 21, 2023, 11:11:01 am
Made saves for werewolves howling, both geoscape (vessel approaching) and battlescape. The version with "bugged" behavior was 7.6.1. Testing it too.
UPD. Works much better.
Still, one thing that will raise the elegance: howling disrupts reaction attacks, so if werewolf howls at someone, he logically should attack that particular unit.
Right now howling is much less (still here, which is good for objective reasons), but melee attacks and "aimed shots" are patterned in such way that melee to closest unit, while howl at random.   
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Xilmi on September 21, 2023, 12:10:25 pm
"The AI shall no longer attack targets that it cannot harm at all and instead spend their time-units on something else." -
How is it checked?
If by trial and error, then will it be that barehanded naked guys will flee from power-armored crew?
Now that you mention this, I realize that I didn't think this through fully.
Firstly it checks this via the scoring-algorithm that also determines who to attack. There it calculates the assumed damage based on their weapon-damage, the targets armor and the targets resistances. Previously the algorithm would act so that it assumes it would always do at least 1 damage. But attacking a target that you can't damage just gives away your position and does not help you. That's why I changed it. Should also help with immersion, that a naked guy with bare-fists doesn't try to go up against someone in power-armor.

But I just realized that there now is a contradiction between leeroy-mode or other high-aggressiveness settings. Because those would still run up to the enemy and then... just stand there. I think that I should check for the units aggressiveness and if it is 3 or higher it should still attack in these cases because otherwise it would look pretty dumb.

This behavior in general needs more testing of what the impact is. Even on lower aggressions. It might still make sense to run up to the enemy to maybe scout more squishy targets.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Abyss on September 21, 2023, 01:30:03 pm
A mission vs ghosts that can only do CHARM damage. (it is similar to daze and inflicts stun.)
Indeed, now AI doesn't use it, preferring to hide or run around, whereas in vanilla it just spammed charm spells until whole crew is unconscious.
I, in person, think that AI still doesn't realize that driving whole enemy squad unconscious is victory condition, too.
If it can inflict wounds - that's good,
If it cannot, then every possible way is good.
Ghosts can do much better, as their attacks ignore armor.

Firstly it checks this via the scoring-algorithm that also determines who to attack. There it calculates the assumed damage based on their weapon-damage, the targets armor and the targets resistances.
That's convenient, but does it:
- count (0-100)x2 damage roll? Which means, that weapons rarely make 200% damage
- to be not that cheaty, at least try to inflict damage before deciding to flee or hide?
- know that fire does at least 1 damage?
- know that his weapon (mostly, multibarrel weapons and energy weapons) reduces target's armor, and then damage can be inflicted?
- interesting, can BAI decide to pass the most convenient weapon to the next unit (e.g. drop it on ground and move a tile, then next unit picks up the weapon and shoots one more time, as player can do this multiple times)

Well, actually the part of the balance is mostly up to the modders who design enemies in each tier of game, BAI's part is to make it better in decision making.
If some unit cannot inflict damage, it still should act with it's powers.

BTW, ghost mission is not the only when possible CHARM attacks are mostly ignored by BAI. There's a mission where naked guys are running around your single soldier on cruise liner. Seems like they don't know how to use melee CHARM attack properly. This is their only attack, because lore-wise they are non-combatants (no brawl).
Ranged CHARM attacks from other units were simultaniously used (although not that efficiently as it could be).

What is it all about, I think:
If modder adds some special weapon (like special claws, howl, or melee/ranged charm, or mind control), he presumes that it alone will make difficulties to the player, thus keeping intrigue even in mid/late missions where all-brutally armored.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Yankes on September 21, 2023, 03:44:19 pm
A mission vs ghosts that can only do CHARM damage. (it is similar to daze and inflicts stun.)
Indeed, now AI doesn't use it, preferring to hide or run around, whereas in vanilla it just spammed charm spells until whole crew is unconscious.
I, in person, think that AI still doesn't realize that driving whole enemy squad unconscious is victory condition, too.
I think this whole endeavor is pointless, attacks are effective "Turing complete" (if someone allow AI to have weapons with complex y-scripts attached).
Probably much easier would be add configs for each weapon that inform AI how much should prefer it over others weapons.
Of corse this will not fix problem like energy shields that are vulnerable only to specific weapons types.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Abyss on September 21, 2023, 05:22:43 pm
Of corse this will not fix problem like energy shields that are vulnerable only to specific weapons types.
Of course, that's what I come up to during the analysis of possibilities: if modder (universe's God) gives something to the unit, it is purposeful and should be used.
Other, special attacks use should be balanced purpose-wise. If howl, then specifically to disrupt reactions. If CHARM, then specifically to take one out of the equation, not just to inflict some stun.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Abyss on September 21, 2023, 06:03:49 pm
New AI decision making breaks patterns of weak enemies: they just dance back and forth on two tiles. The save is attached (past few panic screaming sounds. The whole situation is that one unit dropped gas grenade and killed other unconscious BAI-controlled units).
BAI doesn't yet consider own unconscious units as potential combatants past couple of turns? Doubious situation, but overall ok.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Abyss on September 22, 2023, 09:22:22 am
One more "bug" report: enemy turrets don't shoot. I haven't checked 1x1 turrets, but 2x2 turrets, which are supposed to be the most troublesome enemy in specific missions (and during the base defend at the side of player too), just stay looking at same direction with no particular action.
With BAI turned off works as intended (seeks targets within line of sight and perform shooting).
I checked the stats of turrets, if this somehow helps: they all have some amount of TU (32-100) and 1 energy (immobile), with shooting cost flat % (like, 40% for chaingun turrets, 55+% for battle tank, which is this mission). Turning the turret costs some TU.   
Savegame is attached (XPZ).

As turrets are common and most strong enemy in early & mid game missions, this is vital issue.

Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Xilmi on September 23, 2023, 01:40:27 pm
If the stun isn't used at all, then something is wrong with the calculations that are being done to deduce the effectiveness. I think it probably wasn't a good idea to not attack when the AI thinks they won't do damage due to potential scripts that have effects which are not among the regular effects. Like spawning units and stuff like that. So I think I'll go back to assuming each attack does at least 1 damage no matter what.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.6
Post by: Xilmi on September 23, 2023, 02:23:18 pm
One more "bug" report: enemy turrets don't shoot. I haven't checked 1x1 turrets, but 2x2 turrets, which are supposed to be the most troublesome enemy in specific missions (and during the base defend at the side of player too), just stay looking at same direction with no particular action.
With BAI turned off works as intended (seeks targets within line of sight and perform shooting).
I checked the stats of turrets, if this somehow helps: they all have some amount of TU (32-100) and 1 energy (immobile), with shooting cost flat % (like, 40% for chaingun turrets, 55+% for battle tank, which is this mission). Turning the turret costs some TU.   
Savegame is attached (XPZ).

As turrets are common and most strong enemy in early & mid game missions, this is vital issue.
This must have been broken since I introduced the AI checking for hiding-spots before moving. I fixed two AI issues in relation to the turrets now. But I'd pass this save on right to @jnarcical, as after fixing the issue and testing, the turret was unhittable with "Realistic accuracy"-mode, despite the AI thinking it was hitable. So there was once again a discrepancy between the logic of the AI and the logic in the game.

Also disabling realistic accuracy made the tank hitable again and the other units killed it within two turns.

Edit: I put out a 7.6.7 with fixes for turret-AI and informed Joy Narical to look at the issue of turret not being hitable when "Realistic accuracy" is enabled. My observations showed that the tank is kinda weird since the clickable box to select the turret is not mounted on top of the tank like usually in WH40k but instead somehow sunken into the tank. I suppose this is what's causing the issues.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 24, 2023, 01:25:27 am
As turrets are common and most strong enemy in early & mid game missions, this is vital issue.

So, I have something to say. I've fixed a bug with 0% exposed turrets, but I don't want to roll out new version in it's current state.
There's a mess in UFO Extender accuracy code. I found a discrepancy between displayed accuracy number and "internal" accuracy, I get the reasons of that pretty wrong - I thought that the issue is caused by displayed accuracy calculated in 3D-space, but "real" applied accuracy calculated in 2D (which is true and looks like as obvious bug to me). As it turned out, displayed accuracy also 2D-based, and moreover - 2D "real" accuracy is intentional. So, UFO Extender accuracy doesn't take into account vertical distance. From the game' perspective, distance to adjanced unit is the same as distance to a unit 10 levels higher. Meridian doesn't count that as a bug. Also, calculations for displayed accuracy and "real" one is totally different and give different results. Sometimes you see 50% accuracy on screen and it's true, sometimes "real" accuracy under the hood differs due to different algorithm. Meridian doesn't consider that as bug too. So I closed my PR to OXCE, but for "real accuracy" mod the problem still persists and I'm looking for solution.

As I want to make my mod optional, I tried to save and reuse UFO Extender accuracy code. I suppose, I shouldn't try to fix UFO Extender accuracy, making it 3D-based, so I need to write my own algorithm for distance calculation - from shot origin to a nearest target point in 3D. Until that, displayed accuracy numbers would be false and confusing.

Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 24, 2023, 03:13:41 am
Algorithm example
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: Meridian on September 24, 2023, 10:56:33 am
I found a discrepancy between displayed accuracy number and "internal" accuracy, I get the reasons of that pretty wrong - I thought that the issue is caused by displayed accuracy calculated in 3D-space, but "real" applied accuracy calculated in 2D (which is true and looks like as obvious bug to me). As it turned out, displayed accuracy also 2D-based, and moreover - 2D "real" accuracy is intentional. So, UFO Extender accuracy doesn't take into account vertical distance. From the game' perspective, distance to adjanced unit is the same as distance to a unit 10 levels higher. Meridian doesn't count that as a bug.

Personally, I most certainly count that as a bug.

If you look at the OXCE code (not OXC code), I have even changed the displayed accuracy to be 3D, not 2D. Already years ago.
It is also mentioned in the thread with differences between OXC and OXCE.

It doesn't help with the "accuracy issue" unfortunately, but it helps at least with the "max range" issue.

Also, calculations for displayed accuracy and "real" one is totally different and give different results. Sometimes you see 50% accuracy on screen and it's true, sometimes "real" accuracy under the hood differs due to different algorithm. Meridian doesn't consider that as bug too.

Again, I most definitely consider that a bug too.

Your solution was however both wrong and incomplete, that's (also) why it was rejected.

I have also written that a 100% correct solution doesn't exist in all cases (due to RNG), which is why I abandoned the idea of fixing it in OXCE.
But if you are OK with just a partially correct solution, you're free to partially fix it in your version.

Or, if you find a completely correct solution, I will gladly admit I was wrong.

So I closed my PR to OXCE, but for "real accuracy" mod the problem still persists and I'm looking for solution.

You have not made a PR to OXCE.
You have made a PR to OXC.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 24, 2023, 11:39:38 am
Quote
If you look at the OXCE code (not OXC code), I have even changed the displayed accuracy to be 3D, not 2D. Already years ago.
It is also mentioned in the thread with differences between OXC and OXCE.
....
You have not made a PR to OXCE.
You have made a PR to OXC.
My bad. Very bad  :) I was sure that code wasn't changed. I'm working with OXCE-based code but decided to make a PR to OXC. To be honest, yesterday I was looking for my closed PR in OXCE repo ))))))
If someone interested: https://github.com/OpenXcom/OpenXcom/pull/1427 (https://github.com/OpenXcom/OpenXcom/pull/1427)

Quote
Your solution was however both wrong and incomplete, that's (also) why it was rejected.
That's true. Starting with my wrong understanding of reasons for the issue.

Quote
Personally, I most certainly count that as a bug.
I get it wrong, again, but that doesn't matters... I consider UFO Extender accuracy as legacy, I cannot change it to something totally different.

Quote
I have also written that a 100% correct solution doesn't exist in all cases (due to RNG), which is why I abandoned the idea of fixing it in OXCE.
But if you are OK with just a partially correct solution, you're free to partially fix it in your version.
You're most probably talking about vanilla applyAccuracy(). UFO Extender accuracy number represents real applied one kinda approximately, That's not fixable in current state, that's why I've reworked accuracy mechanics to the very bottom, making it determined. Now RNG depends on accuracy number, not the other way around. And that makes it possible to use the same algorithm in Map::drawTerrain() and in applyAccuracy().

Now, I'm working on voxel-to-unit distance algorithm, which would be voxel-based - that will change the accuracy more gradually. Algorithm should find the shortest path to a target cylinder (not tile).
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: Meridian on September 24, 2023, 11:53:46 am
You're most probably talking about vanilla applyAccuracy(). UFO Extender accuracy number represents real applied one kinda approximately, That's not fixable in current state, that's why I've reworked accuracy mechanics to the very bottom, making it determined. Now RNG depends on accuracy number, not the other way around. And that makes it possible to use the same algorithm in Map::drawTerrain() and in applyAccuracy().

Yes, that's probably the only way how to make both return the same values in all cases.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 24, 2023, 03:10:11 pm
Quote
I don't want to roll out new version in it's current state.
I've changed my mind. It'll take some time to make everything right, so I've just uploaded the fix.

upd: while testing it before I can tell xilmi to make new version, I found another odd bug, which is (as far as I can tell) is not related to my code, and happens before my code. Game return false when checking for LoS, and applies noLoS penalty. While there's obvious LoS in first-person view. There's obvious visible tank turret.

I'm considering to add "big target accuracy multiplier" btw...

upd2: so, I've got clear OXCE and here it is. There's no line of fire to the "turret" unit, thus -50% accuracy penalty multiplier applies. Displayed accuracy is 55%, real accuracy is 27% after casting to int. That bug is not mine (which is good) but I should fix it anyway cause I need noLOS penalty too, and LOS definitely exists here
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 25, 2023, 01:12:03 am
Meridian, here's the fix. Hopefully it won't break anything. And to be honest, that's the very same bug I've fixed in my code first - the issue was more obvious as the debug made it clear.
That's the second time when I'm too lazy to make a PR for a bugfix, first one was when I found UD in getOriginVoxel recently

upd: that tank implementation is nuts, anyway
Title: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 25, 2023, 05:52:58 am
Bug 1: Have a look at the attached screenshot. You can see the debug log saying my agent (standing on the right) hit the deep one (standing one the left) but it is not true - the shot actually hit the tree. Right in the middle.
Fixed. Current state (in my repo) - fixed 3 bugs, tanks in x-piratez are killable now (maybe too easy, but what do you want from rocket launchers with accuracy > 150 while kneeling?)
There's disrepancy between displayes accuracy and that which is showed by debug - it's ok, will be fixed soon. Also, some issues with close combat accuracy numbers and big units - same reasons.
I've done some strange thing - removed my own distance calculations and use one from UFO Extender.

IMPORTANT! If you got a crash - please run the game again, load last battlescape autosave, and check if it will crash again. If yes - post the save here.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: Scamps on September 25, 2023, 03:30:41 pm
V7.6.6. Threw a proximity grenade under reaper's feet. But reaper was smart, and thew (kicked?) grenade away, somehow not triggering proximity (well, it didn't move before throwing, smart creature). A couple of turns later a civilian stepped on said grenade, blowing him(her?)self up. Then I realised that grenade was thrown into my equipment pile. Smart reaper. Civilians were also controlled by Brutal-AI, which leads me to beleive they cooperated with aliens. :)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: Xilmi on September 25, 2023, 04:53:42 pm
V7.6.6. Threw a proximity grenade under reaper's feet. But reaper was smart, and thew (kicked?) grenade away, somehow not triggering proximity (well, it didn't move before throwing, smart creature). A couple of turns later a civilian stepped on said grenade, blowing him(her?)self up. Then I realised that grenade was thrown into my equipment pile. Smart reaper. Civilians were also controlled by Brutal-AI, which leads me to beleive they cooperated with aliens. :)
Aliens picking up and throwing proximity-grenades that land on their tile is intended. But I think units probably have a flag of whether they can pick up stuff which is apparently ignored by the AI. Pretty sure reapers shouldn't be able to.

I can explain the civilian-issue. The code to go for and pick up weapons isn't from me. It's actually outside of the AI code and is run with priority. I never bothered to change that. So if a brutal-AI-controlled unit has no weapon it's primary directive is to go and pick one up. All the safety-checks that are normally associated with movement of brutal-AI are not exected in this case.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 26, 2023, 02:44:42 am
Now, I'm working on voxel-to-unit distance algorithm, which would be voxel-based - that will change the accuracy more gradually. Algorithm should find the shortest path to a target cylinder (not tile).
DONE! Works like a charm, consistently, gives distance in voxels. Perfectly aligns with numbers calculated “by hand” on paper. It’s really cool to see that distance for shooting “from below” is less than “from above”, as weapon barrel is closer to the top of a tile. And even more cool to see that similar fire positions relative to target give totally equal distances. It’ a win)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: Abyss on September 28, 2023, 12:14:48 am
tanks in x-piratez are killable now (maybe too easy, but what do you want from rocket launchers with accuracy > 150 while kneeling?)
The thing is, battle tank with the select box "sunken" into the chassis is the only tank and only mission in the whole giant mod. It might be done in such fashion to be harder dealt with, if not for basic defense from below. It also may had been done so player had to use his brains to deal with it. It's "challenge mission", too, btw. 
Other tanks, which are not static objects, are movable 4x4 units with clear select box.

I wanted to ask you, regarding your improvements in shooting mechanics:
can it be done in such way that legacy hit chances stay in place (e.g. extender accuracy, because all firearms had been balanced with it in mind), while weird stuff, like missing all twelve 140% shots, because bullets fly through the sprite, but don't hit the actual voxels, got solved? This mostly happens when enemy is either near the wall (while your soldier shoots from parallel position to it), or near the border of the map, or behind the opened door, or behind a stick pinned into the ground and so on. That's really frustrating.

The save is attached, soldier is facing the ninja, which is adjacent to map edge.
From this position, and from one tile diagonal closer it weirdly misses.

Don't get me wrong, your accuracy modification improves close-range shooting too well. And that's why I think it affects the balance (had it checked, too, vs plasma autofire enemies, and I thing there should be misses in the queue. Literally all plasma shots hit my soldier and I was upset. That's not what I got used to!). There's not only mechanical issues why things miss (aside from weird voxel issues) - each turn in X-COM is similar to 6-8 seconds in real life. Thus, hand tremor can justify three misses with 60% hit chance. Or four with 70%, rarely. But not twelve with 140%).
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 28, 2023, 03:24:19 am
I wanted to ask you, regarding your improvements in shooting mechanics:
can it be done in such way that legacy hit chances stay in place (e.g. extender accuracy, because all firearms had been balanced with it in mind), while weird stuff, like missing all twelve 140% shots, because bullets fly through the sprite, but don't hit the actual voxels, got solved? This mostly happens when enemy is either near the wall (while your soldier shoots from parallel position to it), or near the border of the map, or behind the opened door, or behind a stick pinned into the ground and so on. That's really frustrating.

The save is attached, soldier is facing the ninja, which is adjacent to map edge.
From this position, and from one tile diagonal closer it weirdly misses.
I've tested your save, it works with "real accuracy"=ON pretty like it's intended to. Do you mean the situation when "real accuracy" is OFF, and "ufo extender accuracy" is ON? If that's the case, I can make it clear for you. There's no such thing as "legacy hit chances", honestly. There's accuracy number, which is basically unit's accuracy * weapon accuracy with particular shot type * 1.15 if kneeling * 0.5 if no line-of-sight * 0.8 if weapon is two-handed but there's something in second hand... and some penalties for wounds count and per health percent left. if a unit has 100 accuracy, weapon has 65% base accuracy for autofire, and unit is kneeled - you get 100*0.65*1.15 ~= 75% accuracy. For some fixed UNKNOWN distance to a 1-tile target, that would mean roughtly 75% chance to hit. For any other distance, or for a bigger target, chances would change drastically. But most important - there are no known numbers at all, just like no known method to calculate them. That's what can be said about vanilla accuracy.

What does "extender accuracy" do?
0. It takes vanilla accuracy
1. reduces it beyond some distance threshold, on per-tile basis
2. reduces it for close-range shots for weapon with "minimal distance" threshold (I don't know any btw)
3. shows resulting accuracy near the cursor in real-time
But number, by itself, still means nothing...

So, missing 12 times in a row with 140% shots is a resulf of vanilla accuracy algorithm. You can change the numbers, it's clear that 140% will hit more often than 100%, and 300% - even more. But what exactly those numbers mean, in the first place? In real life, there's 0% which means "absolutely never" and 100% which means "absolutely every time". You can increase those numbers, but you can't balance them in a meaningful way, like "I want it to hit 50% of the time" in mind. That's why I started to make my own accuracy system, in the first place.

About "bullets fly through the sprite" - the game doesn't use sprites for collision detection. It uses voxel 3D cylinders, representing units. You can press F10 in game and then look in savegame folder how it all looks from your unit's eyes perspective. There are no known bugs when your shot fly through the unit but not detected as hit. You can say from the pictures, that for aimed shot the target is 100% exposed - because line of fire is calculating from the eyes level for aimed shots (in my mod). There's 80% exposure for auto-shot, as it's calculated from waist / chest level, and bottom part of the target becomes hidden.

Don't get me wrong, your accuracy modification improves close-range shooting too well. And that's why I think it affects the balance (had it checked, too, vs plasma autofire enemies, and I thing there should be misses in the queue. Literally all plasma shots hit my soldier and I was upset. That's not what I got used to!). There's not only mechanical issues why things miss (aside from weird voxel issues) - each turn in X-COM is similar to 6-8 seconds in real life. Thus, hand tremor can justify three misses with 60% hit chance. Or four with 70%, rarely. But not twelve with 140%).
Close-range accuracy could be changed, for sure. I just can't figure out the exact formula... I can add "maximum accuracy cap for close-ranged shots" to the options menu, but I don't personally like that idea. And I can't reproduce vanilla chance to hit, as there are no option to know that chance other then statistical experiments )) But I can say for sure, that chance has nothing to do with displayed accuracy, and always was much higher than it.

Other than that... I can't make a mod, which would be balanced against all other mods. I totally don't want it to be balanced against one particular mod either. All it has to do is to show CORRECT accuracy numbers which align with real chance to hit. If there's 1% then it should hit 1 time of 100, but not in a way "I counted 99 misses, the next one should be a hit". And I'm afraid I can do nothing to make it align with, I'd say, such STRANGELY balanced mod as X-Piratez.

Look at pictures, look at the formula and try to guess how that thing is supposed to miss
https://www.ufopaedia.org/index.php/Accuracy_formula (https://www.ufopaedia.org/index.php/Accuracy_formula)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 28, 2023, 01:52:42 pm
weird stuff, like missing all twelve 140% shots, because bullets fly through the sprite, but don't hit the actual voxels, got solved? This mostly happens when enemy is either near the wall (while your soldier shoots from parallel position to it), or near the border of the map, or behind the opened door, or behind a stick pinned into the ground and so on.
Maybe vanilla accuracy algorithm has some corner cases, which become visible in X-Piratez cause the game wasn’t designed for such extreme numbers
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: Abyss on September 28, 2023, 01:53:25 pm
There are no known bugs when your shot fly through the unit but not detected as hit.

Actually, there is, and when real accuracy is off, and extender is on, I simultaneously see the cases when supposed 100% shots miss and projectiles fly through the sprite, not hitting the voxel itself. I just don't have savegame, because I never thought I will address these issues. Nevertheless, your mod makes this particular shot actually hit, thus the problem is solved.

As for the balance - if there's indeed no clue of how close-range shots affected by extender accuracy, may we talk with the designer of this? You see, it's kind of magic and fits game very well.
I'll bring you the case:
You have auto-fire sniper rifle, which has reduced hitchances for any tile closer than 10. At 10 tiles away it gives you 100% vanilla hitchance (which magically won't hit 100 out of 100 shots, but that's cool, too), but 0% at 2 tiles away.
Still, due to extender accuracy, you will likely hit at least 1 time in a queue of 3 shots, but also it may be 2 times or even 3.
I can only guess, that it somehow creates cone of possible trajectories, and the more precise the shooter, the narrower the cone is.
It's not like it will shoot somewhere 45 degrees from a target, right? Soldier with accuracy 120 should shot with little deviation from LoS (line of sight), but still can miss because target is too far away and it's actual contact surface is too small.

The question: what actual mechanics are, both in your mod and extender?
Is it cone mechanics, or just pure formula-based pre-hits (mean, system rolls 1 hit out of 10 and then forcefully pulls 9 hits to the random tiles around the target?)
     
And, one suggestion for your accuracy mod:
If it checks several points of shooting before deciding which fits best, shouldn't this also affect accuracy? You see, if straight/ out-of-the-waist  shot is considered worst, then the obstacle is on the way. If then weapon shifted to a side, such action must have penalty of decreased accuracy. My suggestion is 1/4 decrease of the final value.
Same to melee. I've noticed from the game that if target stays in front of the door, it sometimes can be attacked from adjacent tiles, and vice versa. These hits shouldn't be of same accuracy to the straight attack, because target has natural cover and has lesser area to evade/parry from. I guess, final chance attack success rate should be, at least, halved.
I would also suggest that shifting the hand should affect the chances, if not complicated to implement.
     
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: Abyss on September 28, 2023, 02:13:24 pm
Other than that... I can't make a mod, which would be balanced against all other mods. I totally don't want it to be balanced against one particular mod either. All it has to do is to show CORRECT accuracy numbers which align with real chance to hit. If there's 1% then it should hit 1 time of 100, but not in a way "I counted 99 misses, the next one should be a hit". And I'm afraid I can do nothing to make it align with, I'd say, such STRANGELY balanced mod as X-Piratez.
I assure you that in 99,5% cases both BAI and your mod will be used in mods.
And, most likely, statistically, 50% cases will be that it is used by Piratez player, 20% in XCF and Wh40K, and 9,5% rest. I guess, only tiny part of the players play vanilla X-COM in OXCE.
Nothing is balanced to the perfection. This particular autogun from my save is PSI-powered and considered OP by many players + soldier has weird high stats too. But that's due to excess of battles and battle commendations.

Initially, request was about weird voxel issues. One example is if enemy stands adjacent the wall, and is target for a shooter that stands parallel this wall, this wall somehow affects shooting chances, which makes no sense to me, but still is.

I will get the savegame as soon as I will find this behavior once again.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 28, 2023, 04:25:33 pm
Actually, there is, and when real accuracy is off, and extender is on, I simultaneously see the cases when supposed 100% shots miss and projectiles fly through the sprite, not hitting the voxel itself.   
As I've said, "projectiles fly through the sprite" doesn't mean anything. Sprites don't represent voxels. Unit is just a cylinder in voxel-space. Grab some paper and pen, draw a rectangle with width=5 and height=16. That's sectoid proportions from the base game. Width=5 means that his "diameter" is 1/3 of a tile width, or he takes 1/9 of tile's area. Than look at his sprite, with huge head. Shot WILL fly through and that's not a bug.

As for the balance - if there's indeed no clue of how close-range shots affected by extender accuracy, may we talk with the designer of this? You see, it's kind of magic and fits game very well.
As I've said earlier, extender accuracy almost does NOTHING. You can look at the picture, I highlighted the block where "ufo extender accuracy" actually applies. As you can tell, there's a drop-off for accuracy below the weapon minimum distance, and above the maximum one. And that's in VANILLA code. Extender accuracy just adds different maximum distances for auto/snap shots. That's all. Another place where it matters - in drawTerrain() code, 'cause there should be a way for a player to see how the accuracy changes for different tiles - so it draws modified accuracy near the cursor.

The question: what actual mechanics are, both in your mod and extender?
Is it cone mechanics, or just pure formula-based pre-hits (mean, system rolls 1 hit out of 10 and then forcefully pulls 9 hits to the random tiles around the target?)
In vanilla(extender doesn't affect anything here) it's cone based, in a wierd way. All the code is on second picture. You can tell by yourself, that while it's obvious where and how accuracy is used in calculation - there's NOTHING you can tell about actual chance to hit. That code gives unnatural kind of distribution, where you either hit the squirrel right to the eye from 10 km away, or you go full startrooper mode hitting any point of the cone with (almost) similar probability. That's why misses in x-com are so unnatural. On this gif you can seen probabilities distribution for 0/25/50/75% accuracy: https://www.ufopaedia.org/images/1/16/Accuracy_areas_above.gif (https://www.ufopaedia.org/images/1/16/Accuracy_areas_above.gif)

On the cortrary, my mod takes vanilla/extender accuracy numbers and makes them real chance to hit, by rolling. So you get the roll with precise probability first, and then, if it misses - my code calculates some missing trajectory, which should look realistic. That don't work with vanilla accuracy NUMBER in close-combat, as it's totally unrelated to vanilla chance to hit in close-combat, which is much higher than displayed. So I had to make my own algorithm to increase close-range accuracy.

While I'm writing all this, a realised a good way of capping close-range accuracy - by unit's own accuracy! Min cap could be 50%, and max cap will depend on unit. I'll definitely will try that out!

And, one suggestion for your accuracy mod:
If it checks several points of shooting before deciding which fits best, shouldn't this also affect accuracy?
3D in this game is implemented with very low resolution, that means there's often one huge occassional voxel blocking LoS/LoF. To counter that, off-center shooting was added. There's no need to add penalty, as well as balance accuracy with such detail in such low-detail game. There's always something to be done elsewhere, to a greater benefit.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 28, 2023, 04:35:46 pm
имени.png
https://t.me/jnarical (https://t.me/jnarical)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: jnarical on September 28, 2023, 05:37:00 pm
weird stuff, like missing all twelve 140% shots
I've just tested in "default OXCE", it hits 10/10 there. I've got a regression somewhere, investigating...

upd: found bug, fixed, now testing...

upd2: uploaded the fix, seems working
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.7
Post by: Abyss on September 28, 2023, 10:04:40 pm
https://t.me/jnarical[/url]
I may use that way, but it is very convenient to write all suggestions and questions here on forum because some other players may join the discussion.
As some questions and questionable mechanics are years-old now, I could say your and Xilmi's visit should have brought far more attention, if everybody still interested in occasional improvements.   
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.0
Post by: Xilmi on September 30, 2023, 02:19:26 pm
I just added a new feature: Fog of war.

You can now enable "Fog of war" under Options => ADVANCED => Extended.
You can also select a color for the fog of war.

When enabled any tile that was previously visible to the player but currently isn't will now be drawn in the selected fog of war color. The default is grey.

It was requested here: https://www.reddit.com/r/OpenXcom/comments/16420i7/fog_of_war_mod/
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.0
Post by: KaMef on October 05, 2023, 01:31:05 pm
I just added a new feature: Fog of war.

I really like this new feature, would it be possible to take into account the smoke for fog of war?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.0
Post by: Xilmi on October 09, 2023, 02:59:16 pm
I really like this new feature, would it be possible to take into account the smoke for fog of war?
That's not so easy for the reason that smoke only impacts vision on units but not on tiles.
So tile-visibility-data can't be taken "as is" for this purpose.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.0
Post by: KaMef on October 12, 2023, 04:16:34 pm
That's not so easy for the reason that smoke only impacts vision on units but not on tiles.
So tile-visibility-data can't be taken "as is" for this purpose.

It would be a great feature to be added in my opinion. :)

Would it be possible to have an option 3 for the fog of war feature as a mix of 1&2?
- visible fog of war for the actual turn + fog of war for the selected unit?
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: zee_ra on October 22, 2023, 10:28:42 am
I'm no longer actively pursuing OXCE-integration. If they want to have it, they can feel free to include it though. And that goes for everyone who wants it in their fork.

...

@Xilmi, What is your perspective on the mod compatibility with XCF?  Would it be reasonable to expect the Brutal-AI's behavior -- aside that from inside the tactical missions -- differing from the mainline OXCE when XCF is loaded as the master mod?
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Abyss on October 22, 2023, 02:01:20 pm
@Xilmi, What is your perspective on the mod compatibility with XCF?  Would it be reasonable to expect the Brutal-AI's behavior -- aside that from inside the tactical missions -- differing from the mainline OXCE when XCF is loaded as the master mod?
While waiting for Xilmi's response, I can comment as a player. 
No. It doesn't affect the global scripts, which are either time-based or research-based. So you'll get all the missions the same time you will otherwise get them in vanilla. But on battlescape... Sometimes I hope Xilmi makes a switch for enemies to reserve more TU's for reaction fire. Or even whole TU's after getting to the snapshot position. Because otherwise it's too easy to camp enemies that are coming closer each turn.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.1
Post by: Meridian on October 22, 2023, 02:13:03 pm
There are also other mission triggers, for example Retaliation.
And retaliation works differently in BAI than in OXC/E.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Xilmi on October 23, 2023, 11:18:46 pm
@Xilmi, What is your perspective on the mod compatibility with XCF?  Would it be reasonable to expect the Brutal-AI's behavior -- aside that from inside the tactical missions -- differing from the mainline OXCE when XCF is loaded as the master mod?
There are two optional changes for the geoscape-level-behavior. One, as Meridian already mentioned is related to aggressive-retaliation.
With aggressive-retaliation enabled retaliation-missions can also trigger on successful missions against landed ufos and the search-pattern for the UFOs that look for your base is more consistent.

The other option makes it so that you can't outrange UFOs without having higher speed. This was done so that in vanilla you need  something better than interceptors to safely tackle bigger UFOs. I think in mods this is usually already resolved by rebalancing weapons.

But none of this has a huge impact on the geoscape-gameplay.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Xilmi on October 23, 2023, 11:27:09 pm
Sometimes I hope Xilmi makes a switch for enemies to reserve more TU's for reaction fire. Or even whole TU's after getting to the snapshot position. Because otherwise it's too easy to camp enemies that are coming closer each turn.
What exact settings are you using?
The default "Enemy aggressiveness" of 2 shouldn't produce such behavior.

But if you use a higher value or enable "Inherit unit aggression", the AI uses the unit's aggression-setting to enact certain behaviors, which likely are sub-optimal from their perspective.

If the AI is easy to camp on "Enemy aggressiveness" of 2, then it's something I shall take a look at. If it happens on the aforementioned settings, then it's kinda intended for those.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.1
Post by: QuybiT on October 24, 2023, 06:42:04 pm
Hi. Will you ever port your mod to Android?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.1
Post by: Xilmi on October 24, 2023, 10:51:50 pm
Hi. Will you ever port your mod to Android?
Whoever is capable and willing to make a build-environment for that, is allowed to do it. I'm just not incentivised enough to do it myself.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.6.3
Post by: Xilmi on November 01, 2023, 10:33:25 am
Okay, I'm now positive the AI cheats in a major way in vision mode 3.
Little heads-up for you:
As of version 7.7.4 the AI no longer updates their knowledge of the whereabouts of your units when you open doors.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Abyss on November 02, 2023, 12:43:48 pm
What exact settings are you using?
The default "Enemy aggressiveness" of 2 shouldn't produce such behavior.

But if you use a higher value or enable "Inherit unit aggression", the AI uses the unit's aggression-setting to enact certain behaviors, which likely are sub-optimal from their perspective.

If the AI is easy to camp on "Enemy aggressiveness" of 2, then it's something I shall take a look at. If it happens on the aforementioned settings, then it's kinda intended for those.

Good day!
This comment may be outdated, because last version of BAI I played with was 7.6.8.

I was frequently switching between aggressiveness 2 and 3. Because it became too boresome watching same tactics BAI uses for every fraction.
May I take little of your time for better understanding of the idea behind my words? Below is basic table of scenarios.
Most battlescape scenarios player prefers to choose lay within white-green section, when player has 100% success probability, while evil modders tend to create battlescape scenarios within magenta-white area. That's sort of plot-moving force, so player feels the tension and overcoming of cruelties. It's also classic RPG scenario: to get something to deal with someone. X-COM is sort of RPG, too. Because, as I have it written many times, player has to raise soldier units from useless autistic battlescape meat into supersoldiers via in-battle experience and geoscape trainings and transformations. The battlescape tension curve is considered by modders.     

(Please note that Weapon power and Armor effectiveness are relative to average enemy on battlescape. I mean: RPG should be considered somewhere 3.5 vs power armor, gauss tank barrel is 5.0, while AK-47 should be considered 1 because it will never inflict any harm)

While 1-1 and 5-5 scenarios are generally uncommon, there are multiple missions with all possible variants of balance.

I will try to compare player's and BAI winning strategies for extremes:

1-1: Within this scenario, in most cases player couldn't win if not blind luck (or cheating)

2-2: Weak player units, the only possibility for player to win is in-door camping, or camo, use of flares and other tricks + peeking. In this case BAI should attack immediately, not prefer to hide first. Also, BAI can take open positions for preserved reaction fire, because it has good chances to survive and kill in return.

5-2:  Weaker player units with strong weapons. The best solution for player is reaction fire from camo positions. Because BAI ordinarily prefers to hide first, and only then to peek and attack, then go back, losing more than 50% of it's TU on movement. BAI has three scenarios:
- hide and wait till player comes first and reaction-fire his units;
- peek and suppress with explosives and no-LoS fire;
- or zerg-rush the position with possibility of player units miss or get out of reserved TU's

2-5: Player units are terminators with machetes: Player rushes for enemy openly, while BAI can't do much about it. It fires, but no particular harm being inflicted. The only relevant tactics for BAI are best available weapons and explosives. There passing weapons to each other could help (like, passing assault machinegun to other unit wielding pistol), if this is possible.

5-5: Player's forces are OP in all ways: BAI has no chances to win.
 
While considering extremes is kind of a wrong game overall, the scale of armor/weapon power (multiply) unit amount can be used for getting number of threat points to correct the strategy BAI uses to deal with player's invasion.   
 
Like,
for scenario 2-2 BAI acts with all possible means, suppresses more + reserves a lot of reaction fire at least for half of it's units, while others move forward;
for scenario 4-2 BAI, depending on layout, acts in more hidden manner or rudely exchanges chess pieces on rush (when amount of BAI units is >> amount of player units).
for scenario 2-4 BAI relies more on most powerful weapons and explosives

All this has been written in sole purpose to convince you that there are tons of possible stuff going on and reserving TU's for reaction fire is sometimes good. I don't know on which conditions your BAI taught itself, but in 50% of major mods missions it feels like a brutalless castrate who prefers to hide instead of punch the problem into the face. Who would run away in a power armor vs some black powder guns? Also, almost no reaction fire means less gaming experience and adventure of possibilities (making game more routine and less excited).

UPD. Ofc this is oversimplified model, for many other factors should be considered before strategy review. For discussion.
Title: Re: [SOURCEMOD] Brutal-AI 2.1.1
Post by: Xilmi on November 08, 2023, 07:50:32 pm
This comment may be outdated, because last version of BAI I played with was 7.6.8.
I highly recommend using the most current version, which can be found here:
https://github.com/Xilmi/OpenXcom/releases

Especially when part of the critique is the AI not reserving enough TUs for reaction-fire as this is something that definitely has improved since then.

Other than that, I suppose you are advocating for some sort of dynamic adjustment of the AI's behavior based on stat-comparison.

It also in parts could be understood as some sort of guidelines for modders to properly balance the game-progression.

One part I was missing in that matrix is the amount of units involved. If there's only a few units then they should probably behave differently than if there are a lot.

My thoughts on that are that, sure, if a unit is comparably tanky it can afford to play more aggressively and does not need to be concerned with cover. But on the other hand still taking cover despite having superior stats, while maybe not necessary, is also not really a disadvantage.

One thing that could be improved is the AIs utilization of their equipment. Right now the AI will never bother to pick up another weapon as long as it still has ammo left in theirs. Picking up a Heavy Plasma from their dead friend to upgrade from their Plasma Pistol is something they definitely could benefit from.
Right now the picking up of weapons is handled in a place outside of the AI-code, which is not really good design. Reworking this would be a relatively big effort. How much gain there is in that highly depends on initial loadout. I think XCF sometimes has dramatic differences in loadout-quality. With some enemies wielding nothing but a stick while others have a combat-rifle.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: 0xEBJC on November 14, 2023, 11:38:49 pm
Wow, really good work on improvements and new game-play.


Sorry if this is already asked, or a feature, but is there anyway to set the brutal AI individually for each race?

Example: I play X-Com Files
I'd like most humans, cults, humanoid creatures, humanoid aliens, and Alien tech to have Brutal AI.

But I'd like to exclude most creatures, zombies, farmers & maniacs, creature based aliens, etc.?
or even better yet if there would be a property for each race when Brutal AI is Enabled

Enable Brutal AI Globally            [   ]
Enable Brutal AI Per Races Flags [ x ]

--------------------------
Sectoid
- Brutal AI: true
      Targeting: 2
      Mine_Avoidance: true
      ....

Zombie
- Brutal AI: false
--------------------------

This way you could have 3 options
   Brutal AI disabled
   Brutal AI enabled globally - all enemies are Brutal AI
   Brutal AI Per Enemy Flags - only Sectoids in the example above and not zombies, but also each enabled race can have different flags to include hiding more, or remembering player shot locations, etc...





Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: 0xEBJC on November 15, 2023, 01:08:36 am
can I enable the AI on the fly during a battle? say once I get into the battle and realize its creatures, then leave the Brutal AI disabled as it was set previous to the battle.

but if the Brutal IA is off, then enter a battle and realize it's a cult or an alien race, then enable the brutal AI for that battle?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: jnarical on November 15, 2023, 03:29:56 am
can I enable the AI on the fly during a battle? say once I get into the battle and realize its creatures, then leave the Brutal AI disabled as it was set previous to the battle.

but if the Brutal IA is off, then enter a battle and realize it's a cult or an alien race, then enable the brutal AI for that battle?
I personally think the answer is “yes”, but not 100% sure. But you can check by yourself. Start custom battle, press CTRL+D for debug mode, make several turns watching aliens play, then disable Brutal AI and continue watching. The difference should be obvious
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 15, 2023, 12:53:55 pm
Wow, really good work on improvements and new game-play.

Sorry if this is already asked, or a feature, but is there anyway to set the brutal AI individually for each race?
Thanks for the kind words! :)

For the most part the answer is yes.
Let me quote from the 1st-post in this threat:

All the features for brutal-AI can also be enabled separately while the player themselves has disabled them. This way modders can customize the experience as they wish for their players.

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.

I haven't added every single option to the units themselves since there wasn't really much demand for that feature until now. So the options I implemented later, like the proxy-avoidance one is missing there. Actually it might be the only thing missing as for the aggression-settings you have the inherit-option and isLeeroyJenkins is also taken into account when inherit is enabled.

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

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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 15, 2023, 01:03:27 pm
can I enable the AI on the fly during a battle?
As jnarical correctly assumed the answer is yes.
You can just go to the advanced-settings and switch it on or off mid-combat and the AI will either use Brutal-AI or go back to base-AI when they move next.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: 0xEBJC on November 16, 2023, 01:43:00 am
Thanks for the kind words! :)

For the most part the answer is yes.
Let me quote from the 1st-post in this threat:

All the features for brutal-AI can also be enabled separately while the player themselves has disabled them. This way modders can customize the experience as they wish for their players.

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.

I haven't added every single option to the units themselves since there wasn't really much demand for that feature until now. So the options I implemented later, like the proxy-avoidance one is missing there. Actually it might be the only thing missing as for the aggression-settings you have the inherit-option and isLeeroyJenkins is also taken into account when inherit is enabled.

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

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.

Awesome, thanks!

Another idea I had was to be able to set the the Brutal-AI flag after a specific number of turns, custom for each race.  For example one race has normal AI and then after say 10 turns brutal AI is enabled or 3 turns for another race that much more organized like mutons? or what would really make the races dynamic would be to have turn specific settings per AI flag per race, here's an example, pardon for the pseudo code.

Brutal AI Settings
 - Sectoids
   -- isBrutal: True {3:15}
   -- aiTargetMode : True {5:15}
   ...
 - Mutons   
   -- isBrutal: True {:}
   -- aiTargetMode : True {2:}
 - Waspoids
   -- isBrutal: True {6:8,12:}

This way you could have custom AI behavior per race, each AI flag enabled or disabled during certain rounds. Blank would mean starts at 1st turn or never ends, no last turn to turn off Brutal AI. Not sure how best to implement this in where to place it in the rul configs.
   

Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 16, 2023, 02:26:37 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Abyss on November 17, 2023, 12:35:19 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.


Hi Xilmi!

As you may remember, I changed my mind drastically from the first look while diving into the gameplay with BAI. Please consider this sincere feedback from the best fan with 6 years of time-to-time playthroughs of XCF and XPZ (this is not a bravade, I believe I could have done much better things than wasting time on it).     

I think guy asks about something more broad than just one option.
The thing I noticed while playing XCF and XPZ with BAI for ~80 hrs - is lack of diversification of enemy strategies. Like, whoever you face on a battlefield, will be acting roughly same.
This makes BAI a bit less entertaining on a long run, because player has to keep focus more and, what is more important, sometimes exchange pawns to advance in combat.

Second thought, is that BAI works much harder than Vanilla AI. So, same conditions will result in drastical change in difficulty. What you have perceived as "challenge" with BAI becomes a very easy mission with VAI. That becomes serious problem, but I have an idea that will partially solve the diversification question:
That will be very deliberate of you to consider to implement random chance of BAI and VAI missions (if not mixing BAI and VAI troops in a single mission). But then, the difficulty level for VAI missions should be at least +1 more to player's option.
The proposed options are:
- chance of VAI mission appear
- set VAI missions difficulty 0-4 (Personally I use pre-max difficulty for BAI gameplay, so expect VAI difficulty should be max) 
That's it.
And then, you (or anyone who is able to) can proliferate any other mixed behaviors for races, ranks etc.         

And, a gentle reminder for list of quality of life changes from the player's perspective:
- most casual players never go into code. That's why, I believe, it's better to take advanced configurations into options menu.
- zombies should play vanilla (sadly, XPZ and XCF have different mechanics - but zombies never take cover and hide behind the corners, as they are driven by either animal instincts or controlled by parasites)
- animals should play vanilla/max aggressiveness (random split), because they are not tacticians

Quote
I haven't added every single option to the units themselves since there wasn't really much demand for that feature until now.
There is demand and many other players watch into BAI to use it.
The only thing is it being more flexible and configurable for long runs, not to confront player's brain each mission, but time-to-time (and players/modders decide how often it should)!

Out of the topic, you did great job and we love you <3
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Yankes on November 17, 2023, 01:02:30 pm
And, a gentle reminder for list of quality of life changes from the player's perspective:
- most casual players never go into code. That's why, I believe, it's better to take advanced configurations into options menu.
Casual  players have no idea too how balance AI, to do it you need spend months testing and seeing if given set of configs is correct.
This effective promote this player to modder as he need have good understanding of all mechanics and balance.
Some this problems are explained in this video:
https://www.youtube.com/watch?v=-nJtd8AJghM
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 17, 2023, 07:49:57 pm
I'll now try to share some of my thoughts losely related to Abyss' and Yankes' posts...

There's basically infinite amounts of things that could be tweaked to make a game more balanced, interesting or immersive. Whether that's via AI, enemy stats and numbers or game-progression-mechanisms.

The issue with the general game-design of X-Com is that the outcome of each mission has a huge impact on everything that comes after it. What this means is that an individual-mission must not really have a close outcome. I test the AI in quick-battles and think: "This mission was fun!" In vanilla-X-Com the discrepancy between a rookie and a better-trained soldier is significant but not overwhelming. In XCF this discrepancy is a lot bigger. So even in the regular game but even moreso in mods like XCF, where you empower your squad more and more, there really can't be many missions that are actually tough to overcome because they'd set back your progress so much or would even be game-ending.

Brutal-AI was never designed to result in a balanced experience in the first place. It was made based on observing the enemies' behavior and thinking about what the enemies ideally should do. What that eventually would result in from a gameplay-perspective wasn't really considered.

Randomly mixing up BAI- and VAI-missions most likely has the following effect: The player determines the most effective way to scout out whether they got BAI or VAI and then retreats from the BAI-missions.
Mixing BAI and VAI-troops in a single mission would be a lot more reasonable to achieve this kind of effect. Currently it's only possible to assign this on a unit-type to unit-type basis but not randomly.

But here is also the question: Who really has the competence to tweak the numbers for likelyness over a game that has so many other variables. Only a very dedicated person could properly balance it and then it's balanced for them. Everyone else might still need a different balance because skill and frustration-tolerance vary widely between different players.

In order for me to develop something it also must be fun for me to develop. And adding tweaking-options that I know will for the most part just lead to even more overchoice in the sense that only the most experienced people will have a chance to know how to properly tweak these values, simply isn't fun to develop to me.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: donk on November 17, 2023, 08:21:26 pm
Hi, I'm using this to play XCF, and I can't find the option to pre-prime grenades. There's one for saving your pre-primed setup, but not to enable it. Right click in pre-battle does nothing. Am I missing something?

Edit: And of course now that I posted this it works. I had this problem for days but now suddenly it works after fiddling with the options. So ignore this I guess.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: zee_ra on November 18, 2023, 01:51:04 am
@Xilmi,

I think the essential feature of Brutal AI mod that would make a gameplay interesting is the ability to configure the ability to play by stealth, while at the same time allowing the enemies to blaster you early.

So far, the observed behavior on the latest versions, when playing custom XCF-based mod, has been very plausible.  With aiTargetMode: 3, aiAggression: 2, autoAggression: 3, cheatOnMovement: false, the stealth play is satisfactory, while the enemy does not seem to be dumb (e.g. the enemy does not attempt a zergling rush, and does not refrain from trying to actually do damage every turn, relentlessly).  It is still possible to take Durathread Factory or a Cult Base with only two agents this way, albeit such encounter is a challenge in general.  The enemy is also actually using launchers in that mode, which makes a huge, huge difference when encountering early legates or mummies in XCF.

So far, the only downside is relatively slow performance, especially graphical one, when soldiers are on the upper levels.  I don't understand why that is the case: the openxcom level of graphics should pose no challenge for any hardware accelerated setup, even if coded straightforwardly and inefficiently.

I also noticed that the engine is not taking advantage of multi-core setups.

In terms of features, I think the most pertinent ones at this point would be the ones that allow certain types of explosion (e.g. "spectral smoke", which might as well be a regular smoke with a special flag set) to propagate through the walls.

I wonder, what set of config flags you find to be most optimal when playing your sessions?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 18, 2023, 11:36:05 am
Hi, I'm using this to play XCF, and I can't find the option to pre-prime grenades. There's one for saving your pre-primed setup, but not to enable it. Right click in pre-battle does nothing. Am I missing something?

Edit: And of course now that I posted this it works. I had this problem for days but now suddenly it works after fiddling with the options. So ignore this I guess.
As far as I know you could always just pre-prime-them pre-battle. What I added is an option under Advanced=>Battlescape called "One-click grenade priming", which is what allows you to do it much faster as you don't have to select a number on the timer (it will always default to 0 with this option).
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 18, 2023, 11:58:18 am
I wonder, what set of config flags you find to be most optimal when playing your sessions?
Do you mean in regards to performance or for gameplay?

If the AI calculations are slow that is on me. I've done quite a bunch of things to optimize it but things like the analysis of where there is good cover or what are good locations to attack from will slow it down noticably. The option "Perfomance optmisation" reduces the amount of tiles analyzed for seeking cover. It especially has an impact on flying units, who would otherwise also consider all possible locations they could move to. Units like the bats for examle with very high TUs sometimes analyze like 6000 positions on the map otherwise.

When it comes to rendering-performance I know that stuff like light-propagation is an issue, especially with increased viewing-ranges (40 instead of 20 tiles). OXCE (and thus also Brutal-OXCE) should be quite a bit better at that than regular OXC, since the OXCE-guys put a lot of effort into optimization in this regard. But there's still potential. Modern games do these things with using all of the hardware, especially the GPU, which I believe OpenXCom makes no use of. I personally lack the expertise in that regard and imagine it would be a gargantuan task, even if I had the expertise. So I can't really improve it.

When it comes to gameplay, I pretty much go with the default-configuration for AI, which is the default because I think it's the strongest that doesn't cheat yet. I also enable "Aggressive Retaliation", which is different than in basic-OXC/OXCE in that it normalizes the search-pattern and also triggers off successful landing-missions and "Enhanced Dogfight Behavior", which makes it so that you can't outrun faster craft once you have engaged them.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: zee_ra on November 18, 2023, 06:10:38 pm
When it comes to gameplay, I pretty much go with the default-configuration for AI, which is the default because I think it's the strongest that doesn't cheat yet. I also enable "Aggressive Retaliation", which is different than in basic-OXC/OXCE in that it normalizes the search-pattern and also triggers off successful landing-missions and "Enhanced Dogfight Behavior", which makes it so that you can't outrun faster craft once you have engaged them.

What is the default configuration specifically?  Particularly, the settings aiTargetMode, aiAggression, autoAggression, cheatOnMovement?

With Aggressive Retaliation, I found that the enemy is actually being smart and trying to expend resources.  This also makes early defenses useful (e.g. 6 SAMs, with 1 hit to sufficient to kill).  I still have not seen if the retaliation stops after N attempts or not.  What is the actual behavior in that respect?  Would the attempts continue to infinity?

I think, it has never been possible to outrun a faster craft.  Certainly not when those are on hunt/pursuit.

Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: zee_ra on November 18, 2023, 06:14:07 pm
Do you mean in regards to performance or for gameplay?

If the AI calculations are slow that is on me. I've done quite a bunch of things to optimize it but things like the analysis of where there is good cover or what are good locations to attack from will slow it down noticably. The option "Perfomance optmisation" reduces the amount of tiles analyzed for seeking cover. It especially has an impact on flying units, who would otherwise also consider all possible locations they could move to. Units like the bats for examle with very high TUs sometimes analyze like 6000 positions on the map otherwise.

When it comes to rendering-performance I know that stuff like light-propagation is an issue, especially with increased viewing-ranges (40 instead of 20 tiles). OXCE (and thus also Brutal-OXCE) should be quite a bit better at that than regular OXC, since the OXCE-guys put a lot of effort into optimization in this regard. But there's still potential. Modern games do these things with using all of the hardware, especially the GPU, which I believe OpenXCom makes no use of. I personally lack the expertise in that regard and imagine it would be a gargantuan task, even if I had the expertise. So I can't really improve it.


I see.  I play with longer ranges.

Are there any principal obstacles to increasing the graphics resolution in game?  Also, what is the underlying model in the tactical game?  Is it just a region of space split into relatively coarse-sized voxel cubes?

Also, it seems that the types of analysis related to motion could be performed in parallel, and the problem looks on the surface as an embarrasingly parallel.  I observe that only one (or two?) core is being used by the game so far.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: zee_ra on November 18, 2023, 06:17:37 pm
Do you mean in regards to performance or for gameplay?

If the AI calculations are slow that is on me. I've done quite a bunch of things to optimize it but things like the analysis of where there is good cover or what are good locations to attack from will slow it down noticably. The option "Perfomance optmisation" reduces the amount of tiles analyzed for seeking cover. It especially has an impact on flying units, who would otherwise also consider all possible locations they could move to. Units like the bats for examle with very high TUs sometimes analyze like 6000 positions on the map otherwise.

When it comes to rendering-performance I know that stuff like light-propagation is an issue, especially with increased viewing-ranges (40 instead of 20 tiles). OXCE (and thus also Brutal-OXCE) should be quite a bit better at that than regular OXC, since the OXCE-guys put a lot of effort into optimization in this regard. But there's still potential. Modern games do these things with using all of the hardware, especially the GPU, which I believe OpenXCom makes no use of. I personally lack the expertise in that regard and imagine it would be a gargantuan task, even if I had the expertise. So I can't really improve it.

I wonder, what causes a behavior, when an enemy approaches a trooper who is stronger in melee, then goes back a couple of steps, then approaches, etc., until it runs out of TU.  This looks like a waste of points.  And, this feels like taking advantage of a retard on disability when trying to play hard-edge ninja tactics with Kill-Bill-style melee scenes inside the rooms.

I also occasionally see enemy troops going back and forth along a line.  Is it possible to eliminate such behaviors?  What could be causing them?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 18, 2023, 08:45:36 pm
What is the default configuration specifically?  Particularly, the settings aiTargetMode, aiAggression, autoAggression, cheatOnMovement?
aiTargetMode => 3
aiAggression => 2
autoAggression => 3
cheatOnMovement => false

Note that with 7.8.0 I just introduced a new option, which overrules the aiAgression by default.
The new option is:
Aggressivenss-mode and defaults to: 1 = Dynamic aggressiveness

I still have not seen if the retaliation stops after N attempts or not.  What is the actual behavior in that respect?  Would the attempts continue to infinity?
No. If you survive a retaliation-attempt the retaliation-mission ends and you have to trigger a new one. No infinite retaliation-attempts. It's just easier to trigger them and they are better at finding your base.

I think, it has never been possible to outrun a faster craft.  Certainly not when those are on hunt/pursuit.
Note this relates to dogfights, not what's happening on the geoscape. By "outrun" I mean an Interceptor with 2100 kph keeping an UFO with 3200 kph out of shooting-range. The UFO will now be able to close in even if you do a distant-attack and you can't just retreat either.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 18, 2023, 08:59:12 pm
Are there any principal obstacles to increasing the graphics resolution in game?  Also, what is the underlying model in the tactical game?  Is it just a region of space split into relatively coarse-sized voxel cubes?
Well, I guess the obstacle is that this is not a commercial product and everyone who worked on it did so without compensation in their free-time. So people lack the expertise and/or willingness to improve it beyond of what it currently is. It's open-source though. So if you have the expertise and are willing to rewrite the engine in a way that makes it run more quickly, uses multithreading and gpu-features, no one is stopping you.
The underlying model in the battlescape is a voxel-engine. Each map-tile consists of 16x16x32 voxels that are calculated internally for stuff like lines of sight and fire. Sprites losely represent the voxels of the shown objects. Sometimes better sometimes worse. The engine is also a replication of the original from 1993, which worked in the same way.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: zee_ra on November 18, 2023, 09:05:03 pm
So if you have the expertise and are willing to rewrite the engine in a way that makes it run more quickly, uses multithreading and gpu-features, no one is stopping you.
The underlying model in the battlescape is a voxel-engine. Each map-tile consists of 16x16x32 voxels that are calculated internally for stuff like lines of sight and fire. Sprites losely represent the voxels of the shown objects. Sometimes better sometimes worse. The engine is also a replication of the original from 1993, which worked in the same way.

Thank you for sharing this.

I thought that since SDL is being used, the hardware acceleration should have come "for free".  Certainly for graphics rendering.  For motion calculations, I think the parallel engine would not be too much of a challenge.

However, for more advance features, I think it may be better to implement those as external plugins -- the separate processes that need not be a part of the game's code base.  How challenging would it be to setup an external AI engine, and game control?  That almost sounds like external debugging, in fact.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 18, 2023, 09:07:42 pm
I wonder, what causes a behavior, when an enemy approaches a trooper who is stronger in melee, then goes back a couple of steps, then approaches, etc., until it runs out of TU.  This looks like a waste of points.  And, this feels like taking advantage of a retard on disability when trying to play hard-edge ninja tactics with Kill-Bill-style melee scenes inside the rooms.

I also occasionally see enemy troops going back and forth along a line.  Is it possible to eliminate such behaviors?  What could be causing them?
Well, these behaviours are not intended and qualify as bugs. 7.7.7 supposedly fixed at least one reason for behavior like this. If it still occurs, please make a save, attach it here with your options.cfg and mention of the mod(s) that were in use and ideally give me some reproduction-steps. This way I can analyze and hopefully fix it.

The most common cause of this happening is when there is a discrepancy between the line-of-fire prediction of the AI for a tile it considers walking to and the actual line of fire when it reaches a tile. Stuff like forgetting to consider the height of an object you'll stand on, checking the targetability in the wrong way and different origin-voxels have been causes for issues like that in the past. There may be more potential causes and if so, I need to find and fix them too.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on November 18, 2023, 09:15:30 pm
However, for more advance features, I think it may be better to implement those as external plugins -- the separate processes that need not be a part of the game's code base.  How challenging would it be to setup an external AI engine, and game control?  That almost sounds like external debugging, in fact.
I may be the wrong person and this the wrong thread to ask questions like this.
I'm just the author of this particular mod and relied on the made nest provided by others who came before me. Sure, I have dabbled into the engine a little bit too. And at least to me it was indeed quite challenging.
I've been working with the OpenXCom-code for a little over a year now and still don't feel competent enough to answer questions like these.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: zee_ra on November 19, 2023, 10:50:10 pm
@Xilmi,

I noticed that in XCF mod soldiers with very high accuracy could use BlackOps auto-sniper rifle to demolish enemy troops in Power Suit and Shock Armor outfits.  This must be the effect of powerBonus.

Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: zee_ra on November 19, 2023, 10:54:14 pm
I may be the wrong person and this the wrong thread to ask questions like this.
I'm just the author of this particular mod and relied on the made nest provided by others who came before me. Sure, I have dabbled into the engine a little bit too. And at least to me it was indeed quite challenging.
I've been working with the OpenXCom-code for a little over a year now and still don't feel competent enough to answer questions like these.

The question is more about allowing the interface with external controllers.  Basically, the current code should still implement game rules, etc..  This way, the hard pieces of puzzle could be solved without affecting the current code base.

Actually, a good start may be to put the default logic into a separate component.  So, we might have pluggable vanilla AI, Brutal AI.  At some later a point, a much better solver may be devised, and it would become a third available option.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: Ronios on November 20, 2023, 06:53:12 am
@Xilmi,

I noticed that in XCF mod soldiers with very high accuracy could use BlackOps auto-sniper rifle to demolish enemy troops in Power Suit and Shock Armor outfits.  This must be the effect of powerBonus.

  • I wonder, if it may be possible to somehow specify the maximum effect that a damageBonus may have on the damage?
  • I also wonder, if it may be possible to spill over (configurably) any extra damage into the relevant damage multiplier?
  • I think option (1) without (2) is probably the best solution, since frankly there's no way a most optimal and efficient rifle bullet could more than scratch a walking tank outfitted with alien armor.

The main problem is not that the bonus damage is large and solving this with some kind of limiting crutches is simply stupid.
The problem is the spread of damage itself. 0-200 is too inadequate a spread, at which it is possible to penetrate medium armor with a simple pistol.
I tried playing XCF with 0-200 and with 50-150 and I can say that in the second case the armor actually feels like armor, and not cardboard, which helps exactly until the first big damage roll. Take a pistol with 25 damage, the maximum throw will give 50 damage and when you shoot at a armor vest, which has 28 armor in the forehead and 30% absorption, we will get 35 damage, which will wound for 7 hp. I won’t even mention getting hit in the side.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: Xilmi on November 20, 2023, 04:26:04 pm
@Xilmi,

I noticed that in XCF mod soldiers with very high accuracy could use BlackOps auto-sniper rifle to demolish enemy troops in Power Suit and Shock Armor outfits.  This must be the effect of powerBonus.

  • I wonder, if it may be possible to somehow specify the maximum effect that a damageBonus may have on the damage?
  • I also wonder, if it may be possible to spill over (configurably) any extra damage into the relevant damage multiplier?
  • I think option (1) without (2) is probably the best solution, since frankly there's no way a most optimal and efficient rifle bullet could more than scratch a walking tank outfitted with alien armor.
Isn't this something you should talk about in the XCF-forums? This really doesn't sound like something related to AI.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: zee_ra on November 20, 2023, 08:57:14 pm
Isn't this something you should talk about in the XCF-forums? This really doesn't sound like something related to AI.

I mentioned the pieces that may be done by editing the mod definitions.  However, one of the approaches to solving these weapon definitions problems is to limit the weapon power through a parameter.  Basically, I'm asking if you think that a new parameter maxPower or similar could be added to that end.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: zee_ra on November 20, 2023, 08:59:53 pm
The main problem is not that the bonus damage is large and solving this with some kind of limiting crutches is simply stupid.
The problem is the spread of damage itself. 0-200 is too inadequate a spread, at which it is possible to penetrate medium armor with a simple pistol.
I tried playing XCF with 0-200 and with 50-150 and I can say that in the second case the armor actually feels like armor, and not cardboard, which helps exactly until the first big damage roll. Take a pistol with 25 damage, the maximum throw will give 50 damage and when you shoot at a armor vest, which has 28 armor in the forehead and 30% absorption, we will get 35 damage, which will wound for 7 hp. I won’t even mention getting hit in the side.

Could you consider a case of a pistol with the same spread, but lower armor penetration set by increasing armoreEffectiveness?  Pistols could cause pretty powerful damage to unarmored targets in general, and are much less efficient against armored targets.  This applies especially to higher grades of armor.

My question is would you rather edit the individual parameters and tweak the armors in the mods, or solve the issue with an extra parameter?  Why?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: Ronios on November 21, 2023, 07:08:16 am
Could you consider a case of a pistol with the same spread, but lower armor penetration set by increasing armoreEffectiveness?  Pistols could cause pretty powerful damage to unarmored targets in general, and are much less efficient against armored targets.  This applies especially to higher grades of armor.

My question is would you rather edit the individual parameters and tweak the armors in the mods, or solve the issue with an extra parameter?  Why?

Firstly, I’m a simple player and I want to play with comfort and interest, and not remake other people’s mods.
Early pistols do not have armor penetration, and some also increase the armorEffectiveness of the target, making them apparently useless against later armor. So here, personally, I have no objections. At the same time, rifles have this same penetration and therefore remain useful a little longer.

For myself personally, I made a reduced spread of damage, which very well solved the issue of ridiculous penetrations, while the characteristics of different armor fit almost perfectly into their niche. In my opinion, this was the simplest and most easily implemented option. In addition, this also solved the issue of zero damage from 5-10 shots in a row at completely unprotected targets.

To Xilmi:


If you don’t have any ideas about identifying monsters that need to disable brutality by default (such as werecats), as a last resort, we can manually register them all and attach them as a base mod. I will still add it for XCF. But, of course, with new monsters we will need to constantly update the list and this is not very convenient.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: Abyss on November 21, 2023, 10:13:19 am
If you don’t have any ideas about identifying monsters that need to disable brutality by default (such as werecats), as a last resort, we can manually register them all and attach them as a base mod. I will still add it for XCF. But, of course, with new monsters we will need to constantly update the list and this is not very convenient.

I don't think there will be much more monsters, because them (monsters) are just the arc of the early-mid game storyline.
Most of them definitely should be marked as non-BAI because of low intelligence (same to most zombies, but not all, ofc).
But what would you do with reduced amounts of them on map?
Say, you play with difficulty 2 => BAI gives you fair resistance => you enter map with VAI creeps and don't see any challenge.

Literally, all the magic of these missions was to defy 50-100 creeps with 4-6 agents.
Especially, early powerup of zombie hordes (100 rushing zombies vs 8 agents in Dragonfly)
With difficulty 2 it will be cut to 15-20 opposing units.
That's why I, IMHO, believe that VAI-controlled missions should be increasing the quantity of enemies.

To Xilmi:
Quote
1.Randomly mixing up BAI- and VAI-missions most likely has the following effect: The player determines the most effective way to scout out whether they got BAI or VAI and then retreats from the BAI-missions.
2. Mixing BAI and VAI-troops in a single mission would be a lot more reasonable to achieve this kind of effect. Currently it's only possible to assign this on a unit-type to unit-type basis but not randomly.
1. Not that it would happen, really. Mods have aspect of:
- time: a lot of missions happen once in a month, skipping (retreating) from such mission will sometimes ruin your succession. XCF, in particular, has super-tight timeframe before actual alien invasion (tier 3 and 4) begins. Through 2 years you have to deal with all tier 1 and tier 2 cults.
- wealth/items/monthly score - not succeeding missions, you will lose it all. Some missions also have avoidance penalties. Losing score = cease funding = game ends. Last playthrough, I restarted campaign 3 times to understand how to deal with BAI while not ruining progress of the campaign (spoiler had to hire and train 100 agents simultaneously instead of 30 as in VAI).   
Summ, player has to be prepared well and do as many as possible.
2. unit type = unit rank?
I think of additional RUL-parsed file that can set several characteristics and probabilities to each in-game enemy, including:
- chance of BAI/VAI control;
- chance of set aggressiveness in case of BAI control (like: aggro1 - 0,5, aggro2 - 0,30, aggro3 - 0,2);
- chance of unit amount multiplication in case of VAI control ("statist" crowding for low-mid tier units), etc
With all that input, experienced players could share insights of what these parameters should be.
I can.

2.1. If mixed behavior will happen, how would BAI adapt to such changes? Will it have to be re-learnt to work with VAI semiautistic brothers?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: Xilmi on November 21, 2023, 02:18:55 pm
If you don’t have any ideas about identifying monsters that need to disable brutality by default (such as werecats), as a last resort, we can manually register them all and attach them as a base mod. I will still add it for XCF. But, of course, with new monsters we will need to constantly update the list and this is not very convenient.
I had an idea and it is implemented via the "Brutal Brutes"-option.
The idea was to say: "If the unit doesn't have an inventory, it's dumb". The rationale was: "Having an inventory indicates some sort of intelligence to use and manage items."

However, while this was consistent for vanilla-UFO, when I looked at how XCF does it, I found that the parameter which is part of the armors.rul usually is left at the default, which is to have an inventory.

But this would be the way to control it right now. So it's not the lack of an idea but the lack of something that is also reliable in that regard.

Other than that the reverse-logic can be used. Disable Brutal-AI in options and enable it for all units in units.rul.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: Xilmi on November 21, 2023, 02:28:48 pm
I mentioned the pieces that may be done by editing the mod definitions.  However, one of the approaches to solving these weapon definitions problems is to limit the weapon power through a parameter.  Basically, I'm asking if you think that a new parameter maxPower or similar could be added to that end.
I mean in theory something like that could be added. But the power of a weapon is clearly something that is data-driven and deliberately picked by the modder according to their intentions. An in-game-option to overrule weapon's power is possible but highly counter-intuitive for that purpose.
The proper way would be to create a submod that nerfs each weapon perceived as OP individually. There's also more elegant ways to do so than just hard-limiting their power-level. For example increasing the fire-rate while reducing the power-level to keep the damage against no armor the same while making it weaker against armor.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: Abyss on November 21, 2023, 07:47:53 pm
Quote
1> Dynamic aggressiveness. => AI-controlled units dynamically adjust their aggressiveness based on their morale. The thresholds are:

= 100 => 4
= 83 => 3
= 67 => 2
= 50 => 1
<50 => 0

Will check this, sounds pretty interesting.
In general, this function of morale + some personified adjustments of soldier ranks would do super in terms of battles diversification.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.0
Post by: Xilmi on November 22, 2023, 01:47:41 pm
Will check this, sounds pretty interesting.
In general, this function of morale + some personified adjustments of soldier ranks would do super in terms of battles diversification.
I made an adjustment to how aggressivity 4 works yesterday. It now is distinct from the behavior expressed by Leeroy-mode.
The units will still walk towards where they think the enemy is. But when they think they are currently visible to the enemy, they will snap out of that and start considering cover. However, taking cover has a lower priority than attacking. So they will spend as many TUs as they can for attacking and only use whatever is left to break vision if possible.

I'd say that compared to the leeroy-mode this is actually a valid playstyle for confident units. It is very aggressive but still shows signs of intelligence.

If they are successful in doing that, their morale will keep high and they will continue doing it. Trying to put a swift end to the player's forces. If they notice they are taking losses, they will employ a more careful approach.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.2
Post by: Ronios on November 22, 2023, 07:29:45 pm
Please tell me if there is any way for a player to arm grenades for the player and opponents automatically on turn 1, not 0? Or maybe you can add a turn 1 option to the automatic grenade arming option.

Usually, grenades in the game work completely outside of their role. It's essentially just an area weapon that doesn't necessarily need to hit and does more damage than most weapons. You can even come up, throw it at your feet and walk away.

I want to make grenades into grenades. So that their goal is to destroy shelters, scare enemies away and cause damage to those who simply remain in place.
There will be another option to pick it up and throw it back, or just put it in inventory, but this will also cost TU a lot and may have its own additional risks. And no one will write AI for this, so only the player will have access to this moment.

Well, yes, I'm tired of dynamites thrown from 20 squares, which are almost guaranteed to kill the whole team.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.2
Post by: Xilmi on November 22, 2023, 09:03:56 pm
There will be another option to pick it up and throw it back, or just put it in inventory, but this will also cost TU a lot and may have its own additional risks. And no one will write AI for this, so only the player will have access to this moment.
Code: [Select]
void AIModule::tryToPickUpGrenade(Tile *tile, BattleAction *action)
{
if (!_unit->hasInventory())
return;
for (BattleItem *item : *(tile->getInventory()))
{
if (item->isFuseEnabled())
{
if (_save->getBattleGame()->takeItemFromGround(item, action) == 0)
if (_traceAI)
Log(LOG_INFO) << "Picked up " << item->getRules()->getName() << " from " << tile->getPosition();
}
}
}
*cough*
No, you can't preprime automatically once you left the pre-battle stage. By using hotkeys you can to it relatively quickly manually though.
You can open the inventory drag it to the hand, hit tab and repeat until you're done.
Then you e-1-tab through all your units. The option "One click grenade-priming" needs to be enabled otherwise it needs an additional click. But yes, it requires TUs. You can also activate auto-play for one turn and hope it does prime a few grenades.

Other than that I'm not really sure what you are getting at with your post.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.2
Post by: Ronios on November 23, 2023, 06:05:04 am
*cough*
No, you can't preprime automatically once you left the pre-battle stage. By using hotkeys you can to it relatively quickly manually though.
You can open the inventory drag it to the hand, hit tab and repeat until you're done.
Then you e-1-tab through all your units. The option "One click grenade-priming" needs to be enabled otherwise it needs an additional click. But yes, it requires TUs. You can also activate auto-play for one turn and hope it does prime a few grenades.

Other than that I'm not really sure what you are getting at with your post.
I apologize if I expressed my thoughts unclearly. I meant there was no way to quickly activate grenades. I want that during ACTIVATION, which is performed as usual, the timer for grenades is not set to 0 rounds (instantPrime: true ) (explosion at the end of the current team turn) and not to select how many rounds the timer will be. And so that it is placed strictly for 1 round for both the player and the AI.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.2
Post by: Juku121 on November 23, 2023, 07:16:11 am
It seems to me that most of the grenade changes are more of a ruleset thing rather than anything to do with AI.

Please tell me if there is any way for a player to arm grenades for the player and opponents automatically on turn 1, not 0? Or maybe you can add a turn 1 option to the automatic grenade arming option.
'fuseType: 1'


Honestly, the one-click priming option looks kind of like an end run around existing game mechanics and might actually be counterproductive, depending on mod and grenade.

Well, yes, I'm tired of dynamites thrown from 20 squares, which are almost guaranteed to kill the whole team.
'throwRange'

I was much happier once I changed all grenades to 'throwRange: 12' and big explosives to 'throwRange: 6' or even 'throwRange: 4'. So many people seem to think the absolutely unrealistic throwing ranges and accuracy are a core part of the OG X-Com experience... But I've ranted about this before. :(

I want to make grenades into grenades. So that their goal is to destroy shelters, scare enemies away and cause damage to those who simply remain in place.
Eh, IRL grenades don't really destroy cover. Some types (HE, dual-purpose, thermobaric) do degrade it, but the common frag grenade is exactly meant to be used from cover that will protect you and not the enemy.

X-Com doesn't really distinguish between frag and HE too well unless a modder is into it.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.8.2
Post by: Ronios on November 23, 2023, 09:43:16 am

It seems to me that most of the grenade changes are more of a ruleset thing rather than anything to do with AI.

'fuseType: 1'

Honestly, the one-click priming option looks kind of like an end run around existing game mechanics and might actually be counterproductive, depending on mod and grenade.
The one-click priming option can indeed break some grenades, but for the most part it’s more convenient.
'fuseType: 1' looks like a very interesting option. More digging into the ruleset, but this is really what I need.
'throwRange'

I was much happier once I changed all grenades to 'throwRange: 12' and big explosives to 'throwRange: 6' or even 'throwRange: 4'. So many people seem to think the absolutely unrealistic throwing ranges and accuracy are a core part of the OG X-Com experience... But I've ranted about this before. :(
And even more of ruleset. It will take some time, and I won’t notice everything right away, but setting it up is not a problem. Thank you very much for the good solution to both points.

Eh, IRL grenades don't really destroy cover. Some types (HE, dual-purpose, thermobaric) do degrade it, but the common frag grenade is exactly meant to be used from cover that will protect you and not the enemy.

X-Com doesn't really distinguish between frag and HE too well unless a modder is into it.
The game actually has problems distinguishing between what types of effects grenades can have. I think the closest variant of a frag grenade in the game is shrapnel, which weakly destroys the area, but is very good at breaking things and killing all living things.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.9.0
Post by: Xilmi on November 25, 2023, 11:52:09 pm
@Abyss:

Please check out the changes in 7.9.0.
I think they are something that could be interesting to you to toy around with.

Instead of going the route of randomly assigning old and new AI, I gave the new AI an adjustable chance to make a random move.

I did some experiments with highly inconsistent results.

I set up a game of X-Com with a rifle and a grenade for each soldier against lowest tech sectoids.
It also used Joy Narical's realistic accuracy.
X-Com was consistently using the maximum intelligence at aggressiveness of 3.
Sectoids had aggressiveness 2 but I tried it over and over which each of the intelligence levels.

The results were:

Int 0: 3
Int 1: 5
Int 2: 14 (1)
Int 3: 11
Int 4: 14 (0)
Int 5: 13

The number is how many X-Com Soldiers were killed. The number in brackets is the amount of aliens killed for the cases where X-Com lost.
I had first started with 5, then 0, then 3 then 1. Up until that point it follewed the expectations: The more intelligent the aliens are, the better their results.
But then came the test at Int 2, which was a total outlier. Int 2 means: 60% to make a random move and 40% to make what is considered the best move. With only 1 dead alien that seemed very unexpected.
At Int 4 (20% random, 80% best move) it achieved an even better result.

What this means is that the AI's supposed best moves still have potential to improve if some randomness can actually improve the result.

For melee-units I still need a reasonable idea. For them movement mostly is part of the attack-routine, which isn't impacted by the randomness. Basically they also move randomly when they can't attack a target. But when they can, they move towards it in order to do so. Making melee-units move randomly even if they could attack, would weaken them much more than ranged-units.

A big advantage of going this way instead of using vanilla-AI, is that we can make further adjustments to how exactly intelligence should impact their behavior.

Now with both aggression and intelligence optionally supported, there can be huge behavioral differences between units that modders have control over.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Xilmi on November 27, 2023, 10:31:30 am
For 7.10 I finally implemented something that has been bothering me for a long time:

"Smart ctrl-click and auto-equip" => Ctrl-clicking items in the loadout-phase will prefer slots that are faster to reach. The off-hand will be deprioritized if the main-hand holds a two-handed item. Auto-equip uses the same logic.

With many soldiers dying, as is to be expected with Brutal-AI, equipping new soldiers is something that has to be done over and over. And while using equip-templates clearly helps, a little bit of perfectionism usually caused me to fill them to their capacity with stuff like additional grenades etc.

A fast way of doing so was to just ctrl-click these items on the ground and see how they made their way into the inventory... But what is this. After the belt is full, the stuff goes into the backpack... where it takes a lot of TUs to get it out. That's clearly suboptimal and cried for manual intervention.

Not anymore! The new feature introduced in 7.10 iterates through all inventory-parts and checks the amount of TUs needed to put it from there into the hands. Then it puts the item in the first slot with the lowest slot-to-hands-tu where it fits. This will also work with all sorts of custom/modded inventories.
Furthermore it looks whether the item in the main-hand is a two-handed-item and if not uses the other hand with priority.

So properly "filling up" new soldiers now is much less of a hassle.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Abyss on November 28, 2023, 09:42:29 am
Quote
Ctrl-clicking items in the loadout-phase will prefer slots that are faster to reach
Brilliant! Now it won't ignore quick-draw slots and would not throw everything into backpack.
I haven't thought QoL changes are area of your interests, thus never suggested something like that.

Quote
Intelligence-mode
0> Static intelligence. 1> Inherit intelligence from unit-intelligence. 2> Inherit intelligence from difficulty-level.

The second allows you to pick an intelligence-level for the case static intelligence was selected as Intelligence-mode:

Static intelligence
Chance to make a smart move instead of a random one: 0> 0% 1> 20% 2> 40% 3> 60% 4> 80% 5> 100%
Not sure it is clear from description what intelligence is and how it works.
Intel for each unit? Mean, current unit has a chance to deviate?
Intel of whole fraction? Like top-tier fractions are smart and some bandits are less smart?
Where exactly intel level of units is defined?
How exactly difficulty level affects intellegence? If I play hardest difficulty, will zombies and dogs use 100% smart moves instead of random/vanilla ones?


Quote
I set up a game of X-Com with a rifle and a grenade for each soldier against lowest tech sectoids.
It also used Joy Narical's realistic accuracy.
The more intelligent the aliens are, the better their results.
But then came the test at Int 2, which was a total outlier.
For statistically determined results there should be, at least, 100 rolls for every intel level. Nevertheless, this is quite interesting. I believe sometimes randomness can disrupt and counter AI expectations.
I would also suggest that AI shouldn't be taught on AI, but instead on human leather player playstyles. 
Hm. If there only was a battlefield move logger, then you actually can have a lot of materials to teach the AI from those who would love to contribute.
But as every new version make older one obsolete, logs should be pretty fresh. Is there a way to save the map and everything happening? Will it be massive? Will it actually help?

Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: psavola on November 28, 2023, 10:12:16 am
I'd really like to see QoL improvements make it into mainstream OXCE, to benefit also non-BAI users. But I suspect some of these might be contentious and non-trivial *), so I understand that this might not be a priority for Xilmi.

*) As examples:
 - Pre-prime right-clicking skipping the number of turns dialogue. I suspect 99,9 % of players would prefer this. But already someone has suggested something else. But I'd still wager this could be implementable in OXCE.
 - TU-efficient equipment placement. The right placement of items is affected by the order by which you add the items. Intelligent placement will only work to some degree if you assume the biggest and most relevant items are added first. Adding 1x1 sized objects to optimal places afterwards is a trivial (but very nice) improvement, and the big challenges arise when you place larger objects, the usefulness of which also depends on its purpose. So I could see that at least some improvements might be resisted in OXCE with an argument that doing so would create an endless need to finetune the placement algorithm.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Xilmi on November 28, 2023, 11:00:46 am
Brilliant! Now it won't ignore quick-draw slots and would not throw everything into backpack.
I haven't thought QoL changes are area of your interests, thus never suggested something like that.
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.

Not sure it is clear from description what intelligence is and how it works.
Intel for each unit? Mean, current unit has a chance to deviate?
Intel of whole fraction? Like top-tier fractions are smart and some bandits are less smart?
Where exactly intel level of units is defined?
How exactly difficulty level affects intellegence? If I play hardest difficulty, will zombies and dogs use 100% smart moves instead of random/vanilla ones?
Well, it is three different modes. So the answer to your questions is yes or no depending on what mode you choose.
The default mode is static intelligence. It is same for all enemies and you can set a value from 0 to 5 in the option right below it.
The second one is unit-intelligence, which is taken from the unit-types *.rul-file in the mod. The value that base AI uses for how many turns it can see the location of a spotted soldier. I think this is the one that should be most interesting for your purposes. Note that values can be higher than 5 for this. All units with an intelligence higher than 5 will also just express the most intelligent behavior. But I could also make adjustments and add more levels.
The third option is once again same for all enemies but depends on difficulty. Beginner = 1, Experienced = 2, Veteran = 3, Genius = 4, Superhuman = 5. With that brutal-ai shall become significantly easier on lower difficulty-levels.
Note that these modes are currently mutually exclusive but we could always add more modes if we can think of them.

For statistically determined results there should be, at least, 100 rolls for every intel level. Nevertheless, this is quite interesting. I believe sometimes randomness can disrupt and counter AI expectations.
I would also suggest that AI shouldn't be taught on AI, but instead on human leather player playstyles. 
I know, statistical relevance of one test-run is pretty low. That's also not training the AI based on itself, that's just benchmarking. For benchmarking it, I need something that is constant and something that isn't. My own play obviously would deviate, the AI with a static setting should act the same every time.

The teaching-process mostly is based on observing every move and thinking about whether I would have done the same and if not, look at what information the AI could have concluded by that doing what it did wasn't a good move. However, with so many different modes to set the AI up, a lot of those do not fulfill the "how would I play"-criteria.

Hm. If there only was a battlefield move logger, then you actually can have a lot of materials to teach the AI from those who would love to contribute.
But as every new version make older one obsolete, logs should be pretty fresh. Is there a way to save the map and everything happening? Will it be massive? Will it actually help?
Enabling the traceAI-option in options.cfg logs all the moves and also parts of the "thought-process" of the AI in the log. But this is very dependant on context. A lot of the contents of that log are only ever useful if at the same time I have the map open so I can see what coordinates corresponds to what position. A mere log of what they do without seeing the map would be next to useless. A log of what the player has done even more so.

What actually would help is gameplay-footage in the form of videos, ideally with the player describing their thought-process. Especially on relatively even grounds. Someone showing me what they do and why would allow me to see whether there's something I haven't considered yet.

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. It is possible to learn just by observation but learning by the combination of observation and being told the reasoning would be a lot more efficient.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Xilmi on November 28, 2023, 12:38:32 pm
I'd really like to see QoL improvements make it into mainstream OXCE, to benefit also non-BAI users. But I suspect some of these might be contentious and non-trivial *), so I understand that this might not be a priority for Xilmi.
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.

There's also others who tried to get their changes into OXCE and who were told off. Flaubert and Joy Narical for example. So their features are also exclusive to Brutal-OXCE.

The effort of creating a pull-request towards OXCE for small secluded features like that isn't really all that big. But with the always looming chance of rejection, I won't even bother. And of course there's also the point that I want to see let's players play against my AI, so if I can incentivize more people to use my client by offering some exclusive features besides the AI, chances are higher they will want to use my client and try out the AI too, if it's just one click away.

Also I don't mind if the OXCE-Team backports anything they want from Brutal-OXCE. So if they want any of my QoL-changes, they can just take them. It's what I do with Joy Narical's stuff too.

Intelligent placement will only work to some degree if you assume the biggest and most relevant items are added first. Adding 1x1 sized objects to optimal places afterwards is a trivial (but very nice) improvement, and the big challenges arise when you place larger objects, the usefulness of which also depends on its purpose.
It is indeed as you say. If you don't start with the main-weapon but for example a medikit, it will put the medikit into a hand-slot because the hand-slot is still free and according to the algorithm the hand-slot is the fastest slot to take something into your hands from because the TU-cost for that is 0 since it's already there. The algorithm just assumes you start from the most important and work down to the least important item.

So I could see that at least some improvements might be resisted in OXCE with an argument that doing so would create an endless need to finetune the placement algorithm.
Yeah, as I said, this is a real risk but at this point not even my main reason not to try it.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Abyss 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.

Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Abyss 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,
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: 0xEBJC 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: 0xEBJC 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Abyss 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? 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.2
Post by: Abyss 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?)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Scamps 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...)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.10.1
Post by: Finnik 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Ronios 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.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.7.4
Post by: Xilmi on December 01, 2023, 04:19:05 pm
If the global Brutal AI is enabled, then "isBrutal: false" will not work for these individual units.
You are right, I should definitely make it work like that.

Edit:

...which isn't as easy as I thought. Each attribute has a default-value that it takes when no value is set for it in the config. And for a bool that's either "true" or "false". In this case it is "false".

So whether the rul-file says: isBrutal: false or it doesn't mention the flag cannot be differentiated.

So what I could do is to make it an int instead and have three values, where "0" would be to take the global setting whereas "1" is forced off and "2" is forced on regardless of the global setting.

Should have thought of that before.

Changing it now would break compatibility with existing mods that make use of it... But I don't know whether there actually are any.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 01, 2023, 11:00:45 pm
I captured first months of XCF playthrough.
All zombies roar and chase as intended.
All other creatures seem to do what they originally intended.
Tested both 40% and 60% randomness settings, would like to say it feels much different (in a good way) from both 100% vanilla OXCE and 100% BAI. My preferred setting is indeed 40% random 60% BAI.

Big thank you for your work.

Will come with video-review in a week or less.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Finnik on December 02, 2023, 11:37:47 am
@Ximli it seems you have a lot of new stuff in your fork? Do you have some kind of documentation, how it is different to OXCE? Like wiki page on GitHub, for example
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 03, 2023, 12:18:25 am
Quote
1. Weighted randomization => The scores that are used for decision-making of the AI are multiplied with a random factor in order to reduce predictability.
This will make the AI less predictable at the cost of some playing-strength. However, the loss of playing-strength is less than it may seem the case since it's much more likely that an at least decent option will be picked whereas bad options will have a very low chance of happening.
2. The AI will now consider tiles that have dead bodies of their friend on them as much less suitable to take cover on.
Great! Will upgrade.

To Xilmi:

Little suggestion:
BAI that doesn't see player's units: tends to peek. If reaction fire made by player-controlled units, it sometimes shot into the position even if no visual contact was made. That's cool.
But how would BAI deal with players, that null TU's and thus prevent reaction fire? Earlygame experience.
Mostly done at night + flares + shooting from distance. Aggressiveness is balanced.
AI has no chances to make sight contact. Maybe force a bit of random shooting into the tiles? Players use that too, if automatic weapons equipped. The condition is: BAI thinks this unit is not seen (I hope it doesn't cheat by checking armor's vision stats), e.g. covered with darkness, far from player units.
Call it suppression mechanism. Can be likely more frequent for automatic weapons.


To Jnarical:
Tested your "cover and accuracy" option throughfully within 2 days.
1. a) if an enemy is being shot with autofire, and is downed in the middle of it, next bullets go into the downed body tile, possibly killing it. Should be: all go through the line of non-downed target. This is a key for some crowd-shooting mechanics.
b) haven't yet tested, but is already under the question: two way point autofire (like, minigun). How would it work?
2. a) a lot of battles happen in the forests, suburban area. These little leaves, thin branches and woods, 1/2 inch wooden fences and, of course, hollow Rabitz fences that give 90% cover sometimes seem quite doubtful.
b) another thing, it makes any mission with dense surroundings 2-3x times longer.
c) in early-mid game most shots are already at 40-60% hitchance, thus reduction in 90% of cases makes it a barely noticeable chance of hit.
d) grenades are already gamechanger, because how good they land. Now even more.
Suggestion is to separate weights and sum them:
* 40% plain hit chance
* 40% cover to reduce chance
* 20% range-to cover factor: the more is range, the more is cover bonus.

3. please check shotgun calculating mechanism. It shows more probability than actually logs at "display roll" notice. Compared this to rifles, they are ok.
4. 5% low cap hitchance for shots - is something I personally against. There's even commendation for ~null-chance hits (like, killing from minigun). Thus, hitchance should decay to zero. The roll mechanism will not work, then? Is it possible: to miss, but not to miss with a giant piece of luck?

Will come back with more, which I forgot to mention.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 03, 2023, 02:24:26 am
@Ximli it seems you have a lot of new stuff in your fork? Do you have some kind of documentation, how it is different to OXCE? Like wiki page on GitHub, for example
Well, there's this post:

https://openxcom.org/forum/index.php/topic,10967.msg151712.html#msg151712

I tried to keep it up to date for the most part.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: donk on December 03, 2023, 04:32:07 am
I just downloaded the latest version and there's one thing I'm wondering about. Why is the spread out option an on/off setting? Wouldn't it be better if it was related to the units intelligence? Maybe with a lower chance of happening for dumb units and when on low morale(panicking)?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 03, 2023, 10:36:21 am
I just downloaded the latest version and there's one thing I'm wondering about. Why is the spread out option an on/off setting? Wouldn't it be better if it was related to the units intelligence? Maybe with a lower chance of happening for dumb units and when on low morale(panicking)?
There's different perspectives on whether there should be more separate options to allow as much individual tweaking as possible or wrapping different things up under one option.

A lot of things could be tied to intelligence or otherwise be controlled by a single option.

I'd say we have gone quite far into the "overchoice"-territory, where players will start being intimidated by their vast amount and rather not want to meddle with them out of fear of ending up with a configuration that is not ideal.

I'd like to have more feedback like this. Of whether people like having so many opions or if they'd prefer only a few options that control more than one thing.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 03, 2023, 10:42:23 am
Little suggestion:
BAI that doesn't see player's units: tends to peek. If reaction fire made by player-controlled units, it sometimes shot into the position even if no visual contact was made. That's cool.
But how would BAI deal with players, that null TU's and thus prevent reaction fire? Earlygame experience.
Mostly done at night + flares + shooting from distance. Aggressiveness is balanced.
AI has no chances to make sight contact. Maybe force a bit of random shooting into the tiles? Players use that too, if automatic weapons equipped. The condition is: BAI thinks this unit is not seen (I hope it doesn't cheat by checking armor's vision stats), e.g. covered with darkness, far from player units.
Call it suppression mechanism. Can be likely more frequent for automatic weapons.
You mean the AI should sometimes randomly shoot towards where they think player units could be so the player doesn't know whether their units are seen or not?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 03, 2023, 12:03:37 pm
5% low cap hitchance for shots - is something I personally against.
Yeah, the 95%/5% caps are not something I'm a fan of, either. There are already other factors that simulate the crit/graze mechanics, namely voxels that do not 100% or even 90% match the sprites and the 0-200% damage rolls. Adding this on top is too harsh.

At least make the caps customisable as a ruleset variable if not a game option, please.

in early-mid game most shots are already at 40-60% hitchance, thus reduction in 90% of cases makes it a barely noticeable chance of hit.
Cover degrading accuracy to such a degree is IMO not such a hot idea, either. JA2 v1.13 once made a 'new chance to hit' option that tried to do something like this (well, technically it was more like a reverse of what jnarical is doing with this, but I'm talking about its impact on gameplay), which made battles autofire slogs and slowly fell out of favour with most players, even ones that were into it at first.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 03, 2023, 12:26:02 pm
I agree on the caps. These caps seem arbitrary. And if something is supposed to be realistic, then having arbitrary caps seems weird.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 03, 2023, 02:16:34 pm
I answered to Abyss in messenger, decided to translate my text with DeepL and put it here, just to give you all some context))
I've seen it, plus xilmi forwarded it to me on discord.

I'm too lazy to write it in English.)

This part is quite on point, the problem is that I killed the screen on my main laptop and had to get a spare. It doesn't have an M2 connector and for the first time in almost 20 years I was left without linux and with only Windows, which I need for work. I had to take out the SATA disk with linux and insert the Win10 one.

Because I got a job recently, I don't have time to do hobbies at all. I tried to set up a toolchain on Win, took 5 hours and failed) I hate that shit, on linux it was just one command to install dependencies to get OXC to build and make everything work

This is just an FYI that right now there are no time or tool resources to do the finalization. More to the point...

1. about auto firing and that the rest flies to the floor - I would personally call it if not a bug, then at least an undesirable behavior. It works that way because you have to fiddle around for a different implementation. In the original it was simple in this respect - there is a target voxel and each shot flies into it with a random deviation, no matter if it killed someone or not. In my case, for each shot is determined whether there is a unit on the target voxel or not, and selected accordingly either the ground or the center of the visible part of the unit. In the original game this was also done, but once early on, at the time the target point was determined, after which it did not change. If I have time, I will try to solve this issue.

As a lyrical digression - the task of implementing alternative accuracy mechanics turned out to be much larger, and the goals themselves changed a lot in the process. The story can be summarized as follows:

1) Annoying that in X-Com (normal, without mods!) soldiers from a few meters miss at an angle of 40 degrees to the line of fire and accidentally shot in the back of his own mate’s head. I'll try to look at the source code, if toolchain will work without a headache - I can try to make the cone of fire smaller

2) Fucking hell, I looked at the algorithm, it's not adjustable at all! What probabilities are there - God only knows, that is, they hardcoded some scatter settings, matching them to the accuracy numbers, and it does not work at all distances. And the accuracy cone is tied to these probabilities. We have to write our own from scratch. I'll try to do it this way - we consider the area of the target figure, then we take the accuracy and based on it we calculate the area of the scatter spot, so that the area of the target figure makes up a fraction equal to the accuracy. Then the chance of hitting will remain, but the spread will be around the target, i.e. realistic!

3) A lot of problems! How do I draw a scatter spot in 3D, i.e. how do I limit it in code? In addition, in the game, accuracy often does not change in a huge range of distances, which means that when aiming at a distant target - the shot will be completely predictable in the vicinity, because the cone will be narrowed as the distance grows. In addition - the very concept of "accuracy" in the game - complete nonsense! It is just a figure taken from the ceiling, and the chances of hitting are very conditionally related to it. The projection area of a conditional muton is almost 2 times larger than a sectoid - should this be taken into account? What about large units? I'll make the hit depend on accuracy just like a dice roll, and the trajectory will be built to look nice.

4) Difficult, very difficult....

5) Bugs, lots of bugs in the original code. PRs with bugfixes are not accepted in the main rep, although the bug is obvious and bugfixes too.

6) What, my code doesn't work properly in the 40k/Rosigma mod? What the fuck is this all about, first time I've heard of it. I'll have to put.... FUCKING FUCK!!! Do I have to debug all the mods too?!?!?

7) X-Piratez... X-Com Files... bug reports are flying, fixing the code.

8) Bugs and strange solutions in mods, when the developer to create a model of the tank on the battlefield uses for the hull walls and elements of terrain, and inside shoves a unit 2x2 in the form of a turret. It turns out that not only my code glitches on this spawn of the devil - the original accuracy code erroneously applies a hidden penalty of 50% on accuracy. Another bug in the original code fixed along with mine.

9) Players complain about near misses. Well, yes, the original accuracy is not the same as written, we all know that, and I did exactly according to the figure. I'll just try to increase the accuracy for the next 10 tiles up to 100% up close.... oh shit, how many different and in some places strange shit invented by mod developers! 4 times this piece of code redesigned.

10) Players complain about balance. In mods.

get back to it.)
1.a responded
1.b - the answer is "I don't know." I've never encountered such a weapon, so I humbly await bugreports if something went wrong with it. Expected in theory behavior was - "should work", now - not sure anymore, I'm afraid it will shoot to the floor.

Further not by points, but by groups united by a common meaning. On the topic of missions becoming longer (especially in the jungle). One of the ideas behind my mod was to add working cover mechanics to the game. The way the old accuracy worked - had specific consequences. You either missed by half a map or hit a squirrel in the eye. That is, after applying the accuracy algorithm, the distribution of possible final points is such that either they are in a narrow central beam, or almost evenly smeared over the entire area of the cone. Therefore, the cover in the game was of little or no use. The main hits were of the "squirrel in the eye" category, when the final displacement from the target point is 1 voxel in a random direction.

So, I made it so that there were covers and that they worked. The idea was to add more tactics, when you really try to cover your soldiers, and the shots do not fly into the milk, and hit the covers and surrounding tiles, destroying them and forcing you to change positions. One of the obvious outcomes of this change is that there are far fewer hits in the game. I mean, before it was just accuracy. Now it's multiplied by a number between 0 and 1. Obviously, mathematically, the sum of these numbers will be smaller in the second case. I wanted when you pass the turn to the opponent - so that there wasn't that feeling of doom when shots are flying at you. Instead, now there's hope, because your man is crouched behind the wheel of the Skyranger and the shots hit the chassis strut and lie next to him. That is, your decisions really determine the odds with which the enemy will hit. That said, you have the advantage that opponents don't know how to kneel. In short, I wanted to achieve a more "tactical" feeling from the game, so that there were obstacles and shots hit less often because of them - I achieved this, it's not a bug but a feature))) A hopelessly low chance of hitting is not a problem, it's necessary to be able to see the enemy and plan something tactical, not to pounce in an attempt to kill.

Jungle mission? Burn them with flamethrowers, level them with grenade launchers. Don't shoot spiders and rats with a gun, it's not a good idea in real life either.

that's vanilla accuracy.
https://www.ufopaedia.org/images/1/16/Accuracy_areas_above.gif
0% 25% 50% 75%

I forgot to add to that. If we don't mean specifically the jungle and the stuffiness that the missions on them turn into, I don't consider the fact that the missions have become longer to be a minus. The game is not work, the main thing is that it brings pleasure, in this case, it does not matter in the end how long the missions last. The difference is that your playthrough will pass for a year and not a couple of months))))

If with my changes to play worse and uninteresting - then vice versa, even if the missions would pass for the same time, it does not matter. Personally, I can't play without my mod anymore, it's uninteresting and annoying. But at the same time I know people who play without Extender Accuracy, so if they have an auto-shot 65%, it will be 65% for the entire map. I.e. distance is crossed off the list of parameters that affect tactics. From my point of view - the game is less interesting, less tactical and diverse, but if other people like it that way - no questions asked. It's just that my mod to the game won't work for them.

There is a simple solution - add a setting that adjusts how much cover affects hit chance. What you call "weight".  Make three options for the setting - no effect, partial effect, full effect. The current implementation is "fully". For the option "partially" pick a percentage by which to reduce the invisible part. For example, accuracy 100%, visibility 50%.
after applying the customization will work:
1) "no effect" - chance of hitting 100%
2) "partially affects" - the invisible part of the unit is 50%, we add half of it (conditionally!) to the visible part, the resulting accuracy is 75%.
3) "affects completely" - 50% chance of hitting, as currently done

instead of "conditional half," pick a number. Maybe 60% would look better there, maybe 40%....

With the shotgun, I have to look into it, I haven't really looked into it. It's most likely that its chance of hitting is calculated for the sum of pellets, and in the log is displayed for a separate one. But that's a guess. In any case, a bug is extremely possible, one need to go in and look into it.

Lower cap on hitting. I understand that you're looking from the perspective of your habit of pointing somewhere, seeing 0% and shooting and hitting regularly. Or when you see accuracy numbers like 160% or 230% near the cursor you miss. So there you go))))) Viewed from the outside, a 0% chance of hitting means "impossible to hit" to the average person. If you have zero displayed and you hit regularly, then the chance is not zero. It can be measured by taking a large enough number of shots and collecting statistics. And I'm pretty sure that in the end, where you have 0% displayed, it will statistically turn out to be between 5 and 10%.

In my version - percentages do reflect what they mean in real life. 0% means you will never hit. 100% means you will never miss. An achievement for hitting at 0% doesn't make sense to me, sorry. But 1% would make sense, because the lower cap isn't actually 5%. If a target is less than 5% exposed (2.5% for large targets) - the lower cap is equal to its exposure. So if you find a target that's 1% open - you'll see that exact number near the scope. But at the same time, if you find a mega-cool sniper with 120 accuracy, give him a mega-accurate sniper rifle with 250% accuracy (total 300% accuracy) - you will get 300 * 1% = 3% final chance to hit. If you crouch down - you get 300*1.2 (can't remember exactly) =360*1% = 3.6 rounded up = 4% plus "flat" 2% for a shot from the knee, plus "flat" 3% for aimed. That works out to 9% - the chance is low, but far from zero.

The example was a bit extreme, what I wanted to show is this - for difficult shots good snipers and good weapons will shine, and the preparation for the shot is crucial

"20% range-to cover factor: the more is range, the more is cover bonus."

There's something to this, but there are a lot of problems with it right off the bat. First, it breaks the mechanics of cover at short ranges. Secondly.... If I'm moving forward with a tank, followed by two fighters who are completely hidden behind the tank - I wouldn't want the tank to become more and more transparent to shots as the enemy approaches).

That being said, a variant with a barn, or when your own unit shoots from behind cover that would not have prevented it from fighting, do make some sense.

But here we come to a very important characteristic of the game - the CONVENTION of the game. This characteristic has already been in place since about 94, and trying to make the game mechanics more detailed is possible, but makes no sense at all. Units are cylinders, not real models. The dimensions of these cylinders are often completely inadequate to the sprites. I haven't checked the height of the rat, but I suspect it's no good there))) Further, the accuracy has nothing to do with the size of the target - in the original rat or tank - everything is the same, the accuracy on them is the same. If the target stands on a grass field, in 3D this grass is a piece of 5 voxel "blades of grass" per square meter, each thick as my hand. And when a flying bullet hits such a blade of grass - it destroys a square meter of grass, and it turns out that the blade of grass protected the target.

And the last point, a bit controversial, but quite important for me. The thing is that I have no way to make a "magic pill" - a code variant that would work perfectly for both the main game and all its huge mods. The balance of the mods is completely on the developers' dime, and sometimes completely insane compared to the original game. In XCF, all agents are dumb, slanted, and weak after being hired because of the game's mechanics of training them on base. Such that you are met by 60 enemies on a mission - here I just sit with my mouth open and don't understand why).

That's why I don't have the task to correct the balance of mods by means of hardcoded accuracy algorithms. To some extent I can do it, but beyond that it makes no sense. If something is broken, it's because the mod author made it that way. If the Kalashnikov at 35% accuracy, agents at 60 have it, and the distance of auto-shot 7 tiles - we get 21% of the bullet at 7 meters, further worse. And it may have even worked somehow in the original game - because the shown figure has no relation to the real one, as a result hits happened more often. The problem is that the players HAVE gotten used to this difference! "It's showing 0%, but I'll try auto, sometimes it hits!"

In general, I don't consider it my problem, or rather it has a very low priority. In a good way, you could do a statistical experiment and find out the real odds for hitting different types of shots at different distances. Then adjust the numbers in my mod. But I don't have the resources for that now.

Well, and about grenades. Recently discussed either on the forum or in discord, and with at least one other person in the Telegram. Grenades generally obliterate small arms, and that's a big problem with the game as a whole. It all rests on the degree of convention again. Grenades can be thrown far away, but a Kalashnikov can't hit with a 7 meter auto-fire. I'm not the one who came up with this balance, and I'm not the one to decide it. There are solutions in general - reduce the throwing range and blast radius, remove the "instant" explosion, let the enemy escape... there are options.

Grenade throwing accuracy can be tweaked, of course.

UPD: as I can't work on it right now, I'm still diligent in collecting bugreports and suggestions

UPD2: If you've found any bug or have a suggestion, you can add it here:
https://github.com/narical/openxcom-accuracy/issues
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 03, 2023, 03:15:37 pm
I agree on the caps. These caps seem arbitrary. And if something is supposed to be realistic, then having arbitrary caps seems weird.
They are not (totally) arbitrary... You have 100% if you manage to stick weapon barrel to the enemy's body - but all units stand in the middle of the tile so there's always some gap in between, measued in voxels. As for the bottom cap - 0% visibility means 0% chance to hit, so if you have such chance there should be some non-zero %... For extremely low-exposed targets it will cap to its visibility, like 1% chance to hit for 1% exposure... Other that that - thats right, there are arbitrary numbers, which I tend to tune in order to make accuracy more "tactical", i.e. by making player able to take meaningful decisions. Like, if you plan a hopeless shot for some reason, you can improve your chances by kneeling and chosing aimed shot over everything else.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: donk on December 04, 2023, 01:09:21 am
There's different perspectives on whether there should be more separate options to allow as much individual tweaking as possible or wrapping different things up under one option.

A lot of things could be tied to intelligence or otherwise be controlled by a single option.

I'd say we have gone quite far into the "overchoice"-territory, where players will start being intimidated by their vast amount and rather not want to meddle with them out of fear of ending up with a configuration that is not ideal.

I'd like to have more feedback like this. Of whether people like having so many opions or if they'd prefer only a few options that control more than one thing.
Yes, there are too many options I think. Selecting difficulty is not the only thing that decides the difficulty of the game anymore. Yes, I think you should absolutely group as many options as possible into 1 and just let the player choose the way it should behave.

Also, an idea could be to create templates of settings that would be a good choice based on the difficulty the player chooses. That way it could be a more defined standard per difficulty setting. Right now, saying that you beat super human ironman, says nothing because of all the other settings.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 04, 2023, 12:01:35 pm
Yes, there are too many options I think. Selecting difficulty is not the only thing that decides the difficulty of the game anymore. Yes, I think you should absolutely group as many options as possible into 1 and just let the player choose the way it should behave.

Also, an idea could be to create templates of settings that would be a good choice based on the difficulty the player chooses. That way it could be a more defined standard per difficulty setting. Right now, saying that you beat super human ironman, says nothing because of all the other settings.
Yeah, I can totally see your point here.

Some of the AI-options have a very clear link to difficulty. But for others I honestly couldn't say whether on average they make it easier or harder as it is very situational.

Some of them aren't even supposed to have much of a difference on difficulty and are more for flavor.

I can start talking a bit about the options and what I think.

Sneaky AI. This one is not from me. And I honestly think it's kinda horrible. Because AI behavior was put into the path-finding. It can actually mess with the AI and give them false information like incorrect numbers of TU it requires to go from one location to another. My recommendation is to never enable it together with Brutal-AI.

Explosives from turn 1, prepriming grenades, avoiding proxies, spreading and target-mode 3. All these are about better handling with and against explosives and should on average make it more difficult. However, prepriming, spreading and target-mode 3 all also have some negative effects. Carrying a pre-primed-grenade makes you dangerous to others around you. Spreading makes you further away from "the front", so you need more TUs to come out of cover that you then lack to act. The indirect fire from targeting-mode 3 can be exploited to throw a grenade at basically nothing and not achive anything. Especially when the player knows how this works and constantly takes it into account it is arguable worse than not doing so.

Aggressiveness is super-situational. When I experimented with adaptive aggressiveness, I noticed it can make missions both harder or easier depending on the map-layout. The Triton with the closable door is great to fend off aggressive enemies. Especially when they can't move in from behind. But there's also mods where you don't start in any cover. In a situation like that higher aggressiveness can overwhelm you.

Intelligence, the way it is implemented, is very clearly linked to difficulty as making random moves with increasing chance almost always will be worse than something thoughtful. But it's also usable for flavor by making enemies more or less intelligent depending on what is more fitting. Oh and the same goes for aggressiveness too.

Target-mode 4 and bug-hunt-mode. Those are both for AI-cheating. Bug-hunt-mode is especially impactful on lower aggressiveness as with the information where your units are, the AI can prepare the perfect ambush-scenarios. On higher aggressiveness, the impact is not that big. Target-mode-4 is very weapon-dependent. When the AI only has short-ranged-weapons it will do almost nothing. With long-ranged-weapons and little cover on the map it'll be very frustrating.

The new random-multiplier-option is extremely difficult to judge. It makes the AI less predictable but also causes it to make non-ideal moves according to the algorithms that determine what ideal moves are. I'd say it is more of a flavor-option than one that really impacts difficulty.

So overall the options can impact flavor, difficulty or both.

So when it comes to "presets that make sense to be used together" I'd say:

"Fun":
Explosives from turn 1 => OFF
prepriming grenades => OFF
avoiding proxies => OFF
spreading => OFF
Aggressiveness-mode => 3 (inherit but force set it to 3 if noone is left who has 3 or more)
Intelligence-mode => 2 (inherit)
Random-multiplier => ON
Target-mode => 1 (units can only attack what they see)

"Immersive":
Explosives from turn 1 => ON
prepriming grenades => ON
avoiding proxies => ON
spreading => ON
Aggressiveness-mode => 2 (inherit)
Intelligence-mode => 2 (inherit)
Random-multiplier => ON
Target-mode => 3 (units can attack what others see and blind-grenade/blaster)

"Smart:"
Explosives from turn 1 => ON
prepriming grenades => ON
avoiding proxies => ON
spreading => ON
Aggressiveness-mode => 0 (static)
Aggressiveness => 2
Intelligence-mode => 0 (static)
Intelligence => 5
Random-multiplier => OFF
Target-mode => 3 (units can attack what others see and blind-grenade/blaster)

"Cheater":
Explosives from turn 1 => ON
prepriming grenades => ON
avoiding proxies => ON
spreading => ON
Aggressiveness-mode => 0 (static)
Aggressiveness => 2
Intelligence-mode => 0 (static)
Intelligence => 5
Random-multiplier => OFF
bug-hunt-mode for AI => ON (AI sees units on minimap)
Target-mode => 4 (AI has unlimited targetting-range)

This is what I could fathom what it would look like if I'd condense it all down to 1 option that can be set to different numerical values. It would drastically reduce "overchoice". I'd really like to hear more opinions about that though.

Edit: My idea would be to have a new Option "Brutal-AI-presets" that can take the aforementioned and also a custom-option. Changing the value would then change what the other options show. Could also hide the other options unless a value associated with "custom" is picked in the presets. That way the options would still be there but the average user can just pick a preset.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 04, 2023, 03:50:29 pm
Thank you for great mod, Xilmi.

I checked it on GitHub and README seems to be borrowed from OXCE. Do you have your own with all features and configurations and defaults explained?

Also it seems to be a combination of AI with QoL with some other modded elements. QoL elements are good to have but is it possible to separate AI from other modding? Or, at least, to turn all other modifications off by default leaving AI changes only? Thank you.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 04, 2023, 06:20:13 pm
I checked it on GitHub and README seems to be borrowed from OXCE. Do you have your own with all features and configurations and defaults explained?
The first post in this thread explains all the new options. But you are right, I should probably overwrite the readme, which up until this point is simply the unmodified one from OXCE, which I have forked from.

Also it seems to be a combination of AI with QoL with some other modded elements. QoL elements are good to have but is it possible to separate AI from other modding? Or, at least, to turn all other modifications off by default leaving AI changes only? Thank you.
Do you have any concrete examples for QoL-improvements that currently are enabled by default but you want to be disabled? And can you give a comprehensible reasoning as for why they should be disabled?

I'm not a fan of generalization and would rather look at each topic individually to make the best decision for it.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 04, 2023, 07:07:12 pm
Sure thing. Thank you for responding. This is a revolutionary mod generally.

The problem with such mingling all kind of things together: AI, mods, QoL is that you are building mod for yourself. That is good. Many people will play it because they like the same style. However, many people will also not just because they don't like a thing or two you mingled into the mix. Not to criticize, but just trying to understand what are your default settings to decide for myself.

Here are few examples I grabbed from first post.

Enhanced dogfight behavior
Realistic accuracy and cover system
One-click grenade priming
Fog of war
Smart ctrl-click and auto-equip
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 04, 2023, 07:12:16 pm
Another thing I experienced while developing AI for other games is that players generally do not care about AI fine tuning. In their perception the opponent is just smarter or dumber. And this is what probably you want them to tune up or make it dynamical by difficulty level or something like that.

I hardly can imagine a player that turn off a specific element of AI behavior (like aliens using better cover) just because it does not match their player style (?) .

In other words, I would recommend to set one singe dial "AI strength" and put all details under the hood. This way your implementation is independent on all these parameters. You will be AI designer and not just provide service methods for players to tune it up themselves.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 04, 2023, 08:03:40 pm
I hardly can imagine a player that turn off a specific element of AI behavior (like aliens using better cover) just because it does not match their player style (?) .
I've never played a game with customisable difficulty without my final difficulty being called 'Custom' or some equivalent. So I'd say your imagination needs an upgrade. :P

In other words, I would recommend to set one singe dial "AI strength" and put all details under the hood. This way your implementation is independent on all these parameters. You will be AI designer and not just provide service methods for players to tune it up themselves.
While this is something Xilmi has been musing about on their own, I for one would appreciate if the fine-tuning still remained an option. If not an in-game option, then at least a set of ruleset or config variables, hidden from the eyes of the 'filthy casuals'. :D



@jnarical: I get your ideas about tactical approaches to clawing back the 'lost' accuracy, but there are two problems with that. First, AI doesn't really have the same toolset as the player does, unless Xilmi codes in a separate branch for 'real accuracy'. They won't show up in jungle maps with flamethrowers, never mind actually using them against the foliage. They won't kneel unless a mod makes them able to kneel. Etc.

Second, "it's fine if the base chance to hit is minuscule, use tactics" is the same line of thought that led to JA2's 'new chance to hit'. And even with a bazillion levers to tweak it and people sharing their setups, it never really clicked for most. I really like this concept, but I'm afraid it'll go the way of the dodo nCtH if the gameplay impact is tailored to just one individual's preferences.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 04, 2023, 09:11:11 pm
Quote from: Juku121

Second, "it's fine if the base chance to hit is minuscule, use tactics" is the same line of thought that led to JA2's 'new chance to hit'. And even with a bazillion levers to tweak it and people sharing their setups, it never really clicked for most. I really like this concept, but I'm afraid it'll go the way of the dodo nCtH if the gameplay impact is tailored to just one individual's preferences.

Could you please be more specific? What’s wrong and what you think would be better to do, to fix that?

I get the idea “we don’t like hard caps” but I don’t see any good alternatives. That doesn’t mean there isn’t any, just that I need some guidance )
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 04, 2023, 10:16:49 pm
Essentially, what's wrong (IMO, I don't claim any authority here) is that the current system is extensively playtested and works at least somewhat, and yours is a radical departure that at least at a cursory glance increases time spent on already excessive mission grind in an 'unfun' way (who likes to miss a lot? or even be missed a lot?). Well, unless all you play is short vanilla campaigns or vanilla-ish mods, which I no longer have the stomach for.

But, in general, my opinion is that excessively low hit chances (something like sub-30% or so for most shots) do not make for interesting gameplay.

I tried my damnedest to tweak the JA2 nCtH to work for myself, and in the end it kinda worked for me, but once I looked back at the vanilla JA2 accuracy model and asked myself "is this better?", it was not. Maybe it was not worse, but it was a lot of effort to stand still at best. Yeah, it was more 'realistic'. It was not more fun.

As to the current implementation, I'd need to do some more testing to speak with confidence (and I just lost my filters, again, so no X-Com until I restart my machine, which might take a little while :( ), but what I can definitely say is that:

1) Having a "model of low accuracy + tactics" means that modders lose some of their current control over accuracy. That is, while the game no longer outright lies and misleads, you now have to jump through extra hoops to match your vision and in-game reality.

1b) Someone has to give the 'tactics' to the AI, tactics that are different from the vanilla model.

2) I don't mind caps as such. I mind drastic caps like accuracy never going above 95% except for the rarest of circumstances, or not under 5%. I might be biased here, because I've grown to dislike d20 games a lot due to similar caps. :-\ It fits well into a storytelling game where interesting events, good or bad, must not be too far apart. It's absolutely annoying in a simulationist wargame or tactics game.

1%/99% caps, sure, go ahead.



TLDR, I agree with Abyss that there should be a tweakable 'cover factor' for accuracy, at least. Maybe not for the player, but certainly for the modder to experiment with.

Auto-shots should only have the first shot use the accuracy-as-visible area model, and the the other shots should just scatter around the first shot in a cone or, better yet, rising/falling line. Ditto for shotgun pellets. And a horisontal line for auto-shot waypoint guns.


And, in general, I'd actually like it more if the cone was fixed, and thus accuracy was only ever a stat at a certain range (max range?, half max range?) and all other accuracies were actually calculated from that, using a fixed cone. Possibly with some extra input from all the dropoff values, but without them directly translating into accuracy percentages. This might not be what you're trying to accomplish here, though, and you certainly have no obligation to listen to me.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 04, 2023, 10:35:16 pm
[mention]Juku121 [/mention] as I’ve said earlier, upper cap isn’t actually the cap. There’s gradual increase of accuracy up to 100%, based on distance in voxels between shooter’s weapon and nearest point on target’s cylinder. For distance = 0 there could be 100% accuracy, but usually there’s a gap between two units, as they stay in the centres of their tiles, so distance never becomes 0, and accuracy never becomes 100%. For some units and relative positioning, the distance is minimal and that gives maximum possible accuracy.

For minimal cap situation differs but it’s still possible to get 1% visibility, which is minimum possible value, other then 0% which means target doesn’t have line of sight. Most of the time, minimal cap is 5%

I could change that, in theory, but can’t afford spare time at the moment
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 04, 2023, 11:05:20 pm
Another newbie question.
Do I understand correctly, you don't care about any compatibility with OXCE? If so, how would one install your mod and then install some other regular OXCE mods on top? Is it even possible?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 04, 2023, 11:07:54 pm
Another newbie question.
Do I understand correctly, you don't care about any compatibility with OXCE? If so, how would one install your mod and then install some other regular OXCE mods on top? Is it even possible?
Question to me or Xilmi ?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 04, 2023, 11:37:13 pm
1b) Someone has to give the 'tactics' to the AI, tactics that are different from the vanilla model.
You are right. It should actually be pretty easy. For target-selection incase several targets are attackable from one position that's already done but not for attack-spot considerations itself.

When realistic accuracy is enabled the checkVoxelExposure is run in AI code in order to avoid false-positives. When I do that anyways, I can also factor in that value into the score for the tile to attack from. So if moving a tile further drastically increases exposure, it should then notice that and do so.

So thanks for the hint! :D
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 04, 2023, 11:49:02 pm
Another newbie question.
Do I understand correctly, you don't care about any compatibility with OXCE? If so, how would one install your mod and then install some other regular OXCE mods on top? Is it even possible?
Hu? What gave you this idea?

A lot of effort was put into achieving compatibility with various mods. Handling immobile units like turrets, which don't exist in vanilla, handling neutrals that shouldn't be attackable like damsels, taking short-ranged- but non-melee-weapons into account in different scenarios. Oh and of couse the weird hand-to-hand-combat-mechanics, where you miss all your shots in melee-range because the enemy supposedly grabs the barrel of your gun and points it somewhere away from them. That's also supported.

I wouldn't go as far as to claim that Brutal-AI is fully functionally compatible with absolutely everything that regular OXCE is compatible with. But that was a goal and if someone reports a bug for something that works with regular AI but causes an unintended bug with brutal AI, I'd try to fix it.

The idea is that you can play every mod that is compatible with OXCE on Brutal-OXCE and with enabled Brutal-AI too.

Whether the mods are then too difficult to be actually winable is another story. I'd say tone down difficulty-setting and choose some of the easier brutal-AI-settings. Especially the recently introduced intelligence-option.

Edit: And if this was about "Realistic Accuracy". It's just an optional feature, which is disabled by default. If you don't like how it interacts with certain mods, simply don't use it.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 05, 2023, 12:58:01 am
Thank you for confirming.
In this case where I can find a list of configuration parameters with defaults? I unpacked the zip but there is no readme there too.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 05, 2023, 01:17:58 am
OXCE launch file is OpenXcomEx.exe
Yours is OpenXcom.exe

Should I launch yours?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 05, 2023, 01:41:53 am
What is "Realistic accuracy and cover system"?

I understand vanilla already accounts for cover in the way that if part of the target is covered and shot hits the cover it does not hit the target. Sure this can be calculated and displayed to user for convenience but what exactly is changed?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: zee_ra on December 05, 2023, 04:26:11 am
What is "Realistic accuracy and cover system"?

I understand vanilla already accounts for cover in the way that if part of the target is covered and shot hits the cover it does not hit the target. Sure this can be calculated and displayed to user for convenience but what exactly is changed?

Actually, that is a rather interesting question.  I think, vanilla already accounts for voxel shapes on the way.  Is the model different in this release of the engine?  If so, how it is different?
Title: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 05, 2023, 05:31:14 am
What is "Realistic accuracy and cover system"?

I understand vanilla already accounts for cover in the way that if part of the target is covered and shot hits the cover it does not hit the target. Sure this can be calculated and displayed to user for convenience but what exactly is changed?
I feel like my messages here are invisible… ok, Brutal OXCE incorporates this: https://github.com/narical/openxcom-accuracy

This is the separate mod, with old accuracy code reworked too, to improve it and fix bugs.



You can get some insights here under spoiler:
 https://r.tapatalk.com/shareLink/topic?share_fid=91863&share_tid=10967&share_pid=159302&url=https%3A%2F%2Fopenxcom%2Eorg%2Fforum%2Findex%2Ephp%3Ftopic%3D10967%2Emsg159302%23msg159302&share_type=t&link_source=app

Sorry for Tapatalk link, I’m from the phone forum client - it’s actually this very same forum topic, just ~20 messages away from this

Upd: part about 5%/95% is outdated, I’ve changed that long ago but forgot to fix description. Also, current version of algorithm, increasing accuracy for close-distance shot, differs too. For snap/auto, there’s no multiplier bonus. This algorithm is a subject to change, again, 5th time in a row - I plan to add bonus from initial accuracy, exceeding 100%, to workaround target cover.

Here’s an example.

Current state:
Initial calculated accuracy: 210%
Target visibility: 10%
Final accuracy: 210*0.1=21%

Planned change:
Initial calculated accuracy: 210%
Accuracy overshoots 100% by: 110%
Additional bonus: 110/2=55%
Target visibility: 10%
Final accuracy: 210*0.1+55=21%+55%=76%

That way, snipers are actually snipers, and high accuracy really helps against cover

Also, it could help with accuracy with close-midrange shots in dense environments (at least I hope so)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 05, 2023, 11:15:34 am
Thank you for confirming.
In this case where I can find a list of configuration parameters with defaults? I unpacked the zip but there is no readme there too.
The first post of this thread has the list of the new options.
I'm not sure whether "options" translates to "configuration parameters" though. So not sure this answers your question.

On first launch the new options are automatically set to their defaults and then stored in options.cfg.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 05, 2023, 11:18:48 am
OXCE launch file is OpenXcomEx.exe
Yours is OpenXcom.exe

Should I launch yours?
I personally would have recommended to put it into a separate folder.
But yes, in order to launch Brutal-OXCE you have to launch the exe from it's zip-file, not the one that previously has been there.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 05, 2023, 05:05:49 pm
Started to montage videos.
Tooks a bit longer than expected, plus haven't been working with premiere pro for, like, 6-7 years.
Further will be faster.
This is XCF Red Dawn forward base assault, SH + Ironman, BAI 7.10.2, balanced aggressiveness, 40% randomization. Joy's accuracy settings are off by that moment, too time consuming. 
https://youtu.be/ARGz0PVR4Ek
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 05, 2023, 06:37:12 pm
"Fun":
"Immersive":
"Smart:"
"Cheater":

Hi Xilmi!

I think all these condensed options should be paused to implement right now, because the development goes on and many things are getting tweaked.
Avoiding proxies and mines - should be totally up to player. 
Some missions are impossible to beat w/o that. Like, underground HQ assaults and base defense vs enemy +1 tier from you. Which happens.
Pre-primed grenades is something I play with from 1 turn, but never use myself. And so on.
Please don't yet upgrade this. Or, if upgrade, make customizable option too.

To Jounarical:
Quote
Current state:
Initial calculated accuracy: 210%
Target visibility: 10%
Final accuracy: 210*0.1=21%

Planned change:
Initial calculated accuracy: 210%
Accuracy overshoots 100% by: 110%
Additional bonus: 110/2=55%
Target visibility: 10%
Final accuracy: 210*0.1+55=21%+55%=76%

Here we have balancing issues.

Accuracy overshoots are interesting idea overall, but we rarely counter enemies that exceed 100 accuracy themselves. Plus, 100 accuracy is abstract measure, too. The next thing comes to mind is that any unit which exceeds 100 acc will have too much advantage, while others will miss.

Regarding RA:
- first of all, it should work not only with super-accurate shots, but with every shot
- it should be psychologically reliable: player sees sprites, not voxels. If actual frame of the window makes 80% cover, but the drawing shows large window that exposes all torso and head (33%% cover), player will be dissatisfied with the hitchances. Same with two and a half leaves on a thin tree in front of the unit. Same to wooden fence, which shouldn't stop high caliber at all!   
- fights should be yet dynamic.

What if make it hybrid:
partial weights:
Overshoot mechanic 25%
Weight of the cover/sight 45%
bullet pre-roll damage 20% (0 = 0%, 100+ = 20%)
distance (yet I somehow believe it should matter) 10%
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 05, 2023, 07:29:35 pm
Planned change:
Initial calculated accuracy: 210%
Accuracy overshoots 100% by: 110%
Additional bonus: 110/2=55%
Target visibility: 10%
Final accuracy: 210*0.1+55=21%+55%=76%
That looks a bit better. Personally, I'd instead use accuracy overflow as cover reduction. E.g. in the above calculation, 100%(cap)*(0.1+(0.9-0.9/2.1)) ~= 57%.

But the big problem with this approach is that now aimed shot is king and snap/auto is relegated to knife-fighting ranges only. A reversal of the original 'auto-shot or go home' problem, if you will. Good-bye, heavy machine guns and miniguns, it was nice knowing you. 😢

it should be psychologically reliable: player sees sprites, not voxels.
This is a core feature of OXC and one should not touch this lightly. It's the responsibility of the people who create sprites and match them with voxels (i.e. the modders) to do this. If the engine starts having its own ideas of how a unit/sprite should look like, there's going to be no end of trouble(shooting). Maybe the modder wanted to create a shoot-through hologram, but the engine knows better and makes a giant shot-blocking bedsheet...
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 05, 2023, 08:52:28 pm
How do I install/transfer mods to the freshly copied Brutal-OXCE directory? Just copy "user" subfolder?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 05, 2023, 10:20:16 pm
If the engine starts having its own ideas of how a unit/sprite should look like, there's going to be no end of trouble(shooting). Maybe the modder wanted to create a shoot-through hologram, but the engine knows better and makes a giant shot-blocking bedsheet...
Oh ho, you got me wrong. I was suggesting not about fucking up engine, but either about these two bushes that lower hitchance from 50% to 5%, as from the player's perspective is weird. The entire passage was about bumping up chances.

To Joy:
I still think of the formula. Let's take 50% snapshot from rifle which degrades over 15 tiles. At 30 it will be 30%. The bullet power is 35
1) Make weight of the cover 0.40-0,50. Then plain hitchances are 25-30 and 15-18%, respectively
2) Make accuracy overshoot weight 0,25, e.g. all above 100 divided by 4. This particular shots are not affected = +0%
3) Make bullet pre-roll power-to-accuracy 0,15: (0,15*35/100) = + ~5%
4) Maybe distance to cover factor is not that bad idea. The farer the unit, the better chances it has to move a bit while projectile flies... Like 0,1 (100 tiles -10%, 1 tile 0  ...or... 100 tiles -5%, 1 tile +5%)
5) everything else that seems relevant to balance miniguns, rifles, sniper rifles and other stuff
It's better to make discussion with more modders, because this is relevant to incorporation of RA into design after some time passes.

As per me, all shots on covered units should degrade no more than by 50-60% of plain accuracy
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 05, 2023, 10:21:37 pm
How do I install/transfer mods to the freshly copied Brutal-OXCE directory? Just copy "user" subfolder?
Yes, this should work.
If you have the Documents/OpenXCom-folder, you don't even need to transfer them.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 05, 2023, 10:35:03 pm
Please don't yet upgrade this. Or, if upgrade, make customizable option too.
This was the idea: Have presets that modify the other options but leave the other options there.

Something really scary was that I found bugs in the way the AI cheated when you enabled targeting-mode 4 and bug-hunt-mode. Basically they didn't always make use of this information. I fixed that. This is totally next level! :D

Another thing is that some settings I thought weren't as difficult are actually more difficult than others that I thought that were.

Like the lower-aggressiveness is actually weaker when there's a lot of cover for the player because when the AI operates with outdated information you can sneak up on them. If it plays more aggressive, it often actually is stronger.

This tells me that the algorithm that determines the ideal behavior hasn't been found yet.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 05, 2023, 10:45:24 pm
To Xilmi
Quote
This tells me that the algorithm that determines the ideal behavior hasn't been found yet.
Yep, and next video will be very interesting and informative in the way how algorithm is not balanced yet.
It will be Red Dawn HQ night assault with 16 agents vs ~100 enemies. Same BAI 7.10.2, 40% random, aggressiveness 2, dynamic aggressiveness, TargB 3.,
I have NO idea how would I do that during the day. No chances. Completely different game.
But when BAI doesn't see enemy, even if it knows it is somewhere there in the dark - it is kind of pleasant to do with. 

With the video, I will make a suggestion of "Sea Battle" suppression mechanism. 

Quote
This was the idea: Have presets that modify the other options but leave the other options there.
As most casual+ players come for mods, it's good to be checked through these.
Also, I suggest more dialogue between you guys.
 
Btw, I came with particular question: How does dynamic aggressiveness setting exactly interferes with balanced aggressiveness (2)?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 05, 2023, 10:53:29 pm
Btw, I came with particular question: How does dynamic aggressiveness setting exactly interferes with balanced aggressiveness (2)?
Dynamic ignores whatever you have set as aggressiveness. It starts out at max and reduces it when morale goes down. If they get kills that restore their morale they become more aggressive again.

I also think that in cases where the AI doesn't see much like you described being more aggressive clearly would help.

I just tried again against higher aggressiveness and did much better this time. This is also because of the snow-bally nature of panicking. Even a small difference can have a massive impact on the outcome.

Now gonna test aggressiveness 0.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 06, 2023, 03:27:30 am
It will be Red Dawn HQ night assault with 16 agents vs ~100 enemies.
That’s what I was talking about. Why not 200 enemies? Or 1000? This is nuts, dude. How do I suppose to make accuracy mechanics which works similar in terms of fun both for original game with 15 missions per month / 15-30 enemies vs this nonsense?)
Title: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 06, 2023, 04:29:33 am
Accuracy overshoots are interesting idea overall, but we rarely counter enemies that exceed 100 accuracy themselves. Plus, 100 accuracy is abstract measure, too. The next thing comes to mind is that any unit which exceeds 100 acc will have too much advantage, while others will miss.
We’re talking about 16 agents vs 100 enemies here… this game IS asymmetrical, where you
play with 1:5-6 ratio against enemy forces. It was never was about fair fight. There’s sheer fun obliterating hordes of enemies from afar, and I don’t know why ask for enemies with 100+ accuracy.

Regarding RA:
- first of all, it should work not only with super-accurate shots, but with every shot

We already have that) it’s called vanilla accuracy. Works the same ignoring any cover, and even distance if you disable extender accuracy. I didn’t have an intention to copy that, I’m trying to make something different. Not “one-size-fits-all” and not “better in any possible way”, just different kind of fun. (Better in many ways is still the goal tho).


- it should be psychologically reliable: player sees sprites, not voxels. If actual frame of the window makes 80% cover, but the drawing shows large window that exposes all torso and head (33%% cover), player will be dissatisfied with the hitchances. Same with two and a half leaves on a thin tree in front of the unit. Same to wooden fence, which shouldn't stop high caliber at all!
We are talking about the game full of conventions. One of them is the fact, that deep in our imagination we have a mix of turn-based and real-time action. We know the game represents real and fast-paced battle. That’s why it’s totally ok to have 50% cover in high crops. Grass doesn’t give a protection against bullet, but in real life it gives you a chance to hide and mislead enemy about your true position. Put in other way, covered visibility affects chance to hit. Nothing confusing for players here. You get highly covered enemy? Deal with it, that’s how the game (in this accuracy mode) works.


What if make it hybrid:
partial weights:
Overshoot mechanic 25%
Weight of the cover/sight 45%
bullet pre-roll damage 20% (0 = 0%, 100+ = 20%)
distance (yet I somehow believe it should matter) 10%
In my experience, even one new variable which seems to be clear and have predictable effects - turns out as unpredictable, given the sheer amount of different mods and weapons’ types, and leads to balancing hell and a bunch of iterations of rewriting code… your approach with “let’s introduce a bunch of variables with totally arbitrary values and hope for the best” won’t work, it doesn’t work even for one variable. Things tend to break in most unexpected ways)

I don’t say anything against your ideas, just that implementing should be iterative. And I still can’t configure working toolchain to build the game under Windows, yesterday’ve spent 2+ hours in addition to 4.5 earlier, still no luck.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 06, 2023, 04:41:50 am
Oh ho, you got me wrong. I was suggesting not about fucking up engine, but either about these two bushes that lower hitchance from 50% to 5%, as from the player's perspective is weird.
Every unit checks three different positions for fire, shifting left and right (with off-centre shooting on, which I highly recommend, cause don’t know hot to force turn it on)  and chooses the one with better enemy exposure. If after that you’ve still got low visibility - the very most of the time you’ll get it with in-game sprite representation, too. I personally didn’t have such issues you’re talking about.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 06, 2023, 10:31:21 am
Why not 200 enemies? Or 1000? This is nuts, dude. How do I suppose to make accuracy mechanics which works similar in terms of fun both for original game with 15 missions per month / 15-30 enemies vs this nonsense?)
I think there are missions with 200, too, at least on SH. :P

The whole point of my remarks so far has been to say that you do it by not introducing severe rebalancing. 'Realistic accuracy', on the face of it, sounds like an attempt to remove the 'accuracy is a value and not a probability' issue from the game. But your rework goes far, far deeper. 

Better in many ways is still the goal tho.
As long as your changes completely invalidate anything even resembling vanilla tactics in any moderately cluttered map, promote aimed shots (and grenades and, I suppose, melee, due to running being a thing for quite a while now) over snap/auto to the tune of two orders of magnitude, well, that's going to be a tough sell.

Nothing confusing for players here. You get highly covered enemy?
The voxel/sprite issue (and others, like asymmetric vision due to only some unit voxels counting for visibility) means it's hard to predict cover by just looking at the map. And Xilmi's AI gets a tremendeous leg up here, since it can test all firing positions, something the player cannot do without insane savescumming.

In my experience, even one new variable which seems to be clear and have predictable effects - turns out as unpredictable...
Yeah, that is very much true and a solid argument in itself. But since the whole model is going to behave very different anyway, giving some people (not all!) the ability to tweak your model to achieve results more in line with their mods, or the player base in general, sounds like a better approach than 'my way or the highway'. Well, if you want people to actually play with your option turned on and not look at it, exclaim "5% chance to hit the alien in the bushes 10 tiles away?! What even is this...?" and then turn it off again. JA2's nCtH, for whatever faults I may be finding with it, at least gave people a laundry list of options to tweak to their liking.



Now, at the end of the day, it's all about what you find fun to do yourself. So don't take me too seriously. But I would like an option that makes the accuracy value an actual percentage and nothing more. Or at least nothing radically different, accuracy-wise. Whether there are others who would appreciate that, or whether that's something you'd like to do, well...
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 06, 2023, 11:37:01 am
The bushes are also troublesome for AI. They block tile-vision but are leaky in terms voxel-vision. So you often can see units but not the tile they are standing on. The AI relies on tile-visibility to detect cover. So the bushes often are identified as valid cover because of that.

I personally suggested that no tile-vision should also mean no unit vision. But that caused all sorts of other issues. So to this day there is no real solution. It just means the AI will perform worse on jungle-maps.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 06, 2023, 12:06:30 pm
[mention]Juku121 [/mention] don’t get me wrong, I’m not fond of current state of the game, so… “my way or highway” - we aren’t there yet)) And I take into account other people and their opinions what’s fun and what’s not
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 06, 2023, 12:13:04 pm
Sure, one can find plenty wrong with the current state of the game. Of course, all the mods mean that there is no longer a singular state, anyway, but there's some commonality.

I don't think I've seen anyone except you express an opinion like "hit chances are two orders of magnitude too high", though.


Of course, I don't have much of a leg to stand on regarding all this, since I also frequently change things to my own liking and have even done a limited amount of shoving it down other people's throats (though not here on this forum or under this moniker). So do as you wish, and ultimately it'll come down to whether people like what you do enough to adopt it, or not.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: zee_ra on December 06, 2023, 12:39:51 pm
The only issue accuracy-wise is the fact that a powerful weapon cannot shoot through weaker obstacles (like e.g. bushes and wooden walls).  I think that a good sniper should be able to shoot through the bushes just fine, especially with sniper-spotter setup.  What do you think about this?  Would implementing this break too many model assumptions behind the logical setup of tactical battlescape?
Title: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 06, 2023, 12:44:46 pm
I don't think I've seen anyone except you express an opinion like "hit chances are two orders of magnitude too high", though.
That’s not my opinion. I wonder where did I say something like that…
Title: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 06, 2023, 12:46:54 pm
The only issue accuracy-wise is the fact that a powerful weapon cannot shoot through weaker obstacles (like e.g. bushes and wooden walls).  I think that a good sniper should be able to shoot through the bushes just fine, especially with sniper-spotter setup.  What do you think about this?  Would implementing this break too many model assumptions behind the logical setup of tactical battlescape?
Oh no what have you done… now I want this)

upd: chopping 50m long firebreaks with heavy plasma…
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 06, 2023, 12:51:55 pm
That’s what I was talking about. Why not 200 enemies? Or 1000? This is nuts, dude. How do I suppose to make accuracy mechanics which works similar in terms of fun both for original game with 15 missions per month / 15-30 enemies vs this nonsense?)
This is part of SH difficulty. Lower difficulty means 50-40-30-20 enemies by step.
With vanilla OXCE it was the only challenge option. Same to ironman, because otherwise you can beat the game with no casualties at all. 
With some advanced AI most challenge comes in balance:
- you have to сorrelate losses with the training speed of new units. The later is very low speed process, and yet forces you to take fresh low-stats units to missions, because on-field training goes much faster.
- you have to train 4x units more.
- you have to skip missions which mean significant loses.

IMO, the perfect game design is made so player
-  allocates resources in tight connection with game progress, which, in it's turn, takes them from him for challenge & drama. First is mod design, last is AI.
- with random and gambling, so joy from better result in same action makes player engaged.
It is random missions spawn, with better or worse loot/research topics vs effort. Lootboxes - there are a lot of them. Weapon boxes, ammo boxes, alien stuff packages. Even gambling itself - in X-Piratez you can build casino and spend money in it - and the prizes are everything from weapons and bananas to slaves and stuff.
But also it is gambling with gunfire: whether you hit or miss, whether enemy hits or misses.
And, no less important is gambling with reaction shots - whether this enemy does something or not. In some cases, when enemy has no spare TU's, it's much easier to beat.
- gives player a reward worth all spent resources at certain points
- punishes player for all bad decisions, actually teaching player how to play: everywhere player could have made a better decision - he understands it.
- overall, has good story plot and dynamic
     
RA affects gambling factor and dynamic. Here's another video with RA enabled:

There you can see that player will almost never try a 5% shot. Gambling is affected in negative way. Potential joy is wasted.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 06, 2023, 01:09:27 pm
Oh no what have you done… now I want this)
Not only sniper shots, but also heavy machine gun, gauss, plasma, etc.
Bullet pre-roll damage should make these bushes less bulletproof, yet should be in balance with heavy covers, as result affects all covers. You won't code so only bushes are affected, right? Or you will, but this will take too much effort.

This is part of suggestion to make powerful bullets more accurate.
Quote
bullet pre-roll damage 20% (0 = 0%, 100+ = 20%)
Even though 20% seems too high: pistol with 20 dmg will have +4%, HMG with 50 dmg will have +10%, sniper rifle with 75 dmg will have + 15%. Plus overshoot. Everything else - to the balance of mods, already tuning hitchances.

Or even can make 20 = +0%, 100 = +15%

Modificators apply for shooting into covered target, so only to compensate missing probabilities, not surplus the shots on open terrain.

Quote
a bunch of variables with totally arbitrary values and hope for the best
This is how I see to make it balanced in good and joyful way.
We shouldn't exclude some types of attacks and weapons from the equation, making others supreme.

And, for god's sake, please don't forget that hit/miss mechanics are already emulated by 0-200% dmg roll. 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 06, 2023, 01:33:02 pm
Not only sniper shots, but also heavy machine gun, gauss, plasma, etc.
Bullet pre-roll damage should make these bushes less bulletproof, yet should be in balance with heavy covers, as result affects all covers. You won't code so only bushes are affected, right? Or you will, but this will take too much effort.
Each object has an armor-value. Currently this only determines whether the object will survive the hit of a bullet or not based on the bullet's power.

Something that would be quite feasible is if instead of just destroying the object when it's armor is below the damage-roll but the bullet disappearing, the bullet keeps flying but it's power is reduced by the armor of the object it just destroyed.

This would imho be the most logical and consistent approach.

Your plasma-bolt might pierce through 5 plants easily as their armor is like 12. But it can only penetrate one stone-wall with an armor-value of 50.

And also: The destroyed cover would still have helped you in the sense that it lowers the damage of the shot.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 06, 2023, 01:53:14 pm
the bullet keeps flying but it's power is reduced by the armor of the object it just destroyed.
This approach requires revision of all objects below 60 armor.
And also, there's fork:
- whether object will be destroyed completely
- whether object stays intact, but lets bullet through it
- whether it will demote bullet power overall
- whether it will have HP or not
- etc. etc.

This seems like whole another mod.

Then, also How BAI will deal with all that?

For previous suggestions, everything was in regard to current gameplay.

To Joynarical:
You have two enemies in 10 tiles from you. One is totally open and is within 50% hitchance. Other is covered in bushes and has 2% hitchance.
If you shot into second target, will 48% of shots statistically hit the bushes?
It's not obvious yet. Something makes me not believe that. Seems like most shots go into the air/not line of the hit.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 06, 2023, 02:01:02 pm
IMO, the perfect game design is made so player
-  allocates resources in tight connection with game progress, which, in it's turn, takes them from him for challenge & drama. First is mod design, last is AI.
One of the biggest issues I have with the game-design is that there is a contradiction between individual missions being exciting and the overall game-progress.

A mission that I barely win is exciting. But the campaign isn't balanced around barely winning and sometimes losing missions. You'd fall behind in score and soldier-development.

Vanilla actually still kinda works like that. There is some leeway to lose missions and still go on.

The issue is much exacerbated in mods where there is a big discrepancy between a fresh recruit and someone who is well-trained. The missions must not be exciting as losing well-trained-people is too much of a set-back.

Basically: The Geoscape-difficulty has to be low so the difficulty for individual missions can be higher or vice versa.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 06, 2023, 02:37:45 pm
This approach requires revision of all objects below 60 armor.
And also, there's fork:
- whether object will be destroyed completely
- whether object stays intact, but lets bullet through it
- whether it will demote bullet power overall
- whether it will have HP or not
- etc. etc.

This seems like whole another mod.
Not sure why this would require a revision of all sorts of objects.
Staying intact while letting a bullet through currently isn't possible either. This could be an independent second step but not a necessity for first implementing this.
Same goes for demoting bullet-power. Always destroying the object and always demoting power would be the most consistent approach I can think of.
Objects currently generally don't have HP. They just have armor. You can't damage an object over several attacks and have it eventually break. Each attack has it's individual chance based on whether it rolls more or less damage than the object's armor. Making a change like that would have a big impact on the engine and is once again not necessary for implementing it the way I suggested.

Then, also How BAI will deal with all that?
It would have to be adapted. It needs some sort of new canTargetUnit-code that takes armor-piercing into account. If not it would act as if the feature didn't exist and only benefit from piercing projecties by chance.

You have two enemies in 10 tiles from you. One is totally open and is within 50% hitchance. Other is covered in bushes and has 2% hitchance.
If you shot into second target, will 48% of shots statistically hit the bushes?
It's not obvious yet. Something makes me not believe that. Seems like most shots go into the air/not line of the hit.
I'd also kinda like to know. I haven't tested this in-depth but it would be a big difference if the 48% discrepancy will likely hit and potentially destroy the cover or just miss in some unrelated way.

If I imagine aiming at the center of an enemy and having some sort of hit-cone around the center, then a lot of the off-center-shots should still hit the enemy.

But if I aim at his finger because the finger is the only thing exposed, the cone around of where I aim for would be much worse, especially if the cover is easily breakable.

So I guess the question is: Does lower exposure change where the soldiers aim at? Do they still aim at the center of the enemy or do they aim for only the exposed voxels?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 06, 2023, 02:45:17 pm
Xilmi,
I start to record the 7.11.1 (which loads as 7.11.0 in cmd console, though)
Now I have even more questions how things would interfere:
- statistical randomization, when 40% units are VAI
- weighted randomization, for other 60% BAI units, which still supposed to do some side stuff, randomly. Will it be VAI stuff? Or strange BAI stuff? How many percent of them will do so?
- dynamic aggressiveness will be starting from "don't bother take cover" or "careful advancement"?
- just got shot from other side of the map, while no sight contact is made. Regarding this: is vanilla sniper-spotter mechanism working for these 40% VAI units?
- and if so, are only VAI units eligible to see and shot into "is spotted" units?

If last two questions are "yes", then this is amazingly joyful and cool. 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 06, 2023, 02:50:39 pm
To Joynarical:
Quote
"Why not 200 enemies? Or 1000? This is nuts, dude. How do I suppose to make accuracy mechanics which works similar in terms of fun both for original game with 15 missions per month / 15-30 enemies vs this nonsense?)"
Fair balance, other is up to modders. Right now, with EA it feels natural and balanced.
Even with RA it is already sort of fair right now, except too low hitchances overall in several cases.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 06, 2023, 03:15:39 pm
Now I have even more questions how things would interfere:
- statistical randomization, when 40% units are VAI
- weighted randomization, for other 60% BAI units, which still supposed to do some side stuff, randomly. Will it be VAI stuff? Or strange BAI stuff? How many percent of them will do so?
- dynamic aggressiveness will be starting from "don't bother take cover" or "careful advancement"?
- just got shot from other side of the map, while no sight contact is made. Regarding this: is vanilla sniper-spotter mechanism working for these 40% VAI units?
- and if so, are only VAI units eligible to see and shot into "is spotted" units?

If last two questions are "yes", then this is amazingly joyful and cool.
It's not resorting to VAI.
The 40% chance you get from Intelligence 3 works like this:
The unit still starts checking whether it can attack from where it is with BAI-attack-checks. But if not, it does a completely random move. If the unit is interrupted by finding an enemy or opening a slide-door, it will roll again. If the unit completes the random move it will also try to end it's turn there. But it may be woken up again by other units and then roll again for random move or not.

The weighted randomization also won't do VAI-stuff. It runs through the BAI-algorithms but the scores produced by that are multiplied with a random value from 0.0 to 1.0. It is not "strange BAI stuff". On average it should still result in decent moves. But it will not be the same every time. There might be outliers of bad moves but those should be rare. This happens on every single non-attacking-movement-option BAI wants to perform. The purpose here is adding variance and unpredictability rather than deliberately making bad or random moves.

Yes, that's how dynamic-aggressiveness currently works. But I'm thinking of changing the highest aggressiveness or intruducing one between, that will be okay with being not currently visible. Basically any tile that has no line of fire should be considered as cover as opposed to not considering cover at all.

No, would have to debug to say why you got hit from the other side of the map. As I said, there is no VAI involved. If Target-Mode is above 1, units can still shoot over the hole map if anyone spots for them.
Title: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: jnarical on December 06, 2023, 03:23:16 pm
I'd also kinda like to know. I haven't tested this in-depth but it would be a big difference if the 48% discrepancy will likely hit and potentially destroy the cover or just miss in some unrelated way.

If I imagine aiming at the center of an enemy and having some sort of hit-cone around the center, then a lot of the off-center-shots should still hit the enemy.

But if I aim at his finger because the finger is the only thing exposed, the cone around of where I aim for would be much worse, especially if the cover is easily breakable.

So I guess the question is: Does lower exposure change where the soldiers aim at? Do they still aim at the center of the enemy or do they aim for only the exposed voxels?
Ive sent you a picture of code to Discord) Units aim to the center of exposed part. If miss is rolled. there's part of the code which looks for missing trajectory inside shooting cone, and gradually increases that cone until some limit is reached. Missing trajectory is considerd found when canTargetUnit to some voxel returns anything but V_UNIT, or returns V_UNIT but it is outside of targets boundaries.

If you're asking whether such shots will penetrate bushes and still hit the target... well, it depends of implementation. It could be done in either way, so the real question here is - do you consider % chance to hit number to include chances for to after cover penetration or not.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 06, 2023, 04:02:23 pm
Quote
The unit still starts checking whether it can attack from where it is with BAI-attack-checks.

All I've got from this night mission is just 3 arcing electric shots from Gillmans. Other guys were running around, making them easy targets.   
Quote
But I'm thinking of changing the highest aggressiveness
Should be 3, IMO. They all flew out of the cover towards my troops. But the distance was too high for a LoS contact.
Also, I killed like 40% of them before they actually started bothering take cover.
This mission was quite dissatisfying in terms of a challenge.

Maybe, morale shifts should be changed to 100 -> 90 -> 80 -> 60?
Also, does Brutal OXCE count overall mediocre morale or each unit's morale, hence each unit has different strategy?

I want to suggest the "Sea Battle" mechanics prior to introduction of this giant HQ assault mission.
It is aimed to achieve win condition when player nulls units TU's after each turn.
- the overall conditions are "no enemy unit is seen", condition: night
- there is definitely viable trajectory to shoot to, where enemy unit has high chance to be located.
- SB is enabled on second turn. 
- then, split into: half are spotters, half are playing SB
- units to use this are, preferably, covered by darkness or away.
- each shot goes in a line, not towards the bottom of the tile
- each shot "checks" multiple tiles in a line
- if reaction fire follows, then BAI works as usual on player units reaction-fires.
Then if SB hits enemy, there are multiple targets revealed. If not, only reaction-fired units are spotted. 
- but the most delicious part is hitting enemy, when no reaction shots follows. This enemy is then marked as "spotted" for this turn and is visible for every BAI unit on battlefield, or to some % of BAI units
- then if unit is killed - reenable sea battle. Next turn every "spotted" enemy unit disappears.
- too much grenading may shift the balance even more, but it's up to player - how he gets into the battle: prepared or not.
IMO, this will enhance the power of AI, as it performs best at offense, rather than in defense.

Other question is how AI spots the hit, far away in darkness: player can see AI units flashing red slightly or brightly. But, as I may understand, AI knows the map entirely, thus can calculate whether there should be obstacle, or not. The new obstacle is player unit, obviously.

Also, the save which involves Gillmen is below. It's Ironman, so you probably want to run guys out of Osprey and toss flares around? Kill few close enemies and wait for gillmen to make shots. 
Beware of one green guy in the north building. Although, he couldn't have seen units near the osprey's exit anyhow (arching shot flew there).
Options are also there:

P.S. I just imagined that "Bullet Scanner" name fits quite better than SB.
Also, some players would scream "what kind of BS just happened"
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 06, 2023, 08:31:48 pm
That’s not my opinion. I wonder where did I say something like that…
Well, two orders is hyperbole, but a reduction of 2-3 times seems common, and up to one order of magnitude can happen in cluttered maps. Both can be seen in Abyss's video and there's the "90% covered" calculation example. You don't have to state your opinion if your actions speak for themselves.

And even a twofold reduction is quite significant, but I admit that without it the whole cover idea won't really work, and that seems to be a major goal.

All in all, after a little testing it doesn't seem as bad as I thought. Except for the caps, those appear to be still very much present. 111%*0.97 coverage gave me a 95% accuracy value. Waypoint autofire also seems to work, mostly.

Chainlink fences are kinda ridiculous, though, especially when the shooter is right next to them. Same for dense jungle or forest or orchards.

...do you consider % chance to hit number to include chances for to after cover penetration or not.
I would prefer not, but the cone still covers the, well, cover afterwards. I mean, it's probably not even possible to calculate the 'after cover' chance precisely, since there can be several pieces of cover quite a distance apart. And some of these can deform into new shapes after 'destruction'.



Otherwise, I agree with Xilmi that just letting the bullet 'survive' a cover hit and continue with reduced power, while cover gets destroyed as normal, seems the simplest and most natural way to do this.



Also, there are modding options that would allow you to reduce the impact of closely fought battles, like resurrecting soldiers (even without corpses!, or with functionally invulnerable corpses), giving out most score and loot for success, even one with lots of casualties, etc. It's a lot of work, granted, but far less than a full mod, and eminently doable by someone far less committed than a major modder. All it takes is an interest in both BAI and a mod. Or even vanilla, for that matter.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 06, 2023, 08:50:25 pm
Feedback and questions.

Played it a little. Really amazing work! Thank you for this mod. Aliens are much more intelligent now resulting in advertised brutal combat. The only way to counter their intelligence I found so far is to use what they don't have: smoke and sensors.

One thing I could not understand is how they detect my soldiers? I place them all staring in the alien direction but no one is able to see a single peeking alien even for a second. It is like out of the silence they start shooting one of my unit. Do they know how to avoid line of sight of my units or some other micro cheating or they see farther or better through smoke?

Another thing I noticed they pre-prime grenades and throw them very often. Which is completely fine for this mod. I was just thinking would it be appropriate to rebalance explosive power and resistances and other related stuff to account for that? In fact, the question even broader. Vanilla AI is stupid but huge alien unit bonuses compensate for that. Would it be good to rebalance them and make them more equal to X-Com stats? This way it would more resemble intellect combat instead of beating the weaklings.
I sure can do this in my own mod. Just asking if anything like that was done in this one?

Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 06, 2023, 08:56:23 pm
Anybody can explain how intelligence customization work? Is it possible to assign different intelligence to different races/types/ranks? Is it set like this by default or need to be turned on?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 06, 2023, 09:30:52 pm
One thing I could not understand is how they detect my soldiers? I place them all staring in the alien direction but no one is able to see a single peeking alien even for a second. It is like out of the silence they start shooting one of my unit. Do they know how to avoid line of sight of my units or some other micro cheating or they see farther or better through smoke?
Could be anything. Shooting at likely enemy positions, better infravision, psi-vision, just plain higher vision range, squadsight, even omniscience if you have that enabled.

It's just like night missions in the original without flares, with plasma shots out of the dark murderising your whole team. ;D

Just asking if anything like that was done in this one?
No, stat changes like that are the domain of ruleset mods.

Anybody can explain how intelligence customization work? Is it possible to assign different intelligence to different races/types/ranks? Is it set like this by default or need to be turned on?
The BAI and intelligence interplay is explained here (https://openxcom.org/forum/index.php/topic,10967.msg159452.html#msg159452). BAI has several options for determining enemy intelligence, on of which is to use the vanilla intelligence stat. Which is indeed assigned via ruleset data.

I think BAI intelligence is turned off by default?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 06, 2023, 10:19:13 pm
Also, I killed like 40% of them before they actually started bothering take cover.
This mission was quite dissatisfying in terms of a challenge.

Maybe, morale shifts should be changed to 100 -> 90 -> 80 -> 60?
Also, does Brutal OXCE count overall mediocre morale or each unit's morale, hence each unit has different strategy?
I have reworked and am still in the testing process aggressiveness 3 and also the steps from dynamic aggression.

3 works in a way, that they will take cover from units who's positions they know. But they won't predict where those units might go. Also 3 is now the max in dynamic aggression and it immediately drops down to 2 if morale goes below 100. Most of the time the morale is indeed either 100 or slightly below.

Playing with lowered intelligence makes aggressiveness meaningless for all the cases where they roll making a dumb move. The random-moves will not care about cover either way. So this will dramatically lower the challenge. Especially if the enemy has worse vision than your units.

It is based on individual morale. So a unit that just got a kill and thus gets capped to 100 again will be more aggressive than other units who haven't gotten one.

I want to suggest the "Sea Battle" mechanics prior to introduction of this giant HQ assault mission.
It is aimed to achieve win condition when player nulls units TU's after each turn.
- the overall conditions are "no enemy unit is seen", condition: night
- there is definitely viable trajectory to shoot to, where enemy unit has high chance to be located.
- SB is enabled on second turn. 
- then, split into: half are spotters, half are playing SB
- units to use this are, preferably, covered by darkness or away.
- each shot goes in a line, not towards the bottom of the tile
- each shot "checks" multiple tiles in a line
- if reaction fire follows, then BAI works as usual on player units reaction-fires.
Then if SB hits enemy, there are multiple targets revealed. If not, only reaction-fired units are spotted. 
- but the most delicious part is hitting enemy, when no reaction shots follows. This enemy is then marked as "spotted" for this turn and is visible for every BAI unit on battlefield, or to some % of BAI units
- then if unit is killed - reenable sea battle. Next turn every "spotted" enemy unit disappears.
- too much grenading may shift the balance even more, but it's up to player - how he gets into the battle: prepared or not.
IMO, this will enhance the power of AI, as it performs best at offense, rather than in defense.
This is pretty-much what I used to call blind-fire. The difficult part is to determine "where enemy unit has high chance to be located". It both has the potential of being exploitable or feel like cheating if not done right. I experimented with that in the past. I just let them shoot at where they had spotted something before. This worked well as long as the player didn't know how it works. Then the player could bait the blind-fire in order to reveal the enemies' locations while staying perfectly save themselves.

Other question is how AI spots the hit, far away in darkness: player can see AI units flashing red slightly or brightly. But, as I may understand, AI knows the map entirely, thus can calculate whether there should be obstacle, or not. The new obstacle is player unit, obviously.
Well, I would just have to call the updateEnemyKnowledge-function within the hit-method. Currently this isn't the case but if you say the player would notice when they hit something they didn't aim at, it would only be fair to let the AI notice the same. And done.

Also, the save which involves Gillmen is below. It's Ironman, so you probably want to run guys out of Osprey and toss flares around? Kill few close enemies and wait for gillmen to make shots. 
Beware of one green guy in the north building. Although, he couldn't have seen units near the osprey's exit anyhow (arching shot flew there).
Thanks, I may check it out later.

Options are also there:

Also, some players would scream "what kind of BS just happened"
As I said: If it works too well, it'll look like cheating. And if it doesn't, it'll look pathetic. "Guessing" is really hard to do with algorithms.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 06, 2023, 10:28:50 pm
One thing I could not understand is how they detect my soldiers? I place them all staring in the alien direction but no one is able to see a single peeking alien even for a second. It is like out of the silence they start shooting one of my unit. Do they know how to avoid line of sight of my units or some other micro cheating or they see farther or better through smoke?
Many possibilities. The easiest way to find out what happens is to use debug-mode. It needs to be enabled in the options.cfg-file by changing the line "debug: false" to "debug: true". Then you can hit ctrl+d in the mission to see what happens. You can then observe the enemie's turn. This should tell you how and from where they spotted your units.

I tried to avoid micro-cheating. The cheating is something you have to enable deliberately. If it cheats without the option enabled, it's a bug. Except when there's stuff like we recently had on discord, where someone also accused it of cheating. He was playing with Final Modpack... And yes, it turned out it was cheating because it was modded to cheat by giving the units a stat called "Psivision", which allows it to see through walls.

Another thing I noticed they pre-prime grenades and throw them very often. Which is completely fine for this mod. I was just thinking would it be appropriate to rebalance explosive power and resistances and other related stuff to account for that? In fact, the question even broader. Vanilla AI is stupid but huge alien unit bonuses compensate for that. Would it be good to rebalance them and make them more equal to X-Com stats? This way it would more resemble intellect combat instead of beating the weaklings.
I sure can do this in my own mod. Just asking if anything like that was done in this one?
You can turn the pre-priming off as a separate option. Other than that, balance-changes are modder territory.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 06, 2023, 10:44:32 pm
As I said: If it works too well, it'll look like cheating. And if it doesn't, it'll look pathetic. "Guessing" is really hard to do with algorithms.
Thanks taking time to reply.
Yet, this can be occasional, not 100% determined function. The whole point is to counter players who null TU. In all other cases, BAI works well. It deals with reaction-fire, and anyhow exposed units. Yet, won't do anything if player is halfway the map in the darkness. Trying to spot with a couple of guys per turn, which getting killed halfway. 
As for player will call it cheating or abuse it - it's not.
1) If player's reaction fire units, or exposed units present - they become first priority. BS is sort of much below, because of low probability.
2) BAI tends to take cover, meaning BS mechanic will be implemented few tiles away from cover
3) Player already know where most of BAI units are in the beginning of mission, because they tend to be on key locations, mostly open, and yet exposed to flares.
16 units flare whole map in the beginning of the first turn.
4) Overall, blind shots are kind of BS, too, but designated not to scan multiple tiles, but target something precisely.
5) 10 out of 40 enemies on the map can BS under osprey and opposite position pretty well, getting at least 1-3 probability hits. Then player cannot abuse this.
I abuse this, at least.
Without it, I would have played on lower difficulty.

Quote
One thing I could not understand is how they detect my soldiers
Sectoids have psi-vision. It's not even cheat, it's their feature. The know of biological objects via psi-field. This is X-COM lore.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 06, 2023, 10:46:27 pm
Could be anything. Shooting at likely enemy positions, better infravision, psi-vision, just plain higher vision range, squadsight, even omniscience if you have that enabled.

These are all unknown to me. Never touched anything like that. Where can I check if they are enabled or not?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 06, 2023, 10:54:10 pm
These are all unknown to me. Never touched anything like that. Where can I check if they are enabled or not?
If you play X-Piratez, get Xpedia2 from here:
https://xpedia.netlify.app/
, place it into BRUTAL OXCE folder, run xpedia.bat let it scan everything regarding ruleset, missions, research tree, enemies, etc. and get you all answers regarding installed mod, for which you will ever going to ask.
If you want to play different mod, it is suggested to use separate BOXCE or OXCE folder.
Like, X-Piratez OXCE & XCF Brutal OXCE.

Spoiler: X-Piratez already go with latest OXCE, and need only original game placed into the folder.
IDK if it works with XCF and other mods, though.

BAI uses default settings for enemies, it never changes anything. BAI soldiers are same as vanilla OXCE, except they better at killing you.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 07, 2023, 12:04:21 am
Where can I check if they are enabled or not?
BAI includes blindfire and its version of squadsight, to some degree or another.

The rest are mostly unit or armour variables: 'sniper', 'spotter' (without BAI), 'psiVision', 'heatVision', 'visibilityAtDay', 'visibilityAtDark' (in conjunction with 'maxViewDistance'), various camouflage and anti-camouflage variables. Plus 'cheatTurn' and possible memory from unit 'intelligence'.

BAI has even more memory stuff under the hood that you can't touch directly.

Some mods have automated wikis, for others you need to check the rulesets yourself.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 07, 2023, 12:08:51 am
Thank you for all pointers. I am not using any special mods modifying combat mechanics. Just installed BAI and few of my mods (ruleset only) on top of it.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Juku121 on December 07, 2023, 12:14:02 am
Then it's probably either squadsight or the enemy trying to shoot at likely troop locations. Maybe omniscience, but that should be off by default.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 07, 2023, 12:30:41 am
I guess so. Will keep an eye on this.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 07, 2023, 12:56:57 pm
Without it, I would have played on lower difficulty.
I played this mission yesterday evening with full intelligence and without spending-TU-to-avoid-reaction-fire-shenanigans.
I normally test vanilla or tftd against sectoids or aquatoids.
My soldiers simply shrugged off most attacks and took 0 damage. When they were hit in the first place. They also very often just one-shot the enemies with reaction-fire.
Most of those enemies have way worse stats and weren't a threat either way.
Eventually they stopped walking into my reaction-shots and I had to move. In the house it got dangerous because they would use melee and actually hit with their auto-shots.
Without full intelligence I suppose eventually all of them would have walked into my snipers. I think in situations like that any randomness can eventually backfire. THe only behavior that was good by them was to not show themselves at all until I get really close. And as long as randomness is enabled this is only guaranteed at the lowest aggressiveness.
Basically: They were way too outgunned for them to have a chance with more aggressive behavior. And morale takes a long time to drop low enough for them to learn their lesson. So this is a bit of a dilemma. Enemies with worse stats relative to the player's units would need to be less aggressive. I think I'll use this save for some more experiments. It's very different from my usual test-saves.

Sectoids have psi-vision. It's not even cheat, it's their feature. The know of biological objects via psi-field. This is X-COM lore.
Maybe in various mods but not in the base-game.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 07, 2023, 04:23:37 pm
I played this mission yesterday evening with full intelligence and without spending-TU-to-avoid-reaction-fire-shenanigans.
This one particular mission is not the case.
It is clearly doable w/o loses because entire church of dagon fraction is lowest difficulty among 4 Tier 1 fractions (no armor, no good weapons, only gillmen, dynamite and incendiary grenades actually kill)
I'll bring you the saves with HQ assaults, right after get something.
The strongest are Red Dawn in terms of unit durability and poison grenades/high explosives and Black Lotus with their invisible assassin ninjas, who both have powerful melee and powerful, yet limited-range snap attacks.

Here's the video which shows case where AI could have made much better is used:
1) BS mechanics
2) more grenading
3) thrown flares back
4) Armored vehicles with 200+ TU's and enhanced night vision actually tried to scout our positions.
UPD. and I forgot to tell that pre-primed high explosives are kind of good stuff for suicide runs.
Like, some enemies can sacrifice themselves while taking 2-5 units to the hell as side effect. These thoughts are close to the end of the video.
 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 07, 2023, 05:38:21 pm
I looked at the previous-savegame in debug-mode and immediately spotted an issue with the AI's intended behavior. They have a line of fire but due to the combination of "Extender Accuracy" but not "Realistic Accuracy" their is a discrapency.

They go to a position from where they want to shoot from but then realize: OH, my target is too far, I only get 0%.

This has dramatic consequences on the rest of their behavior. They basically waste their move for preparing something that they won't do instead of using their TUs for something useful.

So further reports from sub-optimal XCF-behavior currently are not needed as chances are a lot of the bad behavior of the AI is a result of this mismatch between moving to attack-positions but then not actually attacking.

I also saw another issue related to updating assumed positions of units, where it returns the same location the unit was guessed to be before.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 07, 2023, 05:54:15 pm
I looked at the previous-savegame in debug-mode and immediately spotted an issue with the AI's intended behavior. They have a line of fire but due to the combination of "Extender Accuracy" but not "Realistic Accuracy" their is a discrapency.
So, long story short, BAI right now performs as intended with Joy's Realistic Accuracy only?

Quote
spending-TU-to-avoid-reaction-fire-shenanigans
Player is allowed to do so by interface. It's BAI that never considered this as potential player's playstyle. Just opinion.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Alpha Centauri Bear on December 07, 2023, 09:17:58 pm
Interesting effect on aliens carrying preprimed grenades. One can kill them and pick/throw their preprimed grenades without even knowing appropriate technology. Fun.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 07, 2023, 11:35:01 pm
So, long story short, BAI right now performs as intended with Joy's Realistic Accuracy only?
Player is allowed to do so by interface. It's BAI that never considered this as potential player's playstyle. Just opinion.
No, this is not the whole story. I debugged all day long and there were numerous bugs of the AI not working properly due to various reasons. The biggest issue was a totally wrong way of applying the no-LOS-accuracy-penalty. It made the AI think it won't be able to attack from where it stands despite the possibility being there. This lead to a lot of cases where the AI went into your firing-range and then walked back out without shooting.

Another one was related to the reduced overall range of their weapons. They did correctly notice the range but they compared it to the wrong variable reaching wrong conclusions.

I also noticed that units with arcing-attacks checked as if their attacks were normal straight-line-attacks. Now they check for arcing, which makes them way better.

Thing is most of these things were unnoticed because the vanilla-ruleset doesn't really have any of this. No No-Los-penalty, no limited weapon-range and only celatids have arcing attacks.

So overall 7.12.0 should tremendously help them with the XCF-ruleset.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Abyss on December 08, 2023, 12:34:39 am
I also noticed that units with arcing-attacks checked as if their attacks were normal straight-line-attacks. Now they check for arcing, which makes them way better.
Even 6.X.X versions clearly used gillmen arching attacks very well from no-LoS terrain. I did playthrough of XCF with it some time ago.
Randomization implementation triggered me to restart, because now I have a little, yet chance to beat SH difficulty.

Checked Github, tremendous work done. Should we again expect hail of bullets and grenades?
Will check it ASAP, sounds too delicious to wait for the weekend

Few fast questions:
1) BAI on extender accuracy (not RA) - works same well as with RA?
2) Will you somehow teach BAI to throw flares back?
3) Will super-high TU units scout (last video shows how Armored cars dispose their TU's instead of best solution)?
4) What was with these gillmen, did they see me? If they did, why human units didn't attack at all this turn?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.11.0
Post by: Xilmi on December 08, 2023, 10:52:45 am
Even 6.X.X versions clearly used gillmen arching attacks very well from no-LoS terrain. I did playthrough of XCF with it some time ago.
The arcing-shot-logic was correctly applied for the "can I attack from where I stand?"-logic. But it was not applied by the "where do I have to go to attack?"-logic.
That's why they sometimes would indeed attack from positions without having LOS. But with the change they should do so way more often. I tested it in TFTD with a terror-mission where there's a lot of these enemies and they killed everyone in one turn. I feared that it would be expensive to call that because they try 10 different angles. But then again it's tile-based not voxel-based so they don't do it as often. And it's done instead of the other line-of-sight-check, so it does not have significant impact on turn-time.

1) BAI on extender accuracy (not RA) - works same well as with RA?
2) Will you somehow teach BAI to throw flares back?
3) Will super-high TU units scout (last video shows how Armored cars dispose their TU's instead of best solution)?
4) What was with these gillmen, did they see me? If they did, why human units didn't attack at all this turn?
1) I did all my testing without RA. So I can't tell for RA for sure. But most issues were AI-bugs afterall, so they should be fixed now either way.
2) Not planned so far. Maybe something for the backlog.
3) Currently the scouting logic works in a way that may not be ideal for scenarios often encountered in mods. On aggressiveness 3 units now should scout much more aggressively at the expense of their own safety. On lower aggressiveness, they will scout but also preserve TUs to go back into cover. And they won't scout very much when they have low weapon-range. The idea is to force you to scout them instead. Playing with sub 100% intelligence however will likely backfire. Because the units who roll a random move might just put themselves out somewhere with no real purpose. Testing under these circumstances is definitely not ideal to make conclusions about the AI's tactics.
Fixed max intelligence and ideally also no randomization is way more conclusive as then you can be sure that the bad moves are actually bad decisions by the AI and not the result of a random-roll.
4) The Gillmen simply didn't suffer from the bug that the other units suffered from as they used an arcing attack and the bug only affected direct attacks. What I did wrong was to subtract the No-LOF-Penalty, which was 50%. That means if their normal hit-chance would have been below 50% they thought they wouldn't hit you at all. The correct application would have been Accuracy *= NoLOFPenalty / 100.0, so halfing their accuracy and not making them think it's negative now. The result was a lot of units simply not attacking at all, when they should have.
So morale of the story: You don't always need a new mechanism of how the AI should behave when they don't work as intended in the first place.

Your savegame definitely was very valuable in improving flaws in the AI.

Wait a minute... Accuracy *= NoLOFPenalty / 100.0 might still be wrong and only work because it was 50. But that's what I think it was also used like in the other code. I need to check. Question is: does it mean: "That much percent of the accuracy is it reduced by" or does it mean "That much percent of the accuracy will be left"? It's same at 50, but what about 25 or 75? In the end it wouldn't matter too much as long as it won't turn the accuracy negative. But I'd still like to understand how it's supposed to be used.

Edit: Just checked again in Projectile.cpp
Code: [Select]
if (noLOSAccuracyPenalty != -1 && !hasLOS)
{
real_accuracy = real_accuracy * noLOSAccuracyPenalty / 100;
}
Not really intuitive. :o
Title: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: jnarical on December 08, 2023, 11:03:13 am
Edit: Just checked again in Projectile.cpp
Code: [Select]
if (noLOSAccuracyPenalty != -1 && !hasLOS)
{
real_accuracy = real_accuracy * noLOSAccuracyPenalty / 100;
}
Not really intuitive. :o
This code is mine but it has always been that way. If you’re not sure - use “vanilla” OXCE to check such things.

I think it could be confusing for other people too, so we possibly would find out that in mods some dev’ve decided it works in one way, and another dev thinks it works just the opposite. I feel like it’s totally possible situation. I haven’t thought about that myself and just acted as “one way” seemed obvious to me.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Xilmi on December 08, 2023, 01:34:55 pm
This code is mine but it has always been that way. If you’re not sure - use “vanilla” OXCE to check such things.

I think it could be confusing for other people too, so we possibly would find out that in mods some dev’ve decided it works in one way, and another dev thinks it works just the opposite. I feel like it’s totally possible situation. I haven’t thought about that myself and just acted as “one way” seemed obvious to me.
2 Days ago someone asked what this parameter does on the OpenXCom-Discord. I confidently gave a wrong answer and no one corrected me. So I think the likelihood that at least some modders who use it, got it wrong too is pretty significant. :o

I just checked the official documentary:
"noLOSAccuracyPenalty    The penalty (in percent) to accuracy applied when attacking a unit or a tile outside of LOS. Overrides global setting."

So no way to deduce how it actually works from there either.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 08, 2023, 03:37:17 pm
Apologies. I may be late to discussion but why vanilla accuracy is no good?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 08, 2023, 04:37:38 pm
BAI authors,

OXCE don't want to add this UI QoL feature as indicating whether tile is in day or night mode visibility. Maybe you would?

https://openxcom.org/forum/index.php/topic,10898.msg150927.html
https://openxcom.org/forum/index.php/topic,10076.0.html
https://openxcom.org/forum/index.php/topic,6869.0.html

Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Meridian on December 08, 2023, 04:55:35 pm
OXCE don't want to add this UI QoL feature as indicating whether tile is in day or night mode visibility. Maybe you would?

Small correction, we don't want to add this non-QoL feature.

QoL is defined as: "What does “quality of life” refer to? Quality of life (or “QoL”) elements cover a broad range of features that are designed to make games easier to play without changing the gameplay itself." (source: https://www.vintageisthenewold.com/game-pedia/what-is-quality-of-life-for-gamers but you can google yourself and find hundreds of definitions saying the same thing, I just took the first one)

Adding this feature has a HUGE impact on the gameplay itself, and thus doesn't qualify as a QoL feature.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 08, 2023, 05:28:00 pm
Sorry for wrong used term. It was the attempt of describing it, not defining.
Didn't intend to offend anybody.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 08, 2023, 11:11:26 pm
Tanks stop after opening doors, soldiers do not. Is it a feature?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 08, 2023, 11:12:30 pm
Playing average difficulty. February. My only base is assaulted by Tasoths with Reapers and PWT launchers. Is it expected or I just unlucky?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Abyss on December 09, 2023, 12:11:35 am
Playing average difficulty. February. My only base is assaulted by Tasoths with Reapers and PWT launchers. Is it expected or I just unlucky?
If you play your own mods then probably some experienced modmakers can help you with insight for mission rulestes. E.g. mission spawn timers and probabilities.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Xilmi on December 09, 2023, 02:52:02 am
Tanks stop after opening doors, soldiers do not. Is it a feature?
No it's not intentional. I compared with OXCE (7.8.5) and there they don't stop.

...

Okay, I think I found the issue. It's caused by the recently included "Brutal Brutes"-option. I implemented this incorrectly. Will be fixed in the next version. But I don't feel it's important enough to push a version just for that. :o
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Xilmi on December 09, 2023, 02:56:15 am
Playing average difficulty. February. My only base is assaulted by Tasoths with Reapers and PWT launchers. Is it expected or I just unlucky?
The earliest base-assault I've gotten was January 6th.
But Tasoths and Reapers shouldn't be possible that early with vanilla TFTD. So there's likely some sort of mod at play.

Note that with "Aggressive Retaliation" enabled in Brutal-OXCE successfull missions on landed UFOs also have a chance to trigger retaliation, not just shooting them down.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: 0xEBJC on December 09, 2023, 03:14:35 am
Xilmi,

This is really great work, thank you!  I am enjoying all the additional features and using them to work on new mods.

I am working on a new hangar mod, and saw that your repo supports not only multiple hangars but configurations for placement and craft specific hangars, i.e. garage for XCF automobiles. .... I didn't realize you already had an example mod for this until after I had already made a garage basebits sprite, it's got a car lift., attaching here and you are welcome to add it to your repo if you want. :)


I have two suggestions that I hope you'd consider.

Would you be open to changing the restrictions of the hangarType slightly?  The problem I'm hoping to solve is I want to put the XCF cars with hangarType: 0 into the garage as well as the vanilla hangar that doesn't have the hangarType defined or -1. So if the craft has a hangarType: x then it can go in any hangar with hangarType: x or -1 but if a craft doesn't have a hangarType defined it can only go into hangars without the hangarType defined or -1, thus all hangars with a hangarType defined can only accept that type of craft but hangarType: -1 (not defined) would accept all craft types.

The second thing I'd suggest a slight change in the wording for clarification in the advanced configuration menu for the following:
"Realistic accuracy shot dispersion"
"0 Realistic"
"1 Normal"

My understanding is that "realistic" is when this feature is enabled and it's confusing as 0 usually denotes off and 1 denotes on... or am I mixed up with what it's saying.  I think "normal" is a little confusing also as opposed to "vanilla" to indicate original game calculations.  Sorry if this was already discuss or if I'm not understanding this setting options.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: 0xEBJC on December 09, 2023, 03:21:20 am
here's part of the hangar mod I'm working on.

I don't have any experience building battlespace maps, so just starting to read the tutorials on that in the forms. was thinking of making the hangars look similar to the duratread facilities with the walls and then add the landing pads.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 09, 2023, 04:47:29 am
The earliest base-assault I've gotten was January 6th.
But Tasoths and Reapers shouldn't be possible that early with vanilla TFTD. So there's likely some sort of mod at play.

Note that with "Aggressive Retaliation" enabled in Brutal-OXCE successfull missions on landed UFOs also have a chance to trigger retaliation, not just shooting them down.

That is probably it. Any description on mechanics?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 09, 2023, 06:04:30 am
Try #2

Again medium difficulty.
Shot one small SUB then landed and raided another small SUB.
Jan 7: my base is attacked!

Isn't it an overdo of aggressive retaliation?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Xilmi on December 09, 2023, 03:47:52 pm
I am working on a new hangar mod, and saw that your repo supports not only multiple hangars but configurations for placement and craft specific hangars, i.e. garage for XCF automobiles. .... I didn't realize you already had an example mod for this until after I had already made a garage basebits sprite, it's got a car lift., attaching here and you are welcome to add it to your repo if you want. :)


I have two suggestions that I hope you'd consider.

Would you be open to changing the restrictions of the hangarType slightly?  The problem I'm hoping to solve is I want to put the XCF cars with hangarType: 0 into the garage as well as the vanilla hangar that doesn't have the hangarType defined or -1. So if the craft has a hangarType: x then it can go in any hangar with hangarType: x or -1 but if a craft doesn't have a hangarType defined it can only go into hangars without the hangarType defined or -1, thus all hangars with a hangarType defined can only accept that type of craft but hangarType: -1 (not defined) would accept all craft types.

The second thing I'd suggest a slight change in the wording for clarification in the advanced configuration menu for the following:
"Realistic accuracy shot dispersion"
"0 Realistic"
"1 Normal"

My understanding is that "realistic" is when this feature is enabled and it's confusing as 0 usually denotes off and 1 denotes on... or am I mixed up with what it's saying.  I think "normal" is a little confusing also as opposed to "vanilla" to indicate original game calculations.  Sorry if this was already discuss or if I'm not understanding this setting options.
These are both things provided by other contributors. Changing the shot-disperstion-option logic would be easy but I'd rather ask jnarical if he has an opinion about that.
When it comes to the Hanger-stuff, I don't really know too much about that code and whether a change like that can easily be done. I'll try to get hold of the guy who coded it first before I'd consider looking at it myself. I mean I did look at it before because I wanted to automatically compute defaults for the positions of several crafts, so it does work without defining them manually. I think I ended up just using the center for all of them as it was too difficult to come up with an algorithm that could just take any number.

Edit: He did reply and said this:

"It can be done, but allocation would be slightly more difficult, as you should consider how many hangars of your type are free, and how many "joker" hangars are free. I suppose it could be done adding a "second allocation trial" when all typed hangars are allocated."

So maybe not so easy for someone who isn't deep into the topic.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Xilmi on December 09, 2023, 04:00:57 pm
That is probably it. Any description on mechanics?
You mean the retaliation-mechanic?

Normally there is a percentage-based chance of triggering a retaliation-mission for every UFO you shoot down. I think it is 4% on Beginner and 20% on Superhuman with 4% increments between difficulty-levels.
The change with Aggressive Retaliation in BOXCE is that this also can trigger off of successfull landed missions, as otherwise the player could just avoid it by never shooting down any UFO.

In vanilla the mission consists out of several small craft who try to find your base and at the end 2 very larges who try the same. Whenever one of the UFOs finds the base it will no longer search for it and instead a very large will go right for the base at max-speed.
Now with aggressive retaliation other UFOs could also randomly find your base, not just the ones that are part of the mission. This had very little impact in practice. But I also normalized the search-pattern. In vanilla the search-pattern heavily depends on the mission-zones. Which makes it make a massive difference to the chance of finding your base based on where it is located. Like for example switzerland had a very high chance but crete had an almost 0 chance. The search-pattern was normalized in BOXCE if the aggressive-retaliation-option is enabled and instead of searching on the region, the UFOs will always search in a sqare centered around the actual base. The square is roughly as big as europe. So it means the chance of your base being found is always as good as when it is in switzerland.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Xilmi on December 09, 2023, 04:06:17 pm
Try #2

Again medium difficulty.
Shot one small SUB then landed and raided another small SUB.
Jan 7: my base is attacked!

Isn't it an overdo of aggressive retaliation?
Medium-difficulty should be 12% chance for retalition. So if the Mods you are using don't mess with retaliation-chances your chance of getting a retaliation were roughly 22%.
Would have been 12% with without Aggressive-retaliation, since the landed sub wouldn't have counted towards the chance.

You can always just disable "Aggressive Retaliation". But I'd also recommend to check your mods. They might have increased the retaliation-chance. There's also away to simply trigger a retaliation based on events. Like researching a certain tech, for example.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 09, 2023, 07:49:36 pm
You mean the retaliation-mechanic?

Normally there is a percentage-based chance of triggering a retaliation-mission for every UFO you shoot down. I think it is 4% on Beginner and 20% on Superhuman with 4% increments between difficulty-levels.
The change with Aggressive Retaliation in BOXCE is that this also can trigger off of successfull landed missions, as otherwise the player could just avoid it by never shooting down any UFO.

In vanilla the mission consists out of several small craft who try to find your base and at the end 2 very larges who try the same. Whenever one of the UFOs finds the base it will no longer search for it and instead a very large will go right for the base at max-speed.
Now with aggressive retaliation other UFOs could also randomly find your base, not just the ones that are part of the mission. This had very little impact in practice. But I also normalized the search-pattern. In vanilla the search-pattern heavily depends on the mission-zones. Which makes it make a massive difference to the chance of finding your base based on where it is located. Like for example switzerland had a very high chance but crete had an almost 0 chance. The search-pattern was normalized in BOXCE if the aggressive-retaliation-option is enabled and instead of searching on the region, the UFOs will always search in a sqare centered around the actual base. The square is roughly as big as europe. So it means the chance of your base being found is always as good as when it is in switzerland.

Very good explanation, thank you. Few questions.

Every USO altercation (shooting or raiding) CAN trigger search mission.
Is it a single time bounded mission? Meaning they search for some period of time and if they don't find it - no more attempts are made (for this search mission).
Then next search mission can get triggered, and so on.

I understand this is probably difficult to calculate but what is the estimate probability for the search mission to discover X-Com base?
What is the probability for the any USO to discover X-Com base? Is it same as in vanilla or different?

Essentially, I am trying to understand with what probability I receive base attack after shooting down or raiding USO? Thank you.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 09, 2023, 07:51:32 pm
Medium-difficulty should be 12% chance for retalition. So if the Mods you are using don't mess with retaliation-chances your chance of getting a retaliation were roughly 22%.
Would have been 12% with without Aggressive-retaliation, since the landed sub wouldn't have counted towards the chance.

You can always just disable "Aggressive Retaliation". But I'd also recommend to check your mods. They might have increased the retaliation-chance. There's also away to simply trigger a retaliation based on events. Like researching a certain tech, for example.

Got it.
I am not using any fancy mods on top of BAI but will check anyway. What should I look for? The "retaliation" word in rules?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Xilmi on December 09, 2023, 08:18:29 pm
Very good explanation, thank you. Few questions.

Every USO altercation (shooting or raiding) CAN trigger search mission.
Is it a single time bounded mission? Meaning they search for some period of time and if they don't find it - no more attempts are made (for this search mission).
Then next search mission can get triggered, and so on.

I understand this is probably difficult to calculate but what is the estimate probability for the search mission to discover X-Com base?
What is the probability for the any USO to discover X-Com base? Is it same as in vanilla or different?

Essentially, I am trying to understand with what probability I receive base attack after shooting down or raiding USO? Thank you.
The search-mission performed by each of the UFOs that are part of it has a finite amount of way-points it flies between. I think like 5 or 6. Basically every time they change direction they reached a way-point.

Every 5 minutes or so it rolls whether it detects your base. The chance of success for that is based the distance to your base and how big your base is (how many slots are filled). There's also a building that reduces this chance. The chance for each individual roll is not very high. But smaller UFOs fly slower and thus have a lot more rolls in total than the bigger ones. Basically you should shoot down every UFO that flies close to your base, as they are likely searching your base. The big ones you can't usually shoot down but those also have the lowest chance to find you, so it's fine.
Problem is: Especially in the beginning with the crappy small radar, chances are you only discover the UFO when it's already too late, as the radar only refreshes every 30 minutes of whether there is something. (once it was found you won't lose it while still in radar range, except if it leaves orbit of course)

Also: If the UFO is not part of a search-mission and you shoot it down thinking it is, you can of course trigger the search-mission in the first place.

With aggressive retaliation enabled the chance of discovery, when you do nothing against it, is pretty high I'd say. More than 50% from experience that they find your main-base that way.
Without aggressive retaliation, as I said the chance can be way lower depending on the location of your base. Threre are some "dead-zones" with abysmally small chance. If you are close to or between several bigger cities the chance is a lot higher.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Xilmi on December 09, 2023, 08:28:46 pm
Got it.
I am not using any fancy mods on top of BAI but will check anyway. What should I look for? The "retaliation" word in rules?
The amount of ships spawned searching for your base per retaliation-mission is in alienMission.rul usually. It also has a timer between each of the spawns. Such a mission can take quite a bunch of time. Basically they will try to find you over and over until all of the UFOs that can be spawned have tried or they succeeded. During a retaliation-mission there can't be another one overlapping with the same. And if they all fail to find you, you have to trigger it again.

I thought that the chance is in difficulty.rul but doesn't look like it. It may actually be hard-coded. I'm also not the most proficient when it comes to rulset modding. I've only done one very tiny mod like this. Might have to look at the documentation for further cues in that regard.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 09, 2023, 08:33:25 pm
Great. 50% is what I need.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 09, 2023, 08:45:04 pm
Xilmi and other authors.
Do you accept other contributors? I like your mod in particular and prefer to use it as a base for further improvements either for myself or for others if they like to.

I do not plan to be persistent but sometimes I see things those could be probably improved or made interesting.
Like base info counts number of detection systems but in fact they don't stack. I.e. misleading information. Could be more interesting if they stack. And others like that.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Juku121 on December 09, 2023, 10:12:00 pm
I thought that the chance is in difficulty.rul but doesn't look like it.
I think 'retaliationTriggerOdds' and 'retaliationBaseRegionOdds' are what you're looking for?

Like base info counts number of detection systems but in fact they don't stack. I.e. misleading information. Could be more interesting if they stack.
They didn't stack in the original. All radars stack in OXC. The short/long distinction is just visual.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 09, 2023, 10:24:05 pm
They didn't stack in the original. All radars stack in OXC. The short/long distinction is just visual.

What do you mean "visual". Aren't they different range and probability?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Juku121 on December 09, 2023, 10:39:04 pm
You could have different radars with the same range and probability, if you wanted.

By visual, I mean that there's a threshold under which radars are classified as 'short' for purposes of base information display. Even if there's more than one type of radar facility that falls under that classification. All others are 'long'.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Xilmi on December 09, 2023, 11:15:03 pm
Xilmi and other authors.
Do you accept other contributors?
Yes, if someone wants to contribute features that are not already present in OXCE and they are either optional or a flat-out-improvement, I'm willing to accept them. But with your example I'm now skeptical due to what Juku121 said to that.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: Alpha Centauri Bear on December 10, 2023, 12:11:56 am
Oh. This was just an example.

I would like to implement damage modifiers UI somehow if it is not yet there.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: jnarical on December 10, 2023, 05:46:44 pm
The second thing I'd suggest a slight change in the wording for clarification in the advanced configuration menu for the following:
"Realistic accuracy shot dispersion"
"0 Realistic"
"1 Normal"

My understanding is that "realistic" is when this feature is enabled and it's confusing as 0 usually denotes off and 1 denotes on... or am I mixed up with what it's saying.  I think "normal" is a little confusing also as opposed to "vanilla" to indicate original game calculations.  Sorry if this was already discuss or if I'm not understanding this setting options.

I was changing wording numerous times... And it turnes out that it's current state still isn't good enough.
Ok, first of all, this option works only with RA enabled. I can't use the word "vanilla because either option is far from it. So, "normal" is closer to vanilla, and realistic is really tight. Former one is selected by default, because most players are more accustomed to it. My line of thought was - "Let people find it. Those who are curious enough - will try it. Those who'll like it - will leave it enabled". Speaking of myself, I use "realistic" option and I like it more.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.0
Post by: 0xEBJC on December 11, 2023, 06:29:38 am
I was changing wording numerous times... And it turnes out that it's current state still isn't good enough.
Ok, first of all, this option works only with RA enabled. I can't use the word "vanilla because either option is far from it. So, "normal" is closer to vanilla, and realistic is really tight. Former one is selected by default, because most players are more accustomed to it. My line of thought was - "Let people find it. Those who are curious enough - will try it. Those who'll like it - will leave it enabled". Speaking of myself, I use "realistic" option and I like it more.

Ah, thank you for the clarification, I didn't realize there was a dependency from one option to another.

So you have to enable "Realistic accuracy and cover system"
and then the others can be toggled or enabled like "Realistic accuracy shot dispersion"
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: jnarical on December 11, 2023, 09:16:00 am
Ah, thank you for the clarification, I didn't realize there was a dependency from one option to another.

So you have to enable "Realistic accuracy and cover system"
and then the others can be toggled or enabled like "Realistic accuracy shot dispersion"
Yes, there’s a bunch of options for RA and you can change them all but they’ll work only after RA itself enabled
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 11, 2023, 01:31:21 pm
Hi Xilmi,  there's one more save with Cult HQ (main base, ~90-100 enemies)
Layout is quite good, but one thing embarrasses: gillmen used to attack alot wherever I used to land in previous playthroughs. Right now they don't do it often.
And even if the hitchances are too little, they should bombard by means they have infinite ammo.
In Dagon HQ castle they spawn at corners & inside the temple itself.
It's turn 3, low-tier enemies around are downed.

Also, this save can be used to train AI use strategies vs usual player approach for such missions (set up a line, then aimed + snap). The most notable about this map vs BAI is: it covers inside the castle and then each unit, that is supposed to attack, goes to the gate, where following sniper reaction shot comes, as 10 agents simultaneously watch the exit.
Meanwhile, I retreated from previous same mission because layout was different (close to castle, more grenades and more shots consequently)
 
 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 11, 2023, 06:12:22 pm
And one more save: past couple of turns from the moment the game crashed (quit without any notifications)
UPD. It occurs if certain moves are made, not reproducing itself anymore. Nevermind. Deleting it.
UPD 2. Caught the turn where it happens all the time. Should 100% be your patient, Xilmi.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 11, 2023, 08:33:21 pm
And one more save: past couple of turns from the moment the game crashed (quit without any notifications)
UPD. It occurs if certain moves are made, not reproducing itself anymore. Nevermind. Deleting it.
I suppose 7.12.0?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 11, 2023, 08:54:06 pm
I suppose 7.12.0?
Yes, I updated the comment and atteched the exact savefile. Just press turn end.

UPD 3 oh my god, you fix bugs way prior me reporting them. The discord community must be very active. Give me the link, too, please
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 11, 2023, 09:44:40 pm
Hi Xilmi,  there's one more save with Cult HQ (main base, ~90-100 enemies)
Layout is quite good, but one thing embarrasses: gillmen used to attack alot wherever I used to land in previous playthroughs. Right now they don't do it often.
And even if the hitchances are too little, they should bombard by means they have infinite ammo.
In Dagon HQ castle they spawn at corners & inside the temple itself.
It's turn 3, low-tier enemies around are downed.

Also, this save can be used to train AI use strategies vs usual player approach for such missions (set up a line, then aimed + snap). The most notable about this map vs BAI is: it covers inside the castle and then each unit, that is supposed to attack, goes to the gate, where following sniper reaction shot comes, as 10 agents simultaneously watch the exit.
Meanwhile, I retreated from previous same mission because layout was different (close to castle, more grenades and more shots consequently)
I tried with the settings as attached and the Gillmen did almost all attack. Used debug to watch them.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 11, 2023, 09:47:57 pm
UPD 3 oh my god, you fix bugs way prior I report them. The discord community must be very active.
Erm... not exactly. I found this one myself. :D

The links are always the same :o

https://mod.io/g/openxcom/m/brutal-ai

and

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

You can bookmark them.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 12, 2023, 12:03:23 am
Erm... not exactly. I found this one myself. :D
The links are always the same :o
Whow.
The discord chat link, though. I wanted to look at what other ppl write there
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: jnarical on December 12, 2023, 12:20:56 am
There's something odd with arcing shots for now, at least with RA enabled. I still have to find time to investigate
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: 0xEBJC on December 12, 2023, 02:12:16 am
would it be an easy, quick change to add a keyboard shortcut option to allow the player to change "Automated Combat" from: ctrl+a to what ever they want?

or ctrl+ "user defined key" like always keep the ctrl+ and allow the user to specifiy another key like 'c' for ctrl+c for example?


Reason being is I'm testing out the auto combat and I used directional keyboard layout (a s w d) for (left down up right) as opposed to the arrow keys and since my left key is 'a' when I press ctrl+a auto combat starts and then the 'a' key is held down and the screens scroll locks left.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: 0xEBJC on December 12, 2023, 02:17:02 am
Two things I noticed, one a light graphics bug, but not necessary to fix:

If you click somewhere on the map and it shows the trail of TUs and the path routing for a specific soldier, then enabling auto combat before clearing the path, then that way point graphics remains even after the soldier moved because of entering auto combat.

The other thing is a QoL request. I know some may not care if you can see what your soldiers are doing when in auto combat mode, but I hope you could consider updating the auto combat so that it tracks the movements and keeps the screen centered on the active soldier.  Currently in auto combat the soldier moved off screen and the screen doesn't track the solder.

Thanks for any considerations.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 12, 2023, 05:15:27 pm
The discord chat link, though.
Oh... Yeah. This makes a lot more sense and explains the seeming contradiction between knowing what I've updated and not knowing the link. https://discord.gg/xxTPB72x
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 12, 2023, 06:57:29 pm
would it be an easy, quick change to add a keyboard shortcut option to allow the player to change "Automated Combat" from: ctrl+a to what ever they want?

or ctrl+ "user defined key" like always keep the ctrl+ and allow the user to specifiy another key like 'c' for ctrl+c for example?


Reason being is I'm testing out the auto combat and I used directional keyboard layout (a s w d) for (left down up right) as opposed to the arrow keys and since my left key is 'a' when I press ctrl+a auto combat starts and then the 'a' key is held down and the screens scroll locks left.
Yeah, I'll do this for the next version.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: 0xEBJC on December 12, 2023, 08:50:10 pm
Regarding AI improvements or observed issues

In auto player mode, against swarmoids the players just pace back and forth one tile then back to the other next to a swarmoid when trying to melee or stunrod them and take no attack action but use up their TUs.

also in auto player mode I think there should be a higher polling for keyboard interrupt, sometimes it's almost impossible to get the game to receive a ctrl+a to disable the auto player mode once activated.  Escape to menu still seams to function fairly quickly.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 12, 2023, 11:58:43 pm
In auto player mode, against swarmoids the players just pace back and forth one tile then back to the other next to a swarmoid when trying to melee or stunrod them and take no attack action but use up their TUs.
What was the Auto-play-aggressivity this happened on?

I think this can happen on the highest aggresivity when they don't have enough TUs to perform a melee-attack once they reach the enemy. But they are forced to change position instead of just ending their turn.

A savegame of this situation would help greatly identifying and fixing the issue. Do you have one?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 13, 2023, 12:25:35 am
To Xilmi:
Here's nice mission vs werewolves (X-COM Files):
1) they act like if they are controlled by Brutal AI. Although they seem more intelligent, than basic creatures, clear hide&seek strategy doesn't look Sci-Fi realistic
- the distance is quite good, only couple can reach near-exit player units on turn one. And they go melee.
- excessive range to player units make other werevolves prefer to stay in cover over attacking on aggressiveness 2.
2) but still they peak =>
- and while peaking, move back and forth, causing reaction shots =>
- getting damaged without benefit
3a) I thought this mission is good to be fed to BAI, because it is all-tough-melee VS all-weak-but-ranged mission.
3b) I also think that all melee specialists in the game can perform better and treat more.
I see dogs, deep ones and, now, werevolves, who cannot approach at all because formal logic tells it is suicide run. =>
If so, I also believe that BAI doesn't know how to plan something besides one turn. But if it was able to plan, for at least 2-3 turns ahead, BAI would know that 20 werevolves (100-120 TU?), even if cut by 80% by reaction fire/measures, will destroy whole squad on turn 3. 

P.S. I also kinda like these strange werevolves moves for vanilla AI mission. It gives little tense and much fun.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: 0xEBJC on December 13, 2023, 12:51:49 am
What was the Auto-play-aggressivity this happened on?

I think this can happen on the highest aggresivity when they don't have enough TUs to perform a melee-attack once they reach the enemy. But they are forced to change position instead of just ending their turn.

A savegame of this situation would help greatly identifying and fixing the issue. Do you have one?

TUs were 100+ standing next to the enemy.  Play er is going back and for many times until TUs run out...  I have only see this issue with swarmoids so far.  Two things come to mind.  Swamoids have a very low chance to take melee damage which might be affecting the AI.  I've also noticed the AI will got around the back of enemies, or tanks to get in a better attack.  Maybe how swarmoids are defined the have no back side just front on every side so the AI keeps moving back and forth to find how to reposition around the back of the swarmoid enemy?

The Auto-play aggressiveness is set to 3

let me know if you wanted to know more of the AI settings.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 13, 2023, 01:47:10 am
- and while peaking, move back and forth, causing reaction shots =>
- getting damaged without benefit
Okay, let me put this straight:

If you run them without max intelligence they will make mistakes. It is intentional that they make mistakes in these cases.
So reporting that they make mistakes like this when their intelligence isn't at max-level is not helpful.

They are not peeking. They have rolled to make a random move and then their random move made them run somewhere where they get reaction-fired at.

Weighted randomization will make them change from one cover-location to another but still not peeking. Only making them have less intelligence than 5 causes this behavior in my tests. For example inherit intelligence and they'll do what you describe. But if I set intelligence-mode to static and intelligence to 5 it simply doesn't happen.

If so, I also believe that BAI doesn't know how to plan something besides one turn. But if it was able to plan, for at least 2-3 turns ahead, BAI would know that 20 werevolves (100-120 TU?), even if cut by 80% by reaction fire/measures, will destroy whole squad on turn 3. 
I must admit that I'm confused about what you actually want me to do. Some time ago you were asking for the AI to randomly make bad moves and now you are asking for them to plan ahead several turns at once.

I'm actually tempted now to remove the random-mistakes-feature again and instead look into planning ahead. I actually have an idea for something like that. Right now the "communication" of the AI-units is limited to sharing vision. What they lack is the ability to plan a coordianted push.
For that they'd need to be able to identify that they are all in position. "In position", in that regard would mean that they are currently standing on the best cover-tile according to aggressiveness 2.
They'd need to put this information out for the others on their team to access and when enough of them have given their okay, they could perform a coordinated push where everyone comes out of cover and storms ahead at once.

Options that make sub-optimal moves would of course severely interfere with something like that in the sense that they'd have a hard time to get "in position".
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 13, 2023, 02:00:49 am
TUs were 100+ standing next to the enemy.  Play er is going back and for many times until TUs run out...  I have only see this issue with swarmoids so far.  Two things come to mind.  Swamoids have a very low chance to take melee damage which might be affecting the AI.
I just created a test-mission against Swarmoids.

I could reproduce the behavior in the AI, when I just gave them melee-weapons. And then I tried what happens when I play myself... Now my question is:

Are swarmoids even possible to be hit in Meele at all?

I used 4 dudes all slashing away at swarmoids with knifes and not getting a single hit. I suppose the AI calculates a 0 percent chance to hit which leads to them just alternate between positions to attack them from but to no avail.

My hypothesis is that my melee-dodge-calculation has a similar error in how it's applied in the AI as I had with the NoLosPenalty. I need to look up how this mechanic actually works and adapt it in the code.

It's a big difference between: "Very low chance to hit" and "It's impossible to hit." So I have to figure out which one applies.

Edit: Yup. That's it. I'm calculating it completely wrong. Dodge-chance does indeed depend on the angle from which the unit is attacked.

Edit 2: Even with the fixed formula, there still doesn't seem to be any chance to hit the Swarmoids.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Alpha Centauri Bear on December 13, 2023, 02:02:58 am
I must admit that I'm confused about what you actually want me to do. Some time ago you were asking for the AI to randomly make bad moves and now you are asking for them to plan ahead several turns at once.

It is not very clear for me why you want to make your AI worse?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 13, 2023, 02:30:01 am
It is not very clear for me why you want to make your AI worse?
Not "make it worse", add options to gradually nerf it in the context of making mods that are otherwise too difficult winnable again.

I added an option recently that can use the unit's intelligence to determine a chance ot the AI rolling to make a completely random move instead of what it otherwise would like to do.

But when I'm getting reports of dumb AI-behavior, which by testing myself I can determine having been caused by using this lower-intelligence-option, this is distracting from valid concerns about AI-mistakes it.

The fewer options there are to mess with, the more I can be sure that reported issues are valid and not the result of setting the option to something that deliberately produces sub-optimal play.

Edit: Have you received my E-Mail answering yours in regards to granting rights for a pull-request?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: 0xEBJC on December 13, 2023, 02:53:04 am

Edit 2: Even with the fixed formula, there still doesn't seem to be any chance to hit the Swarmoids.

I have hit swarmoids before with melee, but I forget how, thinking it was because the agent was enhanced with transformations, using a better armor like the synthsuit and probably using something like the electric club which does a calculation based off reaction for hit bonus.

Anyway, thanks for looking into this, I thought there was something more systemic possibly wrong with the AI which is why I pointed it out, didn't  know the AI calculates the hit change before determining to take a swing.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 13, 2023, 11:15:47 am
I thought there was something more systemic possibly wrong with the AI which is why I pointed it out, didn't  know the AI calculates the hit change before determining to take a swing.
Well, I'd say this behavior still hints to something systemic being wrong with the AI.
Their positioning-code still thinks it can attack them with melee and tries to reposition to do it.
The question is how this should be handled. I see 2 possibilities.

One is to teach the positioning-code about the hit-chance-reduction too, so it doesn't even try.
The other is to ignore the circumstance that they can't hit by internally limiting what they think the dodge chance reduces their accuracy too.

With armor-mitigation the AI does attack anyways, even if it calculates that their attacks will be fully mitigated by the armor.

So should they attack anyways or should they not even try and do something else instead?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 13, 2023, 11:47:01 am
Some time ago you were asking for the AI to randomly make bad moves and now you are asking for them to plan ahead several turns at once.
I'm actually tempted now to remove the random-mistakes-feature again and instead look into planning ahead. I actually have an idea for something like that. Right now the "communication" of the AI-units is limited to sharing vision. What they lack is the ability to plan a coordianted push.
Hi, Xilmi!
Yep. I forgetting that some moves are random. Please forgive me not counting this while making suggestions. Actually, what you have done with weighted randomization and "mistakes" should be considered as fun feature and difficulty reduction. Not to be confused with overall strategy. Please don't disable this feature, it's so cool and fun, and makes game beatable again, yet still very intriguing.

The following text is total mess of thoughts:
- I brought you the save of Church of Dagon HQ assault (jungle castle), which spawned super-lucky.
It's sort of open terrain mission vs 100 enemies.
During a XCF campaign this mission appears again and again, until you terminate the fraction overall. HQ assaults always appear at the beginning of the month, in case you want to test different layouts.
I assaulted Church of Dagon HQ's three times already this campaign, and 2/3 times craft spawned next to castle, making fight more dense. A line of snipers covered under Osprey and reaction-fire+shots turn by turn is usual strategy for this mission.   
- I didn't bring you yet the different mission: Black Lotus HQ, which has underground & many doors layout with same 100 enemies. All different from that CoD castle mission. It's is fairly tough with same-armor agents even if 60% bad moves enabled, because enemy always spawns close and good at melee. This type of missions also the reason why players were against option "AI avoids proximity grenades". Because it was tough even with vanilla AI. This time I wait till some better armors will be available to do it.
- Not pleading for balancing these, because it's BAI feature! What was easy -becomes harder. It's cool.
But when: what was hard - becomes easier - it should be considered for tuning.
- So this all about particular usefulness of smart melee units on open terrain. While ranged units can perform either basic defense and offense, melee units lack defense opportunity. So they are kind of pointless there while running around from cover to cover, except being sort of "distraction" targets, until they approach to attack positions. I noticed that on static Aggro2 they tend to keep same distance. Same time, - I didn't test inherited aggressiveness option with 7.12.1 yet. So it may be that whole thing I write here is pointless. But also, I don't know if aggressiveness levels in VAI and BAI are comparable. In particular it may be that Aggro4 of VAI should be compared to Aggro2 of BAI, not 4. I don't know. Yet, one more thing keeps me from enabling this option: if some bosses will rush for me, while major of troops will cover - it will disbalance the game (make it easier and abusier). So, static aggressiveness right now. 

- Other issue with current state of players suggestions, is that AI will behave different on different options enabled. So each report will be different. And there would be no similarity, until everyone plays on same Aggressiveness and with similar options. Which are most preferred? Somehow believe, that lvl 0 and 1 are not as popular as 2 & 3.

- One thing, though IMHO, still lacks: a feature to roll for aggressiveness prior a mission. +/- 1 to taken option will lead to even more random experience, which would be amazing. Like, you take Aggro2 and some missions can be Aggro1, or Aggro3. Also, randomization roll can be also cool: by default, you set 20% deviation. Yet' sometimes you get 40 and sometimes 0 (but personally I would prefer 20-40%). Or different mechanism. Please consider it.

- Now I'm curious, how a coordinated push (if ever to be implemented) will interfere with aggressiveness options?
- And if 20% and 40% randomization can still be in place while coordinated push takes place?
- And: can coordinated push be random feature, like 40% for mostly ranged units and 60% for mostly melee units ? Because if this strategy means "smart gather" and then implement Aggro4 - is also the strategy player can adapt to and make counter-measures.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 13, 2023, 04:05:13 pm
One more good save to train AI:
Osiron hacienda. Overhelming amount of enemy armed with machineguns, that prefer to stay indoors on aggressiveness 2, while only 5 agents are present.
Oh, I've got brilliant suggestion:
BAI can estimate the amount of enemies by fire frequency (if dark). And, if supposed amount of enemies is threefold lower, it can assault attackers more aggressively, and shoot at previously detected positions much more often.

This mission all I did is threw 3 flares to the closest walls, placed crouched agents in 25 tile range and pressed end turn, rarely aiming some going-to-wild guys and exposed targets.
Some clarification: it's not about BAI works bad or so, it's about some better strategies.
And also, pre-primed grenades are off, but still could be more of them, as only 3 happened (all missed)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Mr. Mister on December 13, 2023, 06:26:44 pm
This is feedback on the XCom Files Garage example mod, and not on the BOXCE itself:

Is it intentional that the Mudranger cannot use the garage? I'd actually find it balanced that it can vs its hilariously short range; currently you kinda have to intentionally build a base close to a long-term mission site if you want to dare bring the mudranger in, but if it could be stored in a garage maybe it'd make more sense to keep one in a 1x1 tile just for the eventuality that a mission spawns very close to the base.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: 0xEBJC on December 13, 2023, 09:30:34 pm
Well, I'd say this behavior still hints to something systemic being wrong with the AI.
Their positioning-code still thinks it can attack them with melee and tries to reposition to do it.
The question is how this should be handled. I see 2 possibilities.

One is to teach the positioning-code about the hit-chance-reduction too, so it doesn't even try.
The other is to ignore the circumstance that they can't hit by internally limiting what they think the dodge chance reduces their accuracy too.

With armor-mitigation the AI does attack anyways, even if it calculates that their attacks will be fully mitigated by the armor.

So should they attack anyways or should they not even try and do something else instead?

First I want to say thank you... your work is great... I appreciate your time and don't want you to think I'm 'expecting' anything other than 'gladly thankful'

I'm not sure how much effort it would be, but here's some thoughts / suggestions:
1.) Maybe something that the AI would 'learn' where if AI controlled units attack at first don't know that they will miss or if it's a 'dumb' actions then ignore learned behavior.  After x# of tries (how ever you decide) then the AI stops that behavior, i.e. melee against a target where melee doesn't work like attacking a tank with a knife and low stats that will never hit or do dmg.  'Learned' actions could reset across battlescape sessions, especially for enemies, or be retained for player AI or not.  Also, I think it would be helpful to warn the player if their isn't a good action to take and pause auto player AI... for example all player agents only have melee weapons equipped and there is an enemy like swarmoids.  Or should the AI recognize they can't melee a target and go 'looking' for a capable range weapon... and what if the battlescape was started with only melee weapons and the only enemy is something like swarmoids and no civilians of any other npc that contains a usable weapon to kill or incapacitate the swarmoid like enemy.

2.) or just do the calc to hit and if it's a 'smart' action then don't attack, and if no sufficient actions could be taken, then pause autoplay player ai and prompt with message about not being able to take a successful actions?


Also not sure if you have looked at the keyboard short cut for entering and exiting auto-play player AI (default ctrl+a) but I've noticed a 'significant' difference between pressing excape to goto the menu which works almost always under heavy cpu load of the auto AI, and when trying to press ctrl+a to stop the auto AI under heavy cpu load it doesn't pickup the command.  I'm guessing it's how it polling and looking for the keyboard shortcut during each iteration of computing the ai actions or possibly not storing the keyboard command until a specific iteration is completed to decide to exit the auto  ai.  Sorry for bring this up again, not trying to be annoying but this has been a significant issue for me trying to exit auto ai player action in the middle of a battle.  And which I thought it was interesting that pressing escape to menu didn't have the same issue.

On another thought about the hang with the keyboard shortcut, is there a way no matter how much the cpu is taxed with the AI calc, to give priority to the GUI, mouse and keyboard shortcuts or even moving the battlescape position?

Again, thank you!

Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 15, 2023, 03:28:18 pm
Crash report: perhaps, some minotaur-related stuff. Crashed on turn 3 and, after reload, on turn 4. Same, just kicks out of the game with no notifications.   
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 15, 2023, 03:58:29 pm
what you have done with weighted randomization and "mistakes" should be considered as fun feature and difficulty reduction. Not to be confused with overall strategy. Please don't disable this feature, it's so cool and fun, and makes game beatable again, yet still very intriguing.
I think weighted randomization is a neat feature. It provides variety and only decreases difficulty slightly if at all.
Intelligence below 5, however dramatically lowers the perceived competence of the AI and will disrupt their game-plan quite a bit.

because enemy always spawns close and good at melee
This is the thing. Out in the open with extenter and/or realistic-accuracy the enemies are even more in a disadvantage than without it. They get sniped from far away and their own ranged-attacks are dramatically worse. Low damage and low accuracy.

- So this all about particular usefulness of smart melee units on open terrain. While ranged units can perform either basic defense and offense, melee units lack defense opportunity. So they are kind of pointless there while running around from cover to cover, except being sort of "distraction" targets, until they approach to attack positions.
Yes. But... As I said like 3 times before. This does not happen when intelligence is maxed out. They do not "run around from cover to cover". They stay in cover and force you to get to them until they can actually attack.

- Now I'm curious, how a coordinated push (if ever to be implemented) will interfere with aggressiveness options?
- And if 20% and 40% randomization can still be in place while coordinated push takes place?
- And: can coordinated push be random feature, like 40% for mostly ranged units and 60% for mostly melee units ? Because if this strategy means "smart gather" and then implement Aggro4 - is also the strategy player can adapt to and make counter-measures.
Yeah, it's actually a problem. It won't really work if they are not on the same page when it comes to aggressivenes and randomness would also make it much less useful.
One of the biggest strategical issues is indicisiveness. Both on the level of a single unit and on the level of the whole team. If only a few on the team storm the enemies' fortress, they will all die and the rest will be left alone.

I recently had Trauson play again, the one who's strategy was supposed to be countered by the behavior of Aggressiveness 2. And watching him play convinced me that this approach is still the overall best strategy. Anything more aggressive than that can backfire and is only better on stronger units.
But aggressiveness 2 is never really "bad". A strong unit that could survive rushing  forward doesn't become useless if it plays a little saver. I'd say that on average it leads to the best results.

A push, even a coordinated one, can still go wrong if the situation was misjudged. Like in your mission with the werewolfes. I think they'd do better if they hide out of your line of sight and jump people that come close to them rather than trying to bridge a huge gap of clear land where they have a lot of guns pointed at them.

It's a situation like Zerglings vs. space-marines in Starcraft. If the space-marines form some sort of ball and the zerglings come from the same side, chances are they all die before even being able to attack. But if they unborrow right ontop of the marines the marines get slaughtered. So melee-units best strategy is to stay out of the line of side of ranged-units until those are close enough to be attacked.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 15, 2023, 04:18:58 pm
Crash report: perhaps, some minotaur-related stuff. Crashed on turn 3 and, after reload, on turn 4. Same, just kicks out of the game with no notifications.   
I can't even load this save-game at all without crashing.
Getting a huge amount of loading-errors in the log.

I can still load other games from you, so I'm not sure whether my crash on load is related to your crash.

Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 15, 2023, 04:29:23 pm
I can't even load this save-game at all without crashing.
Getting a huge amount of loading-errors in the log.
There's one more for different turn.
UPD it sometimes doesn't crash, I have no particular idea what it can be.

Quote
Trauson play
Can you share the link? I wonder to see
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 15, 2023, 04:49:03 pm
There's one more for different turn.
Crashes just the same. It might be related to mods you are using which I don't have.
Can you share the link? I wonder to see
I haven't uploaded it.
Does anyone know of a good editing-software, that doesn't take ages to recompress after cutting? All I want to do is just throwing away the last 5 seconds of the video. But with everyhting I tried that requires a very long process.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 15, 2023, 04:55:39 pm
Crashes just the same. It might be related to mods you are using which I don't have.I haven't uploaded it.
Ah, yes. Thank you, haven't considered this.
I have two mods:
Natasha morozova join https://openxcom.old.mod.io/natasha-morozova-join-for-x-com-files
and XCF arsenal additions https://mod.io/g/openxcom/m/x-com-files-additions
Also, there one more save for turn 5, JIC

Quote
Good editing software:
Depends on the platform.
On windows I use Premiere Pro, on Android YouCut video editor (it takes a while, though, to apply changes)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 15, 2023, 06:16:02 pm
Natasha morozova join https://openxcom.old.mod.io/natasha-morozova-join-for-x-com-files
and XCF arsenal additions https://mod.io/g/openxcom/m/x-com-files-additions
Installing these helped. I can now load the game at least.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: 0xEBJC on December 15, 2023, 07:43:06 pm
Crashes just the same. It might be related to mods you are using which I don't have.I haven't uploaded it.
Does anyone know of a good editing-software, that doesn't take ages to recompress after cutting? All I want to do is just throwing away the last 5 seconds of the video. But with everyhting I tried that requires a very long process.

Here's a good list of software that I use for video editing:
https://obsproject.com/wiki/Post-Production-Tools-you-can-use

No matter how you look at it, cutting a portion off of a video, I've always had to re-encode the entire video.  Maybe Handbreak could do that? I use it to legally back up DVDs I own. It also might have features to cut or remove a section of the video...but I haven't looked into it.
https://handbrake.fr/

My preferred tool is Camtasia, I have an older version which works great for post production video editing and is fairly fast. Downside is I had to pay for it, it's not free. I've tried the demo of their newer versions and think they are too bloated and also are too expensive.

You can download older versions here, but I'm not sure if they'd still sell licenses for older versions?
https://www.techsmith.com/download/oldversions

Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 15, 2023, 11:16:02 pm
Installing these helped. I can now load the game at least.
But I couldn't reproduce a crash once I had all the mods. I guess I also might need your options.cfg in order to make sure all the settings are the same.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 15, 2023, 11:52:08 pm
But I couldn't reproduce a crash once I had all the mods. I guess I also might need your options.cfg in order to make sure all the settings are the same.
Ok. Here it is.
On your side it doesn't crash? I had it two times out of 4 tries, on third and fourth turns of AI.
Somewhat inconsistent decision making)
Perhaps randomization options may affect it too.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Alpha Centauri Bear on December 16, 2023, 04:21:11 am
I have adapted my mod for BAI engine and testing it now. Some initial feedback.

AI acts like player would: spots an enemy and kills it with all firepower. Which is pretty neat. Taking cover, smoke, motion detectors, remembering enemy positions, anticipating enemy move is more important now. It becomes true game of intellects like chess. Amazing. Thank you for this mod and you hard work on AI.

Numbers of forces are extremely important now. Fighting larger USO is noticeably more difficult and terror missions are a slaughterhouse. I don't even bother going to terror sites without personal armor. And even with personal armor I encounter serious casualties.

Smoke helps against small number of enemies located in one direction (small USO recovery). For large number of opponents I have to surround my troops with complete circle of smoke plus make sure I extend it high enough to be hidden from high views as well. Still somehow they manage to see through some holes in smoke and notice at least one of my units and then unleash the hell on it until its dead. This is especially pronounced during terror mission when deployment location is surrounded by aliens from all sides including some at second-third floors. Even continuous wall of smoke does not help in these cases.

Due to AI being smart the battle is most intense at the beginning when they both sides have maximal number of units. As soon as alien strength is broken it makes it somewhat easier to hunt for last ones. Same is true when player team strength is broken. Then it is wiser to just bail out. For terror missions it turns into absurd: aliens cannot even let me get out of the transport to establish smoke screen at times. And if I dare to get out without smoke screen hoping to set it up next turn, they kill half of my army effectively ending my assault. First few turns and luck in transport positioning defines the battle.

They shoot across whole map with sonic and arch weapon (deep ones). True that players do the same at their leisure. However, when number of units is high at each side, spotted unit is dead same turn. Being spotted becomes the biggest fear. No amount of armor helps as they keep shooting and throw grenades until unit is dead. With PWT launchers they just slaughter X-Com troops in few turns. Looks like there is threshold number of aliens beyond which it is impossible to fight them.

They use up ammo and grenades extensively. They also quite often carry primed grenades effectively wiping out all dropped inventory. This seriously impact recovery income.



Some thoughts of what can be improved regarding the above. Not the suggestion for this mod. More of thinking out loud. Maybe I can do this in mine.

Probably reduce involvement of far units into the shooting. Either introduce max shooting distance or let aimed shot precision to diminish as well with extender accuracy.
Maybe also reduce accuracy when shooting target that is not directly visible (radio targeting). Maybe further reduce accuracy when shooting through smoke/fire and the like? This way smoke may play less role in covering but more role in blurring units and give them survival chance.

Grenades destroying fell inventory is fine. I can probably just increase item cost to compensate.

Maybe give AI and X-Com initial spacing. Do not place them immediately next to each other at turn one? Give both parties chance to create a formation. Otherwise, Xarquid or Biodrone hanging right across transport door will put a stop to any attempt to disembark.

Rework smoke mechanics. Make it more protective in all direction including height.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: jnarical on December 16, 2023, 05:34:11 am

They shoot across whole map with sonic and arch weapon (deep ones).
There’s a known issue with arc weapons. Did you have a feeling that deep ones are too deadly in terms of accuracy? Did they ever miss?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Alpha Centauri Bear on December 16, 2023, 06:24:44 am
They miss very often. Like one of three shots hits. However, having all the TU shooting from any position on the battlefield, they can shoot 3-4 times. Time this by number of them shooting at the same target. Some inaccuracy is irrelevant.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 16, 2023, 12:45:06 pm
On your side it doesn't crash? I had it two times out of 4 tries, on third and fourth turns of AI.
I tried 4 times and unfortunately couldn't reproduce the crash despite using your config. :\
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 16, 2023, 12:52:36 pm

Some thoughts of what can be improved regarding the above. Not the suggestion for this mod. More of thinking out loud. Maybe I can do this in mine.

Probably reduce involvement of far units into the shooting. Either introduce max shooting distance or let aimed shot precision to diminish as well with extender accuracy.
Maybe also reduce accuracy when shooting target that is not directly visible (radio targeting). Maybe further reduce accuracy when shooting through smoke/fire and the like? This way smoke may play less role in covering but more role in blurring units and give them survival chance.

Grenades destroying fell inventory is fine. I can probably just increase item cost to compensate.

Maybe give AI and X-Com initial spacing. Do not place them immediately next to each other at turn one? Give both parties chance to create a formation. Otherwise, Xarquid or Biodrone hanging right across transport door will put a stop to any attempt to disembark.

Rework smoke mechanics. Make it more protective in all direction including height.
A lot of these things are possible with the available options:

Involvement of far units shooting => Put "Targeting behavior for Brutal AI" to 1 and they won't do it anymore.
Reduced accuracy without vision is a setting that can be set in Mods. It's the NOLosPenalty we recently talked about.
Grenades destroying inventory => Disable "Allow Brutal AI to pre-prime grenades". However, this also vastly impacts their playing-strengths as not prepriming makes grenades a lot less useful.
Smoke meachanic => This is tied to the "Explosion height" option. This way smoke can cover units in several layers. It maybe could be made separate from explosion-height.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 16, 2023, 04:14:40 pm
I tried 4 times and unfortunately couldn't reproduce the crash despite using your config. :\
Yep, I ended the mission with no more crashes too. I'll report if it appear again. 
Though, Inconsistent crashes means that AI differentiates behavior. Which is ultimately good.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Alpha Centauri Bear on December 16, 2023, 05:57:36 pm
A lot of these things are possible with the available options:

Involvement of far units shooting => Put "Targeting behavior for Brutal AI" to 1 and they won't do it anymore.
Reduced accuracy without vision is a setting that can be set in Mods. It's the NOLosPenalty we recently talked about.
Grenades destroying inventory => Disable "Allow Brutal AI to pre-prime grenades". However, this also vastly impacts their playing-strengths as not prepriming makes grenades a lot less useful.
Smoke meachanic => This is tied to the "Explosion height" option. This way smoke can cover units in several layers. It maybe could be made separate from explosion-height.

You are right these things can be disabled. However, my point is not to disable them. I like them. I just want the battle to last somewhat longer instead of being few turns roll. I also like AI to be able to do everything human can. Dumbing it down is not an option for me.

For far shooting I use extender accuracy dropoff for all shooting types including aimed and all weapons are affected including terrorist special weapons.

Yes, I thought about vision accuracy penalty but with the accuracy dropoff it is less of the concern.

I am fine with grenades destroying inventory. This is merely economical impact that can be offset by cranking cost of alien stuff up.

I have explosion height = 2 in my mod. Still does not help at times. Need to work on it a little more. Actually, this is a big question how explosion height affect smoke generation.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 16, 2023, 08:52:50 pm
Probably reduce involvement of far units into the shooting. Either introduce max shooting distance or let aimed shot precision to diminish as well with extender accuracy.
All shot types  (snap, auto and aimed) are customizable with formulas.
If you don't like a weapon to be precise in your mode - just set formula you like.
Like Dioxine balanced weapons for a year or so, and then 5 years took various suggestions from people who play X-Piratez. And still introduces new weapons and tactics for each update of mod.
 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 16, 2023, 10:08:50 pm
Yep, I ended the mission with no more crashes too. I'll report if it appear again. 
Though, Inconsistent crashes means that AI differentiates behavior. Which is ultimately good.
I read on Rosigma-discord that this might be related to the build-version being 32 Bit and the megamods running out of memory. Me always running from Editor could explain that I don't have this. Could try what happens with compiled version.
He uses this program: https://www.techpowerup.com/forums/threads/large-address-aware.112556/
there are others, but this one has GUI.

Which apparently kinda turns it into a 64-Bit-version.

When I try to compile in 64-Bit I get an error while linking yaml-cpp.lib.

I should try to figure out what I have to do in order to be able to build it as 64-bit-version in order to prevent these kinds of errors.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 17, 2023, 01:09:43 pm
FYI:

There now is a sub-forum for this mod:

https://openxcom.org/forum/index.php/board,46.0.html
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Abyss on December 17, 2023, 07:50:46 pm
FYI:
There now is a sub-forum for this mod
Yep, Alpha Centauri Bear inspired me to make such suggestion to forum owners.
All is good, even if changes way different than intended) 
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Alpha Centauri Bear on December 17, 2023, 10:24:51 pm
Just curious if Windows 64 bit has any benefits? The 32 bit version works completely fine for me.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on December 18, 2023, 03:07:46 pm
Just curious if Windows 64 bit has any benefits? The 32 bit version works completely fine for me.
Here's a quote from 40k-discord that explains why I've been trying to build one:

"The problem with not having a 64bits version of a BrutalAI exe is that the openxcom megamods (like 40k+rosigma are) features truckloads of pictures/images/etc.. that respective sizes are very likely adding up with playtime and make the memory used ingame flirting with the 32bits executable limitation :
https://en.wikipedia.org/wiki/2_GB_limit
Something not happening in vanilla openxcom of course due to everything being small in file size."
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Bluedrake42 on February 07, 2024, 07:07:58 pm
Been playing this mod on 7.11.1

Some suggestions and feedback.

1. When setting aggressiveness for individual soldiers, their aggressiveness settings don't stay persistent when reloading a save game or between missions. It would be great if it was possible to setup aggressiveness states that were permanent... so that way I don't have to reset them every time I load a save or embark on a new mission.

2. Have you thought about also applying AI to interceptors to automate the intercept/dogfight process? I would be interested in potentially automating manufacturing, purchasing, and research options too. Could potentially make the entirety of XCOM and "idle" strategy game which is appealing to me.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Kozinsky on February 08, 2024, 09:53:17 am
2. Have you thought about also applying AI to interceptors to automate the intercept/dogfight process? I would be interested in potentially automating manufacturing, purchasing, and research options too. Could potentially make the entirety of XCOM and "idle" strategy game which is appealing to me.

If you automate all aspects of the game, then what should the player do? Just sit back and watch the game play itself? :)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on February 08, 2024, 11:08:34 am
Been playing this mod on 7.11.1

Some suggestions and feedback.

1. When setting aggressiveness for individual soldiers, their aggressiveness settings don't stay persistent when reloading a save game or between missions. It would be great if it was possible to setup aggressiveness states that were permanent... so that way I don't have to reset them every time I load a save or embark on a new mission.

2. Have you thought about also applying AI to interceptors to automate the intercept/dogfight process? I would be interested in potentially automating manufacturing, purchasing, and research options too. Could potentially make the entirety of XCOM and "idle" strategy game which is appealing to me.
I don't think 7.11.1 already had configurable individual soldier-aggressiveness. I assumed they were permanent and stored in the soldier-object. But this code is not from me, so I'll have to check. I just recently changed the default to 3 as otherwise it's very likely they stall.
If they don't remember the value they were changed to, I'd consider it a bug anyways.

The soldier automation was mostly included for testing-purposes, so I don't have to play out all missions manually. It also was a low-hanging-fruit as I just had to make it possible to use the already existing alien-AI for them anyways.
Threre is no Geoscape-AI for the aliens and if there were, it would probably be playing a very different game to the player anyways. So modifying the entire game to play itself really isn't something I'm willing to do.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: eXalted on February 12, 2024, 11:29:14 pm
I've been having so much (a little masochistic) fun with the mod, nice work!

Wanted to signal a small issue when the "Alternate craft equipment management" option is enabled. It seems the columns are slightly off:
(https://i.imgur.com/Mpe6e4w.png)
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on February 13, 2024, 11:06:05 am
I never tried this feature. Gotta compare it with how it works in regular OXCE. I vaguely remember someone making a CR related to right-aligned text-orientation to make numbers better comparable.  Guess he might have overlooked this part.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Alpha Centauri Bear on February 14, 2024, 01:31:13 am
Must be my "number right alignment" feature. Need to make more space for last column.

From the other hand, it seems that the number could either have or not have slash with following difference. In this case I am not sure it needs to be right aligned at all. Yes, it will look misaligned for 1 and 2 digit numbers mix but with this slash character they are not numbers anymore but strings.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Reuged on March 23, 2024, 08:27:08 pm
apparently it seems has a bug on "powerRangeReduction" hook witch the algorithm doesn't work properly, as you can see the chainsaw has the powerRangeReductionset set to reduce 99 power points after the 3rd tile however the weapon's power still remains, i don't know it is a setup you can tweak on the engine but this happens with any weapon within any mod witch has setup to to trigger the power Reduction
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on March 23, 2024, 08:57:33 pm
apparently it seems has a bug on "powerRangeReduction" hook witch the algorithm doesn't work properly, as you can see the chainsaw has the powerRangeReductionset set to reduce 99 power points after the 3rd tile however the weapon's power still remains, i don't know it is a setup you can tweak on the engine but this happens with any weapon within any mod witch has setup to to trigger the power Reduction
This doesn't sound particularly AI-related. Does it work as intended in regular OXCE?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Reuged on March 23, 2024, 09:13:00 pm
100%, i can test on another mod if you want to
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on March 23, 2024, 09:23:49 pm
Are you using the "Realistic accuracy and cover-system" option?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Reuged on March 23, 2024, 09:28:36 pm
no, it has to?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on March 23, 2024, 09:32:21 pm
no, it has to?
No. Just trying to rule things out.

I see you are using the absolute latest version of OXCE 7.12.2.
I haven't released a version yet that is updated to this.

Did this work properly in OXCE before 7.12.2? Is this functionality related to "y-script"?
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Reuged on March 23, 2024, 09:35:36 pm
you mean on 7.12.1 ???
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Reuged on March 23, 2024, 09:55:54 pm
there
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on March 23, 2024, 09:58:09 pm
you mean on 7.12.1 ???
I'm trying to figure out whether this could be something that was just fixed in the latest version of OXCE. If so, I could stop trying to figure out what's going on here. Other than that, I've never heard of this kind of feature before and am also pretty sure I haven't made any changes to code that should mess with it.

However, BrokenRegistry probably has.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Reuged on March 23, 2024, 10:13:07 pm
maybe the targeting calculations is mess up when you re-work the targeting system cuz whenever i move the mouse off the limits, the values decrease to zero as intended but it quickly come back to original values
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Xilmi on March 23, 2024, 10:29:05 pm
maybe the targeting calculations is mess up when you re-work the targeting system cuz whenever i move the mouse off the limits, the values decrease to zero as intended but it quickly come back to original values
I think I found it. It's not the targeting-calculations itself that are faulty but the cursor-drawing. There he replaced the line:

totalDamage -= rule->getPowerRangeReduction(distance * 16);

with

totalDamage -= rule->getPowerRangeReduction(distanceTiles * 16);

In this case "distanceTiles" is supposed to be the same that "distance" previously was. However, "distanceTiles" is initialized with 0 and only calculated for the accuracy-dropoff-part wheras distance was initialized like this:

int distance = (int)std::ceil(sqrt(float(distanceSq)));

I think that simply initializing distanceTiles the same way distance was initialized should fix the issue.
Title: Re: [SOURCEMOD] Brutal-OXCE 7.12.1
Post by: Reuged on March 23, 2024, 10:33:46 pm
 :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) cool let's try it out