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

深入探讨游戏AI类型及其设计要点

发布时间:2012-10-06 08:53:29 Tags:,,,

作者:Luke Dicken

Warren Spector最近就现今游戏产业对于优秀AI的需求为主题接受了Eurogamer的采访。他自称特别希望John Carmack和Tim Sweeney等人能够将注意力从图像上转移到创造可信赖的角色和具有沉浸感的游戏世界。

对此我有些疑问。要知道,他所提到的这些人都是图像程序员而非AI专家。想想看,让图像程序员来AI的问题,就已经明显是一个AI文化上的问题——AI并不被视为一个真正的学科,人们认为它并不“困难”,在这个领域还未出现任何可被称为“专家”的人,所以我们当然也能邀请图像程序员前来解决问题!

当然了,这种说法并不正确,并且这也是对于那些正致力于此的专家的侮辱。我们并不需要John Carmack为我解决AI问题,我们希望的是人们能够注意到AI领域中Carmack式的角色,他们经常被忽略,因为“玩家并不需要优秀的AI”。

然而Warren所谈论到的这些心酸面却非常有意义,这也是我过去几个月的演讲中所强调的内容。

我所谈论的一大主题便是AI的扩展和推广——希望以此解释什么是AI以及我们该如何使用AI创造出更优秀的游戏。

对于很多人来说AI是一个非常可怕的话题。我想很大一部分原因是,基于文化影响我们总是习惯于将智能机器看成是一些坏东西。在过去数十年间出现了各种关于智能机器奴役人类的书籍和电影,而这一切都只是因为机器人和AI系统太过聪明了。这一点让人类感到害怕。但是事实却不一定是这样的!

其实AI也就是一种有关决策的应用科学。数学中有一个完整的分支是关于决策分析的,其中包含了决策论,游戏论以及经济论等。这让我们能够基于理论去陈述如何在一个特定的环境下做出反应,即当我们在进行了所有的算式分析后,我们便能在黑板上获得一个完整的结果,然后离开——这样问题也就解决了。而AI便是将这些解决方法付诸实践——不管是在模拟环境中还是机器人身上。

但是真正的问题在于,我们可以在哪里看到这样的决策?一般情况下当玩家在谈论游戏中的AI时总是会说到“AI会做某某事”,其实这也意味着AI就是游戏中的敌人。

游戏中便存在着许多这样的决策,即开发者投入了大量的精力创造出各种能够被玩家所注意到,并在被杀后使他们信服的角色。这也是游戏AI作为一门学科所强调的内容(也就是我们所说的敌人AI)。

人们总是会说玩家并不喜欢在游戏中看到更优秀的AI,从某种程度上看来这种想法也不无道理。因为玩家总是不希望敌人会比自己聪明。

而我的主张便是明确地解决这一问题,特别是在学术界,“更优秀”也就意味着更强大且更有能力。如果这就是游戏AI的目标,那么就像暴雪的Schwab(游戏邦注:暴雪的高级人工智能/游戏工程师)在2011年GDC上所指出的那样,我们便可以只是创造出一些更快,更强且更有攻击性的NPC。

创造出一款更具有挑战性的游戏并不复杂。相关学者(特别是AI学者)便能够搬出最佳解决方法,而我的突破便是进一步解释游戏AI是如何优化“乐趣”元素。有些人理解了这一点,也有些人会使用各种算式去定义乐趣,但是不管他们使用的是何种方法都不会改变核心理念,这也是我们在游戏中使用AI而试图达到的目标。

我希望在此解释我们该如何使用AI去做到这一点。我并不会分析一些技术细节,我只想以设计师和制作人能够理解方式来阐述。

有史以来最优秀的游戏

一开始我想声明的是,很多人都会将《龙与地下城》看成是史上最优秀的游戏。不管是游戏本身还是其整体的桌面风格都是迄今电子游戏都未能超越的。它的支持者们从未对这款游戏感到厌倦;对于他们来说拿这款游戏与大热的《魔兽世界》相比实在有够痛苦的。

D & D(from my.mmosite.com)

D & D(from my.mmosite.com)

《龙与地下城》最突出的一点便是它本身其实并不能算是一款游戏,更确切的说它应该是一个规则框架,即游戏是在这个框架中诞生的,并且玩家不会被局限于任何行动中。当然了,这也意味着玩家将尝试着去做一些古怪但却有趣的事,并且他们不可能预先猜到自己将面对什么,也正是如此才诞生出这款游戏。

之所以能够设定这样的规则是因为,游戏是由人类所扮演的地下城城主控制着的。DM也是游戏和游戏群组的组成部分。在游戏开始前,他们创造了世界,并明确了相关游戏理念,如游戏情节是怎样的等等。

我们需要注意的是,因为玩家将很大程度地推动游戏内部元素的发展,所以地下城城主便很难预先规划完整的故事情节。就像任何优秀的战略家所知道的那样:“没有任何作战计划在与敌人遭遇后还会有效”,所以玩家将只能在游戏过程中逐渐完善整个故事。

但是这种发展过程将会引出一些遭遇战,所以开发者便需要创造一张地图并在此添加一些与玩家相敌对的生物。除此之外开发者还必须在遭遇战或特别元素中添加情节装置,去预见一些今后会发生的事件,为玩家创造一种具有内在凝聚力的游戏体验。

当开发者创造了这种遭遇战并且玩家也融入了其中,DM便需要决定该在地图上设置哪些生物了。这也是DM这一角色所具有的一大乐趣,因为DM必须平衡所有生物的行动,并带给玩家激动人心(但是不能具有过多的挑战性)的游戏体验。

如果玩家又一次死于goblin射手的箭下,那么让射手转向并朝着墙上射击就没有任何道理了。玩家并不会相信这一行动,他们也不会喜欢上这种带有错觉的冒险。

Schwab将其描述成“失去风格”,这也是这种玩家体验管理的一大重要组成部分,我们不希望游戏任凭玩家摆布,但同时我们也不希望看到玩家在游戏中受挫,或提前结束游戏。

解决这一问题的最好的方法便是明确游戏的目标对象,了解这一目标对象中有那些类型的玩家,以及他们在特定情境下会做出何种反应等。这让DM能够更好地进行游戏管理,并最终促成玩家想要看到的结果,同时还能面向特殊的玩家类型定制他们所喜欢的内容——如果你了解到目标玩家更喜欢用交涉来解决方法而不是相互对抗,你便能够为他们提供最合适的选择。

同样地,如果你所面对的是喜欢对敌人发动猛攻的玩家,你便可以为他们设置一些“惊喜”,让他们能够利用这些惊喜去做一些愚勇之事。

在我看来,DM便是造就《龙与地下城》等游戏取得成功的大功臣。它们比同时代的游戏拥有更长的寿命,时至今日仍然深受玩家欢迎,并拥有非常强大的用户基础。

这是我们今天在制作游戏时能够效仿的一种“黄金准则”——不一定是参考设置和基调,我们也必须学习这种给予玩家最大选择空间的设计原理,而这一切都深刻地影响着我们今天所面对的游戏世界。

当然了,最简单的方法便是在每一款游戏中设置DM,但我们也需要正视的是,在游戏中安插一个角色让他时刻盯着玩家的行动并实时控制游戏也会被认为是一种侵犯人权的行为。

所以我们应该在开发期间预先分配好DM的工作。我们需要事先确定整个游戏情节,避免一系列遭遇战与各种场景搅合在一起。也就是我们将在一些固定的关卡中经历这种遭遇战——这些固定的关卡是设计师精心设置的,并不会因为玩家玩了多少遍游戏而发生改变。

然后我们还花了大量的时间去控制遭遇战中的小兵——从某种程度上来看这便是对于游戏AI的最广泛认知。

当然了,我要说的不只如此,我还想谈谈我们该如何使用AI去复制DM角色,并最终创造出强大且具有吸引力的游戏体验。

叙事AI

虽然我不是很理解这一点,但是我们却能够使用AI去阐述有趣的故事,我们可以基于这一点去考虑玩家的行动并更好地调整故事内容。当BioWare成为了分支叙事做法的最大先驱时,这种叙事AI方法也渐渐变成了主流形式。

这种设置更像是70年代的专家系统而不是我们所认为的真正的AI,但是在《质量效应》等游戏中,玩家的选择将作为游戏中的一重要组成部分而影响着之后的发展与选择。从基本层面来看,你可能会认为这只是你所选择的一种冒险,但是即使是这样,很快地它也将变得非常复杂了。

现在让我们将《质量效应》等游戏中的一些细微差别添加到对话,循环游戏角色等内容,此时潜在状态图中的组合数量将会不断激增。我们可以继续深入下一个阶段,因为我们不仅能够使用AI技巧呈现出潜在阶段的数量,从而进行更有效的管理,同时也能在游戏世界中引入各种行动让AI系统引导着玩家进入概念图表中的某一特定状态。

如果我们希望玩家能够到达故事中的某一个特定的点上,我们便可以沿着特定的方向将他们往后推,并开始限制他们的选择。操作合理的话我们不仅能够让玩家感受到完整的选择,同时也能够有效地管理游戏体验。

我们也可以基于文学角度去构建游戏理念,并通过调整相关元素呈现方式而有效地操控故事节奏。

遭遇战中的AI

在游戏开发社区中,程序内容生成(PCG)是最近的大势所向。基本上来看,它指出创造各种内容(游戏邦注:包括任务,各种类型的武器甚至是关卡等)是一个耗时的过程。

基于一定的开支,我们可以创造一个AI过程让我们能够获得想要的内容,并尽可能创造出我们所需要的所有元素。《天际》的Radiant任务系统便证明了这一方法的有效性,这让开发者可以无需手动编写任何内容便能够创造出无限的支线任务。系统可以基于混搭模式明确探索,任务和目标的位置,然后将其传达给玩家。

《翼飞冲天》便是另外一个典例,即玩家每天所体验到的关卡都在发生变化——开发者无需基于算式去生成这些关卡,因为这只会是白白地浪费时间。

Tiny-wings(from gamejudgment.com)

Tiny-wings(from gamejudgment.com)

可以说提到PCG就不能不提《翼飞冲天》!在这款游戏的核心中,程序内容是动态地创造各种内容,看起来好似随机的,但事实上并非如此。但随机性并不意味着你可以随便将一名有才能的内容创造者(如关卡设计师)替换成他人——这也正是他们被雇佣的原因。

我们能够汲取他们的想法并将其整合到生成系统中,从而创造出他们心目中的理想内容。再次以《翼飞冲天》为例,游戏中的每个关卡都具有不同的参数描述,尽管游戏中的特定细节每天都会发生改变,但是关卡所带给玩家的整体感觉始终保持一致,而难度则会以相同的方式不断发生改变。

可以说程序生成是最接近我的想法的一种模式,并且也是Heather Decker-Davis所认同的模式,所以我们才将其广泛地应用于我们所创造的休闲游戏中,而它也帮助我们塑造了许多合理的工作流程和工具。

角色控制AI

就像我之前所说的,这是一个非常传统的领域并获得了大量的关注,除了阐述你能够用于创造角色的各种技能(如行为树,目标导向行动计划,等级任务网络以及有限状态机等)外,我将尽量简略概括。

最后你需要明确自己想努力获得的目标到底是什么——是提供给玩家具有挑战性的对手还是吸引人的同伴?除此之外开发者还必须区分那些将被毁灭的AI技能以及那些用于反应各种(玩家将会面对的)古怪但有趣的内容的AI技能。

如果你想要创造敌人,你便需要考虑这些敌人是否是以小组的方式而出现,以及这些小组是由一些相关联的敌人所组成的松散小组还是接受了某种特定命令(游戏邦注:可能是小组内部军官的命令)的训练有素的小组。

《光晕》便证实了带有军官的小组能够有效地执行道德系统,并具有强大的团队凝聚力,愿意与军官同生死。

这种设计选择将直接决定哪种AI技能将创造出游戏世界中最符合玩家要求的角色,而当玩家看到的是不符合自己预想的角色时,他们的游戏沉浸感便会遭到严重破坏。

玩家愿意相信外星人占领了纽约,以及政府命令军队杀死所有相关人员,但却不愿相信自己能够杀死一些士兵但却对于同伴的死亡没有任何反应。

玩家建模AI

游戏中的玩家建模是一种已经得到广泛认可的新方法,但同时它也算是一种变革性力量,特别是在结合我们之前所提到的各种技巧时。当我们在现实中与真人玩游戏时,玩家建模可以说是我们最熟悉的一种方法了,也就是我们会尝试着去揣摩对方的身份以及他们的游戏方式等。

例如在扑克游戏中这便是一种很常见的方法,游戏中存在固有的玩家分类,如“严谨”和“散漫”便是我们在游戏中的常用的形容术语。在这类竞争游戏中我们通过这些分类去预测对手的行为,但是这也不是游戏AI的真正目标——当对手了解并适应了你的战术和挑战,你便需要更努力地与之对抗,而我们对于这种技能的使用范围却远不止如此。

《寂静岭:破碎的记忆》便完美地体现出了游戏中的玩家建模元素。在游戏的开场你将发现自己正在医务室接受着一连串的心理测试。这是玩家所陌生的环境,尽管场景的设置是关于角色在接受这种测试,但是实际上玩家的回应才是真正起决定性作用的。

事实上,这是面向玩家的测试,这也算是一种标准的心理描述。如此玩家将会被分成不同的类型,所以在游戏中开发者将根据不同类型的玩家而呈现出不同内容。这并不会改变整体的游戏故事,只是会改变游戏体验的基调和情感。

Silent Hill(from gamasutra)

这是两个不同类型的玩家所体验到的相同场景(from gamasutra)

但是如果你在游戏一开始并未拥有足够的时间对玩家进行性格测试,情况又会是怎样?说实在的,如果游戏必须提供这样做的理由,玩家很快便会感到无聊了。就像在扑克游戏中,我们可以根据玩家的游戏风格去划分不同玩家,我们同样也可以在其它游戏中这么做。

2009年,来自根本哈根ITU大学的Drachen等人便通过玩AAA级游戏《古墓丽影:地下世界》而进行数据分析。他们发现通过使用这种机器学习方法能够将玩家划分成一些较常见的类型,如“资深玩家”,“解决者”,“和平主义者”以及“奔跑者”。这完全是基于游戏内部的分析,而我们也已经广泛使用了这种类型的数据。

通过使用AI系统我们便能够进一步了解玩家以及他们是如何与游戏进行互动。我们也可以再次返回内容生成或叙事系统中,面向着特定的个人群组去定制相关游戏体验。这是我们过去几年在学术界中一直在探索的内容,如马里奥关卡生成等。

现在我们也逐渐能在一些“真正的”游戏中看到这些内容,我和Heather已经尝试着将这些内容整合到我们的独立游戏中去。对于我们来说这是件再简单不过的事了。我们的游戏是基于一个简单的迷宫系统,这也是由我们的PCG系统所创造出来的。

如果我们能够察觉到哪些玩家对于迷宫探索感兴趣,并确保他们在进一步发展前已经收集到了所有物品,我们便能够根据游戏内容而提供给他们更加蜿蜒崎岖的迷宫以及更广泛的收集物品。同样地,如果我们发现玩家更愿意直接进入迷宫并经历其中的各种危险,我们便可以根据他们的喜好而提供更多行动导向式体验。

使用人类DM去掌握玩家的喜好和愿望也就意味着我们能够更好地迎合特定玩家的需求,并让他们进一步融入到游戏中。这也意味着玩家将获得更棒的游戏体验并感受到更多乐趣,并说明我们将创造出更加出色的游戏!

总结

我真心希望本篇文章能够帮助你更好地理解AI在游戏中的作用——AI将成为游戏开发领域的“明日之星”,而我们需要做的便是培养更多不再畏惧它的设计师!(本文为游戏邦/gamerboom.com编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦

Opinion: The Spector of game AI

By Luke Dicken

Warren Spector recently gave an interview to Eurogamer that’s circulating pretty widely now about the need for better AI in games. Specifically what he’d like to see is people like John Carmack and Tim Sweeney stop focusing on graphics and start working on creating believable characters and immersive worlds.

Of course, I’ve got some issues with this. These guys are graphics programmers, they aren’t AI experts. Thinking that a graphics guy can just up sticks and refocus on AI is effectively part of the cultural issue AI has – it isn’t considered a serious discipline, it isn’t “hard,” it isn’t something people are experts in already, so let’s call in some graphics programmers to solve the issue!

Of course, this is completely untrue and shows a bit of contempt for the AI that does exist and the experts who are working on it right now. We don’t need John Carmack to solve AI for us, we need people to listen to the Carmack-esque characters who already exist in AI and who are ignored because “players don’t want good AI”.

However, this minor piece of bitterness aside, what Warren is talking about makes a lot of sense, and it’s something I’ve been saying a lot over the past couple of months as part of a lecture tour that’s taken me to South America, Europe and across the USA.

One of the key themes I’ve been talking about is AI outreach and advocacy – helping to explain what AI is and how we can use it to make better games. So, because Warren has set the stage so well by bringing it up, here is the article version of that presentation!

Why so scared?

AI is seen as a really scary topic by a lot of people. I think a big part of it is that we’ve been culturally conditioned to see intelligent machines as an inherently bad thing. We’ve had decades of books and movies dedicated to the enslavement of humanity, if not an outright apocalypse, all because of robots and AI systems getting a little too smart for our own good. It makes people kind of wary. But it doesn’t have to be that way!

All AI really boils down to is the applied science of decisions. There are whole branches of maths dedicated to analysis of decisions, Decision Theory being an obvious one, but also Game Theory and even Economics. These all allow us to theorize about how we should react in a given situation, and after we do all the algorithmic analysis, we end up with a neat result on a whiteboard and we walk away – problem solved. AI is about putting that solution into practice, whether it be in some simulated environment or with a robot.

But the big question is, where do we see these kinds of decisions? Typically when gamers talk about AI in the context of games you might hear that “The AI did such-and-such,” and what they really mean is the enemy in the game.

There are an awful lot of decisions happening there, it takes a surprising amount of sophistication to create characters that can believably run into the player’s field of view and convincingly fall over when killed. And whilst this is what a lot of Game AI focuses on as a discipline – what you might call opponent AI – there’s a lot more possible.

People often say that players don’t want better AI in games, this is what they’re talking about. And to an extent they’re right, because what they mean is that players don’t want opponents that can out-think them.

Part of my advocacy has been to address this specifically, especially in the academic community where “better” typically means stronger and more capable. If that was truly the goal of Game AI, as Blizzard’s Schwab pointed out at GDC ’11, we could just make NPCs that were faster, stronger and had more powerful attacks.

Making a game more challenging in and of itself isn’t hard. Academics – especially AI academics – like to talk in terms of optimal solutions, so one of the breakthroughs I’ve had is to explain Game AI as AI that tries to optimize “fun”. Some people get it, others then want to pontificate about an algorithmic definition of fun, but that doesn’t alter that as a core concept, this is what we are trying to achieve by using AI in games.

What I want to do, though, is explain to people how we can use AI to do this. I’m not going to deal in technical details, because what I want to do is explain this in a way that designers and producers can follow, and implementations already exist out there.

The best game ever made

I want to start out by asserting that Dungeons & Dragons could quite easily be described as the best game ever made. It, and the table-top genre as a whole, has endured in a way no video game has to date. And its supporters aren’t growing tired of it; it’s just a bit of a pain to organize compared to firing up World of Warcraft.

The great thing about D&D is that it’s not a game itself; it’s a rules framework in which games can be created and players aren’t restricted in what they can do. Of course that means that players will try to do weird and wonderful things, things that could never be predicted beforehand, and that’s where D&D can come into its own.

The thing that makes this possible is the human Dungeon Master who controls the game. The Dungeon Master is part of the game, and part of the gamer group. Before the game starts, they create the world and build up an idea of what the plot of the game will be.

It’s important to note that since the players drive a lot of the game, the DM can’t plan out the entire storyline in advance, because as any good strategist knows, “No battle plan survives first contact with the enemy,” and players need to be able to shape the story that is unfolding in their own way.

Invariably however, this unfolding process will lead to a combat encounter, which requires a map to be created and populated with creatures for the players to battle. There may be plot devices as part of the encounter or specific elements that foreshadow something to come later which combine to create a subtly cohesive experience for the player.

Once the encounter is created and the players are engaged in it, the DM will take responsibility for controlling whatever creatures have been placed into the map. This is a fairly interesting part of the role, because the DM has to balance the need to take believable actions that would make sense for those creatures against the need to make an exciting – and not too challenging – experience for the players.

If the players will die from one more hit from a goblin archer, it doesn’t make sense for the archer to turn and fire into the wall. This isn’t a believable action though, and players in general won’t like that there is only an illusion of risk.

Schwab described this as “Losing with style,” and it’s a key aspect to this kind of player experience management – we don’t want to be blatantly throwing the game in favour of the player, but at the same time, we don’t want to be insensitive to the fact that they are playing a game and don’t want to be frustrated or have the game end prematurely.

One of the most important ways to manage this is to have a good understanding of who you are running the game for, knowing what types of player are in the party and how they will react in certain situations. This allows the DM to have a much better handle on how to stage manage the game to get the desired outcome, as well as tailoring the content to suit particular player types – if you know that players in your group tend to favor finding diplomatic solutions rather than confrontation, you can ensure that the options for this kind of play are available.

Equally, if you have a player who is liable to charge at every band of enemies presented, you might like to prepare “surprises” for that player to exploit that they’re going to do something foolhardy.

The Dungeon Master is, in my opinion, a significant part of what makes D&D and games like it so successful. They have a longevity completely unmatched by any other games from their era, and continue to enjoy popularity and a zealous fan-base.

To my mind, they represent the “Gold Standard” of what we should be trying to emulate when we make games today – not necessarily in terms of setting and tone, but certainly the design philosophy of empowering players to make choices and have real, tangible impact on the worlds we are playing in.

Of course, the obvious way to do this would be to ship a DM with every game, but I’ve been assured that cramming guys into retail boxes specifically to look over the player’s shoulder and tweak the game in real time would be considered a human rights violation. … Hippies.

So instead, what we typically do is pre-bake a lot of the DM’s job during development. We fix the whole plot of the game upfront and reduce it to a sequence of combat encounters stitched together with cutscenes. We play those encounters out in a set of fixed levels, crafted by a designer once and then never changed, no matter how many times a player works through them.

And then, we spend the vast majority of our time focusing on controlling the minions within the encounters – to such an extent that this almost becomes the totality of the wider perception of what Game AI is.

Of course, it is so much more than that so I want to close out by discussing briefly how AI can be used to start to replicate the DM’s role, and hopefully create powerful, engaging experiences as a result.

AI for storytelling

This one is a bit over my head, but we can use AI to dynamically tell interesting stories, to take into account the player’s actions and adapt the story to take this into consideration.

We’ve started to see this becoming increasingly mainstream lately, with BioWare being one of the big pioneers of some of the lowest-hanging fruit here with branching narrative.

This is more of a ’70s era expert system than what we think of as true AI, but consider a game such as Mass Effect, where your choices at one part of the game are going to influence what happens and what choices are offered later. At a basic level, you might think of this as a choose your own adventure book, but even that rapidly becomes pretty complex.

Now add the nuances that Mass Effect and the like introduce into dialogue, recurring characters and so on, and the combinatorial explosion on the potential state graph is pretty intense. We can go a stage further though, because not only can we represent an enumeration of potential states using AI techniques to effectively manage this, but we can start to introduce actions within the world that are the AI system steering the player towards certain states in this notional graph.

If we specifically want the player to arrive at a particular point of the story, we can push them back in that direction and begin to constrain their choices. If done carefully, we can give the illusion of complete choice, whilst still stage managing the experience. We can also build in concepts from literature to this, and manage the dramatic pacing of the story by modifying how components are shown to the player.

Choosing your own path through an entire trilogy proved to be so engaging to players, that they nearly revolted when this choice was removed.

There’s a strong and growing Interactive Fiction movement that has some great resources on this subject. A great place to start if you are able is “Beyond Eliza: Constructing Socially Engaging AI” from this year’s GDC. For those without Vault access, Leigh Alexander wrote a summary of the session on Gamasutra that is a good substitute.

For those wanting more detail, you could do a lot worse than check out University of Teeside’s Marc Cavazza, who has a lot of publications centered on the theme.

AI for encounter design

Procedural Content Generation is one of the latest crazes sweeping through the game development community. At its most basic, it says that creating content, whether that be quests or a varied array of weapons or even levels for the game, is a time-consuming process.

For a certain amount of overhead, we can instead create an AI process that will make that content for us, and make as much of it as we need. Skyrim demonstrated this effectively with the Radiant quest system, which enabled the developers to create a seemingly limitless range of side-missions without ever having to write one of them by hand. The system could pick, in a mix-and-match style, a location for the quest, a task, a target and then assign it to the player.

Tiny Wings is another great example, where every day the levels the player experiences change – without a way of generating these levels algorithmically, it wouldn’t be feasible to do this since it would be so time-consuming.

No discussion of PCG is complete without a Tiny Wings reference!At its heart, procedural content is about creating things dynamically, and may seem to be random, but rarely is. Randomness in general is a bad idea when you are talking about replacing a talented content creator such as a level designer – there’s a reason these folks get paid to make content, and it’s not because they can be replaced by glorified dice.

With that said, it’s often possible to capture something of their insight and build that into the generation system, to create the kinds of content that they would. Using Tiny Wings again, each level has a different parametric description, so the overall feel of the level is kept the same and the difficulty progression varies in the same way each time, despite the specific details changing day-to-day.

Procedural generation is something that’s really close to my heart right now as myself and Heather Decker-Davis have been relying on it heavily for a casual title we’ve been working on, and in turn it has shaped a lot of our workflow and tools.

You can hear more about our experiences and some tips we shared for working with procedural methods in this presentation, which we gave at the No Show Conference in July. You might also find this article by Notch discussing terrain generation in Minecraft of interest, and again if you have GDC Vault access, the guys behind Spelunky gave a great overview of their approach last year.

AI for character control

As I said earlier, this is traditionally an area that gets an awful lot of attention, so I’m going to gloss over it a little bit, except to say that there are a broad range of techniques that you can use to create characters, such as Behavior Trees, Goal-Oriented Action Planners, Hierarchical Task Networks and even Finite State Machines.

Ultimately, though, you need to understand what you are trying to achieve – is it to provide the player with a challenging opponent, or an engaging companion? The AI techniques required to die convincingly are separate from those required to create a believable set of responses to the weird and wonderful things that the player might decide to do.

If you intend to make opponents, you need to consider if they work in squads, and whether a squad is a loose collection of affiliated enemies, or a well-trained group following specific orders, perhaps from an officer within the group.

The Halo franchise demonstrated that small squads with officers could implement a morale system effectively and have squad cohesion disintegrate with the death of the officer.

These design choices are going to have a direct impact on what AI techniques are going to be most appropriate to create the desired feel to the characters in our game worlds, and it can be some of the most immersion breaking moments for players when the characters don’t act the way they expect.

They are willing to believe that an alien swarm has taken over New York and the government has ordered the military to kill everyone involved, but they aren’t willing to believe that it’s possible to kill one of a pair of soldiers without having the other react in some way to his companion’s death.

There are lots of resources for reading more about this kind of AI, from AIGameDev.com through to a large portion of the AI Summit held at GDC, available through the Vault. The AI Game Programming Wisdom series of textbooks is also a good source of material.

And when it comes to understanding the rationale behind the decisions characters might make in specific circumstances, I also highly recommend “Predictably Irrational” by Dan Ariely, which is a book about so-called “Behavioral Economics,” or where decisions meet psychology head on.

AI For player modeling

Player modeling in games is a relatively new approach that has yet to see wide adoption, but which has the potential to be a bit of a game changer, especially when combined with some of the other techniques already discussed. At its most basic, player modeling is something we’re already pretty familiar with whenever we play a game with humans; we try at some level to get a sense for who they are and how they play.

This is most often seen in games like Poker, where the stereotypical classifications of players, such as “Tight” and “Loose” have become part of our vernacular. In these competitive games, we use this kind of classification to predict an opponent’s behavior and exploit this, but again this isn’t really the aim of Game AI – sure it’s great when an enemy opponent adapts to your tactics and challenges you to try harder, but we can use this technique for so much more than this.

Silent Hill: Shattered Memories is a great example of player modeling in action. In the opening scene of the game, you find yourself in a doctor’s office undergoing a battery of psychological tests. Unknown to the player, however, the scene is set up in such a way that although the character is being given these tests, really the player’s responses to them is what matters.

In truth, the testing is being done on the player, and it’s actually a standard psychological profile being built up. Based on this, the player is put into a category, and throughout the game, different content is shown to them dependent on their category. It doesn’t change the overall story of the game, but it does change the tone and feel of the experience.

This is the same scene, as experienced by two different types of player

But what happens when you don’t have the luxury of running a complete personality test on the player as the game begins? Let’s face it, games would rapidly begin to feel pretty dull if they all had to find a justification for doing this! It turns out that just as in Poker, we can start to classify players as we observe their playstyle, we can do the same thing with other games.

In 2009, Drachen et al at ITU Copenhagen were able to analyze data from playthroughs of the AAA title Tomb Raider: Underworld. What they found was that by applying some machine learning approaches, they could extract a number of stereotypes of players that people would broadly fall into, namely “Veterans,” “Solvers,” “Pacifists,” and “Runners.” This was based entirely on in-game analytics, the kind of data we all have access to already.

Using AI systems then, we can learn a lot more about our players and how they interact with the game. But we can also feed that back into our content generation or narrative systems to start customizing the experience directly to specific groups of individuals. This is something we’re seeing explored in the academic world through such things as the Mario Level Generation competition that has been running for the last couple of years.

It’s something that we’re starting to see come to “real” games a bit, and in particular it’s something that myself and Heather have been working to put into our indie title. For us, it’s pretty much a no-brainer. Our game is based around a simple maze system, and this is broadly what our PCG system creates.

If we can detect players who are interested in exploring the maze and ensuring they have collected everything before progressing, then we can adapt our content to prefer to give them more sprawling mazes with a wider range of things to collect. Equally, if we find players are more liable to dart straight to the maze exit and take more risks with the hazards in the maze, then we adapt to suit those tastes too and provide a more action-oriented experience.

As with the human DM, understanding the players tastes and desires means that we can cater more directly to specific individuals and get better engagement with them. That means they have a better experience, more fun and means we’re making better games!

The end

I really hope that this post has helped you to understand a little bit more what AI can do for your games – in a very real way, Warren Spector is bang on the money, AI has the potential to be the next big thing in game development but we need to get more designers who aren’t intimidated by it!

If you want to learn more, there are some great resources online that can help you get started, and of course every year the AI Game Programmers Guild hosts the AI Summit at GDC which is a great source of more inspiration. And who knows, maybe you’ll run into Warren there!(source:GAMASUTRA)


上一篇:

下一篇: