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

以《地牢围攻2》为例解析角色属性系统设计过程

发布时间:2012-01-04 19:27:08 Tags:,,,

作者:Daniel Achterman

上篇文章介绍了系统设计的概念,主要讨论系统设计师的目标和某些实例。这篇文章将通过例子来阐述如何将那些准则运用到实践中。

在下文中,我将阐述《地牢围攻2》的角色属性系统设计过程,我曾参与过这款游戏的系统设计。我会描述系统的运转方式,如此设计的原因以及我们如何通过数学将目标转换成游戏内容。

点击图片查看《地牢围攻2》电子表格

点击图片查看《地牢围攻2》电子表格

《地牢围攻2》角色属性设计过程

《地牢围攻2》是款RPG游戏,角色能力随等级提升。他们的属性增加,获得更多的生命值,更好的武器和护甲。为让角色在游戏过程中遭遇到难度合适的挑战,我们需要预测角色在每个等级的强大程度。

我们决定,角色的“基础能力等级”由角色的属性及其武器和护甲的基础数值构成,因而我们开始确定这些项目所涉的数值和进阶过程。部分额外要素还可以增加这个基础能力等级,包括技能、能力和提升角色整体能力的战利品。

所有这些公式都以“等级”为参数。就角色而言,“等级”便是角色等级。就道具而言,“等级”便是我们期望角色使用该道具时的等级。道具等级限制了随机财宝生成器掉落该道具的时间。

秒伤(游戏邦注:Damage Per Second,下文简称“DPS”)

对于角色的基础秒伤,我们有几个目标:

1、所有职业的基础秒伤公式都是相同的。《地牢围攻2》中各职业有不同的优点和弱点,但是他们的初始DPS都是相同的。玩家可以在游戏中通过自行分配技能点数来改变角色DPS,但是基础值应当相同。

2、基础秒伤公司应当非常简单。该公式将用于其他许多数值的计算中,比如怪物的生命值和道具奖励数值,因而这个公式应当非常简单。

为实现DPS公式的简单化,我们的设计是基础DPS随等级线性增加,这是最为简单的进阶方式。公式如下:

基础秒伤=8+2*等级

我们可以看到,电子表中第6、16和27行中所有职业的数值都是相同的。“8”代表游戏开始时角色的基础伤害。“2”代表基础DPS随等级提升的比率。

在设定武器或咒语的伤害时,用电子表格中预期基础秒伤乘以武器的攻速,便可以得到武器的秒伤。对于群伤武器,我们可以削减力量或敏捷等属性对角色伤害的加成。

以下是攻速1.5秒的10级双手剑的伤害计算公式:

10级双手剑伤害=10级基础DPS*攻速-力量加成

10级双手剑伤害=(8+2*10)*1.5–(0.2*(10+3*10))

10级双手剑伤害=34

因而,10级战士每次用该双手剑劈砍可造成34点伤害。以下是使用不同攻速武器时伤害来源于武器和力量加成的比例示图:

DPS_Bars(from gamasutra)

DPS_Bars(from gamasutra)

如果要让我对这个公式进行修改的话,我会将公式的系数设定得更高些。有时在低等级时,玩家获得的武器或护甲只比他之前使用的道具好一点点,这种感觉并不好。

我们可以将游戏中的数值设定得更大些,这样早期的升级更能够让玩家感到兴奋。

战士护甲

护甲值进阶同游戏的伤害计算公式有关。不同游戏的伤害公式不同。有时这些公式相当复杂,令人难以理解。以行业标准来看,《地牢围攻2》的伤害公式很简单:

实际伤害=攻击伤害*(攻击者DPS/护甲)

实际伤害=攻击伤害*((8+2*攻击者等级)/护甲)

“攻击伤害*((8+2*攻击者等级)/护甲)”本质上就是受攻击者承受的攻击伤害百分比。我们希望该百分比在游戏过程中大致保持不变,50%似乎是个适合耐力型战士角色的百分比。

保持百分比不变使我们可以只通过改变怪物生命值和伤害来改变游戏难度。

为实现50%的百分比,战士和怪物的基础护甲应当是基础伤害值(游戏邦注:见电子表格第7行)的两倍:

护甲=2*(8+2*等级)=16+4*等级

游侠和魔法师护甲

假设游侠的护甲为战士的X%。通过我们设计的简单伤害公式很容易便可以得出,他受到的攻击伤害值为战士的1/X,因而他在死亡之前需要承受X%的惩罚。

游侠和魔法师的护甲显然比战士的护甲值低,这样玩家便可以察觉到不同职业间的差别。最终,我们设定游侠的护甲值为战士护甲的70%,魔法师的护甲值为战士护甲的55%。电子表格的第17和28行可以看到这些公式。

战士生命值

要弄清楚角色的生命值,我们需要思考杀死角色所需要的时间。因为基础秒伤随等级线性增加,所以基础生命值也应当随等级线性增加,这样角色在低等级和高等级时被杀死所需的时间就可以保持不变。

战士生命值是游侠和魔法师生命值的参照标准,所以我们先设置战士生命值。我们将秒伤公式与不同数值相乘,探寻生命值合适的进阶比率,如下所示:

生命值=42.4+10.6*等级

在经过多次测试后,我们意识到低等级战士显得很脆弱,因而我们增加了初始生命值,提升低等级玩家的耐力:

生命值=56+10.6*等级

我们可以看到,电子表格第8行的数值采用的就是这个进阶比率,但是游戏中真正采用的公式并不是如此。《地牢围攻2》借鉴了其首作中的设计——角色的生命值和魔法同力量、敏捷和智力等属性有关。力量对生命值的影响最大,其次是敏捷,随后是智力。

生命值公式如下:

生命值=A*力量+B*敏捷+C*智力

要找到A、B和C的适当数值,我们还需要考虑游侠和魔法师的生命值。

游侠和魔法师生命值

我们都知道,游侠和魔法师的生命值要比战士少。我们决定参照护甲设计,将这两个职业的生命值设定为战士生命值的一定百分比。在等级相同时,游侠的生命值为战士的90%,魔法师的生命值为战士的75%。

在不同职业有不同生命值公式(游戏邦注:如《暗黑破坏神2》)的游戏中,实现上述目标较为简单。但是在《地牢围攻2》中,每种职业的生命值公式是相同的。角色生命值与属性相关,而不同职业的属性成长比率是不同的。

我们必须得出生命值公式系数,这样就能够与不同的属性数值相乘来得出预设的每个职业生命值百分比。

生命值公式为:

生命值=A*力量+B*敏捷+C*智力

电子表的3-5、13-15和24-26行显示各职业属性进阶情况。将力量、敏捷和智力替换成各职业的期望数值,我们可以得到以下3个公式:

1、战士生命值=A*(10+3*等级)+B*(10+等级)+C*(10+等级)

2、游侠生命值=A*(10+等级)+B*(10+3*等级)+C*(10+等级)

3、魔法师生命值=A*(10+等级)+B*(10+等级)+C*(10+3*等级)

将“战士生命值”替换为期望的生命值进阶,将“游侠生命值”和“魔法师生命值”替换为战士生命值的期望比率,得出以下公式:

1、56+10.6*等级=A*(10+3*等级)+B*(10+等级)+C*(10+等级)

2、0.9*(56+10.6*等级)=A*(10+等级)+B*(10+3*等级)+C*(10+等级)

3、0.75*(56+10.6*等级)=A*(10+等级)+B*(10+等级)+C*(10+3*等级)

在《地牢围攻2》中,所有角色在初始等级的生命值都是相同的。我们不能给战士、游侠和魔法师设定不同的初始生命值,我们能做的就是让它们以不同的期望比率改变。因而,我们可以去除上述公式中所有的常量,得到如下公式:

1、10.6*等级=3A*等级+B*等级+C*等级

2、9.5*等级=A*等级+3B*等级+C*等级

3、8.0*等级=A*等级+B*等级+3C*等级

然后除去公式两边的“等级”,将公式简化如下:

1、10.6=3A+B+C

2、9.5=A+3B+C

3、8.0=A+B+3C

解此方程式可得出A、B和C的数值,于是最终得到的生命值公式如下:

生命值=2.5*力量+1.95*敏捷+1.15*智力

这便是电子表8、18和29行中公式的由来。20和31行数据显示,游侠和魔法师的生命值与战士生命值的比值与预期相同,这样我们就知道先前的计算是正确的。

Health_Progressions(from gamaustra)

Health_Progressions(from gamaustra)

这种方法确实很有效,但是也非常复杂。这种设计方法导致属性的变动会影响到多个数据。比如,如果要通过增加战士力量来增加其群体伤害,那么生命值比然也会随之增加。

如果让我重新设计的话,我会将生命值直接同职业等级联系起来,完全不涉及属性。

数学计算

将数学运用到系统设计中,这需要经过一定时间的练习和实践。探寻计算公式并弄清楚他们在不同情况下的表现以及如何获得所需的结果,这是件很难的事情,尤其当你刚开始接触这类数量化设计方法时。以下是某些有关游戏系统数学的小技巧:

设立正确的等式。你运用的数学简单还是复杂并不重要,重要的是等式的正确性。如果我以基础DPS进阶为基础,但武器伤害值运算不当,那么得到的游戏结果可能与我预想中的进阶大相径庭。

数值单位是最困难的部分。如果你的已知值是“秒伤”,那么乘以时间值得到的便是伤害值。分清单位,不可混淆。比如,攻击频率的单位和攻击间隔时间的单位是不同的。

无需过于精确。游戏中的数学同物理中的数学一样,只是估算复杂系统近似值的工具而已。我无法得到游侠和魔法师生命值公式的精确结果,但是估算值已经足够实现系统设计的目标。只要你的属性进阶设计准确,即便是估算值也无伤大雅。

通过曲线图测试结果。如果你不确定自己的数学运算是否准确,可以用曲线图来检测结果。这样错误的结果便显而易见,你就知道需要重新检查整个运算过程。

实践。查看其他游戏使用的公式并努力研究设计师如此设计的原因所在。

不必过分在意首个游戏系统设计

无需过分在意游戏首个系统的细节,原因有以下两点:

1、这些都只是初始设计。制作的护甲和武器伤害进阶数值并不完整,后期还要将各内容贯穿起来,比如怪物生命值和伤害,这还可能导致数值改变。

2、玩家对游戏内容的平衡性并不敏感。大部分PvE玩家并不会深入研究游戏系统中的数值。只要游戏中没有明显的异常现象,玩家更倾向于认为游戏是平衡的。

首个系统的设计往往是最困难的。可以采用的方法很多,最重要的是你的系统必须可理解和可运行,这样你就可以避开或修正内容中任何较大的不当之处。只需要选择简单的规则和进阶即可,无需将每项数值都设计得尽善尽美。(本文为游戏邦/gamerboom.com编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦

The craft of game systems: Practical examples

Daniel Achterman

My previous articles were about system design at a conceptual level, focusing on goals and best practices for system designers. This article gives an example of how to put those principles into practice.

To demonstrate, I’ll walk through the character stat systems for one of the games I did system design for: Dungeon Siege 2. I’ll describe how its systems work, why we set things up the way we did, and how we did the math to translate our goals into content.

I’ve posted the part of our system spreadsheets where we tracked and compared these values. As you read, follow along with the numbers here: Dungeon Siege 2 System Spreadsheet.

Dungeon Siege 2 Character Statistic Progressions

As an RPG, characters in Dungeon Siege 2 increase in power as they level up. Their stats increase, they get more health, and they get better weapons and armor. In order to make content that is appropriately challenging for characters throughout the game, we needed to be able to predict how strong characters would be at each level.

We decided that characters’ attributes and the base statistics of their weapons and armor would form their “base power level”, so we started by defining those values and progressions. This base power level would later be increased by additional factors like skills, powers, and random loot modifiers to give their total overall power.

All of these formulas have “Level” as a parameter. In the case of characters, this is their character level. In the case of items, it’s the level we expect characters to be when they are using the item. Item level restricts when the random treasure generator can drop it.

Damage Per Second

We had a couple simple goals for base character damage per second:

The base damage per second formula should be the same for all classes. Dungeon Siege 2′s classes have different strengths and weaknesses, but they all start with the same DPS. This changes as players start specializing their roles by spending skill points, but it’s nice to have one base formula for everyone.

The base damage per second formula should be stupidly simple. It appears in countless other tuning calculations, like monster health and item bonus values, so it should be an easy formula to work with.

To keep the DPS formula simple, we made it increase linearly with level, the simplest kind of progression rate. It’s just this:

Base Damage Per Second = 8 + 2 * Level

You can see it is identical for all classes in rows 6, 16, and 27 of the spreadsheet. The “8″ term represents how much damage a character does at the start of the game. The “2″ term represents the rate his base DPS changes with each level.

To find a weapon or spell’s damage, we multiplied the expected base damage per second from the spreadsheet by the weapon’s time between attacks to get its damage per attack. For melee and ranged weapons, we then subtracted the expected damage bonus characters would get from statistics like Strength or Dexterity.

Here’s an example of a level 10 two handed sword that swings once every 1.5 seconds:

Level 10 Sword Damage = Base DPS at Level 10 * Time per Swing – Strength Bonus

Level 10 Sword Damage = (8 + 2 * 10) * 1.5 – (0.2 * (10 + 3 * 10))

Level 10 Sword Damage = 34

So, a level 10 fighter wielding a sword that deals 34 damage per swing will deal the desired base DPS. Here’s a visual of how much of a fighter’s damage comes from his weapon vs. his strength at different weapon speeds:

If I had to do it again, I’d make the formula coefficients higher. Sometimes at low levels a player got a weapon or piece of armor that was one or two points better than his previous item, which just didn’t feel very good.

There was nothing to stop us from making all the numbers in the game bigger, so we should have done it to make those early upgrades feel more exciting.

Fighter Armor

The armor value progression is related to the game’s damage calculation formula. There are a million different damage formulas in different games. Sometimes they’re so complicated no one understands how they work. Dungeon Siege 2′s is pretty simple by industry standards:

Actual Damage = Attack Damage * (Expected Attacker DPS / Armor)

Actual Damage = Attack Damage * ((8 + 2 * Attacker Level) / Armor)

The “((8 + 2 * Attacker Level) / Armor)” term is essentially the percentage of attack damage the victim takes. We wanted that percentage to stay roughly constant throughout the game, and 50% sounded like a good target for durable fighter characters.

Keeping the percentage constant allowed us to tweak difficulty by just changing monster health and damage, without having to factor in changing damage reduction.

In order to get the 50 percent ratio, base armor for fighters and monsters must be double base damage per second (see row 7 of the spreadsheet):

Armor = 2 * (8 + 2 * Level) = 16 + 4 * Level

Ranger And Mage Armor

Say that a ranger has X percent as much armor as a fighter. Our simple damage formula makes it easy to determine that he’ll take 1/X times as much damage from attacks as the fighter, so he’ll be able to withstand X percent as much punishment before dying.

The defense values on ranger and mage armor were noticeably lower than the values of fighter armor so players could see the distinction between gear for different classes. We ended up making ranger armor defense values 70 percent of fighter armor and mage armor 55 percent of fighter armor. You can see these formulas in rows 17 and 28 of the spreadsheet.

Fighter Health

To figure out how much health characters have, we thought in terms of how long it would take to kill a character. Since base damage per second increases linearly with level, base health should also increase linearly with level, so that it takes about equally as long to kill a character at low and high levels.

Fighter health is the baseline that ranger and mage health were compared to, so we started with it. We started by multiplying the damage per second formula by different numbers to get a progression that looked right:

Health = 42.4 + 10.6 * Level

After playtesting a bit, we realized that low levels were pretty lethal, we increased the starting health value a bit to give low level players more durability:

Health = 56 + 10.6 * Level

You can see the values in row 8 of the spreadsheet follow this progression, but the formula for it looks very different. One of the things Dungeon Siege 2 carried over from the first Dungeon Siege is that character health and mana are a function of their attributes – Strength, Dexterity, and Intelligence. Strength has the biggest impact on health, then Dexterity, then Intelligence.

The health formula has this format:

Health = A * Strength + B * Dexterity + C * Intelligence

To find the actual values of A, B, and C, we needed to also consider ranger and mage health.

Ranger And Mage Health

We knew we wanted rangers and mages to have less health than fighters. As with armor, we decided to make their health a percentage of fighter health. Rangers should have 90 percent as much health as fighters of the same level, and mages should have 75 percent as much health.

This would have been easy if different classes had different health formulas, as they do in games like Diablo 2. But in Dungeon Siege 2, every class uses the same health formula. Character health is based on attributes, which grow at different rates for different classes.

We had to derive health formula coefficients that would multiply their different attribute values to result in the expected health percentage for each class. Time for some math!

Here’s the health formula again:

Health = A * Strength + B * Dexterity + C * Intelligence

Rows 3-5, 13-15, and 24-26 of the spreadsheet show how attributes progress for each class. Replacing Strength, Dexterity, and Intelligence with their expected values for each class, we get the following three formulas:

Fighter Health = A * (10 + 3 * Level) + B * (10 + Level) + C * (10 + Level)

Ranger Health = A * (10 + Level) + B * (10 + 3 * Level) + C * (10 + Level)

Mage Health = A * (10 + Level) + B * (10 + Level) + C * (10 + 3 * Level)

Replacing “Fighter Health” with the desired health progression and replacing “Ranger Health” and “Mage Health” with the desired ratios of Fighter Health gives us the following:

56 + 10.6 * Level = A * (10 + 3 * Level) + B * (10 + Level) + C * (10 + Level)

0.9 * (56 + 10.6 * Level) = A * (10 + Level) + B * (10 + 3 * Level) + C * (10 + Level)

0.75 * (56 + 10.6 * Level) = A * (10 + Level) + B * (10 + Level) + C * (10 + 3 * Level)

In Dungeon Siege 2, all characters start at level 0 with the same amount of health. We can’t give fighters, rangers, and mages different health at level 0. The best we can do is give their rates of change the desired ratios. To focus on that, we can throw out all the constants in the formulas:

10.6 * Level = 3A * Level + B * Level + C * Level

9.5 * Level = A * Level + 3B * Level + C * Level

8.0 * Level = A * Level + B * Level + 3C * Level

Then divide both sides of the equations by “Level” to clean up the formulas:

10.6 = 3A + B + C

9.5 = A + 3B + C

8.0 = A + B + 3C

This is a system of simultaneous equations. This Wikipedia page explains how to solve for values of A, B, and C, resulting in this final health formula:

Health = 2.5 * Strength + 1.95 * Dexterity + 1.15 * Intelligence

That’s the formula that appears in lines 8, 18, and 29 in the spreadsheet. Lines 20 and 31 and the chart show that ranger and mage health settle into the expected ratios of fighter health, so we know our math is right.

That works, but getting there was really complicated. This design also doubles up the functionality of attributes. We couldn’t increase a fighter’s strength to increase his melee damage without significantly increasing his health as well.

If I were designing a game from scratch, I would have done something like derive health directly from class levels, without involving attributes at all.

A Word On Math

Applying math to system design can take some practice. It can be difficult to look at some formulas and figure out how they behave in different situations, or how to get the result you want, especially if you’re just starting to do this kind of quantitative design work. Here are some tips for game system math:

Focus on setting up equations correctly. It doesn’t matter if your math is simple or complex, but it does need to be right. If I started with my intended base DPS progression but messed up the math to solve for a weapon’s damage value, then the reality of the game wouldn’t match my intended progression at all, and I’d get unexpected results and make bad conclusions.

The hardest part is keeping your units straight. If you know a value is “damage per second”, then multiplying by a time value will result in a damage value. Keep track of your units and don’t mix up inverses. For instance, frequency is not the same as time between attacks.

Don’t try to be too precise. Math in games is like math in physics – it’s a broad-strokes tool for approximating a complex system. I wasn’t able to get exactly the result I wanted with the ranger and mage health formulas, but I got close enough for my purposes. So long as your progressions are set up correctly, it’s okay if the reality of your game doesn’t match your ideal version completely.

Test your results by graphing them. If you’re not sure your math is right, check your work by graphing your result. Erroneous results will often be apparent, letting you know that you need to review your math to see what went wrong.

Practice, practice, practice. Look up formulas that other games use and try to determine why the designers set them up that way.

The Final Word: The First System Doesn’t Really Matter (Yet)

In the grand scheme of making a game, all of the above work on the first game system – every formula and value chosen – is completely arbitrary and doesn’t matter very much. Don’t obsess over it.

Write some formulas down, plug some numbers in, and move on.

Seriously.

There are two reasons not to worry too much about the details for the first system in your game:

None of this is “tuning” yet. Making armor and weapon damage progression values isn’t tuning until you make the content that intersects them, such as monster health and damage. You can make that stuff match whatever you choose to do here.

There’s a huge range of values for game content that players will perceive as balanced. The vast majority of PvE players don’t engage with numbers in game systems in a deep way. So long as there aren’t obvious anomalies in your game, players are inclined to perceive a game as balanced.

The first system is often the hardest to design. There are so many ways you could set up your game content and make your rules work, and it’s easy to over-think it.

The most important thing is for your systems to be comprehensible and workable so that you can avoid or fix any big irregularities in your content. Just choose simple rules and progressions and don’t worry about making every number perfect. (Source: Gamasutra)


上一篇:

下一篇: