View Full Version : Bug AI doesn't buy/deploy mines and obstacles
edox
July 5th, 2023, 04:40 PM
Hi,
playing with the latest patch, I noticed a weird thing: during a defensive battle, the Player 2 AI doesn't buy minefields or obstacles. This happens even if the opponent isn't part of the Ottawa Treaty, or when the Treaty didn't even exist! With the same Year/nations matchup, the AI buys minefields as it should if set to Player 1.
I have made many trials over a wide range of years and with several nations, letting the AI do the buying and deploying.
Has any other noticed it? Is there any workaround? It means that in any campaign, the AI opponent (being the Player 2) won't ever buy mines.
Mobhack
July 5th, 2023, 05:09 PM
AI player does not always buy field defence points, its a random choice to buy a batch as it loops through the purchase code many tmes over. A chance which can result in a "nope" for the choice - thus perhaps wasting any points the attacker has invested in breaching kit and engineers.
So, sometimes none may be bought, sometimes quite a lot and usually at least some. It's that random number thing again.
Same as it doesent always buy planes even if it has flights allocated to it, thus wasting any player points spent on AAA in anticipation of enemy air. Nor does it always buy off-map batteries (may buy a heavy mortar platoon or rocket troops instead).
The AI purchase code is complicated and based on many factors (e.g. it may like SS troosps for a given battle date versus a particular opponent, e.g. Canadians in Normandy)
So not a "bug" - but a feature. You just saw one of the times that after many passes through the buy loop, it has said "no thanks" to all mine buy choices.
edox
July 5th, 2023, 05:31 PM
Unfortunately, I think that it might be a real issue.
Just to be sure, I just did another test run. Freshly installed and patched free-version of SPMBT: USA vs USSR 1967, letting the AI do both sides' buying/deploying.
USA (P1) assaults USSR (P2): the USSR AI doesn't buy/deploy a single mine in 10 consequent tries (!).
USA (P1) defends against USSR (P2): the USA AI buys/deploys mines every single game, in 10 consecutive trials.
Added to the dozen or so trials I did earlier, with several nations and different eras, I think chance must be ruled out. Perhaps it's an issue with my system, but it's still happening with a fresh install. It didn't happen until the v16 patch (I did a couple of trials per patch while reinstalling them).
Suhiir
July 5th, 2023, 05:52 PM
Run into a similar issue.
Working on revising scenario 37 and I can spend points on defenses/mines for North Korea BUT when I go to the deployment screen to place them the points I'd spent have reset to zero (0) so I cannot place anything, trenches, wire, mines.
And I seriously doubt North Korea signed the treaty (but I'm to lazy to look up if they did).
edox
July 5th, 2023, 06:12 PM
Ever weirder: just found that if you go to the editor and deploy some mines as the P2 in a random scenario, or if you load a scenario that already has some mines for the P2, then the next time you set up a random battle (but only for one game) the P2 AI finally buy mines... and it seems that the amount of mines bought in this new random battle is directly linked to the number of obstacles build-points available in the scenario just before opened in the editor (!).
It's as if the AI is "remembering" build points from another scenario: if I go to the editor and spend 20 points buying mines, then exit, the next random battle the defending P2 AI will roughly deploy 20 points of mines. If I spend 200 in the editor, the random battle P2 AI will deploy 200 in the next game.
Mobhack
July 5th, 2023, 07:43 PM
Looks like there may well be a real bug here.
I tred 20-25 WW2 AI-everything assaults with random opponents/defenders and some where I exited the game between tries, some after another attempt (to see if there was any "memory" of preious mine points bought).
Way too many of the battles had no field defences!
So looks like it needs thouroughly investigating - though IIRC, absolutely nothing has been changed in the AI purchase code. So if it is somethingthen its not that!. Defenders with a no-buy of engineer stores should be a very rare thing, I was seeing say 50% of the pairings being mines-clear.
Weird.
DRG
July 6th, 2023, 07:47 AM
This issue appears to be intermittent or caused by some unknown preference setting perhaps
Date in all cases is June 2024
I just let the AI set up two games Ukraine vs Russia with Russia defending and both times the Russian AI bought mines......but ONLY mines
Tried again with South Korea vs North Korea with the North defending and the AI bought an abundance of mines but no wire or DT's
The next test was something a little different. Albania vs Albania and in that one mines AND wire was bought
The next was the Swiss assaulting USMC. No mines etc were bought but as noted, sometimes that does happen
Then I tried China vs China and no mines etc were bought
I exited the game and tried again China vs China and this time mines and wire were bought
I tried the Swiss assaulting USMC again and USMC did not buy mines etc
USMC assaulting GB ......The GB AI did not buy mines etc
Russia Assulting Ukraine did not generate mines etc
Ukraine Assualting China did not generate mines etc
Restating the game I tried the original UKR vs Russia test... Mines and Wire bought
What I did not see any of was DT's in any test so it's hit and miss if mines are bought or not but it always was. We need to look into this but my suggestion to try is if you seem to be into a No mines etc rut try rebooting your computer. The game uses a random number generator to ensure the same thing does not happen over and over but sometimes in one sitting that CAN generate the same thing over and over becasue of the RNG
DRG
July 6th, 2023, 11:39 AM
Restarted the computer after 3 hours--EDIT ... all of these tests P2 is the defender
The first game was Pakistan V Georgia with Georgia defending and mines and wire were bought
Second test game Tanzania vs China and the Chinese AI bought both mines and wire
Third was Russia Assaults Germany and the German AI did NOT buy anything
The fourth game was the reverse Germany Assaults Russia..... the Russian AI bought mines and wire
The fifth was Slovkia assaults China.......the Chinese AI bought Mines.. no wire this time
Finally Mozambique assaults Kenya... The Kenyan AI bought mines so I am NOT finding the "bug" others seem to be finding. What I do see is a total lack of DT's being bought but as for no mines/wire......... most times it buys, and sometimes it does not..... the sometimes does not is normal
All battles were set up as before June 2024
Suhiir
July 6th, 2023, 03:29 PM
Want a copy of my currently "in progress" Wolmi-Do scenario where I can purchase defenses/mines BUT then I swap to the deployment screen they're not available?
DRG
July 6th, 2023, 06:49 PM
Sure, post it and I'll take a look
Suhiir
July 7th, 2023, 04:36 AM
Sure, post it and I'll take a look
Note:
This IS NOT a completed working scenario just a test case for the mine issues.
DRG
July 7th, 2023, 07:46 AM
Do you mean these points ?
https://i.imgur.com/Xvs6nAL.png
https://i.imgur.com/ebjOBxv.png
and these mines / DT/ wire?
https://i.imgur.com/n8JIagX.png
What's the problem? Once again I am NOT finding the "bug" others seem to be finding.
Anyone else who wants to check this please do. I clicked NK deploy, then the mines/DT/wire button and 537 points were available then I started scattering mines etc. around.
I don't see the problem which only means I don't see the problem using the master games EXE in the master game ( which IS the same EXE everyone who has DL'd V17 will have ). If after this the problem you see still exists then I'll need a screenshot showing what you are seeing
zovs66
July 7th, 2023, 11:56 AM
I don't see any bug or problem.
Are we just talking about going into the Editor with this scenario and placing mines or wire?
No issues for me:
https://i.imgur.com/lyAKbjZ.png
Suhiir
July 7th, 2023, 04:21 PM
Do you mean these points ?
Odd.
OK ... no clue ... maybe restarting my PC and/or WinSPMBT "fixed" the problem :dk:
Karagin
July 7th, 2023, 05:28 PM
Would the issue be if the new "mine" icon is not being used?
DRG
July 7th, 2023, 06:35 PM
Would the issue be if the new "mine" icon is not being used?
No code was changed and the icon location for the respective number of mines was not changed so the answer is no.
That is the same Icon file as the original with the four mine symbols changed but not their location in the file........again NO CODE was changed to display them.
It's a simple swap just like we have used in SPWW2 for the historic German flag used in WW2 and the non-historical cross version. No code changed there either just the icon in the file
Dion
July 9th, 2023, 05:13 PM
Whenever I play, the AI lays mines and deploys obstacles, but then again most people think AI stands for artificial intelligence, but it really stands for automatic idiot, so you never really know for sure.
Sorry If I offend anyone that goes by the name of AI. AI is computer talk not people talk.
dTerm
September 22nd, 2023, 06:57 PM
Sorry for digging this up again.
I spend the afternoon running about 50 random assault games via the battle generator, all had different opponents and were set at 'June 2024' with player 2 being the defender. In only 4 games the defender had deployed mines, never ever wires/DTs. From the 10 games I let player 1 defend, all had mines/wire/DTs being deployed. I restarted my computer three times in between.
Afterwards I did a couple more games, and set 'human deploy' to check whether build points had been bought. Player 1 had always spend 80 points, player 2 always zero. Map size was 50x100.
So this brings up two questions for me.
In the manual it is stressed to let player 2 be played by AI, when designing scenarios via the editor. Is this because of underlying programm behaviour, or merely as convention?
Does this 'rule' also apply to random games via the battle generator? My understanding has always been, that I can freely choose here, which side would be played by me, and the other by the computer.
Mobhack
September 22nd, 2023, 07:39 PM
If you have no plans to play about with the map, scenario length etc. then by all means let player 1 be the AI in a random battle.
Otherwise - the view map function will only let you see whatever the AI player 1 randomly took as the battlefield with the V hexes fixed and so forth.
dTerm
September 23rd, 2023, 07:26 PM
If you have no plans to play about with the map, scenario length etc. then by all means let player 1 be the AI in a random battle.
Otherwise - the view map function will only let you see whatever the AI player 1 randomly took as the battlefield with the V hexes fixed and so forth.
Not that big an issue to me, I have used the Battle Generator mainly for small casual games in the past.
If I care for specific terrain features/layout, I can still generate a random map via the Scenario Editor and load it up as a custom map in the battle setup. Makes an OK enough workaround for me. :)
vBulletin® v3.8.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.