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

阐述游戏机制新设计工具Machinations工作原理

发布时间:2012-08-19 08:22:54 Tags:,,,,

作者:Ernest Adams   &   Joris Dormans

在所有游戏设计的概念中,游戏机制是最难解释清楚的。我们使用的词基本上是抽象的,比如,负反馈循环和难度级数。这些东西也很难模拟和测试,因为除非他们简单到只需在桌面游戏中执行,否则就要编写代码或使用电子表格,但这两部分做起来都不快,也不直观。

最近,我与荷兰游戏设计师和学者Joris Dormans合作写了一本书,其中部分内容是关于设计游戏机制的。这本书名为《Game Mechanics: Advanced Game Design》,由Peachpit出版社出版。本文浓缩了书中第五章的部分内容。

Machinations_overview(from jorisdormans.nl)

Machinations_overview(from jorisdormans.nl)

Joris开发了一个免费工具Machinations,我认为这将彻底变革我们开发和教学游戏机制的方式。这里,我将介绍Machinations和它的用途。

Machinations是一种用于图解游戏经济的可视化语言,也是一种用于绘图和模拟的工具,无需编写代码。

Joris读了我的书《Fundamentals of Game Design》后,开发了一种图解内部经济基本特点的方法,所谓的内部经济就是我所说的:资源、来源、排水管、转换器和交易器。之后他又增加了几种,使他的系统更加强大和灵活。

Machinations工具的工作原理

Machinations工具支持用户创建和保存数字版的Machinations图解,并实时查看其变化。该工具与对象型2D绘图程序如Microsoft Visio类似。它的中部是工作区,侧边栏是各种可选择的工具。

workspace(from gamasutra)

workspace(from gamasutra)

当使用工具时,它以一系列时间顺序或迭代(这里的“迭代”是指“可交替的”)方式执行由图解指定的事件。该工具可以改变图解的状态。当它完成一次迭代时,就会执行另一次迭代,并显示图解的新状态。这个过程一直重复直到用户自行中止。用户可以通过设置间隔值来控制各次执行的时间长度;如果用户想让工具缓慢运行,可以将间隔值设成每次执行持续多少秒等。

running(from gamasutra)

running(from gamasutra)

(简单的Machinations图解。小圆圈代表资源,既可以储存成节点,也可以在节点之间移动。)

Machinations图解允许玩家任意提取概念。可以用图解表示全部或部分的游戏机制。使用Machinations图解,用户可以在不同程度的细节上设计和测试游戏的机制。例如,它可以从单一玩家的角度模拟游戏,即使游戏其实是多玩家类型的。又或者,它可以不同程度地模拟不同玩家模式的机制。用户还可以忽略游戏中某些方面,如轮流玩家回合。

Machinations图解的基本元素

Machinations结构可用于模拟活动、交互作用和游戏内部经济的不同部分之间的互通。游戏的经济系统是由资源的流动决定的。为了模拟游戏的内部经济,Machinations图解使用了若干类型的节点,即引入、推出、收集和分配资源。资源连接决定了资源如何在不同元素之间的移动;状态连接决定了资源的当前分布如何改变图解中的其他元素。总地来说,这些元素形成了Machinations图解的核心。我们将从最简单的一个开始说起。

池和资源连接

池是图解中的一个位置,用于集中资源。当池为空时,用空心圆表示;当池中存有少量资源时,就用更小的圆圈表示资源数量;如果池中的资源太多,无法用堆叠起来的圆圈表示时,就用数字表示资源数量。

pools(from gamasutra)

pools(from gamasutra)

池用于模拟实体。例如,如果用户有一种名为金钱的资源和一种名为玩家银行帐户的实体,用户可以用池代表银行帐户。注意,池只能储存整数值。

最简单的一种连接是资源连接,即从一个节点向另一个节点转移资源。用实心箭头表示连接图解中的节点。资源连接可以以不同速率转移资源。在资源连接旁边的标签表示每一次可以顺着连接转移多少资源。如果资源连接没有标签,就表示速度为1。

connectio(from gamasutra)

connectio(from gamasutra)

用户可以给资源连接指定任意流动速率,方法是在标签框中输入数值。随机速率可以用不同的方法表示。如果用户简单地输入D,资源连接旁边就会出现一个骰子,表示一个未指定的随机因数。Machinations工具可以用相同的骰子符号(这在纸笔RPG中常用)产生随机数字。D6代表由六面骰子滚动一次产生的一个随机数字,D6+3表示在相同的骰子滚动后产生的数字上增加3,2D6表示将两次结果数字相加,这样就产生了一个介于2到12的数字。

用户还可以用百分数表示随机值。一个标签为25%的资源连接表示每一次一种资源可以沿着连接流动的概率是25%。当使用百分数时,可能会出现百分数高于100%的情况。例如,250%表示至少加上一次100%和一次50%的概率的流动速率。

randomcon(from gamasutra)

randomcon(from gamasutra)

激活模式

在各次迭代中,在Machinations图解中的节点可能会开启。当一个节点开启时,它将资源沿着连接引入或推出到与它连接的另一个结点。节点是否开启取决于它的激活模式。Machinations图解中的节点可以分为以下四种不同的激活模式:

1、可以自动开启的节点,它可以在每一次迭代中开启。所有自动节点都是自行开启的。自动节点用星号表示。

2、交互节点可以表示玩家的活动。在Machinations工具中,交互节点在用户点击它之后开启。交互节点用环圈表示。

3、开始活动节点在第一次迭代以前只能开启一次。在Machinations工具中,开始活动节点在用户点击运行按钮后立即开启。这种节点用字母S表示。

4、被动节点表示只在回应由另一种元素产生的触发器(这个之后讨论)时才开启。资源可以被其他节点推出或引入被动节点为,但被动节点本身并不推动或牵引资源,除非被触发。被动节点用一个圆圈表示。

activatio(from gamasutra)

activatio(from gamasutra)

推出和引入资源

当池开启时,它会将资源引入任何与之连接的输入点。它引入的资源的数量取决于各个输入资源连接的速率。或者,池可以设为推出模式。在这种模式下,当池开启时,它将资源沿着它的输出连接推出,流动率就是输出资源连接的速率。在推出模式下的池用P表示;如果一个池只有输出,就认为它处于推出模式,那么P标志就可以省略了。

Pushing(from gamasutra)

Pushing(from gamasutra)

如果池要从它的远端的输入引入更多的资源,有以下两种方法:

1、默认地,节点会尽可能多地引入资源,取决于它的输入流动率。如果没有足够的可用资源,它仍然引入已有的资源。

2、或者,节点可以设为引入所有或不引入资源。在这种模式下,当没有足够的可用资源时,节点将不引入资源。处于引入所有或不引入模式下的节点用&表示。

沙漏案例

使用池和资源连接,我们可以构建一个简单的沙漏。在这个例子中,两个池被一个连接关连起来。上方的池(A)是被动的,包含5个资源,而下方的池(B)是主动的,没有资源。经过各次迭代,B将从A引入一个资源,直到所有资源都从A转移到B。之后,这个图解的状态将不再发生变化。

DN_Machinations08_hourglass(from gamasutra)

DN_Machinations08_hourglass(from gamasutra)

状态改变

Machinations图解的状态是指节点中的资源的当前分布情况。当资源从一处移向另一处时,状态就变化了。在Machinations结构中,用户可以使用状态改变来修改资源连接的流动速率。此外,用户可以根据资源分布情况的变化触发节点开启、激活或停用节点。

为此,Machinations提供了第二类连接,叫作状态连接。状态连接表示节点的当前状态的改变如何(资源数量)影响图解中的其他的元素。

状态连接用虚线箭头表示,从控制中的节点引向目标(可以是节点,资源连接或比较少见的另一种状态连接)。状态连接的标签显示它如何改变目标。

状态连接有四种类型,根据它们连接的元素类型和它们的标签划分。这四种类型分别是标签修改器、节点修改器、触发器和激活器。在本文中,我们只重点解释两种:标签修改器和激活器。

标签修改器

记住,在资源连接上的标签决定了一次有多少资源可以通过那个连接转移。标签修改器把一个源节点与资源连接(或甚至另一个状态连接)的目标标签关连起来。

标签修改器表示源节点的状态改变在当前执行中如何修改目标标签的当前值,这与状态连接自己的标签一致。新值将在下一次执行中生效。源节点的改变总量会与标签倍增器自己的标签相乘。

所以,如果标签修改器说+3且源节点增加2,那么目标标签将在下一次执行中增加6(游戏邦注:它将增加两次3,源节点的每一次改变增加一次)。然而,如果标签修改器说+3,而源节点减少2,那么目标标签减少6。

DN_Machinations09_labmod(from gamasutra)

蓝色箭头表示标签修改器(from gamasutra)

标签修改器的标签总是带着一个+或-号。例如,在上图中,每一个添加到池A的资源增加2到池B和C之间的资源流动速率。这样,B第一次被激活时,1个资源流向A,而3个资源流向C。第二次时,仍然是1个资源流向A,但5个资源流向C。

激活器

激活器连接两个节点。根据它们的源节点的状态和特定的条件,它们激活或抑制目标节点。激活器的标签将指定这个条件。条件写成一个算术表达式(如,==0, <3, >=4, or !=2)或一个值域(如,3-6)。如果源节点的状态达到这一条件,那么目标节点就被激活(它可以开启)。当未满足条件,源节点就被抑制(它不能开启)。

高级节点类型

池不是Machinations图解中唯一可能的节点。在这个部分,我们将描述几种类型的节点,包括用于四种经济功能(来源、输出、转换和交易)的特殊节点,这些是我原来在《Fundamentals of Game Design》一书中描述过的。

与池相反,门不能收集资源。它的功能是立即重新分配资源。门用菱形表示,通常有多个输出。各个输出用一个可能性或一个条件作标签,而不是用流动速率。第一类输出指的是可能的输出,而其他的指的是有条件的输出。一个门的所有输出必须是同一类型的。

可能性可以用百分数表示(如,20%)或用单一的数字量表示(如,1或3)。在第一个例子中,正在流向门的资源有一个等于各个输出表示的百分数的可能性。这些可能性的总数不可以增加到超过100%。如果总数少于100%,那么资源有可能不会沿着任何输出发送,而可能会被破坏。

说到单一的数字量,资源会流向特定的输出的可能性等于由门的输出总量分离出来的输出量。换句话说,如果有两个输出,一个的量是1,另一个的量是3,资源会流向第一个的可能性是四分之一,会流向第二个的可能性是四分之三。

当带有条件标签时,输出就是条件性的(如,>3 or ==0 or 3-5)。在这种情况下,每一次资源到达门处都会检查所有条件,1个资源沿着所有达到条件的输出发送。条件可能会重叠;这会导致资源复制,或,当不满足条件时,资源会被破坏。

门有两种分配模式:决定型分配和随机型分配。决定型门会根据由百分比或量表示的可能性相应地分配资源,如果它有可能的输出的话。当它有条件性输出时,它会计算每一次通过它的资源数目,然后使用那个数目来检验它的输出条件(将带条件输出的决定型门作为计数门是很方便的)。注意,计数会在每一次执行时开始,所以如果1个资源到达时,决定型门将没有特别的标志,用一个小的空心菱形表示。

随机型门产生随机值,决定了它将在哪里分配输入的资源。当它具有可能的输出时,它会产生一个合适的数字(介于0%到100%或一个低于输出总量的数字)。当它的输出是条件性的时候,它会产生一个介于1到6的值来检验条件,就好像图解滚动一个普通的六面骰子。随机型一个骰子标志表示。

门非常强大,包括许多其他功能,只是我们没有办法一一介绍了。以下是几种类型的门。

DN_Machinations10_gates(from gamasutra)

DN_Machinations10_gates(from gamasutra)

来源

source

source

来源是创造资源的节点,用一个指向前方的三角形表示。就像Machinations图解中的其他所有节点,来源可以是自动的(默认的),交互的、被动的,或它可以在图解开始以前激活一次。例如, 《Star Wars: X-Wing Alliance》中的星球战士的防护盾就是一个稳定再生的自动来源。建立《Risk》中的敌人可以模拟成一种敌人的交互来源。传递《大富翁》中的棋子可以当作是一种由游戏事件触发的金钱被动来源。来源的产生资源的速率是来源的基本属性,是用它的输出的流动速率表示的。

排水管

drain

drain

排水管是消耗资源的节点;进入排水管的资源会永远消失。Machinations结构包括一种特殊的排水管,用朝下的三角形表示。排水管的排出率取决于它的输入资源连接的流动速率。有些排水管会以稳定的速率消耗资源,而其他排水管则消耗它的输入连接所关连的所有东西,这种排水管的资源连接的标签是“ all”(“引入所有”)。

转换器

DN_Machinations13_converter(from gamasutra)

converter

转换器的功能是将一种资源转换成另一种,用指向右边的、中间带一条垂线的三角形表示。转换器是用来模拟如工厂这类将原材料变成成品的东西。例如,风车将小麦变成面粉。转换器的作用好比产生来源的排水管,消耗一种资源以产生另一种资源。正如来源和排水管,转换器可以有不同的消耗和生产速率,这是由它的输入和输出指定的。例如,表示锯木厂的转换器可能将1棵树变成50块木板。

交易器

交易器是当开启时,会引起资源改变所有者的节点。两名玩家可以使用交易器来交换资源。Machinations图解用一个垂线横过两个分别指向左右的三角形的图形表示。当一类给定数目的资源被交换成(不是转换成)另一类给定数目的资源时,就要使用到交易器。它对任何类似购物的情形都是适用的:按规定的比例(价格),商人收钱,消费者收货。如果商人和消费者都没有必须的资源,交易将不会发生。在《辐射3》中,所有交易器的供应都是有限的,这就是一个好例子。

DN_Machinations14_trader(from gamasutra)

DN_Machinations14_trader(from gamasutra)

交互型交易器(虚线节点)。当点击时,它将3个红色资源交换成2个蓝色资源。

组合

这是《Game Mechanics》一书中的第五章的结尾内容,但是我现在想给读者展示的是利用Machinations能做的事。以下图解显示了所有我之前介绍到的元素。

DN_Machinations15_overview(from gamasutra)

DN_Machinations15_overview(from gamasutra)

从左到右,我们有自动来源(旁边的*号表示它是自动的),它每一次产生2个资源,然后将其发送到被动池。这个池是状态连接(虚线箭头)的源头,而这个状态连接在每一次资源到达时以0.1的速率减少它的输入资源的标签数值。经过20次迭代后,标签会变成0,且资源将不再发送。

这个池连接到交互转换器,当点击时,转找器取得3个资源,然后将其转换成5个。这5个输出资源之后进入随机型门,随机型门将其中的25%返回池,75%的发送到排水管,在这里资源将消失。右边的交易器与图中的其他元素没有关联。

案例

用户可以利用Machinations模拟任意抽象程度的动态系统。比如,《大富翁》的积极反馈循环:

DN_Machinations16_Monopoly(from gamasutra)

DN_Machinations16_Monopoly(from gamasutra)

收入以低随机率进入,最初每次是介于1到6个单位(默认的Machinations随机值产生器是六面骰子,尽管这个值是可以设置的)金钱进入被动池。

此时,玩家可以点击购买财产的转换器,它将金钱资源转换成财产资源,之后财产资源进入财产池。财产池的状态改变传送回收入来源的输出连接的标签,增加了每一回合增长的金钱总量。

从《大富翁》到《星际争霸》,这是很多游戏的经典的升级过程:投资生产设备,消耗储存的资源,增加新资源的产量。

以下是一个我们很熟悉的简单的自律机制。

DN_Machinations17_toilet(from gamasutra)

DN_Machinations17_toilet(from gamasutra)

从贮水器到供水的状态连接不是一个标签修改器,而是一个激活器。当贮水器中的水量低于20个单位时,它就开始得到水供。贮水器装满后,供水停止(在Machinations工具中,它变成灰色)。当点击交互排水管时,它就立刻将所有贮水器中的所有水排出。“all ”标签表示资源连接的流动率是不受限的。

这些只是小例子,让读者了解Machinations可以完成的反馈循环和控制系统。全书中包括所有设计模式——不同种类的引擎和摩擦系统,增长模式和像技术树之类的杂项模式。

我在本文中描述还不到Machinations强大的功能的四分之一。读者可以在书中找到所有功能。 《Game Mechanics》的第六章列举的例子包括横版动作游戏、射击游戏、RPG、竞技游戏、RTS游戏等。该虽然没有解释如何做成一款完整的游戏,但它确实可以帮助读者制作或测试游戏经济的部分。读者还可以高速执行多重任务,收集、展示或输出数据,创造虚拟玩家尝试不同的策略,看看哪种最占优势。

第五章的剩余部分将带领玩家一步一步地模拟《吃豆人》中的各种设定,从幽灵到水果再到超级圆点。它当然不能复制这个迷宫本身的布局,但它可以让玩家了解各种机制以及它们如何产生交互作用。以下是最终结果(注意,包括我没有描述到的功能1):

DN_Machinations18_pacman(from gamasutra)

DN_Machinations18_pacman(from gamasutra)

本文为游戏邦/gamerboom.com编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦

The Designer’s Notebook: Machinations, A New Way to Design Game Mechanics

by Ernest Adams, Joris Dormans

Game mechanics are harder to talk about than any other aspect of game design. The terms we use are largely abstractions — things like negative feedback loop and difficulty progression. They’re a nuisance to prototype and test, too, because unless they’re simple enough to implement in a board game, you have to either write code or use a spreadsheet, and neither one is particularly fast or intuitive.

Recently I’ve co-written a book that’s (partly) about a better way to do it. The book is called Game Mechanics: Advanced Game Design, published by Peachpit and available here. (Instructor and media review copies are also available free to qualified applicants). This month’s column condenses part of chapter 5 of the book. My co-author is Joris Dormans, a Dutch game designer and scholar.

Joris created a free tool called Machinations that I think will revolutionize the way we develop, and teach, game mechanics. (I really don’t like hype, so I don’t say that lightly.) Here, I’m going to introduce what Machinations is and what it does.

Machinations is a visual language for diagramming game economies, and a tool for drawing, and above all, simulating them without writing code.

Joris (pronounced YOR-is) had read my book Fundamentals of Game Design and created a way to diagram some of the basic features of internal economies that I talked about: resources, sources, drains, converters, and traders. Then he added several more that make his system more powerful and flexible.

How the Machinations Tool Works

The Machinations Tool allows you to create and save digital versions of Machinations diagrams and see how they change over time. The Tool looks similar to an object-oriented 2D drawing application such as Microsoft Visio. It has a workspace in the middle and a variety of selectable tools in a side panel.

The Machinations Tool, available at www.jorisdormans.nl/machinations

When you tell the tool to run, it performs the events that are specified by the diagram in a series of time steps or iterations (we use the terms interchangeably). The tool changes the state of the diagram. When it has completed one iteration, the tool then executes another with the diagram in its new state, and so on, repeatedly until you tell it to stop. You can control the length of each time step by setting an interval value; if you want the tool to run slowly, you can set the interval to several seconds per time step.

A simple Machinations diagram running. The small circles are resources, either stored in a node, or moving from node to node.

Machinations diagrams permit you to abstract as much or as little as you like. You can use them to focus on all, or only part, of a game’s mechanics. Using Machinations diagrams, you can design and test your game’s mechanics at different levels of detail. For example, it’s often sufficient to model a game from the perspective of a single player, even if the game is actually played by multiple players. In other cases, it’s useful to model the mechanics for one player at a higher level of detail than other players. Or you can leave out certain aspects of the game, such as players taking turns.

Machinations Diagram Basic Elements

The Machinations framework is designed to model activity, interaction, and communication between the parts of a game’s internal economy. A game’s economic system is dominated by the flow of resources. To model a game’s internal economy, Machinations diagrams use several types of nodes that pull, push, gather, and distribute resources. Resource connections determine how resources move between elements, and state connections determine how the current distribution of resources modifies other elements in the diagram. Together, these elements form the essential core of Machinations diagrams. We’ll start with the simplest ones.

Pools and Resource Connections

A pool is a location in the diagram where resources gather. Pools are represented as open circles, while the resources that are stored in a pool are represented as smaller circles that stack on them. If there are too many resources in a pool to show them as stacks, the tool displays a number instead.

Pools are used to model entities. For example, if you have a resource called money and an entity called the player’s bank account, you would use a pool to model the bank account. Note, however, that pools cannot store fractional values, only integers.

The simplest kind of connection is a resource connection, and it transfers resources from one node to another. They’re represented as solid arrows connecting the nodes of the diagram. Resource connections can transfer resources at different rates. A label beside the resource connection indicates how many resources can move along the connection in a single time step. If a resource connection has no label, its rate is considered to be 1.

You can specify random flow rates for resource connections by entering them in the Label box. Random rates are represented in different ways. If you simply enter D, a die symbol will appear beside the resource connection to indicate an unspecified random factor. The Machinations Tool can generate random numbers using the same dice notation that is commonly used in pen-and-paper role-playing games. In these games, D6 stands for a random number produced by a roll of one six-sided die, whereas D6+3 adds 3 to the same dice roll, and 2D6 adds the results of two six-sided dice and thus will produce a number between 2 and 12.

You can also create random values using percentages. A resource connection labeled 25 percent indicates that there is a 25 percent chance that one resource can flow along that connection at each time step. When using percentages, it is possible to use percentages higher than 100 percent. For example, 250 percent indicates a flow rate of at least two plus a 50 percent chance of one more.

Activation Modes

In each iteration, the nodes in a Machinations diagram may fire. When a node fires, it pushes or pulls resources along the connections that are connected to it. Whether a node fires depends on its activation mode. A node in a Machinations diagram can be in one of four different activation modes:

A node can fire automatically, which means it simply fires every iteration. All automatic nodes fire simultaneously. Automatic nodes are marked with an asterisk (*).

A node can be interactive, which means it represents a player action. In the Machinations tool, interactive nodes fire after the user clicks them. Interactive nodes have a double outline.

A node can be a starting action, which means that it fires only once, before the first iteration. In the Machinations Tool, starting actions fire immediately after the user clicks the run button.

They’re marked with the letter S.

A node can be passive, which means it can fire only in response to a trigger generated by another element (we discuss triggers later). Resources can be pulled out or pushed into it by other nodes, but it does not pull or push them itself unless triggered. Passive nodes have no special mark.

Pulling and Pushing Resources

When a pool fires, it will try to pull resources through any inputs connected to it. The number of resources it pulls is determined by the rate of the individual input resource connection.

Alternatively, a pool can be set in push mode. In this mode, when the pool fires, it pushes resources along its output connections, at the flow rates of its output resource connection. A pool in push mode is marked with a P. A pool that has only outputs is always considered to be in push mode, in which case the P marker is omitted.

If a pool is trying to pull more resources than exist at the far end of its inputs, it will handle it in one of two ways:

?By default, a node pulls as many resources as it can, up to the flow rates of its inputs. If not enough resources are available, it still pulls those that are.
?Alternatively, a node can be set to pull all or no resources. In this mode, when not enough resources are available, none are pulled. Nodes that are in all or none pull mode are marked with an ampersand (& sign).

Hourglass Example

Using pools and resource connections, we can construct a simple hourglass. In this case, two pools are connected by a single resource connection. The top pool (A) is passive and contains five resources, while the bottom pool (B) is automatic and starts without any resources. After each iteration, B will pull one resource from A until all resources have moved from A to B. After that, there are no further changes to the state of this diagram.

State Changes

The state of a Machinations diagram refers to the current distribution of resources among its nodes. When the resources move from one place to another, the state changes. In the Machinations framework, you can use state changes to modify the flow rates of resource connections. In addition, you can trigger nodes to fire, or activate or deactivate them, in response to changes in resource distribution.

To make this possible, Machinations offers a second class of connections called state connections. State connections indicate how changes to the current state of a node (the number of resources in it) affect something else in the diagram.

State connections are shown as dotted arrows, leading from the controlling node and going to a target, which can be either a node, a resource connection, or, rarely, another state connection.

Labels on the state connection indicate how it changes the target.

There are four types of state connections that are characterized by the type of elements they connect and their labels. The four types are label modifiers, node modifiers, triggers, and activators.

In this condensed version of the chapter, we’ll concentrate on two: label modifiers and activators.

Label Modifiers

Remember that a label on a resource connection determines how many resources can move through that connection in a given time step. Label modifiers connect an origin node to a target label of a resource connection (or even another state connection).

A label modifier indicates how state changes in the origin node modify the current value of the target label at the current time step as indicated by the state connection’s own label. The new value takes effect in the next time step. The amount of the change in the origin node is multiplied by the label multiplier’s own label.

So, if the label modifier says +3 and the origin node increases by 2, then the target label will increase by 6 in the next time step (it will add 3 twice, once for each change in the origin node).

However, if the label modifier says +3 and the origin node decreases by 2, then the target label will decrease by 6.

The blue dotted line is a label modifier.

The label of a label modifier always starts with a plus or minus symbol. For example, in the figure above, every resource added to pool A adds 2 to the value of the resource flow between pools B and C. Thus, the first time B is activated, one resource flows to A and three resources flow to C. The second time, one resource still flows to A, but now five resources flow to C.

Activators

Activators connect two nodes. They activate or inhibit their target node based on the state of their origin node and a specific condition. The activator’s label specifies this condition. Conditions are written as an arithmetic expression (for example, ==0, <3, >=4, or !=2) or a range of values (for example, 3-6). If the state of the origin node meets this condition, then the target node is activated (it can fire). When the condition is not met, the target node is inhibited (it cannot fire).

Advanced Node Types

Pools are not the only possible nodes in a Machinations diagram. In this section, we will describe several more types of nodes that you can use, including special nodes for the four economic functions (sources, drains, converters, and traders) that I originally described in Fundamentals of Game Design.

Gates

In contrast to a pool, a gate does not collect resources. Instead, it immediately redistributes them. Gates are represented as diamond shapes that often have multiple outputs. Instead of a flow rate, each output is labeled with a probability or a condition. The first type of outputs are referred to as probable outputs while the others are referred to as conditional outputs. All outputs of a single gate must be of the same type.

Probabilities can be represented as percentages (for example, 20 percent) or weights indicated by single numbers (for example, 1 or 3). In the first case, a resource flowing into a gate will have a probability equal to the percentage indicated by each output. The sum of these probabilities should not add up to more than 100 percent. If the total is less than 100 percent, there is a chance that the resource will not be sent along any output and be destroyed instead.

In the case of weights, the chance that a resource will flow through a particular output is equal to the weight of that output divided by the sum of the weights of all outputs of the gate. In other words, if there are two outputs, one with a weight of 1 and the other with a weight of 3, the chance that a resource will flow out the first one is 1 in 4, and the chance that it will flow out the second one is 3 in 4.

An output is conditional when it is labeled with a condition (such as >3 or ==0 or 3-5). In this case, all conditions are checked every time a resource arrives at the gate, and one resource is sent along every output whose condition is met. The conditions might overlap; this can lead to duplication of resources or, when no condition is met, to the destruction of the resource.

Gates have one of two distribution modes: deterministic distribution and random distribution. A deterministic gate will distribute resources evenly according to the distribution probabilities indicated by percentages or weights if it has probable outputs. When it has conditional outputs, it will count the number of resources that have passed through it every time step and will use that number to check the conditions of its outputs. (It can be convenient to think of a deterministic gate with conditional outputs as a counting gate.) Note that the count starts over each time step, so if one resource arrives, a deterministic gate has no special symbol and is represented as a small open diamond.

A random gate generates a random value to determine where it will distribute incoming resources. When it has probable outputs, it will generate a suitable number (either a value between 0 percent and 100 percent or a number below the total weights of the outputs). When its outputs are conditional, it will produce a value between 1 and 6 to check against the conditions, just as if the diagram rolled a normal six-sided die. Random gates are marked with a die symbol.

Gates are very powerful and include a number of other features that we don’t have room to discuss here. Below are a few types of gates.

Sources

Sources are nodes that create resources. They are represented as a triangle pointing upward. Like any other node in a Machinations diagram, sources can be automatic (the default), interactive, passive, or it can activate once before a diagram starts. An example of an automatic source is the steady regeneration of the protective shields of the player’s star fighter in Star Wars: X-Wing Alliance. The action to build armies in Risk would be modeled as an interactive source of armies, and passing Go in Monopoly would be a passive source of money that is triggered by a game event.

The rate at which a source produces resources is a fundamental property of a source and is indicated by the flow rates of its outputs.

Drains

Drains are nodes that consume resources; a resource that goes into a drain disappears permanently. The Machinations framework includes a special drain node represented as a triangle pointing downward. The rate of a drain is determined by the flow rate of its input resource connection. Some drains consume resources at a steady rate, while others consume resources at random rates or intervals. You can also make a drain consume everything its input resource connection is attached to by labeling the resource connection with all.

Converters

Converters convert one resource into another. They are represented as a triangle pointing to the right with a vertical line through it. Converters are designed to model things like factories that turn raw materials into finished products. A windmill, for example, turns wheat into flour. Converters act exactly as a drain that triggers a source, consuming one resource to produce another. As with sources and drains, converters can have different types of rates to consume and produce resources as specified by their inputs and outputs. For example, a converter representing a sawmill might turn one tree into 50 boards of lumber.

Traders

Traders are nodes that cause resources to change ownership when fired: Two players could use a trader to exchange resources. Machinations diagrams represent a trader as a vertical line over two triangles that point left and right. Use traders when a given number of resources of one type is exchanged for (not converted into) a given number of another type. This is ideal for any situation that resembles shopping: the merchant receives money, and the customer receives goods in a stated proportion (the price). If either the merchant or the customer does not have the necessary resources, the trade cannot take place. Fallout 3, in which all traders’ supplies are limited, is a good example.

An interactive trader (note the doubled lines). When clicked, it exchanges three red resources for two blue ones.

Putting It Together

That’s the end of the excerpt from chapter 5 of Game Mechanics, but I now want to show you a few things you can make with Machinations. Here’s a diagram that shows all of the elements I introduced earlier.

Several of the Machinations elements.

Going from left to right, we have an automatic source (the * next to the source designates it as automatic), which initially generates 2 resources every time step, and sends them to a passive pool.

The pool is the origin of a state connection (the dotted arrow) that reduced the label on its input resource connection by 0.1 for each arriving resource. After 20 iterations, the label will be down to zero and the source won’t send any more.

The pool is connected to an interactive converter that takes three resources in and converts them to five whenever it is clicked. The five output resources then go into a random gate that sends 25 percent of them back to the pool, and 75 percent to a drain, where they disappear. The trader off to the right is not yet hooked up to anything.

A Couple of Examples

Machinations lets you model and simulate dynamic systems at arbitrary levels of abstraction. Here, for example, is the basic positive feedback loop of Monopoly:

The positive feedback loop of Monopoly.

Income arrives at a low random rate, initially between 1 and 6 units every time step. (The default Machinations random value generator is one six-sided die, although this value is settable.) The money goes into a passive pool.

At any point, the player can click on the Buy Property converter, which turns a single Money resource into a Property resource that goes into the Property pool. The state change in the Property pool is transmitted back to the label on the Income source’s output connection, increasing the amount of money raised each turn.

This is the classic upgrade process for everything from Monopoly to StarCraft: investing in production facilities consumes stored resources but increases production of new ones.

Here’s a simple self-regulating mechanism that we’re all familiar with.

A toilet.

The state connection from the cistern to the water supply is not a label modifier but an activator. It permits the water supply to provide water so long as the amount in the cistern is below 20 units. Then the cistern gets full, the water supply shuts off (in the Machinations tool, it turns grey). An interactive drain drains the entire contents of the cistern immediately whenever it is clicked. The word all is a special label designating an unlimited flow rate for a resource connection.

These are just trivial examples to give you an idea of the kinds of feedback loops and control systems that are available in Machinations. The book includes a whole library of design patterns — different kinds of engines and friction systems, escalation patterns, and miscellaneous patterns for things like technology trees.

I’ve described fewer than a quarter of Machinations’ many powerful features in this article. You can build all sorts of things with it. Chapter 6 of Game Mechanics includes examples from side-scrolling action games, shooters, RPGs, racing games, RTS games, and more. It’s not designed for building complete games, but it does let you create and test parts of a game economy and elaborate on it. You can also execute multiple runs at high speed, collect data and display or export it, and create artificial players to try out different strategies to see if any of them are dominant.

The remainder of Chapter 5 takes you step by step through the stages of modeling the various features of Pac-Man, from the ghosts to the fruit to the super dots. It can’t reproduce the layout of the maze itself, of course, but it enables you to see the various mechanisms and how they interact with each other. Here’s the final result (be aware, it includes features I haven’t described here):

The complete Pac-Man internal economy. (source:gamasutra)


上一篇:

下一篇: