版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://lichong.blogbus.com/logs/37567677.html
译者按:因为时间和精力有限,不逐字翻译了,拣筋骨翻译,皮肉尤其是肥肉,就去看原文或者自己脑补一下吧(以后尽量都这样)
原文:7 Ways to Make Your AI Smarter
个人观后感:本文我觉得最好的观点是这么几个,a) 老老实实让AI的行为能被预测、符合预期 b) 要让AI有机会表演 c) 做人形角色比较吃亏些。d) AI要干什么,先让它大声说出来
SCRIPTING
脚本
A huge amount of what convinces us a game has good AI is often completely scripted. Nothing ruins the illusion of AI like the Level Designers treating them purely like cardboard cutouts or filler. What the AI is doing before they start fighting is just as important as what happens during the fight.
就是说大家所谓的好AI,很多时候是靠脚本来硬写的,在非战斗状态下的行为,同样重要
My favorite reference for believable AI scripting are the NOLF games. Yes you couldn’t go more than ten yards without stumbling on a pair of AI guards having a conversation but it adds so much to their characters that you become far more forgiving towards them.
作者最喜无人永生的AI脚本,那些个对话
The arrival of an enemy is a great opportunity to make them seem smarter than they really are. AI that Rapel down a wall before fighting you or who shout for backup when they see you causing two more enemies to sprint around the corner. These are almost always scripted events but most Players will attribute it all to the AI.
在敌人出现的时候,如果可以相应地给于一些行为,比如使用绳索下来或者互相呼喊进行进攻等,玩家一般都把这类看作AI
Even just adding Patrol routes or some good ambient animations can make a very simple AI character appear more inteligent.
巡逻和简单的闲暇动画也很有用
FEEDBACK
有所反映
AI that don’t tell the Player what they are going to do before they do it look stupid.
NPC默默地去干一件事情,通常会让它显得很蠢
In Half Life the Soldiers would always shout “GRENADE!” before they threw a Grenade at you. When they shouted “Flank Left!” an AI would always run out of cover moments later.
HL里面敌兵就是叫嚷着“我要丢手雷拉”,“我要包抄拉”,然后再去干,这样2b群众们会觉得AI真棒_-
You are making your enemies appear as if they have goals and that they are trying to fulfill them. If the player doesn’t know what the AI was trying to do then alot of their actions won’t make any sense. If a Soldier just ran out of cover then the Player would assume the AI is stupid for leaving cover. By preceeding it with the command “Flank Left!” the enemies behavior is given a context that makes a stupid suicidal manouvre appear inteligent.
必须要让NPC显得是有目的地进行行为,先让玩家“偷听”(说白了就是强迫你知道)敌人的目的,然后再有所行动
Your enemies don’t have to actually Flank anybody. They just need to say that they are before they move somewhere else. The Player will assume the AI is trying to do something very clever when they are really doing something immensely stupid. It’s all about context.
就是说对于2b玩家而言,目的=AI,即便实际上后续行动和sb没区别,但玩家都会脑补
Above all else AI that are talking to each other and the player appear more Human. The Grunts in Halo would have seemed very stupid if they had never said anything. Instead you always knew what was going through their tiny minds as a result of your actions.
比如说黑佬里的咕噜人的对话
ACCURACY
命中率
If your enemies carry guns then don’t turn them into Storm Troopers (unless they ARE Storm Troopers in which case it’s OK). While the Player should have an advantage ov er the AI in terms of accuracy making the AI too inaccurate will just result in them looking stupid. If the player realises that they can just stand still in the open while they pick off the bad guys with a single headshot each then their sense of immersion will be completely broken.
就是说别把敌人命中率调太低
Below is a video I made when we were making Wheelman to indicate just how “Stupid” AI can appear when they are inaccurate. The good stuff is at about 1:50.
视频看不到,不过丫居然是做wheelman的
If you want your AI to miss then put some effort into making them miss believably. If they are using automatic weapons then have them group their shots in a burst and have the entire burst miss. Don’t just spread the shots out in a cone around the player because it’s much more noticable.
如果要让AI的枪法不是那么准,那也得基于一些可信的缘故
If the Player is standing still in the open looking at the enemy then the AI should tear the Player a new one.
。。。
LIFETIME
活多久?
You can have the most inteligent goal-oriented perfect-pathfinding AI enemies in the world but it doesn’t count for anything if the Player is killing them before they get to do any of that clever stuff.
你的NPC有着不错的AI行为,但如果玩家一上来就有条件将他们干掉,那么再nb的AI都看不见了(联想到最近在打的生化,基本上每处开打前都会有个简短的ingame cutscene来表现一下敌兵的登场,其实就是为了保证玩家能看到一些行为)
The only difference in Halo between the AI in Easy mode and Legendary mode is that in legendary the AI has more health. This meant they lived longer and as a result did more cool clever things making them appear more inteligent. They were also more accurate and did more damage which supports my previous point.
黑佬里的NPC,在“容易”难度和“传奇”难度下,其AI的区别主要是因为“传奇”难度下有更多的HP,NPC可以活得更久,于是有更多机会表现,并且有更准的枪法,造成的伤害也更大
Adding health isn’t the only way to increase your AI’s Lifetime (and you may not be able to get away with it contextually) but there are other ways to make your enemies live longer.
给NPC更多血,不是延长其存活时间的唯一手段
* Enemies that can Blind-Fire are harder to kill while still presenting a threat to the Player.
* Make the Players weapons less accurate meaning they have to work harder. Too much aim-assist is a bad thing.
* Allow enemies to break-out of Hit-Reactions quickly. If your Hit-Reactions are too long then you often only need to land one hit to neutralise the enemy. The remaining hits are a formality.
* More Enemies at once mean that even though Individuals die quickly the others are showing off in the meantime.
* 会盲射的敌人,不容易被打死且可以压制玩家
* 让玩家的武器射击精度降低
* 让敌人可以迅速摆脱受创硬直
* 更多的敌人,这样即便某些死得比较快,但总有一些活得更久些
ROBUST
强壮没毛病
If I had to choose between Very Clever buggy AI and Very Simple Bug-Free AI I will always pick the Simpler choice.
宁可要简单但是没有bug的AI
Every time an AI gets a Path wrong or does something slightly unpredictable (in a bad way) is another notch against your AI appearing smart.
AI如果有bug或者奇怪的不可预测的行为,就会立刻显得sb
Half Life 2’s Combine AI is really simple but also very effective. Their basic behavior is to move towards their target shooting at them if they have line of sight. When they need to Reload they will move to a position where they can break line of sight.
HL2里的战斗AI非常简单,就是看见敌人的时候,边射击边靠近,需要reload的时候,就找个挡视线的地方(按,实际上大原则都是很简单的,关键是怎么保护避免bug)
That’s roughly 80% of the Combine AI right there. It’s incredibly simple and copes with just about anything you can throw at it. Because it’s so robust it rarely goes horribly wrong and the Player can build a mental model of that enemies behavior very quickly that is always right.
这就是80%的战斗AI了,极其简单且强壮,很少发生严重错误,玩家可以迅速明白敌人的行为并学会预测
When the AI behaves how the Player predicts then the AI is perceived as being smart because they have fulfilled the Players expectations of them. When the AI exceeds these expectations it’s even better. However the most important part to nail first is that the AI never falls short of them.
当AI按照玩家的预期进行活动,看起来就聪明了,如果还有一些超越,那就更好,但最重要的是,首先不要让玩家的预期落空
MANAGE EXPECTATIONS
设置预期
Human shaped AI are the hardest to get right because as Humans we have very high expectations of their behaviour. We interact with other Humans everyday so Human AI in games needs to fit into an existing Mental Model informed by our life experiences, TV, Films and all sorts of other crap.
人属性的角色的AI最难搞定,因为对于人的行为模式我们都会有很高的预期,我们每天和人打交道,通过电视电影这些个垃圾来明白人是如何行为的,所以要在游戏里模仿这些,很难
Aliens, Animals, Robots. All of these are far easier to make appear inteligent because our Expectations of their behaviour aren’t preconceived or at worst much lower. Nobody knows how a Strider is supposed to act before they start fighting one. You can infer a bit from the way they look and move but they are essentially a blank slate. A Strider can behave however Valve wants them to and so long as they are Robust they will appear inteligent.
外星人,动物,机器人,这些的AI就容易搞得多,因为咱们对它们的经验少预期低。没人确切知道一个三脚机器人究竟应该如何行为,你可以推测,但基本上有较大的发挥空间。Valve可以让三脚机器人按照他们的意愿活动,且看起来照样非常聪明
If Halo’s Grunts had been Human shaped then their AI wouldn’t have seemed as clever as they wouldn’t have matched our preconceived expectations of how Humans behave. Don’t underestimate just how much leeway using non-Humans will buy you.
如果黑佬中的咕噜人,看起来和人一样的外观,那么就不会显得那么聪明了,因为达不到我们对于人的行为的预期,别低估了使用非人角色带来的巨大余地
LEVEL DESIGN
关卡设计
Bad Level Design can make good AI look terrible. It is the job of the Level Designers and AI Programmers to ensure that everything in the game is working together to create the best experience possible. If you spend six months crafting cautious cover using AI and all the Levels in your game are empty warehouse deathmatch levels then your AI isn’t going to look good.
就是说你花再多功夫设计AI,但如果关卡不配合进行设计,一切都是浮云
Make sure that Levels are playing to the AI’s strengths and vice-versa.
。。。