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/417650When 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