<< Back to Warzone Classic Forum   Search

Posts 1 - 7 of 7   
Fixing a bug with random AI: 2020-04-26 07:39:16

Fizzer 
Level 64

Warzone Creator
Report
Lepanto31 made a cool puzzle level and even gave away a coin prize to the first player to clear it: https://www.warzone.com/Forum/417650

When I was looking at this level, I noticed that the AI was always playing its sanctions cards and diplomacy cards on the human player. This surprised me, since the AI doesn't treat the human any different from another enemy AI (except bosses). The AI sanctions and diplomacies based on how many armies it sees on its borders. In this level, there were neutrals separating all players, so the armies on the borders were always 0. So why was it targeting the human?

Well I dug into it and found a bug. Since the AI had no armies on its border, it should have simply selected a random target, but instead it selected the first target in its list of players (due to a <= check that should have said <). In the case of community levels, the human player got inserted first so they were always the top player in the list. This could even vary depending on platform or other factors, since it's enumerating a hash table and the order it enumerates is undefined and implementation dependent.

I think it is necessary to fix this bug to keep the AI fair. The intent is not to break puzzle levels, but rather to ensure fairness. The order of the list of players will be irrelevant after this fix, which is important for ensuring fairness where it matters, such as in multi-player. This could have an effect on single player levels that depended on the old behavior, like Lepanto's level, but it is a necessary fix.

This bug will be fixed in an upcoming update.

Edited 4/26/2020 07:39:51
Fixing a bug with random AI: 2020-04-26 09:38:17


Beep Beep I'm A Jeep 
Level 64
Report
Hey Fizzer, maybe you can make a checkbox or something for SP level makers to choose between your fair version and a version that forces the AI to play the card on the human player?
It would be sad to just kill a lot of good puzzles like that.
Fixing a bug with random AI: 2020-04-26 09:54:59


krunx 
Level 63
Report
The AI is not used for multi-player games, anyway. It is simply not strong enough.

I think AI made a good suggestion about a checkbox for the SP levels, in which such stuff is extremly important.
Fixing a bug with random AI: 2020-04-26 11:07:25


Viking1007
Level 60
Report
Yes, like AI said, it would be sad to kill so many fun and challenging puzzles that I and many others enjoy playing.

So, a checkbox for the SP levels sounds fine, since lots of players would enjoy the challenge more than what the actual level would be without the bug.
Fixing a bug with random AI: 2020-04-26 11:52:25


alexclusive 
Level 65
Report
AI made a very important point!
Fixing a bug with random AI: 2020-04-26 11:59:32


TBest 
Level 60
Report
This bug will be fixed in an upcoming update.

Sometimes a bug is a feature. Having the AI target a human in SingelPlayer feels more fair and gives better level design.
Fixing a bug with random AI: 2020-04-26 12:23:26


Math Wolf 
Level 64
Report
Makes a huge difference for the "Playing Favorites" level in Single Player, maybe it will now be more feasible to get a gold star.
Posts 1 - 7 of 7