AI算法设计:卡牌游戏

发布于 2024-11-07 06:01:57 字数 547 浏览 1 评论 0原文

目前,我正在开发一款名为 Briscas 或 Briscola 的西班牙纸牌游戏,http://en.wikipedia。 org/wiki/Briscola

简而言之,这是一款纸牌游戏,两队 2 名玩家相互对战(他们看不到对方的手,甚至看不到团队成员),只有在开始时牌是洗牌,然后将三张牌交给每位玩家。按照顺时针方向,每个人都扔一张牌来尝试赢得该回合。谁在该回合获胜就获得积分。然后,仍按顺时针方向,上一轮获胜的玩家从牌堆顶部拿一张牌,以及他/她左边旁边的玩家,依此类推。然后你将继续玩几轮,直到甲板空了。谁的队伍得分多,谁就获胜。

细节:

甲板尺寸:40
玩家:4 人(2 队,每队 2 人)
卡片具有特定的价值。 (从 0 到 11)

问题

我知道直接 MiniMax 会太贵。通常使用哪些算法 对于这类卡牌游戏? 此外,您可以指出的任何文献也会有所帮助。

谢谢

Currently I'm working on implementing a spanish card game called Briscas, or Briscola,http://en.wikipedia.org/wiki/Briscola

In a nutshell, it's a card game where two teams of 2 players play against each other (they can't see each others hand, not even team members), only at the beginning cards are shuffled, then three cards are handed to each player. In a clockwise manner everyone throws one card to try to win that turn. Who ever wins that turn take the points. Then, still in a clockwise manner, the player who won the last round, takes a card from the top of deck, and the player next to his/her left, and so on. Then you will keep playing rounds until the deck is empty. Who ever team has more points wins.

Details:

Deck Size: 40
Players: 4 (2 teams of 2)
Cards have specific value. (from 0 to 11)

The Question

I know that straight MiniMax would be to expensive. What algorithms are typically used
for these kind of card games?

Also any literature that you can point to will also be beneficial.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半衬遮猫 2024-11-14 06:01:57

这取决于您想要达到多大的目标,但作为开始,您需要一个快速的引擎来模拟游戏。

那么您需要一个快速且可能简单的模型播放器。

该模型玩家将没有时间向前计算。它只能对预定义的状态做出反应。所以你的第一步是构建一个足够好的游戏状态。游戏状态应该包括你的手牌和一些已被丢弃的牌的历史统计数据,以及玩家如何玩他们的手牌。

接下来,您构建一个作用于状态的模型玩家。要么

A)
手动编写一个,根据您定义的一些启发式进行播放。但请记住 - 还没有进行繁重的计算!

二)
编写一个通用玩家,但省略常量和截止值。使用模拟引擎和遗传算法进行锦标赛选择,为所述值演化出良好的参数。为了获得奖励积分,请以两人一组的方式发展您的球员,以便他们能够很好地互补。

三)
使用更多的人工智能并让遗传编程系统(有一些成熟的系统。找到一个可以进行锦标赛的系统。您甚至可以自己实现一个,但我们不要得意忘形:)使用您的状态为您编写整个玩家作为输入。

下一步:

要么你已经拥有一名出色的球员并且可以认为自己已经完成了,要么你想要让它变得更好。如果你想让它变得更好,那么你很幸运!

使用蒙特卡罗模拟来玩大量的手牌,每个选择都在特定的情况下进行(如果我理解正确的话,总是有三种选择)。让你的模型玩家在每次有选择时做出决定,并让你的蒙特卡罗模拟在每次进行模拟时随机洗牌。

现在你应该拥有一位出色的纸牌玩家了!

This depends on how ambitious you want to get, but as a start you need a fast engine for simulating play.

Then you need a fast, and thus probably simple, model player.

This model player will not have time to calculate forward. It can only react on a pre-defined state. So your first step is to construct a good enough game state. The game state should include your hand and some statistics of the history of which cards have been discarded and maybe how players have played their hands.

Next you construct a model player that acts on the state. Either

A)
write one by hand, that plays according to some heuristics that you define. But remember - no heavy calculation yet!

B)
write a general player, but leave out constants and cut-off values. Use your simulation engine and genetic algorithms with tournament selection to evolve good parameters for said values. For bonus points, evolve your players in teams of two, so that they complement each other nicely.

C)
use even more AI and let a genetic programming system (there are a few mature ones. Find one that can do tournaments. You can even implement one yourself, but let's not get carried away :) write the entire player for you, using your state as input.

The next step:

Either you already have a great player and can consider yourself done, or you want to make it better. If you want to make it better your in luck!

Use Monte Carlo simulation to play out a large amount of hands, with each of your choices in a certain situation (there are always three choices if I understand correctly). Let your model player make the decisions each time you have a choice, and let your Monte Carlo simulation shuffle the deck randomly between each time that you play out a simulation.

Now you should have a great card player!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文