One could split the implementation of game design and balance in two parts:
1. Gathering of all required variables to calculate the outcome.
2. Calculate the outcome.
In short, Factor is responsible for the first part.
Notice how splitting the game design implementation into two logical steps can
benefit us: testing the outcome of a calculation, or experimenting with new
equations is as simple as passing the raw data, which represents the facts.
In doing so, we've essentially decoupled the collection of the data from the
calculations of balance and design.
Helix.Factor is the first part; Helix.Balance is the second one.
Helix.Balance is meant to be as dumb and free of context as possible, receiving whichever data it needs to calculate the output. It must not perform any side-effects. It must always return a number (either integer or float, whatever makes sense`).
Helix.Balance.Penalty - Returns penalties like cool-down, heat, etc.
It may be helpful to have some syntactic sugar around it (macros), specially for dealing with integer <-> float conflicts, rounding up/down in a consistent way and having a special, unhygienic c variable with global (and local) constants.
This is an evolution of #266.
From the
Helix.Factor
docs:Helix.Factor
is the first part;Helix.Balance
is the second one.Helix.Balance
is meant to be as dumb and free of context as possible, receiving whichever data it needs to calculate the output. It must not perform any side-effects. It must always return anumber
(eitherinteger
orfloat
, whatever makes sense`).Sub-modules include:
Helix.Balance.Virus
- Returns virus earnings, DDoS power, etcHelix.Balance.Software
- Returns software-related data like expected size, time/cost for researchHelix.Balance.Process.X
- Returns objectives and resources related to processX
Helix.Balance.Constants
- Returns constants likeinflation_rate
Helix.Balance.Difficulty
- Returns difficulty multipliersHelix.Balance.Penalty
- Returns penalties like cool-down, heat, etc.It may be helpful to have some syntactic sugar around it (macros), specially for dealing with integer <-> float conflicts, rounding up/down in a consistent way and having a special, unhygienic
c
variable with global (and local) constants.