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

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
[SOURCEMOD] Brutal-OXCE 7.12.1
« 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.
« Last Edit: December 10, 2023, 12:34:54 am by Xilmi »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.0
« Reply #1 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.

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.1
« Reply #2 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?

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.1
« Reply #3 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.

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.1
« Reply #4 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.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.1
« Reply #5 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.

Offline N7Kopper

  • Captain
  • ***
  • Posts: 61
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.1
« Reply #6 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.
« Last Edit: January 01, 2023, 11:40:09 am by N7Kopper »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.1
« Reply #7 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.
« Last Edit: January 03, 2023, 12:20:59 am by Xilmi »

Offline EttyKitty

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.2
« Reply #8 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.
« Last Edit: January 03, 2023, 09:23:07 am by Sayurime »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.2
« Reply #9 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.

Offline EttyKitty

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.2
« Reply #10 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. 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 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.
« Last Edit: January 04, 2023, 06:17:13 am by Sayurime »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.2
« Reply #11 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.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.2
« Reply #12 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.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.2
« Reply #13 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.

Offline EttyKitty

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: [SOURCEMOD] Brutal-AI 2.1.2
« Reply #14 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.