This module implements Swarm Simulator-style unit production.
It uses a graph describing the state of all units at time t0, and one polynomial per unit.
This module is abstract enough to use in other games that want a similar production style.
The vertices of the graph are unit counts - how many of each unit the player has at time t0.
The edges of the graph are unit productivity - how many child-unit one parent-unit produces each second.
Given this graph as input, this module has functions that output production polynomials -
one polynomial per unit, describing how many of that unit exist at any moment in time later than t0.
Calculating unit counts based on these polynomials takes a constant(ish) amount of time, no matter how far
into the future it is. This is a great property for an idle game with offline progress!
This module implements Swarm Simulator-style unit production. It uses a graph describing the state of all units at time
t0
, and one polynomial per unit. This module is abstract enough to use in other games that want a similar production style.t0
.child-unit
oneparent-unit
produces each second.Given this graph as input, this module has functions that output production polynomials - one polynomial per unit, describing how many of that unit exist at any moment in time later than
t0
.Calculating unit counts based on these polynomials takes a constant(ish) amount of time, no matter how far into the future it is. This is a great property for an idle game with offline progress!