游戏邦在:
杂志专栏:
gamerboom.com订阅到鲜果订阅到抓虾google reader订阅到有道订阅到QQ邮箱订阅到帮看

论述设计游戏AI的难度及其基本要求

发布时间:2012-02-22 12:02:24 Tags:,,,

作者:Pat Flannery

如今现代游戏开发者所享受到的资源,无论是在易用性、简单性,还是在专业性方面都达到空前水平。现在,基于Unity和UDK等预制引擎所制作的游戏在视觉效果上已同髙预算的AAA游戏不相上下,而脚本语言和逻辑创建替代方式则令这些作品实现类似水平的可访问性。从表面来看,似乎只要出于正确动机,有抱负的开发者就能够在没有任何外部援助或编程知识的情况下制作出一款完整的游戏。但游戏开发还涉及一个常被忽略的“关键要素”:人工智能(AI)。你将如何设置游戏的交互性?除非你的项目无需互动逻辑,否则你就会在开发过程中碰壁。本文将协助你找到AI问题的解决方案,让你制作出令自己满意的作品。

学会思考

AI from gamasutra.com

AI from gamasutra.com

所以首先:什么是AI?简而言之,就是接收空间信息,做出相应决策,然后落实决策,将此反馈给游戏空间的“智能代理人”。着手学习AI的一个很好渠道就是免费网站www.ai-class.com,其中包含众多视频、小测试及讲座,能够让你充分把握AI的完整概念。研究在线课程一小段时候后你就会发现,你的传统AI概念有些狭隘。AI不只是NPC的大脑,它是整个游戏逻辑内容的组成要素,甚至还是游戏互动内容的核心元素。这可能会令雄心勃勃的开发者颇感沮丧,因为他们缺少相关知识及编程技能;更糟的是,这可能会使你产生“我不想再制作这类内容”的想法。幸运的是,我们可以将处理AI元素这项艰难的任务变得更直观,激发你积极应对游戏开发中的这一艰难挑战。

若你开始查看ai-class.com,那么你就逐步朝AI设计师的思维模式转变——这并不是视觉方面的直观进展。相反,这是设计互动机制的深思过程。一个不错的方案就是直观呈现AI逻辑,或是基于某些通俗易懂的目录机制;例如,你可以在游戏中植入名称是Joe的NPC,然后附上他的系列合理输入内容及行为操作,具体样式如下:

diagram from gamasutra.com

diagram from gamasutra.com

此图表能够让你把握AI机制的具体运作内容,你的预期反应内容及其要如何同其他游戏活动进行互动。显然,随着你编程和AI设计知识的增多,此图表会变得越发复杂;例如,“Player Hits ‘Action’”就会被描述成,出自玩家的光束是“Action”引出结果行为的必要条件。虽然你的编程/AI机制创建知识依然相当匮乏,但在你和AI设计师搭档或自己学习此设计过程时,这些组织方式将给予你很大帮助。

选择工具层出不穷

学习AI对于雄心勃勃的游戏开发者来说,无疑是最为棘手的内容,这其实就是通过落实代码,对NPC及游戏反馈机制等元素进行控制。多年来,这部分都属于简单的编程内容,但对那些不熟悉编程的开发者而言,这块内容则就非常棘手。如今由于游戏开发技术的发展,我们享有更多选择,但遗憾的是,AI的执行依然是个相当艰难的过程。一个常见问题是:为什么这部分的开发内容没有像其他内容那样直观?很多人都提供有关“Photoshop of AI”的输入内容;或者是向非编程人员提供处理AI的通俗解决方案。Michael Mateas教授曾发表有关游戏AI的重要演讲。他的主要观点是,关于AI互动方式的选择多种多样,因此我们根本无法通过单个工具完成所有相关工作。例如,若上述图表瞄准的是运动游戏,其输入内容和行为元素就会截然不同;游戏之间的不一致性会让设计所有选择变得有些多余。

话虽如此,目前行业依然持续出现众多能够充当开发者和引擎桥梁的选择工具,进而降低直接进行编程的必要性。

xaitcontrol precondition and postcommands from gamasutra.com

xaitcontrol precondition and postcommands from gamasutra.com

AI设计涉及众多知识

AI制作同其他游戏开发内容的最大区别在于,软件不会帮你完成额外的工作。你可以在Photoshop中运用毛刷,在canva上进行拖曳,最终获得你无法事前进行规划的最终结果;同样,你可以在Unity中调节物理背景,发现新的互动机制。但要进行AI设计,开发者所掌握的知识要比工具软件更胜一筹——你脑中要浮现所有想法,然后通过代码/中间设备实现这些目标。这一根本差异清楚说明,为什么你无法轻率对待AI工具(游戏邦注:而若是运用Unity、UDK或Source等其他游戏软件,你就能够这么做)。简而言之,你所具备的知识不能只局限于某款具体的游戏,只有这样你才能制作出令人满意的AI互动内容;这也许会是你游戏开发过程中的一大障碍,但若你全心投入其中,你将掌握设计游戏AI的所有知识。若你分身乏术,不妨尝试同其他更擅长编程的人士合作——只是你得确保清楚传递自己的目标和想法,忠于自己的原始构思。(本文为游戏邦/gamerboom.com编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦

Teaching Your Games To Think: An Introduction To Artificial Intelligence

by Pat Flannery

The resources available to modern game developers are unparalleled in their ease-of-use, simplicity, and professional results. Games built in premade engines like Unity and UDK can now visually compete with big-budget AAA titles, and scripting languages and alternative means of building logic (visual scripting) have brought gameplay into the same realm of accessibility. On the surface it appears that, given the right motivation, an aspiring developer could create an entire game without any outside assistance or knowledge of coding. However, there is one ‘sticking point’ left in the game development pipeline that is often overlooked: artificial intelligence. How will you configure the interactivity within your game? Unless your project specifically doesn’t require interactive logic, you’re eventually going to hit a brick wall in your development process. Let this article guide you towards a solution for your artificial intelligence woes, and help you finish a game that you’re proud of.

Learning to Think

So first off: what is artificial intelligence? In short, it’s when an “intelligent agent” receives information from its environment, makes a decision, and acts its decision back out on the environment. A great place to start learning about AI is through the free project www.ai-class.com, which is a series of videos, quizzes, and lectures that can take you from baseline to a pretty complete understanding of the concepts of artificial intelligence. After just a short time exploring the online classes, you’ll begin to realize that your traditional understanding of AI is probably a bit narrow. Rather than AI being just the brain of an NPC, it’s really an integral part of your entire game’s logic and probably the most important part of making your game something that can be interacted with. This might leave aspiring developers a bit frustrated with their own lack of knowledge and programming ability; even worse, it could be yet another reason for you to say “I don’t feel like making this anymore.” Hopefully we can make the daunting task of approaching artificial intelligence a bit more tangible, and get you motivated to face another tough, but entirely conquerable challenge in the game dev process.

So if you’ve started checking out ai-class.com, you’re beginning to get into the mindset of an AI developer – this isn’t the instantly-gratifying realm of visual arts. Rather, it is a thoughtful process of designing interacting systems. A great idea is to represent your AI’s logic visually or through some sort of easily accessible list system; for example, you might have an entity called Joe the NPC, along with a detailed list of his possible inputs and behaviors, looking something like this:

This type of diagram can help you wrap your mind around what’s going on within your AI system, what kinds of reactions you want to create, and how it all interacts with other events within the game. Clearly, as you build out your knowledge of coding and AI design, this diagram will become more complex; for example, “Player Hits ‘Action’” would be clarified to include that a raycast from the player would be required for “Action” to cue the resultant behavior. Even if your knowledge of programming/building an AI system is still next to nothing, these methods of organization will help you greatly when you either pair up with an AI-minded programmer, or learn the process yourself.

It’s Alive! It’s Alive!!

The part of learning AI that is undoubtedly the trickiest for aspiring game developers is actually implementing the code to control your NPCs, game feedback systems, etc. For years, this part of the process has been a straightforward case of programming and, for those unfamiliar with coding, difficult. Now, thanks to the advancements in game development technology, there are more options…but unfortunately implementation of your AI is still a tough process. A common question is: Why hasn’t this part of development been made as intuitive as other aspects of the pipeline? Many people have offered their input on what Chris Hecker described as “the Photoshop of AI”; or an easily accessible solution for non-programmers to work with artificial intelligence. An important talk by Professor Michael Mateas about this concept is available exclusively here (http://www.design3.com/industry-insight/item/2404-michael-mateas-presentation-revisiting-the-Photoshop-of-ai-debate), in which he spells out the problems with the idea of a “Photoshop of AI” and why artificial intelligence may never have an easy-to-use option. The gist of his argument is that because the options for AI interactions are nearly endless, a tool that took most of the work out for you cannot exist. For example, if our diagram above were instead for a sports game, the inputs and behaviors would be 100% different; the lack of consistency between games makes designing for all options redundant.

That being said, there are numerous options being developed to act as middleware between you and your engine to reduce the amount of direct coding required. An extensive list of resources can be found at the end of this article, and there may be even more that we overlooked (feel free to add in the comments section). In essence, these pieces of software are not intended to be the end-all “Photoshop of AI” – rather, they do what they can to make your interaction with AI systems more tangible, easy to understand, and intuitive. Commonly this involves removing the need for in-depth coding and replacing it with a modular, visually-driven interface; these systems (like the Xaitment suite shown below) intend to allow more intuitive adjustments to be made by designers without complex engineering to the underlying system. In effect they abstract the programmatic connections to a simplified visual interface. Most of these middleware programs are not free, and require the user to learn and develop additional skills specific to the software, but in doing so can offer a much easier (and faster) way to control your game’s AI processes.

The Pupil Must Become The Teacher

The most extreme difference between AI authoring and all other aspects of game development is that the software will not do extra work for you. You might apply a brush in Photoshop, drag it across the canvas, and achieve an end result that you couldn’t have planned on; similarly, you can tweak physics settings in Unity and discover new interactive dynamics. However, AI design requires that you know more than the software knows – you must have all your ideas in your head and use the code/middleware to achieve it. This fundamental difference explains why you haven’t ever found yourself ‘playing’ with AI tools as you might with Unity, UDK, Source or the variety of software used throughout the pipeline. In short, you must know more than your game in order for your AI interactions to be satisfactory; this might prove to be a difficult hurdle in your game development race, but if you truly dedicate to it, you can master the art of designing artificial intelligence in your games. If your time is spread too thin, don’t feel embarrassed to join up with someone more adept at programming – just make sure you get your intentions and ideas across clearly, and stay true to your original vision. No matter what choice you make, start looking into AI more deeply today to begin reaping the benefits it can offer to your game development projects.(Source:gamasutra


上一篇:

下一篇: