<< Back to Programming Forum   Search

Posts 1 - 7 of 7   
Can AIs pick us less?: 2019-06-10 22:07:40

unɐq ǝɔuɐɥƆ
Level 51
Report
When I was just making a level, I am getting a problem because I do not want an AI to sanction or Diplo me, and that was a little bit of a problem. As always, if there is a card, they will pick me all the time as the top priority.
Can AIs pick us less?: 2019-06-10 22:10:53

Fizzer 
Level 64

Warzone Creator
Report
The AI sanctions the player they feel is the biggest threat to them. If it's usually sanctioning you, then it means you probably have more armies on its borders than its other opponents.

The AI does not target the human player. It treats all opponents equally.

Also worth nothing is that, whenever an AI sanctions you, you are more likely to notice since it affects your income. If the AI sanctions another AI, you probably won't even notice that they did so. So even if the AI sanctioned completely randomly, it's likely you'd feel like they were only targeting you. To combat this effect, you should look at history once the game is over and count the number of times each player got sanctioned. If you do this, I suspect you'd find that you're not actually being targeted.
Can AIs pick us less?: 2019-06-11 07:58:17

unɐq ǝɔuɐɥƆ
Level 51
Report
I actually did it, but Everyone has the same income. I get picked in all 15 attempts I did.
Can AIs pick us less?: 2019-06-11 10:00:36


ps 
Level 61
Report
test replaying the game and not showing your armies on the frontline, if the AI still targets you.
Can AIs pick us less?: 2019-06-15 08:14:53


Timinator • apex 
Level 67
Report
Currently trying to gold-star the last "official" SP-level and i got sanctioned 7/8 times so far without ever bordering the AI that sanctions me. The AI has no team, so it has no extra vision due to teammates.

Are you sure AI doesn't prefer the player over AI @Fizzer?
Can AIs pick us less?: 2019-06-15 15:30:47


TBest 
Level 60
Report
  private static bool PlaySanctionsCard(BotMain bot, CardInstance card)
        {
            var canSanction = bot.Players.Values.Where(o => o.State == GamePlayerState.Playing && bot.IsOpponent(o.ID)).Select(o => o.ID).ToList();
            if (canSanction.Count == 0)
                return false;

            var sanction = bot.UseRandomness ? RandomUtility.WeightedRandom(canSanction, o => bot.WeightedNeighbors[o]) : canSanction.OrderByDescending(o => bot.WeightedNeighbors[o]).First();
            AILog.Log("PlayCards", "Sanctioning " + sanction);
            bot.Orders.AddOrder(GameOrderPlayCardSanctions.Create(card.ID, bot.PlayerID, sanction));
            return true;
        }

https://github.com/FizzerWL/WarLight.AI/blob/master/Prod/MakeOrders/PlayCards.cs
Can AIs pick us less?: 2019-06-15 16:09:28

Fizzer 
Level 64

Warzone Creator
Report
TBest's code is correct - this is the exact logic the AI uses when sanctioning. You can see it never even checks if the player is human, only if it's an opponent.

@Timinator: That level has a bunch of 100000 wastelands. Go back in history to the turn where the AI sanctioned you, switch to that AI's perspective, and count how many armies it can see from each of its opponents. Maybe it can't see any other opponents?
Posts 1 - 7 of 7