<< Back to Programming Forum   Search

Posts 1 - 20 of 42   1  2  3  Next >>   
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 07:56:10

Fizzer 
Level 64

Warzone Creator
Report
For WarLight's new AI, I am brainstorming algorithms that could be used to allow it to know when and where to play some types of cards.

First off, the AI will never play cards when teamed with a human teammate (just like it works now). So you don't need to worry about an AI taking your cards. The assumption is that humans know best, so the AI will defer all cards to them unless it's in a situation where it must play cards to commit.

Assume you're facing an AI which is either alone or on a team with other AIs, and they have one of these cards:

- Blockade Card
- Emergency Blockade Card
- Diplomacy Card
- Bomb Card
- Gift Card (assume it's on a team)

I need to try to come up with algorithms to determine when and where to play these cards.

Does anyone want to provide input at this? You don't need to know how to program -- pesudocode is fine. For example, a simplistic algorithm for the bomb card could be something as basic as this: If an opponent territory has a stack of armies greater than 3x our income, bomb it.
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 08:53:07


GeniusJKlopp
Level 61
Report
Hey,

I'm sorry my question is not about the subject of this thread,but here's my question:
Could the previous AIs use cards with a human teammate?

P.S. Good luck with the algorithms
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 09:22:14


cookie 
Level 65
Report
About bomb card. It can be related to number of turns. Lets say If turn 2 if AI see 12 troops bomb it. But in turn 3 he need to see 15 troops to bomb and turn 4 four 18 troops. Also we can put some luck to his decision. So he will not be predictable.
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 09:51:25


Master Ryiro 
Level 63
Report
for me,conditions for blockade card are:-
1.blockade most preferably on chokepoints
2.no. of armies to be blockaded always greater than 3 times the income that can be gained from the bonus used for blockade for bonuses upto income 6.
3.blockaded armies should be more than
(opponent's stack seen on the border+opponent's or your income+re-enforcement card-1)*(0.6)
for example if your income is 12,opponent's stack is 12(you assume opponent's income is 12 unless you know what it is) and card piece +5 then the blockade should be
(12+12+5-1)*0.6=16.8~17
so blockade should be of atleast 18 armies in that situation
0.6=offensive killrate,this should also vary with the settings,so instead of 0.6 offensive killrate in the algorithm should be better

now when to blockade and when not to-:-
1.if the territory cannot be defended eventually with both players deploying all on the border
2.when there are re-enforcing stacks coming to defend,do not blockade,or make a small bolockade to trick the opponent.
3.if the opponent started in that bonus but cannot complete it in atleast 2 turns,attack the border territory and blockade next turn
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 10:33:22

Hasdrubal
Level 61
Report
If you didn't notice, on some maps AI cannot find front line, so, blockade card is not an option. If AI had larger armies about 4-5 provinces behind front lines, it won't move them, or would move them on random location. Using blockade or Em blockade card by AI may prevent it to exploit good situation.
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 10:40:42


DanWL 
Level 63
Report
You should use an Emergency Blockade Card when you know your going to be attacked, but where it'll be affective as well. You want to sevearly reduce the opponents' stack or get rid of it compleatly.

Use when your stack+your non-spreading income)*Abandon %>(Opponent's stack + their visable income+predicted income used spreading).

For example when:
Opponent's stack is 30;
Opponent's visable income is 12;
Predicted opponent's income used for spreading is 3;
Abandon % is 300;
Your stack is 2;
Your non-spreading income is 12.

(5+12)*300%>(30+12+3)
17*300%>45
51>45

Assuming the opponent attacks:
Opponent looses about 35 armies, leaving them with 45-35=10 and the abandoned territory has about 27 armies left. (This assumes pure skill, no luck.)
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 13:12:53

Алексей
Level 62
Report
Blockade Card and Emergency Blockade Card
Use only to spoil bonuses that we can not defend or recapture. I guess AIs will never be good at determining if a choke point is worth blockading.
The number of armies to use is hard to guess - the AI developer will tune it after testing. It is sometimes enough to use 3 armies with 350% blockade to spoil the bonus forever and sometimes dozens of armies do not stop the enemy.
Do not use non-emergency blockade on a territory that borders an enemy.

Diplomacy Card
Use only if there is more than one enemy. Do not use the card if the sum of attacks on us last turn is less than our income. Use on the enemy who has max(sum(armies attacking us last turn)).

Bomb Card
Use on the biggest enemy stack once it has twice your income. There is no point in waiting it to triple. Just bomb and attack. Do not wait for the enemy stack to grow if we have more than one card, bomb this 1 army (if it is the biggest enemy stack) and capture the territory 1v0.

Gift Card
Use if an ally does not border any enemy. Use on a territory in a broken bonus. Use on a territory that does not border an enemy but is 1 territory away from them.
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 16:05:19


MightySpeck (a Koala) 
Level 60
Report
What if we could play a card for our AI (make them blockade something or gift)
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 16:19:11


muddleszoom
Level 59
Report
i think ais should always e able to play a gift just in case you are in danger
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 16:24:03


GeneralPE
Level 56
Report
What if we could play a card for our AI (make them blockade something or gift)


I would like that, but I don't know if it would fly, since your pretty much just playing as one guy then
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 16:52:23


Norman 
Level 58
Report
Hello

The question is very general and assumes that there is a common understanding about how a WarLight AI is supposed to work what can't be the case. The strength of most game AIs comes from two factors, namely their evaluation function and their ability to look deep into future configurations (mainly minimaxing with lots of optimisations). However a reasonable fast WarLight AI is only capable to look mainly into the current configuration (maybe with some local lookaheads) and the playing strength only comes from superior heuristics.

This explanation shows that two of those card problems are much more difficult than others, namely:
- Blockade Card
- Diplomacy Card
Both of those cards don't affect the current board but the board next turn. If your bot has no explicit understanding about how the board should look like next turn then it's not possible to play those cards effectively.

As for the other cards I don't see the cards as a separate problem to solve but as an integrated part of the other problems that your bot solves. For example with the order prio and order delay you solve the problem of playing those cards together when solving the problem to find a good move order.

Bomb Card
--> Your bot should have a concept about how the opponent deployment looks like. Every bot has such a concept else they couldn't attack their opponent at all. (and if the concept is just that the opponent deploys nowhere,...)

Emergency Blockade Card
--> Your bot should have a concept about where an opponent will attack. As for the Wunderwaffe this will also fit nicely into my task to prevent the opponent from taking a bonus completely over where he then can just play the emergency blockade card when he can't find any other solution.

Gift Card (assume it's on a team)
--> I can think about different situations here, for example: Only gift territories in a bonus that you don't own or in a bonus that's not valuable for you to expand into. Gift then under following circumstances:
1) Gift to a teammate who is completely surrounded by teammates.
2) Gift to a teammate who is facing elimination. A teammate is facing elimination if all his territories are bordering opponents and if the opponents would deploy all against him they could together eliminate him this turn.

Edited 3/10/2016 17:03:37
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 17:12:27

talia_fr0st
Level 59
Report
Diplomacy Cards should be played when there are:

3 players fighting the AI (use on one with projected highest income).
2 players fighting the AI, 1 of which holds a choke point (use on one not controlling choke point).
1 player fighting the AI, before Turn 3
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 18:30:15


ViralGoat 
Level 60
Report
I noticed in games with commanders that the AI does not defend his commander by deploying more, making it very easy to kill its commander. Airlifting the commander away to safety would be a great move! Also, bombing an enemy's commander then attacking it would be nice, but not all the time (so that it doesn't become too predictable)
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 18:50:17


MightySpeck (a Koala) 
Level 60
Report
Well the AI would still deploy, and attack, but you could just say can you gift that to me, and then the AI will redo it's orders so it will gift it to you.
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 20:23:22


ViralGoat 
Level 60
Report
is there a way to give commands or suggestions to the AI through the team chat? That would be amazing: Gift me this, attack this territory, blockade this, etc.
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 21:20:53

wct
Level 56
Report
First off, the AI will never play cards when teamed with a human teammate (just like it works now). So you don't need to worry about an AI taking your cards.

This is actually a real problem sometimes, when your AI team mate won't play cards even though he desperately needs them.

E.g. If I play a single-player game against teams of AIs, I usually include one AI team mate for myself just so I can 'hand over the keys' once I'm dominating all the other AIs, so that I don't have to play the game all the way to elimination just to 'win' it. If I play it right, then my AI team mate will also be dominant and will play the game to the end to clean up all the other AIs to elimination.

But if I'm playing against teams of 3 or 4, and my team is just me and 1 AI, *and* my AI team mate *never* uses a reinforce card for himself, then he will *almost always* be super-duper slow to expand, and will usually be the weakest player in the game after a few turns. On the other hand, I really don't need the cards to beat the AIs, so they are wasted on me.

The end result is that by the time I'm super-dominant and want to end the game, either my team mate is weak, or eliminated, or I had to take extra special care of him to protect him from any other AIs and allow him to expand freely somewhere. Or pump him full of troops for several turns to try to get him caught up to everyone else.

In other words, right when I should be able to watch the game play out to my inevitable victory, I have to either quit it prematurely with a 'loss', or spend several tedious turns trying to 'hand over the keys' to my weakling partner.

If only humans could *force* their AI team mates to play certain cards, or tell them "No, really, it's okay. You use it!"
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 21:42:32


ChrisCMU 
Level 61
Report
- Blockade Card

It should only do safe blockades (not on a territory that borders enemy) as it would not use proper delay tactics to limit risk.


- Diplomacy Card

Maybe proceeding a turn it can take a large bonus (where it needs to divert a majority of income to do so, rather than deploy on borders of enemy.
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 21:42:41


TBest 
Level 60
Report
@wct +1
noobie UI example. If multiple AI's just give a popup similar to that of doing a gift.
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 21:43:25


ChrisCMU 
Level 61
Report
And I agree, the AI should use a gift card when playing with a human (would need rules for that).
How should AIs use Blockade,Gift,Diplomacy,Bomb?: 3/10/2016 21:48:54

wct
Level 56
Report
Assume you're facing an AI which is either alone or on a team with other AIs, and they have one of these cards:

- Blockade Card
- Emergency Blockade Card
- Diplomacy Card
- Bomb Card
- Gift Card (assume it's on a team)

I need to try to come up with algorithms to determine when and where to play these cards.

Emergency Blockade would require the AI to model where they predict a big attack will come from in order to be used like more than a defensive Blockade.

You could have the AI use blockades to 'ruin' enemy-controlled bonuses that it can't afford to defend properly. E-blockades could be used this way too, I guess. Actually, that's probably the most straightforward way an AI could use them.

Diplomacy could be played between the AI and its biggest *neighbouring* enemy, especially if it is being overwhelmed by many enemies and can't afford to defend against them all. If the AI has access to the "Actual deployments" statistic, it could use the last few turns to get an estimate of its biggest enemy threat.

On the other hand, if the AI is dominating and can afford to attack a lot, then it should generally not play Diplomacy.

Other uses of Diplomacy such as to prevent access to certain parts of the map, or to force to squabbling weaklings to focus on expansion so that they both are a bigger problem for the AI's bigger enemy (assuming free for all, or many small teams), is probably a much harder thing to get working properly.

One potential problem with Diplomacy cards is that if they are too plentiful you can end up with stalemates where no one can attack anyone.

Bomb card: If the AI can predict where a big deployment will be, that would be a good way to use it. But a very simple heuristic would simply be to play it on the biggest neighbouring enemy stack.

The question of whether to hold on to a card like a Bomb is an instance of a more general problem of when to use cards vs. when to save them.

Also, there may be cases where you want to treat the Bomb as part of a larger 'attack plan', rather than just a separate tool of its own.

Gift Cards could be used either by stronger team-mates to save struggling weaker team mates from extinction, or by weaker team-mates to 'summon' stronger team mates to a heavily contested battle field.

I think they would generally be wasted merely to complete shared bonuses. Although... this would help solve one very annoying behaviour of AI teams, which is that they are especially terrible at resolving shared bonuses, since the bonus needs to be *entirely* empty before they will even *try* taking one of their team-mate's territories. If the minority team mate would simply gift away its territory, then it wouldn't matter if the bonus was empty or not, since Gift always works.

So maybe my first thought is wrong. Maybe it wouldn't be wasted. But generally, the better usage of Gifts is to help weaker team mates in battles or survival by 'teleporting', rather than merely completing a shared bonus.
Posts 1 - 20 of 42   1  2  3  Next >>