台球的AI [英] Pool Billiard AI

查看:249
本文介绍了台球的AI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

林实施台球的游戏在Java中,这一切工作正常。它是一个多人游戏,但尽管如此,它也应当能够单独播放。为此,我想实现一个简单的KI。目前,碘化钾选择只是随机的方向和随机强度的冲动(不知道正确的英文单词为)。当然这AI是非常差,不可能永远挑战的球员。

Im implementing a pool billiard game in Java and it all works fine. It is a multiplayer game, but nevertheless, it should also be possible to play it alone. For this purpose I'm trying to implement a simple KI. At the moment, the KI choose just randomly a direction and a random intensity of the impulse (don't know the correct english word for that). Of course this AI is very poor and unlikely to ever challenge a player.

于是我想到了改善KI,但有几个难以解决的问题。首先,我以为只是选择最近的球,并尝试直接把它放到最近的孔。这并不坏,但如果线之间还有其他的球,这是不是真的工作了。另外,该解决不到风度计算脉冲的强度德问题。

So i thought about improving the KI, but there are several hard to solve problems. First I thought of just choosing the nearest ball and to try to put it directly into the nearest hole. This isn't that bad, but if there other balls in the line between, it isn't really working anymore. Additionally this dosn't solve te problem of calculating the intensity of the impulse.

那么,有没有任何一般性的建议?或者有什么想法?最佳做法?

So are there any general advice? Or any ideas? Best practices?

推荐答案

占用多少CPU时间和内存没有考虑到计算的游戏之一动的结果吗?你能负担得起,分析超过一招?如果它是相对便宜的事,随便挑N个随机的方向/脉冲,计算出结果,并挑选最好的一个。您可能会消除一些狡猾的情况下,当球进入口袋太多的冲突之后。此外,为简化起见,可以限制模拟时间为每个移动(即不要等到所有的球停下来,只是calulate第一个T秒)。

How much CPU time and memory does it take to calculate the results of one "move" of the game? Can you afford to analyze more than one move? If it's relatively cheap to do, just pick N random directions/impulses, calculate the results and pick the best one. You may eliminate some "tricky" cases, when ball goes to pocket after too many collisions. Also, to simplify, you can limit the simulation time for each move (i.e. don't wait until all the balls stop, just calulate the first T seconds).

这种方式,你可以有不同程度的电脑玩家 - 高N(和T)对应于较高的水平发挥

This way, you can have computer players of different level - the higher N (and T) correspond to higher play level.

这篇关于台球的AI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆