Writing formulas - part 1

One of the most important and tricky aspects of Beta 6’s design is the creation of formulas. This series of posts (don’t ask me how many will be written, I really don’t know) will try to explain the process.

In this first post I’ll present the different types of formulas that need to be written in order to create a game such as Legacy Worlds.

There are actually two very different types of formulas. Some formulas are directly related to some of the in-game parameters, for example the employment computation; when writing these formulas, the most important aspect to think about is the intended meaning of the result. They must remain as true to a simplification of reality as possible, and the logic behind them can be assessed with relative ease.

The second type of formulas is much harder to figure out: it includes all generic formulas, which can then be used as elements of other formulas. One typical example of this is the “happiness curve”, a parametric formula which is used by the happiness computation to determine the effects of employment or security level on a population’s happiness.

The problem with these formulas is their abstraction - the fact that they can’t be linked to any “real” situation directly. There are two ways to solve this problem: either writing them as a part of another formula, or writing them with the desired curve’s shape in mind. However the result can’t be trusted without simulation, as they do not directly affect anything “real” - this type of formula is closer to what was used in Beta 5 (for example the optimal factories formula) and the consequences of a mistake here can be terrible and hard to spot.

We will concentrate on the first type of formulas in the next few posts of this series; I will use the employment formula as an example, and detail it (yes, it means you’ll get the formula, but that won’t get you very far). Later on, we’ll get to the second type of formulas, probably using the “opposition formula” as an example.

Leave a comment

You must be logged in to post a comment.