找回密码
 点一下
查看: 587|回复: 1

如何利用刷出动画制作可信而智能的AI

[复制链接]
发表于 2013-2-25 10:15:25 | 显示全部楼层 |阅读模式
本帖最后由 theninth1985 于 2013-2-25 10:17 编辑

  转载自:http://gamerboom.com/archives/66295

作者:Travis Hoffstetter


作为一名游戏玩家和关卡设计师,我能看出遭遇战中出现的刷出动画是否达到理想效果。3款AAA游戏的制作经验告诉我,导致遭遇战的刷出动画太无聊的原因是很多的,但是因此在开发前期忽视制作丰富的、高品质的AI刷出也是错误的。在AI与玩家互动以前,要使它显得逼真,必须让它以独特的方式进入关卡;再加上强大的AI系统和可靠的关卡设计执行,是组成高级遭遇战敌人的基本元素。

在本文中,我将为读者介绍制作高品质AI刷出的过程。在理想情况下,一支开发小分队在制作前期就要开始制作AI刷出。因此,当制作正式开始时,关卡设计师就有一套敌人刷出作为快速执行和重复遭遇战的工具了。即使制作已经完成,这也是一种可靠的工作实践,得到的成果仍然可以供其他关卡团队使用。



common AI entrance(from gamasutra)


AI刷出的类型

AI进入关卡空间的方式太多了,在此我列举主要的5种类型:

AI环境无互动刷出:这是一种常见的类型,即AI进入场景时不对所在的环境产生交互作用。例如,AI从拐角处跑出来、从天花板的洞降落下来、通过某种炫丽的特效出现在场景中。

AI环境互动刷出:AI进入场景时与所在环境产生互动活动。例如:AI踢开门、AI沿着柱子滑下来、AI撞开窗户、AI从地上刚形成的一个洞里爬出来。

AI物品互动刷出:AI进入空间时借助动画或物理驱动的物品。例如:AI从飞船上落下来、AI从卡车里跳出来、AI在船上朝玩家开枪。

多个AI环境互动刷出:多个AI进入场景时与环境产生互动活动。这种类型有趣的地方是,玩家可以中断AI活动。例如,一个AI帮助另一个AI从高台降下来,玩家可以在他们互相帮助时朝其中一个AI射击,使之落地死亡。当AI处于脆弱状态时,中断这整个过程和对AI造成更大伤害,可以给遭遇战增加复杂度。

多个AI物品互动刷出:多个AI进入场景时与物品产生互动活动。两个AI正在打开车库的大门,如果你在这时射死其中一个,门就会马上落下来砸死另一个。这是产生于玩家与AI互动的一个有趣因素。就这样,AI不可能跑过来进攻家了。设计师在这类刷出中创造了一个微型游戏,肯动脑筋的玩家可以避免这场遭遇战。


unique exciting spawn(from gamasutra)


极致

多个互动AI刷出是AI刷出的前沿技术。很难做动画,而且并非所有游戏都有这种让AI与AI或物品同步动画时仍然正确响应玩家的破坏行为的技术。

如果你的AI不能与另一个AI或游戏内物品同步动画,那么告诉你的AI程序员和设计师这种刷出方案可能还不能在项目中执行。他们会对你的问题感兴趣,并乐意提供帮助。记住,任何让AI生动起来的事,都要靠他们。

确定刷出位置

介绍完几种刷出类型,下一步就是认识刷出产生的位置的表述用语。AI刷出位置似乎有很明显的表述语言,但是,有些开发者根据AI的角度考虑刷出位置,而另一些开发者则从玩家的角度理解刷出位置。例如,动画师可能说AI从柜子里跳出来的刷出发生在左边,如果AI跳出来时是朝左边移动的话。然而,设计师可能认为这种刷出是发生在右边,因为AI是朝屏幕的右边移动的。确定一种规范的表述方法可以避免这种因为不同视角而产生的交流混乱。

首先是AI刷入的垂直位置,即顶部、中部和底部。例如,一个敌人从头顶上方落下来,一只僵尸从柜子里跳出来,一只蝗虫从地上的洞里钻出来。


subdivision of the screen space(from gamasutra)


你可能有一段刷出动画,用示意图表示某个方向可能比模块化部件来得好。例如,从屏幕上看,一只僵尸从柜子里朝左边跳出来。如果分别用模块化刷出动画表示左边、右边和中间刷出,当僵尸在左边刷出时,他就是直接跳出来,落地站好,然后调整移动方向朝向玩家,看起来非常机械。

在现实生活中,僵尸(如果现实生活中有僵尸的话)跳出柜子后,一落地就是朝人扑来的。通过使用特定的“从柜左边跳出”的动画,使僵尸在跳的过程中调整方向,会让僵尸看起来不那么机械,似乎能意识到周围有人类。这个原理也适用于大部分刷出动画,想一想一个敌人从上方落下、把门踢倒或从地板的活门爬上来。当AI出现在场景中时将方向朝向玩家,看起来会显得更逼真,更聪明。AI要调整方向意味着我们的位置表述还要包括左边、中间和右边。


subdivision added(from gamasutra)


刚才我只谈了垂直位置,现在要说的是水平位置。例如,“僵尸从左边的柜子里跳出来”是中间左边刷出、“敌人从建筑顶上往右边落下来”是顶端右边刷出。如果刷出没有水平位置,那就用垂直空间表述它的刷出位置。例如,《光晕》中的飞船就是垂直刷出。《耻辱》中的刺客就是中间刷出。

让你的团队理解这些表示刷出位置的用语,不仅可以提高交流的效率,而且有助于规范命名、头脑风暴、讨论AI刷出的顺序和书写漏洞。

研究现有的刷出类型

再来看看如何在你的游戏中运用以上五种主要的刷出类型。在向制作刷出的团队表述你的想法前,收集参考资料是关键。首先要研究与你的游戏类似的其他游戏,然后拓展到其他运用了你喜欢的刷出类型的游戏。当你在视频中看到喜欢的或想尝试的刷出类型时,可以收集起来。

上乘的AI刷出灵感无处不在,但最常见的来源除了游戏,就是电影。观看一些你喜欢的动作电影,观察坏人如何出现在遭遇场景中。还是那句话,如果看到喜欢的,别忘了收集起来,还要标记刷出在电影中出现的位置,以便之后作参考。

垂直空间是表述用语的重要部分,也是AI刷出的一种排列方式。各种垂直刷出类型你都应该研究一下。如果你的刷出中只有中间刷出,那么当AI出现时,玩家就不会环顾整个场景空间,那你就失败了。当AI进入时,应该让玩家观察整个垂直空间。为此,你需要各种刷出来满足眼球的运动,所以确保你能平衡这些刷出类型。

实现刷出类型

在决定刷出类型以前,还是要走常规流程。也就是,召集动画师、AI程序员、AI设计师和其他有想法的设计师开展讨论会。在白板上罗列各种刷出类型,然后开始头脑风暴。每一个类型都要至少想出十种创意,然后根据时间和资源条件排除不切实际的创意,留下可行的方案。

记录你想出的刷出垂直空间。确保顶中底三部分刷出的平衡分布。一个部分比另一个部分略多没关系,只要保证关卡设计师创造遭遇战敌人时有各种选择。

最后,根据重要程度排列制作刷出的时间顺序。如果你的团队进度落后了,你就知道要牺牲哪一个了。在电子游戏设计中,少即是多,宁可保证少量的刷出高品质,也不要容忍数量多的刷出低品质。

命名规范

我们可以利用表术用语给刷出规范命名。在每一段刷出动画名称前写上“屏幕位置–”,这样设计师、动画师和程序员就知道这段动画应该在哪里出现了。例如,僵尸从柜子左边刷出,应该写成“ML-柜子”。其中“ML”表示屏幕空间的“垂直中间(Middle)水平左边(Left)”。敌人从建筑上方往右边落下来应该写成“TR-落下”,即表示敌人从顶端(Top)右边(Right)往下运动。将屏幕位置作为前缀使设计师在搜索刷出列表时能很快找到他们需要的刷出。


spawn location matrix(from gamasutra)


如果刷出没有水平方向上的设计,如从飞船上落下或从特效中出现,那就把屏幕空间名称中的水平部分替换成“–模式”。当然设计师是很聪明的,在某些布局中,中间刷出可能会用在顶端位置,但80%的设计采用的是宫本茂法则。你设计的每一种系统都可能有一些特例,这没什么问题。

制作刷出类型

头脑风暴环节结束后,就到了制作刷出的时间了。首先,做一个白色的盒子,用于测试所有刷出类型。标记盒子的各个区域,以便所有人察看刷出方式。确保有一个网格结构模拟各个刷出的正确位置。最后,每周要开几次会,确保所有人在制作动画和编写代码时都能看到参考视频。

作为团队的领导者,你要负责制定刷出的品质标准。像动画出现和关卡剪辑之类的问题必须提出来并解决。如果物品动画不能与AI动画同步或动画师需要更多代码支持,那就找程序员谈谈。

刷出类型的制作标准

每制作出一个新刷出,其执行的标准列表也必须制定出来,这样关卡设计师才知道如保何构建和布局刷出。例如,飞船进入时需要的水平和垂直宽度是多少?天花板上的洞离地面有多远?刷出点在屏幕上可见或不可见?基本上,执行刷出的每一个细节都必须记录成容易阅读的文档,并存放在游戏目录或其他信息库中。

确保你的白色盒子的体现所有这些标准,并准确标记和评价。如果刷出需要一件动画物品或特殊的布置,那么就要将这些归类为预制件、组合件或引擎支持的其他游戏物品分类工具。一旦所有标准和刷出动画完成了,就要与设计团队召开会议,演示这些刷出,并告知他们标准是什么。

制作系统的刷出类型

如果做出一个非常实用的刷出,或有一个刷出要求不同动画变体才能满足不同关卡的布局,那就要把这个刷出系统化处理。例如,你有一个AI沿柱子滑下来的刷出,距离地面高度为500单位。关卡设计师发现这个刷出适合按顺序出现,但需要AI从不同高度的柱子上滑下来,以满足不同布局的要求。这时候,程序员就要让动画以样条曲线的方式出现或借助其他技术方案。因此,动画师就不用浪费时间制作不必要的动画,同时刷出也变得更加通用,从而节省大量制作时间。

总结

在制作前期,有趣的刷出动画往往被忽略;当资源有限时,就由关卡设计师在制作期间负责设计不同的刷出动画。尽早设计和制作刷出动画,一方面使关卡设计师在制作遭遇战时有现成的工具,另一方面节省了制作时间。如果设计师能更加看重尽早制作有趣的刷出,也许现在我们就能将高品质AI刷出的标准上调一个档次了。(本文为游戏邦/gamerboom.com编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦)

The Use of Spawn Animations to Make AI Look Smarter

by Travis Hoffstetter

As a gamer and a level designer I can feel when spawn animations in a combat encounter are an afterthought or have been rushed.  Having shipped three AAA titles, I know there are many reasons for the lack of interesting AI spawns in a combat encounter, but neglecting to create a varied, quality AI spawn set early in development is a mistake.  By having the AI enter the level space in a unique, thrilling way, the AI look lifelike before they even interact with the player.  Combining that with a quality AI system and solid level design execution brings together the base ingredients for a 90+ rating combat encounter.

I am going to walk you through a process for creating a set of quality and varied AI spawns.  Ideally, creating a set of spawns occurs in pre-production on a strike team.  That way, when production hits, all level designers have the spawn set as a tool for them to quickly implement and iterate thrilling combat encounters.   If production has hit, it’s still a solid workflow practice at the start of a new level and all your work can still be shared with other level teams.

Fig 1. The door kick has become a common AI entrance

Types of AI Spawns

There are only so many different ways AI may enter a level space.  The five major types include:

AI non-interactive environment spawn: Run of the mill spawns where AI spawn and enter the scene without interacting with their environment.  Examples include: AI run from around a corner, drop through a hole in the ceiling or depending on the AI type, pop into the world shrouded by some type of cool FX.

AI interactive environment spawn: Spawns where the AI interacts with the environment as they enter the screen space.  Examples include:  AI kick open a door, slide down a pole, crash through a window, or rise up out of a newly formed hole in the ground.

AI object interactive spawn: AI enters the space on an animated or physics driven object.  Examples include: a drop ship flies over and AI repel down, a truck pulls up and the AI jumps out, a boat pulls up alongside and the AI rain bullets on the player.

Multiple AI environment interactive spawn:  AI enters the space working together in the environment.  The cool factor of the multiple AI spawn is interrupting the AI action.  One AI helps another down from a high ledge, but the player can shoot them while they help each other causing one to fall and die.  Interrupting the whole process and inflicting more damage on the AI while they are in a vulnerable state adds a fun layer of complexity to the encounter.

Multiple AI object interactive spawn:   AI enters the space working together using an object.  Two AI open a large garage door together, if you shoot one of the AI in the process, the door drops, crushing them both.  The cool factor comes from the interactive possibilities the player has with the AI.  The AI just do not run around the corner anymore, now the designer has created a mini game out of the spawn where the player may avoid the encounter altogether by using their brain.

Fig 2. Enemies erupting from the ground in Gears of war are a unique exciting spawn

Take it to the Limit…Limiiiiit

Multiple Interactive AI Spawns are the cutting edge of AI spawns.  They are difficult to animate and not all games have the tech in place for AI to animate in sync with each other or objects and still play all the appropriate hit reacts upon interruption.

If your AI cannot animate in sync with in game objects or each other, talk to your AI programmer and designer as such spawn plans may not have been done on the project yet.  They will be EXCITED by your questions and want to help.  Remember, anything you do to make the AI look cool reflects positively on them.

Identifying Spawn Locations

Now that the types of spawns to create have been identified, the next step is to develop a language for communicating where on screen the spawns take place.  Communicating where AI spawn may seem obvious, but some developers think of spawn locations from the perspective of the AI while others from the perspective of the players. For instance, an animator may say a jump out of closet spawn is a left spawn if the AI moves to their left as they jump out of the closet.  However, a designer would think of that same spawn as coming from the right, because it comes from the right side of the screen.  A common language identifying vertical and horizontal screen space helps eliminate any communication confusion from different perspectives and helps ensure you have created a balanced set of spawns for designers to use.

The first part of our language is the vertical location that enemy AI can spawn in, top, middle and bottom.  An example of each would be an enemy repelling down from overhead, a zombie jumping out of a closet or a locust springing up from a newly formed hole in the ground.

Fig 3: Top, Middle, Bottom subdivision of the screen space

At times you may have a spawn animation where the animation looks better with delineation towards a specific side than as a modular element.  For example, consider a zombie jumping out of a closet on the left side of the screen.  If one modular spawn animation is used for left, right and center spawns, when he spawns on the left, he jumps straight out, lands and then his mover adjusts his orientation to the player, making him look robotic.

In real life (wink) the zombie jumps out of the closet and orients to the human as he lands.  By using a specific jump out of left closet animation that orients the zombie towards the player during the jump, the zombie looks aware of the player and not robotic.  The same theory can be applied to most spawn animations, think of a guy repelling down, kicking down a door or coming up from a trap door.  When the AI orients to the player as he or she comes on screen, the AI look smart.  That being said, let’s add the second part of our language, the horizontal space the AI enters from, left, right and center.

Fig 4: Left, Center, Right screen space subdivision added

Our language for where an AI spawns onscreen is now simply the vertical location followed by the horizontal location. For example, the zombie jumping out of the left closet is a middle left spawn.  A repel from a building on the right is a top right spawn and so on.  If a spawn does not need a horizontal delineation, name it by the vertical space it enters from.  For example, a drop ship in ‘Halo’ would be a vertical spawn.  The assassin appearing in a mist in ‘Dishonored’ would be a middle spawn.

Make your team familiar with this language as a way of identifying spawn locations.  The language not only helps to communicate more efficiently, but also helps with naming conventions, brainstorming, critiquing sequencing of AI spawns and more effectively written bugs.

Research Existing Spawn Types

Now that we know the types of spawns to create and a language to identify where, it is time to research how the five major spawn types may be implemented in your game.  Collecting reference is key for communicating spawn ideas to the team that will be creating the spawn sets with you.  Start looking at other games that are similar to the game you are working on, and then branch out to other games that use spawns you like.  Video capture or grab a “you tube” video when you see a spawn you like or want to expand upon.

Inspiration for cool AI spawns can come from anywhere, but the most common source besides other games is movies.  Watch some of your favorite action movies and pay attention to how the bad guys enter during a combat scene.  Once again, when you find an entrance you like, find a “you tube” video or note where it is in the movie so you can reference it for later.

Vertical space is a key part of our language and also of sequencing AI spawns.  Make sure you are researching a balanced amount of vertical spawns.  If you only find middle spawns, you have failed because the player will not be looking around the entire screen space when the AI comes on screen.  Make the player look up, down and middle when the AI enters.  You need a variety of spawns to accomplish that eye movement, make sure you have lots of ideas for that balance of spawns.

Realizing the Spawn Types

Start building the spawn types the old fashioned way.   Book a meeting room and pull in an animator, AI programmer, AI designer and another designer whose ideas you respect.  Make a column on the whiteboard for each type of spawn and start off a brainstorming session.  Come up with at least ten ideas for each type and then narrow it down to a realistic number to execute upon given your time and resource constraints.

Keep track of the vertical space where your spawn ideas enter from.  Make sure you maintain a balance of top, middle and bottom spawns.  It is okay to have more of one than another, just make sure level designers have variety when they go to create their combat encounters.

Lastly, prioritize the creation of the spawns in order of which ones have the most impact.  If your team falls behind, know which ones you will cut.  Less is more in video game design, it’s always better to have fewer high quality spawns than a bunch of low quality spawns.

Creating a Naming Convention

We can use our language to generate a naming convention for our spawns.  Place a ‘screen location_’ in front of each spawn animation name so the designers, animators and programmers all know where the animation is supposed to be implemented.  For example, the zombie spawn closet from the left would be ‘ML_Closet_Scare’.  The ‘ML’ stands for the middle left of the screen space.  A Repel animation that comes down a building on the right would be ‘TR_Repel’ to indicate the spawn starts in the top right and comes down.  Having the screen location as a prefix allows designers the added benefit of easily sorting through a list when they are looking for spawns.

Fig 5. Spawn Location Matrix

If a spawn does not need horizontal designation, like a drop ship or a FX shrouded spawn, add an ‘_mod’ after the vertical screen space designation instead of the horizontal screen space.  Of course designers are tricky and in certain layouts a middle spawn may be used in the top, but we are implementing the Miyamoto rule, designing for the 80% case.  Every system you develop will have edge cases and that is okay.

Creating the Spawn Types

With the brainstorming session over, the time comes to create the spawns.  First, make a white box for everyone to test the spawns in to act as the hub for all the spawn animation work to be tested and approved in.  Label each area in the white box so everyone, including producers, can go in and watch the spawn occur.  Make sure there is block mesh geometry to simulate the correct metrics needed for each spawn.  Finally, meet several times a week and make sure everyone refers to the reference videos as they create animations or programming additions for desired behaviors.

As the leader of the group you are responsible for setting the quality bar for the spawns.  Issues like animation pops and level geometry clipping need to be called out and addressed.  If object animations do not sync up with AI animations or animators need more code support, talk to your programmer.

Creating Metrics for the Spawns Types

With each new spawn created, a list of metrics for their implementation needs to be identified so level designers know how to setup their geometry and layout for the spawn to work and look good.  For example, how much vertical and horizontal clearance does the drop ship need to fly in?  How far must the hole in the ceiling be from the floor for the animation to look seamless as the AI lands?  Does the spawn point need to be on or off-screen?  Essentially, every detail about the implementation of the spawn needs to be recorded in an easy to read document and placed in your game twiki or other info dump source.

Make sure your white box level showcases all these metrics and everything is labeled and commented nicely.  If the spawn requires an animated object or specific geometry, it’s always a good idea to group those into a prefab, collection or other game object grouping tool your engine possesses.  Once all the metrics and spawn animations are complete, setup a meeting with the design team to demonstrate the spawns and inform them of the metrics.

Making the Spawn Types Systematic

If a spawn stands out to be super useful or requests for different variations of the animation come in to support different level layouts, it may be time to make that spawn systematic.  For example, let’s say you have a spawn where an AI slides down a pole 500 units off the ground.  Level designers find the spawn useful in sequencing, but need the AI to slide down poles of varying height for different layouts.  The time has come to get a programmer to setup the animation to play along a spline or other tech solution.  That way, animators don’t waste time making unnecessary animations and the spawn becomes more versatile, saving lots of production time.

Conclusion

Often interesting spawn animations are neglected in preproduction and level designers shoulder the responsibility of requesting different spawn animations during production where resources are tight.  Starting work on spawn animations early provides a tool set all level designers can use to quickly iterate through exciting ways to initiate combat encounters and ultimately saves production time.  If designers start placing an emphasis early on interesting spawns, we can all start raising the bar of quality AI spawns in games today.(source:gamasutra)


发表于 2013-2-25 21:02:21 来自手机 | 显示全部楼层
好帖 标记!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-11-24 22:51 , Processed in 0.041383 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表