最小 - 最大的评价函数的游戏函数、最小、评价、最大

2023-09-11 23:28:59 作者:陌

我开发一款游戏(坦克游戏2D),(例如: - 的链接)AI球员。我的球员将是其他5名球员(AI也)打谁获得最多的硬币,随机出现在某个地方电网之一。(看看上面给出的图片)。玩家还可以拍摄每个另一个。和健康包也以网格某处出现随机。

I'm developing a game(Tank Game 2D),(eg - link ) AI player. My player will be one of 5 other players(AI also) who playing for obtaining maximum coins appears randomly somewhere in the grid.(take a look at the picture given above). Also players can shoot each another. And health packs are also appear somewhere in the grid randomly.

因此​​,为了用最小最大树,并找出最聪明的下一步行动我必须建立一个评价函数。问题就出现在这里,我没有这样的评价function.Is有什么我应该遵循的准则或previous的经验是那里做我的意思是我有东西在我的脑海,我不知道这是否是一种常见的方式会做的工作。您能否给我建议这方面应该学习的。我GOOGLE了一下,发现了许多事情,但没有适当的教程或类似的东西。谢谢。

So in order to use min max tree and find out the most clever next move I have to build a evaluation function. The problem arises here, I have no previous experience with such evaluation function.Is there any guidelines should I follow or is there a common way to do it I mean I have something in my mind and I'm not sure if it gonna do the work. Can you suggest me which area should study on. I googled it and found out many things but there is no proper tutorial or something like that. thank you.

推荐答案

基本上,做的就是游戏的评价最好的事情是:

Basically, the best thing to do to get an evaluation of the game is:

玩游戏 - 试一下,看看你尝试什么情况下避免,哪些是好的。尝试制定这些情况成为普遍的评价。 研究 - 有人可能已经研究了这个或类似的问题,如果是的话 - 也许有一些文章或其它材料提出一些启发性功能 Play the game - try to see what situations you try to avoid and which are good. Try to formulate these situations into a general evaluation. Research - someone might have already studied this or a similar problem, if so - maybe there is some article or other material suggesting some heuristic functions.

我会做如下:

(从最近的敌人对敌人的距离,火线,我的健康吧,...)创建一组启发式功能,游戏中的每个描述了一个方面。我会尽可能多玩游戏来扩大这个名单可能,当然,看在线的想法其他人可能已经找到了这种/同类游戏。 从第一步,我们实际上得到了一组函数: H_1(板),H_2(板),...,h_n(板) - 但我们仍不知道什么是我们的启发式功能 我会尽量找一些参数 A_1,A_2,...,A_N ,并创建我的启发函数: ^ h (板)= A_1 * H_1(板)+ A_2 * H_2(板)+ ... + A_N * h_n(板 现在的问题是 - 如何得到这些参数。需要注意的是,现在我们有一个最优化问题。 针对这一特定问题的一个解决方案是蒙特卡罗学习。 Create a set of heuristic functions, each describing one aspect of the game (distance from nearest enemy, line of fire on enemy, my health bar, ...). I'd play the game to expand this list as much as possible, and of course look on-line for ideas others might have found for this/similar games. From step one, we actually got a set of functions: h_1(board),h_2(board),...,h_n(board) - but we still do not know what is our heuristic function I'd try to find some parameters a_1,a_2,...,a_n, and create my heuristic function: h(board) = a_1 * h_1(board) + a_2 * h_2(board) + ... + a_n * h_n(board The question is now - how to get these parameters. Note that now we have an optimization problem. One solution for this specific problem is Monte-Carlo learning.

蒙特卡罗学习:

蒙特卡罗学习的想法是创建一个代理列表(AIS),每个都有一些随机值 A_1,...,A_N 初始化 - 和让他们之间的比赛。 比赛结束后,每个代理基于代理的preformed最好的改变 A_1,...,A_N 的值,和重新运行了比赛。 (如何做这件事的方式是类似于遗传算法一代步 - 跨接管和基因突变,但也有其他方面也)。

The idea of Monte-Carlo learning is to create a list of agents (AIs), each initialized with some random values for a_1,...,a_n - and have a tournament between them. After the tournament is done, change the values of a_1,...,a_n for each agent, based on the agents that preformed the best, and re-run the tournament. (one way to do it is similar to the "generation" step in Genetic Algorithms - cross overs and mutations, but there are other ways as well).

在结束 - 蒙特卡洛学习的过程应该给你不错的值 A_1,...,A_N - 它会给你一个很好的启发函数为板。

At the end - the Monte-Carlo learning process should give you good values for a_1,...,a_n - which will give you a good heuristic function for the board.