我可以将战舰2玩家游戏降至最低吗?

发布于 2025-01-20 21:49:46 字数 1455 浏览 4 评论 0原文

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

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

发布评论

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

评论(1

蓝眼泪 2025-01-27 21:49:46

简短的回答:不。

极小极大算法需要对每个节点中的游戏状态进行某种评估。在战列舰中,你没有作为玩家或 AI 的所有信息(对手的舰船是未知的),这使得你不可能做到这一点。你当然可以作弊,让人工智能测试所有可能的动作,并找到隐藏的船只 X 向前移动,但我想说这是违反规则的。
然后人工智能总是会找到这艘船并且总是会命中,这也会让对战变得非常无聊。

您可以在此处找到一些有关其他算法的灵感使用。

Short answer: No.

The minimax algorithm needs some sort of evaluation of the gamestate in every node. In battleship you don't have all information as a player or AI (opponent ships are not known) which makes it impossible to do this. You could of course cheat and let the AI test all possible moves and find the hidden ships X moves ahead, but I would say this is against the rules.
The AI would then always find the ship and always make hits which would also make it very boring to play against.

You can find some inspiration for example here on other algorithms to use.

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