Login  |  Register

Author Topic: Any hopes for better AI w/ personalities?  (Read 325 times)

Offline LordGek

  • Newbie
  • *
  • Posts: 1
    • View Profile
Any hopes for better AI w/ personalities?
« on: 23 March 2018, 03:24:00 AM »
Hey Devs,

While I'm always hoping developing better AI is something on the docket, something that would mean ALL the world to me is if you guys added a little more variation in their play.  I think the AI is actually competent, for the most part, but what's really annoying when I'm playing vs. multiple AIs is how they clearly all have identical mindsets and thus create, as much as possible, near identical decks from whatever random set of cards the game presents.

My feeble hope of a solution to this is to have an option to give each AI some hidden weighting variables to things like tendencies of gathering treasure, victory cards, having a small deck, or creating long chains.  The idea being in some cases where the AI might in a given situation almost give a treasury and an action card equal weight, the more action oriented AI is at least a little more likely to grab the action card whereas another AI in that same match might be more inclined to snag the treasury card in the same situation.  The end result being that by the end of the game the multiple AI players should have more diversified decks.

Offline AdamH

  • Sr. Member
  • ****
  • Posts: 328
    • View Profile
Re: Any hopes for better AI w/ personalities?
« Reply #1 on: 03 April 2018, 04:06:27 PM »
So I think it would be really helpful to be able to program my own bot and play against it. I feel like it would go a long way if the client only added the ability to import something like a text file with buy rules (much like the inputs to Geronimoo's simulator) and then had the bots play it out in a game with you (forcing in the cards that the bot requires). Adding in the ability to specify simple play rules other than "play non-terminals first, then terminals" could be useful as well.

Not only would this feature be really useful on its own, but if you make it easy for people to share and rate their bots, it could become a great way to crowdsource a Dominion AI...

Let's be realistic, the devs don't have the time it would take to write a competent AI because that's an extremely difficult and time-consuming problem. If you allow users to make bots, I feel like a lot of the work of making a somewhat competent AI could be offloaded onto people other than the developers. With a library of enough decent bots that are good on specific kingdoms, you can pretty easily take a random board and just cherry-pick the best bot you have that has all of the cards it requires.

Some particularly important people would be really happy if Shuffleit had a decent AI, and I think that implementing this feature now would be a very small time investment that would pay off in a huge way.

Offline Ingix

  • Global Moderator
  • *****
  • Posts: 769
    • View Profile
Re: Any hopes for better AI w/ personalities?
« Reply #2 on: 04 April 2018, 12:10:10 AM »
In theory, a great idea. In practice, its *really hard* to basically invent a programming language that 'speaks' the game, then implement it, test it, document it a.s.o.

What *might* be doable is to use the data structures already present in the client, but have them not interface with a human player, but javascript code that makes the decisions required. I assume that's how it works with the current AI, as initially it had a few cases where bots can get stuck (Lurker used to be such a case), which I think is the AI just giving no or an illegal answer.

If I understand you correctly, you want say one player write an AI that uses Village and Smithy, which cam then be  expanded by other player to include more Villages-likes and Smithy-likes. The problem I see is that that needs to be able to 'deal with' (on a technical level, not just for playing well) all cards an opponent can use against it. If you only know about the base cards and Village/Smithy, what is the AI supposed to do when it has to do something for Militia, or Contraband or any number of cards that require a decision for the game to continue?

Offline AdamH

  • Sr. Member
  • ****
  • Posts: 328
    • View Profile
Re: Any hopes for better AI w/ personalities?
« Reply #3 on: 04 April 2018, 02:11:39 AM »
In theory, a great idea. In practice, its *really hard* to basically invent a programming language that 'speaks' the game, then implement it, test it, document it a.s.o.

What *might* be doable is to use the data structures already present in the client, but have them not interface with a human player, but javascript code that makes the decisions required. I assume that's how it works with the current AI, as initially it had a few cases where bots can get stuck (Lurker used to be such a case), which I think is the AI just giving no or an illegal answer.

If I understand you correctly, you want say one player write an AI that uses Village and Smithy, which cam then be  expanded by other player to include more Villages-likes and Smithy-likes. The problem I see is that that needs to be able to 'deal with' (on a technical level, not just for playing well) all cards an opponent can use against it. If you only know about the base cards and Village/Smithy, what is the AI supposed to do when it has to do something for Militia, or Contraband or any number of cards that require a decision for the game to continue?

I don't know details of the implementation, but in theory, all of the decisions other than buy rules are currently handled by the bot already, and using an XML or something similar to describe buy rules has already been done by Geronimoo's simulator. I would hope that it's not terribly hard to just substitute the bot's current buy rules with something a user could program. Other things may be more difficult but this one thing I think would go such a long way towards an AI and is so little effort.

Offline Ingix

  • Global Moderator
  • *****
  • Posts: 769
    • View Profile
Re: Any hopes for better AI w/ personalities?
« Reply #4 on: 04 April 2018, 11:56:40 AM »
OK, so you want to do *only* buy rules at the moment, and keep the actual playing of cards and other decisions to the existing bot. Did I understand you correctly?

Offline AdamH

  • Sr. Member
  • ****
  • Posts: 328
    • View Profile
Re: Any hopes for better AI w/ personalities?
« Reply #5 on: 04 April 2018, 01:44:18 PM »
OK, so you want to do *only* buy rules at the moment, and keep the actual playing of cards and other decisions to the existing bot. Did I understand you correctly?

Yeah. I mean I want all of the things but that's probably not realistic, right?

I assumed that it would be a tough sell to do anything like this because there's so much else to do, but I would also assume that it would be a very small amount of work to be able to just do the buy rules. And only buy rules would still go a super long way towards crowdsourcing the AI (and improving the user experience), and doing it soon would give the community time to generate lots of bots.

The rest of the stuff would be great to have eventually, and maybe the devs make some implementation choice now that makes that stuff easier down the line, so yeah it's probably good to keep in mind.