User Tools

Site Tools



Mapcraft - Fantasy map designer

WorldGen - SciFi universe generator

Mapcraft Web - Web based fantasy map designer

All code for the project is released under the GPL, and is copyright Samuel Penn.

The text on this wiki is dual licensed CC-BY-SA and GPL.

You can contact the author at



:!: We are now into version 3 of trade system.

Planets, moons and asteroids are generally a source of resources, which are then traded across the galaxy. When worlds are created, the types of resources that they provide also needs to be generated. Generally, the planet type dictates the type of resources that are available, but there is some variation allowed for.

Resources are listed as a commodity type and density for each planet. Whilst resources are just commodities, not all resources can be traded as goods. Any commodity that can be a resource will have an output mode defined for it. A Facility will define which output modes it supports, and will define which trade goods are produced.

See also: Facility, Commodities, Consumers

Resource Codes

Commodities have a Source, which define the type of facility that is required to produce goods.

Code Description
Mi Mining resource, must have a Mining facility.
Ag Agricultural resource, must have an Agriculture facility.
In Industrial resource, must have an Industrial facility.

Resources are defined by the world type, according to the Planetary Classification List. They may be modified by other factors, including random chance. Some resources are only found in particular types of star systems (such as around white dwarfs, or particularly hot stars).

Resources are obtained with Facility, which mine or farm the commodity to generate actual trade goods. Such facilities are known as Generators, and turn resource into a trade good of the same type. Currently, generators are either Agriculture or Mining.

General Rules

The following applies to all types of resources.


All resources have a density associated with them, which is an indication of how much of the resource is available at a given location. Density generally ranges from 0 (not present) to 100 (sitting around on the surface).

Quality of resource Range
Unavailable 0
Trace 1-5
Scarce 6-15
Poor 16-30
Moderate 31-50
Good 51-75
Ideal 76-100

Different ores have different commonality. An ideal world for a common resource will have more available than an ideal for a rare resource. The commonality of a resource multiplies the base density.

Commonality Multiplier
Very rare x0.10
Rare x0.20
Uncommon x0.50
Common x1.00

Should have common random values.

Gathering Resources

The amount of resources that can be gathered, is based on the population, the density of the resource and the properties of the resource and output mappings.

Resources must have output mappings defined in order for them to be 'mined'.

The effective population is modified by the size of the facility (as a percentage), and by the efficiency of the mapping (again, a percentage). Mining worlds may have facility sizes near 100%, but most worlds will have much lower ratings for mining. Agriculture will tend to be 30% to 60%, depending on world type.

The production rating of the commodity being produced is then used (not the PR of the resource, unless the two are the same).

The efficiency of the mapping multiplies the effective population. Most mappings have an efficiency of 100%, for no change.

Each commodity has a production rating, where PR = 0 are easiest to produce, and PR = high are hardest. 1 unit of commodity can be produced each week per population for a PR of 0. Each +2 PR multiplies the population requirement by 10 (so PR = 6 means 1 unit per week per 1000 population).

The density multiplies the people requirement by (10000 / density^2).


Resources are turned into goods. Normally, a resource produces goods of the same commodity type. This is not always the case however. If the commodity resource has a code of PR, then it produces goods of different types. One or more child commodities will have P? codes, where ? is 0+.

  • P0 - Goods equal to 100% of the resource are produced.
  • P1 - Goods equal to 50% of the resource are produced.
  • P2 - Goods equal to 25% of the resource are produced.
  • P3 - Goods equal to 10% of the resource are produced.

If the resource commodity itself has code P?, then it is also produced.

If the commodity has a code of VR, then it is a variable resource, which produces goods of different types based on the resource density. This can be combined with PR resources, and behaves in a similar way. Child commodities have V? codes, with higher codes only being produced at higher densities. Low codes (V0 etc) are only produced at low densities.

  • V0 - Produced from 0 upwards (ubiquitous).
  • V1 - Produced from 20 upwards (common).
  • V2 - Produced from 40 upwards (uncommon).
  • V3 - Produced from 60 upwards (rare).
  • V4 - Produced from 80 upwards (very rare).
  • V5 - Produced from 100 upwards (incredibly rare).

If a commodity is marked as VL, it will cease being produced at higher densities.

A commodity cannot have a P? code as well as a V? code, but may have both VR and PR. In the latter case, all P? children are added, then all matching V? children are added.

Tech Level

A resource cannot be produced if the commodity TL is higher than the planet's TL. If the planet's TL is sufficient, then the resource is produced at full rate.

If the commodity has a code of Tl, increase production by 10% per extra TL.

If the commodity has a code of TL, increase production by 25% per extra TL.


If the item is illegal on this world, multiple the number of people required by 10 for each level of difference (e.g. if good has law of 4, and local law level is 6, multiple by 100).


If the resource has an Agricultural source, and the world has an Ag trade code, halve the number of required people.

Otherwise, if the world has an Na trade code, multiply required numbers by 10.


If the resource has an Industrial source, and the world has an In trade code, halve the number of required people.

Otherwise, if the world has an Ni trade code, multiple required numbers by 100 (yes, this is much worse than lacking agriculture).


If the resource has a Mining source, then:

Trade Code Multiplier
Mi 0.5
In x1
Ni x4
Ag x2

Consuming Resources

Resources are consumed according to what the population wants. See Consumers.

worldgen/resources.txt · Last modified: 2015/02/04 22:39 (external edit)