<< Back to Warzone Classic Forum   Search

Posts 18 - 24 of 24   <<Prev   1  2  
Why dont AIs like taking down Blockades !!!!! Grumble !!!!: 3/12/2012 23:59:33

Fizzer 
Level 64

Warzone Creator
Report
I took a look into what the AI was thinking in that long period where it didn't move.

The AI looks at the bonuses available and basically decides that none of them are worth taking. I'd say this part is working correctly for most bonuses, with the exception of East Russia which is a +6 bonus blockaded only by 36, and Australia which has 12 enemy armies and an income of 4.

The AI currently uses (bonus value) * 3 - (armies we'd have to kill to take the bonus). If this comes out negative, it won't deem the bonus worthy in some cases.

One part of the issue is that the AI doesn't border any enemies. So when it comes time to deploy, it doesn't have any choice except to deploy next to a neutral. But the bonus-taking routine doesn't take into account armies it already has on hand. It just determines the bonus is a bad ROI and that its armies can probably be better used elsewhere.

Another part of the issue is that the AI doesn't have the concept of traveling to get to an enemy. It only looks at things adjacent to itself. This is why when New Zealand gets taken it reacts - it now has a target that's more tasty than the undesirable bonuses.

The real underlying issue is that this AI was designed for the built-in single-player levels. Outside of these settings, there are lots of situations you can put it into where it behaves very poorly - for example, it doesn't take advantage of multi-attack or most cards. This situation is just another one of those.

Eventually I'm sure WarLight will get a new AI that can be designed to handle more cases. However, this one won't be tweaked since it would invalidate the scores of existing single-player levels. Once we have a new one entirely, hopefully the game can be modified so that players have a choice of which AI to use, that way the existing levels can be retained as-is.
Why dont AIs like taking down Blockades !!!!! Grumble !!!!: 3/13/2012 02:14:36

RvW 
Level 54
Report
(I have a hunch what your answer will be, but there's no harm in trying...)

1) As Bakapon explained, if this can be solved with a minor tweak (something specifically aimed at solving this particular weakness, so it won't activate, *and therefore essentially NOT change the AI* unless this cornercase happens), then it isn't necessary to reset single player scores, since this situation can't happen in some of the single player levels and is incredibly unlikely to occur in the others.

2) Such a tweak could be a simple post-processing step: after the AI runs, look how many move/transfer orders it has issued. If none, then attack the least-unworthy bonus (the one where that evaluation function returns the value closest to zero).
Other options could be to attack "something" with the biggest available stack, or performing the attack with the best attackers-per-defenders ratio.
Either way, to prevent a stalemate it should suffice to give *an* order; maybe the AI will move slowly for a turn or two, but that's much, much better than it stalling completely.

---

Another idea:
Wouldn't it be relatively easy to allow for multiple classes of AIs, both in the code and in the user interface? You could have "AI" and "AI (experimental)". The experimental one would obviously be based on the normal AI, with just some tweaks (I don't even want to know how long a rewrite-from-scratch would take... :s ).
If it's not allowed in ranked games, it doesn't hurt anything, but it would allow for incremental changes. And by marking it "experimental" people know it might weird-out and be unpredictable (for instance when it gets updated mid-game: version 1 plays one turn, version 2 plays the next).

---

If this is just nowhere near the top of your priority list, please just say so and I'll drop the issue. The point is, in your post you explained why it isn't currently possible to update the AI, so I'd like to explain why I think it *is*. However, I can't read your mind, so there's a risk you're secretly thinking "Stop whining about the AI guys, I have other things to worry about" when you're typing a very polite, analytical reply...
Why dont AIs like taking down Blockades !!!!! Grumble !!!!: 3/13/2012 05:34:09

duffer
Level 2
Report
It would be interesting to have various AI personalities as options you could choose when making a multi-player game with AI seats. I'd suggest being able to pick each personality by random too, without knowing in advance which way the AI is going to behave in the game. This would only be workable when there are different versions of the AI that do play differently enough for it to be observable in practice (say when given different weights for how much they value expansion vs. attack vs. defense), so it's just a minor wish for the future.

Also, would it be anywhere near the realm of possibility for Fizzer or someone else to make a locally runnable and possibly reduced version of Warlight to which you could plug in your own AIs to play each other? This would let other people experiment with writing AI heuristics and you could even run tournaments between them to pick good candidates for future official AIs. This sound like the sort of thing people with programming experience would be interested in, and the off-line runnability would mean it wouldn't eat up resources on the server meant for human players :)
Why dont AIs like taking down Blockades !!!!! Grumble !!!!: 3/13/2012 07:46:05

RvW 
Level 54
Report
@duffer:
|> Also, would it be anywhere near the realm of possibility for Fizzer or someone else to make a locally runnable and possibly reduced version of Warlight to which you could plug in your own AIs to play each other?

Not only possible, it's already been done, see the blog post "[WarLight as a candidate to the Google AI Challenge](http://blog.warlight.net/index.php/2011/04/warlight-as-a-candidate-to-the-google-ai-challenge/)".

Just a small warning if you've never done any AI programming... I consider myself a pretty competent coder, but I'm not even going to attempt this; writing a decent AI is *incredibly* hard because there's *so* many corner cases to worry about. If you want to try, by all means, please go ahead, but be prepared for it to be quite a challenge...
Best of luck! :)
Why dont AIs like taking down Blockades !!!!! Grumble !!!!: 3/13/2012 09:22:38


{rp} General Mac 
Level 53
Report
Thanks for your input everyone

Not knowing anything about AI coding i did fear that it would be difficult to correct

However this below quoted by RvW does sound like a viable option

----------------------------------------------------------------------------------
2) Such a tweak could be a simple post-processing step: after the AI runs, look how many move/transfer orders it has issued. If none, then attack the least-unworthy bonus (the one where that evaluation function returns the value closest to zero).
Other options could be to attack "something" with the biggest available stack, or performing the attack with the best attackers-per-defenders ratio.
----------------------------------------------------------------------------------

All this being said i would now like to show you even stranger AI movements regarding the blockades

I set back up the same game style but this time less blockades to see if I could avoid the stalemate
however around turn 17-20 we hit the dreaded AI stalemate However something very strange happens on turn 39.... The AI Decides to knock down pretty much all the Blockades in one turn. very strange

This is great but what made them decided to do that rather than stay behind them?

[Link text](http://warlight.net/MultiPlayer.aspx?GameID=2380358)
Why dont AIs like taking down Blockades !!!!! Grumble !!!!: 3/13/2012 09:23:38


{rp} General Mac 
Level 53
Report
oh im not sure why it made one section of my text bold...that was un intended :)
Why dont AIs like taking down Blockades !!!!! Grumble !!!!: 3/13/2012 10:11:37

duffer
Level 2
Report
@RvW: Thanks for the link.

I am not thinking of devoting a lot of time into making an AI myself (I know it is hard :-), but I'll at least try to get more people interested in the idea of making a Warlight AI and play with the tools a bit.

It would also be great to see Warlight in the Google AI challenge.
Posts 18 - 24 of 24   <<Prev   1  2