友情博客

搜索

最新评论

RSS

我的 Blog:
mrG 最新的 20 条日志
[关于我]
[FLASH]
[酷站推荐]
[好贴转载]
[web标准]
[News]
[网页制作]
[资料翻译]
全站 Blog:
全站最新的 20 条日志

传统的开发人员有一点儿担心不确定性的AI,尽管这正在改变。不可预见性是不容易测试和调试的——你怎么测试游戏玩家所有可能的动作,确保你的游戏在某种情况下不会出现很傻的举动?游戏开发者们还要面对怎么不断减少开发周期的问题,怎样使开发和测试新技术成为一个生产标准更加的困难。这样在商业的游戏大众市场,想缩短开发周期使得开发者很难完全理解新锐的AI技术和游戏的含义谈何容易。

至少知道现在,另一种制约游戏AI开发的因素出现了,就是现在更多的开发者更多的关注图形图像的质量。如此的关注开发更好更快的图形技术包括硬件的加速,这样现在要开发出更好的游戏就要付出比开发聪明的AI更多的代价。事实是在开发出下一代更好游戏的压力下,开发者正被鼓励开发彻底的不确定技术。我们少候会继续讨论这个话题。


已确定的游戏AI

可能在游戏中2使用最广的AI技术就是欺骗。比如,在一个战争模拟游戏中电脑一方可以他的人类敌人所有的信息——基地的位置,战斗单位的种类数量和位置等等。而不必像他的对手智能的人类玩家一样,要派出侦察兵才能得到对手的信息。如此的欺骗方法是很常见的,而且可以给电脑一把利刃来对付聪明的人类玩家。然而,欺骗也会不好。如果电脑的欺骗太明显的话,玩家很可能假设他的努力是没有结果的然后失去游戏的兴趣。同样,不公平的欺骗给电脑太多的权力,使得游戏玩家不可能击败他的电脑对手。当游戏玩家看到他的努力没有结果的时候,他同样会失去对游戏的兴趣。欺骗必须对游戏玩家公平,并且有足够的挑战性,使游戏玩家保持对游戏的兴趣和快乐。

当然,欺骗不是唯一一个好的确定性的AI技术。有限的规定机器是一个普遍使用的游戏AI技术。我们会在第九章讨论,它的基本理论是列举出电脑控制的人物的动作和规则,并当检测条件条件满足假定条件的时候执行或越过动作或条件。

开发者一般使用模糊逻辑规则,以减少可预知的结果动作并且减轻了列举出大量的条件规则的负担。不像有限的规则机器,当满足条件:如果距离等于10且生命等于100的时候才攻击,模糊逻辑可以让你使用不精确的条件,比如像:如果靠近并健康的时候开始攻击。我们在第10章讨论模糊逻辑问题。

在各种游戏中有效的导航是电脑人物必须完成的基本任务。电在战争模拟游戏中脑控制的单位必须得地面导航并且避开障碍物到达敌人的位置。在第一人称视角的射击游戏中的生物穿过地牢或者建筑物或者从游戏者手中逃跑。游戏关卡是无穷无尽的,难怪游戏AI的开发者给导航技术这么大的关注。我们在第六章讲解基本的导航技术,并在第七章介绍A*算法。

这些是仅有的几个已被确定的游戏AI技术。其他还包括可编辑,有规则可寻的系统,和一些人工生命技术(A-life)。A-life技术被普遍应用于机器人应用软件,开发者在电视游戏中成功的使用了这项技术。基本上,一个A-life系统就是一个能表现人的行为的综合系统。这些行为都是底层算法的结合的结果。在这本书中我们会看到A-life和其他技术的一些例子。

【原文】

Developers traditionally have been a bit wary of AI that is nondeterministic, although this is changing. Unpredictability is difficult to test and debug—how can you test all possible variations of player action to make sure the game doesn't do something silly in some cases? Game developers face an ever-shortening development cycle that makes developing and testing new technology to production-ready standards extremely difficult. Such short development periods make it difficult for developers to understand cutting-edge AI technologies fully and to see their implications in a mass-market commercial game.

At least until recently, another factor that has limited game AI development is the fact that developers have been focusing most of their attention on graphics quality. As it turns out, such focus on developing better and faster graphics techniques, including hardware acceleration, might now afford more resources to be allocated toward developing better, more sophisticated AI. This fact, along with the pressure to produce the next hit game, is encouraging game developers to more thoroughly explore nondeterministic techniques. We'll come back to this point a little later.

Established Game AI

Perhaps the most widely used AI technique in games is cheating. For example, in a war simulation game the computer team can have access to all information on its human opponents—location of their base; the types, number, and location of units, etc.—without having to send out scouts to gather such intelligence the way a human player must. Cheating in this manner is common and helps give the computer an edge against intelligent human players. However, cheating can be bad. If it is obvious to the player that the computer is cheating, the player likely will assume his efforts are futile and lose interest in the game. Also, unbalanced cheating can give computer opponents too much power, making it impossible for the player to beat the computer. Here again, the player is likely to lose interest if he sees his efforts are futile. Cheating must be balanced to create just enough of a challenge for the player to keep the game interesting and fun.

Of course, cheating isn't the only well-established AI technique. Finite state machines are a ubiquitous game AI technique. We cover them in detail in Chapter 9, but basically the idea is to enumerate a bunch of actions or states for computer-controlled characters and execute them or transition between them using if-then conditionals that check various conditions and criteria.

Developers commonly use fuzzy logic in fuzzy state machines to make the resulting actions somewhat less predictable and to reduce the burden of having to enumerate huge numbers of if-then rules. Rather than have a rule that states if distance = 10 and health = 100 then attack, as you might in a finite state machine, fuzzy logic enables you to craft rules using less precise conditions, such as if close and healthy then attack aggressively. We cover fuzzy logic in Chapter 10.

Effective and efficient pathfinding is a fundamental task that nonplayer characters must accomplish in all sorts of games. Nonplayer character units in a war simulation must be able to navigate over terrain and avoid barriers to reach the enemy. Creatures in a first-person shooter must be able to navigate through dungeons or buildings to reach or escape from the player. The scenarios are endless, and it's no wonder that AI developers give pathfinding tremendous attention. We cover general pathfinding techniques in Chapter 6 and the venerable A* algorithm in Chapter 7.

These are only a few of the established game AI techniques; others include scripting, rules-based systems, and some artificial life (A-life) techniques, to name a few. A-life techniques are common in robotic applications, and developers have adapted and used them with great success in video games. Basically, an A-life system is a synthetic system that exhibits natural behaviors. These behaviors are emergent and develop as a result of the combined effect of lower-level algorithms. We'll see examples of A-life as well as other techniques throughout this book.

作者:Mr.Greedy 发表时间:2006-3-26  [所属栏目:资料翻译] | [返回首页]
日志-1  每页显示-1 

评论(共 条) 我要评论
{CommentTime} | {CommentAuthor} {CommentUrl}
{CommentContent}