Skip to content
sognat edited this page Sep 13, 2010 · 6 revisions

Status: Working Draft Revision 8

There are two kinds of resources, that given constant environment behave the following:

  • Fundamentals – those increase over time. This group includes basic resources (wood, stone…) and extras (meat…)
  • Ratings – those do not increase over time (happiness, civilization points)

In case of Fundamentals, we can speak of production.
In case of Ratings, the production equals to current amount of the resource(i.e. production=consumption, but that’s not a part of this spec).

Resource may depend on:

  • Buildings
  • Production of other resources
  • Technologies

In every case, six things are given:
“granularity
production_base, production_quotient
bonus_base, bonus_quotient,
efficiency”

In case of buildings Efficiency updates by Building Class.

Whilst computing a single resource, two constant fields are kept. Those are
“sum_prod_base, sum_bonus_base”
In every iteration over a building, resource, technologies the fields are increased basing on following formula:

if (production_quotient != 0): sum_prod_base += production_base * production_quotient^((level-1) div granularity) * efficiency else: sum_prod_base += production_base * level div granularity * efficiency;

Same applies to sum_bonus_base(be advised, however, iterating over bonus is done with forced efficiency=1). Take note that in case of iterating over ‘resource’ level means current production of another resource.
Cyclic references (ie. production of A depends on production of B and vice-versa) are INVALID.

The result of production for a given resource equals to:

sum_prod_base * (1+sum_bonus_base)
Clone this wiki locally