Unity Plugin (UP) & API
Converters & Traders
Converters and Traders use only 1 Step to both get the input and execute the command.
Converters transform one or more Resources into another.
Converters are designed to model things like factories that turn raw materials into finished products. In League of Legends, for example, you would use a Converter to forge a Hextech Key out of 3 Hextech key fragments.
🔧 Hit Play in the example diagram below. The Converter will automatically pull 3 Resources every time step from the Key Fragments Pool, and forge them into a Key. When there won’t be enough Key Fragments (3) to forge a Key, the Converter will continue to pull Resources (emphasised by the blinking Resource Connection), but it will only succeed when the Pool will once more contain at least 3 Key Fragments.
The rates at which Converters consumes one type of Resource and produces another are given by the Formulas on its input and, respectively, output Resource Connections. In the example above, the Converter drains 3 Key Fragments and produces 1 Key.
There are 2 types of conversions this Node can perform: Single or Multiple. You can set this in the
Properties Panel > Conversion.
Single Conversion: Performs all possible conversions during separate Steps (one conversion per Step)
Multiple Conversion: Performs all possible convertions in a single Step.
In the diagram above, perform a Step Play to visualise the difference between the 2 types of settings.
The Converter Equivalent may come in handy if you need to limit the output of the conversion.
By combining a Drain and a limited Source, you can get a limited Converter that can produce only a limited amount of Resources as its output.
Traders are Nodes that cause Resources to change ownership when fired: two players could use a Trader to exchange Resources.
Traders have 4 Trigger Modes – select one of them in Properties > Trigger.
Traders require that the 2 types of Resources being traded be differentiated through Filter (Colour Coding). The construct will have 2 pairs of input-output Resource Connections, each of a certain colour (eg: 1 red coming in – 1 red coming out; 1 blue coming in – 1 blue coming out).
All input and output Resource Connections need to be colour coded, even if one of the colours is the default Black. To do this, you need to tick “Filter” in the Properties Resource Connection panel on the right. [The Filter box ticks automatically when choosing a different colour than the default, from the drop-down beside it.]
Read more about Filter (Colour Coding)
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.
From a player’s perspective, Converters and Traders have almost the same function: pass a number of Resources to it and get a number of other Resources in return.
From a game designer’s perspective, however, they are definitely not the same. When activating a Converter, Resources are actually consumed and produced, and therefore the total number of Resources in the game might change. In contrast, activating a Trader leads only to an exchange; the number of Resources in the game stays the same.