Enjoy!
Goals
The goals of the background simulation are as follows:
- Politics
- Create a dynamic, evolving galaxy
- Generate interesting events
- These can then be used to create missions
- Respond to player activities
- Player activities should have greater impact
- Respond to injected events
- Respond to generated events (chain effect)
- Economy
- Create a dynamic economy
- Populate markets (quantities and prices)
- Be relatively predictable (to aid player understanding)
- Generate interesting events
- These events can be used to create missions
- Respond to player activities
- Player activities should have greater impact
- Respond to injected events
- Respond to generated effects (chain effects)
The requirements for both the political and economic simulations are similar, potentially similar enough that they can be driven by the same system, which is something we will explore with this design.
From a technical perspective the following goals are also required:
- Low overhead for processing
- Low overhead for data storage
- Low data access requirements
What the simulation is not
- It does not provide faction command, this will be done by designers by injecting events.
- Although the system should provide aggregated data to help guide these events.
- It does not provide a fine detailed simulation of human space in the galaxy.
- Note that it does provide the framework for a living galaxy as required in the goals.
What defines a simulation entity
A simulation entity is the lowest unit to which the simulation applies, this will typically mean a system or a world within a system. Note that an entity can support multiple markets.
An entity has a number of variables. Each of those variables defines what events the simulation creates.
- Government type
- The government type is one of a list of predetermined types. The types apply a range of modifiers to the base values for system. For example communism, or democracy. The list of government types is listed below:
- None
- Anarchy
- Commune
- Communism
- Corporate
- Cult
- Democracy
- Dictatorship
- Federation Democracy
- Imperial Republic
- Economy type
- The economy type is a broad indication of the primary income generation for the system. This usually reflects what the main exports are. They also determine
- what items are generally available in the markets.
- Agricultural
- Industrial
- Mineral
- Service
- Population
- The population size of a planet is used to measure the effects of changes or player activities. It is also used to modify the availability of items in associated markets.
- Development Level
- This a broad indicator for how advanced the colony is. It provides modifiers for the various variables of the entity. In a broad sense it is an indicator of how well the entity can absorb change, shortfalls and so forth. It also represents the entities ability to support itself through contact via other entities.
- Standard of Living (SOL)
- The standard of living variable indicates how good life is for the average member of the entity’s population. A high standard of living requires adequate essentials (such as food) as well as luxury items. This will also affect the availability (and demand) for such items in the markets.
- A low SOL indicates a poor standard of living for the population, in situations with low stocks of essentials like food this indicates an event like a famine.
- Manipulation of the markets either directly through trade or indirectly by blockade will change the SOL appropriately.
- Security
- The security value represents the security situation for the entity. The higher the value, the more secure the population feels and vice versa.
- The security value can be modified by direct player action, acts of piracy will lower the security while bounty hunting will increase it.
- Wealth
- The wealth variable indicates the accumulated wealth of the entity. The entity can use its wealth to generate events to boost its other values and as such acts as a cushion for negative changes. It also indicates the strength of the economy and feeds into prices.
- Note the while SOL and wealth are connected, they are not the same thing.
- Players can influence wealth in a number of ways, generous trading will increase wealth, while reducing profit margins for the locals will reduce wealth. Destroying entity assets will impact on wealth, and influencing security and SOL will also have a knock on effect.
Bi-Modal Simulation Tick
The simulation runs in two distinct modes (although the evaluation of each mode generates the same events). The first is based on player activities, once an activity type reaches a threshold for the entity, the impact is applied and any events generated.
As well as player effects we also want periodic change driven by the simulation itself.
Player Activity Thresholds
Player activities within the associated volume for the entity are tallied into various influences. These influences have a direct effect on the entity’s stats. The tracked activities are as follows:
- Development level
- Negative impact
- Failed development missions
- Positive impact
- Completed development missions
- Standard of Living
- Negative impact
- Failed standard of living missions
- Positive impact
- Completed standard of living missions
- Completed trades that add to the entity’s essential goods
- Security
- Negative impact
- Piracy
- Murder
- Failed security missions
- Positive impact
- Bounties collected
- Completed security missions
- Wealth
- Negative impact
- Issuing missions
- Losses made on trade by entity
- Positive impact
Thresholds for the activities are set depending on the entity’s population, development level and modifiers from government types as applicable. A count for each activity is maintained; note that it is the net between positive and negative actions that is used to determine any change. Missions are weighted more heavily in the count than general actions. Once the net effect reaches the threshold value then an event is generated. The activity counts are reset and the threshold value recalculated based on the new statistics if needed.
Note that wealth is not a triggered threshold, but is included as it does change depending on circumstances and is required for generating remedial missions.
Generated Events
When a threshold has been triggered then the entity creates an event, this is typically a mission designed to address the problem, although this will cost the entity some of its wealth. If the entity has no wealth then an event cannot be created, however a message will be generated for the monitoring developers (see intervention triggers).
Periodic change can also create events.
The government type determines whether an event should be generated for the triggered threshold.
If the government type allows it then an event (and associated mission) is generated. These will follow the same pattern as the activity thresholds list, so for example a bounty hunter mission will be generated if the security variable is reduced.
Periodic Change
The periodic development of entities is handled by a periodic scan of each entity. The entity’s variables are analysed and adjustments made. If any changes change a value across a given minimum then an event is created in the same way as if an activity threshold was crossed.
Faction Support
For entities that belong to a faction (the Alliance, Federation and Empire) there is a safety net provided by those factions. When an entity attempts to generate an event and lacks the wealth to do so it uses its faction’s lookup table to generate a faction event for the event type.
For example an Imperial system has been plagued with pirates; it has issued missions which no player has completed. This cycle continues, with more player pirates pushing the entity into a downward spiral. Eventually it is no longer able to generate missions and so receives a faction support event. This is an Imperial task force of a cruiser with several squadrons of fighters. These suppress the pirates and order is restored.
Government Collapse
When an entity attempts to issue an event and cannot (and it doesn’t have faction support) then the entity’s government collapses and is set to none.
Injected Events and Intervention
Events that affect entities can be injected into the game that can directly change an entity’s statistics. This mechanism can be used to add specific events to the game, like civil wars, economic collapse and major story items.
Intervention messages are a failsafe in the system. When an entity’s stats reach set levels (a minimum and a maximum) a message is sent to whoever is monitoring the galaxy highlighting possible collapse or expansion opportunities. They can then be used to manually add events as desired.
Markets and Trading
Each entity can have one or more markets. A market is defined as a place where the player trades with NPC’s. Typically this will be at space stations, ship yards, pirate and smuggler bases. The entity defines what commodities are available and their prices, although the markets will also modify these.
As with the political events, economic events occur in a bi-modal tick. The periodic method is a check of the entity’s markets and any adjustments made. The other method is the threshold system of players trades that works in a similar fashion to the player activity thresholds.
Calculating base prices
Base prices are initially calculated as a function of economy type, government type, development level and population.
For example a largely populated agricultural world with a high development level would have cheaper food prices than an equivalent industrial world.
Prices have a universal minimum and maximum price cap to prevent catastrophic price failures and exploits.
Rare Goods
Entities which have a sufficiently high development level may start creating rare goods based on their primary economic output, e.g. an agri-world could generate a rare foodstuff.
Periodic Market Analysis
On a periodic basis (daily) the market for each entity is analysed and updated depending upon the analysis. This analysis is performed before the political simulation so that any economic changes are taken into account.
The major components of that analysis are as follows:
- Restock markets
- The markets for the entity are restocked according to the type of market, the commodities that the entity produces (these are also affected by the development level, government and economy types).
- There are caps to the maximum capacity for each commodity determined by the market type. Larger stations can hold more goods for sale. These caps also limit player sales, so if a market is already full of food, no more food can sold to that market.
- Note that the restock quantities are representative (scaled by population size and development level). We do not have an agricultural world producing a million tons of food per day.
- Calculate wealth adjustment
- The current trade for the system is calculated and the net effect is applied to the entity’s wealth.
- Standard of Living (SOL)
- The entities standard of living is processed, quantities of essential goods are removed from the markets. The removed quantities are representative values scaled by population and development level, we are not modelling planetary scale use of commodities.
- Commodities are grouped for essentials and luxuries. If there is a shortfall then the SOL is reduced appropriately. Surpluses of essentials will increase SOL, but only to a maximum of 50%. Shortfalls of luxury items reduce SOL, but to a minimum of 50%. Surpluses of luxury items increase the SOL, but only if the SOL is at 50% or higher.
- Recalculate prices
- For the remaining quantities of each commodity a new price is calculated, based on a ratio determined by a lookup table from the price at the beginning of the analysis process. For example if the commodity now has a stock level of 50% higher, the price per unit will drop by 25%.
- Reset trace counters
- The accumulated counters for the trade thresholds are all reset.
- Reset thresholds
- The thresholds for each commodity are reset depending on the updated stock levels.
Market Thresholds
In the same way the political events are triggered by player activity thresholds, price and stock changes are triggered by player trades.
For stock availability this correlation is direct to the trade, so purchasing 100 units reduces the stock level by 100 units and vice versa.
Prices are not quite as volatile as stock levels, they require accumulated trades to trigger price changes.
For each commodity the entity creates a threshold level for price increases and drops. The threshold is determined using the entity’s economy type, government type and development level. The unit quantity for each trade is applied to the relevant counter for each commodity, when the counter reaches the threshold for a change the change is triggered.
Inflation
The economy is not a balanced system of checks and balances, but a system of causes being used to generate effects. As such there is a danger of inflation (where players accumulate so much money that it is effectively devalued).
This issue can only be completely eradicated if money is destroyed in the same quantity that is being created. As the game is focused on positive effects (from the player’s perspective), with only some negative effects, this is not an achieveable goals.
To combat inflation there needs to be suitable money sinks that the player spends money on reducing the cash in the player economy.
It should be noted that players getting richer is not the same as inflation and is desirable. However we should ensure that at all times there are interesting spend choices.