Page 2 of 2

Re: building a Diplomacy AI

PostPosted: 04 Jan 2019, 22:54
by Strategus
An AI should decide on the best possible outcome, and assume that the relevant diplomacy will make it happen. The diplomacy has to make it happen.

Re: building a Diplomacy AI

PostPosted: 04 Jan 2019, 23:55
by jay65536
So you're claiming that a Diplomacy AI should simply never accept any draw?

Re: building a Diplomacy AI

PostPosted: 05 Jan 2019, 00:09
by Strategus
I don't remember saying that...?

Re: building a Diplomacy AI

PostPosted: 05 Jan 2019, 14:22
by Jack007
The dilomacy part of an AI would preferably be realized by a multiple choice dialogue I guess.

Another task is to find an algorithm on how to assess the strength of a position, be it with or without strategical considerations.

I had this Atari programm which had a quite good gunboat engine, but I don't know how they calculated a good position.

Re: building a Diplomacy AI

PostPosted: 09 Jan 2019, 23:30
by espero
Thanks all.

On the "best moves", my simple understanding is that the new generation of AIs (e.g. AlphaGo, AlphaZero) is less prescriptive than earlier generations: rather than trying to teach the system how experts evaluate various situations, it lets them play and try moves for themselves.

@Jay65536: your observation about signalling via support orders is a good one - thank you.

Finally, I'm not sure that deciding when to offer draws will be a big deal: it's certainly something that featured in, for example, AlphaGo's 2016 tournament with Lee Sedol.

Re: building a Diplomacy AI

PostPosted: 03 Feb 2019, 08:04
by super_dipsy
I very rarely visit this part of the forum, but I happened to do so and saw this topic. Without wishing to resurrect a thread unnecessarily, if anyone has listened to the latest edition of Amby and Kane's Diplomacy podcast ([url][/url]) they will know that this is something I am messing about on. I guess my approach is rather different to the proposer. It is rather insular in its view, based very much in my Playdip world experience, using the framework of Playdip rather than any generally available framework, with possibly one exception. So one example of this approach is leveraging as much as possible our huge history of 100,000 Diplomacy games complete with orders. Knowing actions taken and end results at least provides a statistical source of information for what it's worth. For example, it can help significantly when deciding on early moves. A simple case: commonly F and E agree a DMZ in the channel. How have E and F fared in our historical database when they did / did not agree a DMZ? And in the case where one or the other then breaks the DMZ, how did the country fare? Yes you can argue that a million things can have happened that would impact the end result, but at a very coarse level it does provide some level of information.

The current approach I am taking on negotiations is very basic at this point. Rather than get involved with natural language support, which is a minefield and quite possibly something that should be addressed using some open source initiative, at this stage it is ugly but simple. The prime base in design is yes/no style offers. So for example

DMZ Eng, do you agree? (tick box for yes)
A Swe S A Edi - Nwy if F Nth S F Bal to Den, do you agree? (tick box for yes).

By using this messy and unnatractive approach, the essence of Diplomacy at least at a basic level can be achieved reasonably simply. Of course getting an agreement to a 'deal' does not guarantee the AI will hold to the deal, just as it does not in the human case ;). The reason for adopting this primitive approach though is it seems to me that evolution is the right approach to this design, and if a basic AI can be created that works at least at one level, then attention can turn to shining it up and making it pretty later, possibly as a more opern source type effort. On this front, the one exception to leveraging more commonly available frameworks I have in my dreams at the moment is I am thiking of utilizing the IBM Watson Assistant stuff, which deals with NLP and also provides a load of data mining stuff that can operate on our database of Diplomacy games. But frankly, that is just a glint in the eye at the moment :)

The general thrust is quite similar to what has already been discussed though. Gunboat provides a much simpler challenge, because the communications are limited to something that does not actually require conversation (ie specific moves that are submitted just to signal alliance potential). The rest of it is just programming. A key point in what I am messing about with at the moment is that frequently there will be a number of options in terms of moves (well actually, there is a finite set of moves possible anyway, but what I mean is there will be a number of more attractive options than others!), but at that point the AI will decide based on a weighted random number approach. In other words, suppose the AI thinks that most sensible would be to keep Eng Chan a DMZ but that there is an immediate gain from breaking it, the weighted decision might be 9 times out of 10 it keeps the DMZ but 1 time out of 10 it doesn't. The reason for this is otherwise the AI just becomes too easily predictable and exploitable. This weighted approach is similar to that first used in the site Stuff Happens option, and more recently in the cheater hunting AI we deployed late last year.

I guess I should say that another key point of the design thinking currently is that the main purpose I envisage for this initially is as a replacement for a country in CD. If someone surrenders, the AI would take over until someone joins the game to take control of the country. This may help to reduce the effect of surrenders by ensuring that in the case of a surrender the game does not become unbalanced so fast, and may be particularly useful for a country with few units tht is highly unlikely to be picked up by anyone. This design point means that having a pretty ropy AI may well still be better than nothing! Realistically, trying to build a full conversational AI that can play the game well is a million miles from where my mind is at the moment; but building one that can do a reasonable if unspectacular job of controlling a CD country for a few turns is a much more achievable objective.

Finally, in case anyone gets the wrong idea in terms of expectations, as I said in the Amby interview referenced above, this may never see the light of day. Frankly it is something I am messing with as the mood takes me. It is very much a back burner project, and whenever something else comes up it goes back in the cupboard. But if anything does come of it, rest assured it will not just be thrown onto the site. For instance, even if it seems a good choice for replacing surrendered countries, it would at least start out as a game creation option so people are not unknowingly exposed to it :D

Re: building a Diplomacy AI

PostPosted: 06 Feb 2019, 21:28
by espero
Thanks super_dipsy.

If you've not looked at the BANDANA framework, it may be worth looking at. Its negotiation language should be able to handle proposals like the E & F DMZ example that you cite.

Re: building a Diplomacy AI

PostPosted: 07 Feb 2019, 07:45
by super_dipsy
Will do

Re: building a Diplomacy AI

PostPosted: 07 Feb 2019, 14:56
by David E. Cohen
You are exactly right. The "best" moves, tactically speaking, can often be a strategic or diplomatic disaster.