I was thinking about (in my understanding) the biggest challenges remaining for LT and came to the conclusion that the key stuff yet to be implemented(tm) are:
- Exploration: beside graphical stuff ("easy" for the brilliant graphical Josh) probably the history generation that give the impression to discover civilizations and not simply one more star.
- Trading: the economical simulation as well as the basic traders (all the truckers that are not Han Solo but keep the economy running; so the issue is mass NPC)
- Wars: the LOD simulation and AI smartness,
- Fights: I guess we are good. Perhaps AI need to improve, but I guess they could fight already in the prototype (which I did not see!).
Definitions
The envisaged LOD (Level of Details) are the following:
- Historical, used for history generation
- Strategic, used for far away systems
- Neighborhood, used for "close" systems
- Local, used for the system where the player is.
I suggest generating and simulating a cluster of stars that represent a "natural" topological unit. Because of the "frontiers" around the natural unit, this explains why there is relatively few interactions in the history of neighboring clusters.
A new cluster is generated (as well as its history) when the player arrives about 3-4 systems away from the border, and this new cluster, during its historical generation, integrates the border planets of the existing one (and possibly modify the yet undiscovered systems). This allow: "bridgeheads" of large civilizations of the new cluster in the border of the old one, and possibly the extension of the major local player in the new cluster (thus making "border" world actually booming trading highways).
Cluster
A Cluster is composed of many systems. Say few hundreds. Those have one (or possibly several) habitable planets. On a random number of planets, a "civilization" AI is created. The number of such species is one of the key (random) parameter - is the sector booming with life and with a complex structure of civilization (possibly fighting each other), or is it mostly empty and was filled (or not) by the only existing civilization without any competition.
Obviously each system also has "geographical" information such as raw material distribution, asteroid fields, and so on...
Civilization
The civilization is the planetary AI (see below) of the home planet of a homogeneous group of beings. A civilization includes basic character traits as well as (obviously procedurally generated) physical appearance (as "text" description, to add depth), possibly design basics so that all ships have a "familiar" look to them and roots for naming convention of people, stars and ships.
During the historical generation, part of the time is spent seeing, based on the characteristics of the specie to evaluate whether it reach the space age technology, and/or whether it destroys itself by intestine wars. Civilization not reaching space age will obviously remain bound to their planet, but can still develop unique items and a history. Such worlds (and destroyed worlds) will add depth to discovered systems.
A civilization can spawn new AIs (see below). Those are members of the civilization and inherit basically its traits and description. The traits can be "locally modified". So for example if a trait can be in a scale 0-100, a "new" civilization gets a random value, say 47. Now a new member of the civilization gets a value randomly picked e.g. between 42 and 52. The "broadness" (here 10) could even be a basic trait of the civilization ("homogeneity").
The result is that members of a same civilization mostly behave consistently, thus adding to the universe an inherent order and allowing to gain knowledge that can be used for subsequent encounters (you "know" what to expect when encountering another member of the same specied).
Note that it does not remove surprises, because of drifts: if a species AI spawn another AI that spawns another AI for a couple of generation the traits can become quite different.
Planetary AI
A planetary AI is bound to the planet, and only if the planet is conquered or destroyed can it be removed. It is possibly to have several AI per planet if one want to add complexity and allow concurrent empires from different nation states of the same species, but for the purpose of simplicity, I suggest beginning with a simple rule:
1 inhabited planet = 1 planetary A.I.
The planetary AI simulates a whole planet. It will certainly use the same engine as "normal" AI (the guys flying the ships around you), but has some specifications:
- It cannot move.
- It can spawn descendants; normal ship AI (LOD - Neighborhood), fleets (LOD - Strategic) or spawn new planetary AI when colonizing a new planet or building stations (LOD - History).
- It is a ressource sink and source, i.e. it produces some ressources and consumes some. This represent the economy of the whole planet.
- It manages drone AIs. Drone AI are all the truckers of the galaxy, that mine and move goods around but have a job (and keep their independent objectives for their free time, and outside of the scope of the game). Drone AI are simulated like normal ship-AI at local-LOD when having to react to player's interaction but otherwise serve to keep a multi-planet civilization running.
The planetary AI is the lowest level of detail (LOD) of the historical simulation.
Growth and basic economical model
The planetary AI is the core of the economic simulation engine. It manages stocks of all major goods
Based on the characteristics of the planet as well as on its "population", traits and technological level, it produces a certain amount of ressource per time unit, and consumes as well a certain amount. When production is higher than consumption, the price is low and those ressources are readily available, in the opposite cases they are scarse and expensive.
The growth of the population and the technological evolution (extremely coarse for historical purpose, during the player's lifetime it can be considered frozen except when there is an contact with a new civilization) are possibly limited by ressource scarcity, and simulated during the historical period based on the traits of the AI.
Colonization
When a civilization reaches space age, it can extend to new stars in the "neighborhood". First it can mine, getting ressources (the efficiency of miner is determined by technology and traits, as well as the local amount of materials; mining has costs too so throwing more miners may become negative). It can colonize. Colonization of an unpopulated planet is represented as follow:
- A descendant AI is spawned as new planetary AI on the planet.
- It gets the civilization level of the parent AI, and a small start population,
- Its "terraforming" is simulated, it costs ressources,
- It is therefore an extra ressource drain for the parent AI until terraforming is completed and the new planet can develop on its own, having a status of "slave" (see below).
The interaction with other existing planetary AI involves status of war, neutral, ally, slave, master. The status is decided at first contact based on chance, the traits and the economical situation. The status is periodically updated to make for an interesting history. A slave can become an ally (independent state, but friendly) or an enemy (revolution), and so on.
The status are defined as:
- War: no commerce. Ressource sink for both AIs to a random level (battles in space, skirmishes to full scale wars). Once in a while a planet may be taken over. In this case the existing planetary AI gets the status of slave of the victor, and its own traits are modified as a crossover of the victor's and the existing one. If the winning civilization has a high "homogeneity" it is considered to kill more people and impact deeper in the planetary affairs, thus resulting in a new planetary AI with traits very close to the victor's. Otherwise they may basically require tax and leave the planet otherwise untouched, thus leaving the existing AI's traits basically unchanged. (Note, with regards to species and description: the new AI contain both descriptions and these are passed together to any future child planet AI or one of them is randomly selected to generate a "real" NPC. The result is that planet which changed often ownerships have mixed population of many species, but with common traits).
- Neutral: commerce is active, half the intensity.
- Ally: commerce is active and the ally help each other in case of conflicts (attacking the other's aggressor). The Ally also gets slowly the technology of his partner. This is the way for an planetary-AI that did not reach space-age to be discovered by another AI, become its ally (usually because the traits of the discovered are making him very gentle), and slowly reach space age using the other civilization's tech.
- Slave: commerce is active. A tax in each goods is levied and given to the master. The master decides the tax level. It can plunder, but obviously this will not help the slave planet develop its economy (remember scarcity may limit population growth and hence ressource generation) so may be negative in the long term.
- Master: commerce is active. A master may give ressource to a slave (thus making the name "master/slave" no really correct) to help its evolution. In this case, it is more like a state with many cities, then a centralized empire.
Commerce at historical-LOD is represented by the exchange of goods between planets, thus placing goods from one stock to the other, and exchanging with another good in the other direction.
Planetary AIs also have a bank account for exchange. This account has a certain initial capital (based e.g. on traits) and does only change by commerce (no growth or decrease like other goods).
The maximum intensity ("number" of ton of exchanges) is set by the technological level, the proximity and the size of both partners. There is potentially N*(N-1) commerce to be evaluated. First master/slave are evaluated, than allies, then neutrals. Prices are obviously adapted dynamically based on stock and demand after each operation.
The maximal added value is targeted, thus if stocks are available using the good with the highest price difference, than the second, and so on up to the exchange volume. A cost of transport is factored in (based on tech, proximity...) and only if the resulting value is positive the transfer is actually done, thus it can be that the whole capacity is not used.
It goes in both directions. The difference in value is credited (and debited) from the planet's bank account.
No planet can go negative in its bank account - if the planet has no more money, the commerce is limited to exchange of goods for an equal value.
This economic model will lead to low price differences at places where lot's of goods can be moved around. This is the expected behavior. It will also possibly not fulfill needs of a planet in low value material (due to the cap in intensity of commerce). This is also expected - space travel is expensive and not used for low value stuff on a grand scale.
With this we should have all the requirements to make the historical LOD simulation of the sector.
Note that this can become darwinian, and that possibly very good combinations of traits coming from the crossing of several species will come to dominate the sector. The options are very interesting and can make for intrigate histories. Obviously the history needs to be logged to be referenced in the descriptions of places and NPCs...
Strategic LOD - Fleets and drones
At the strategic LOD, I suggest keeping the planetary AI active and adding spawned descendant AIs for significant fleets. Fleets are composed of military presence ("fleets") and merchants and miners ("drones").
They fulfill a difference function, drones being required for the strategic LOD economical simulation while fleets are required for the political simulation.
Fleets
Fleets are significant groups of ships that are controlled by the parent planetary AI but where the commender has defined own traits (which will be used when changing the LOD to neighborhood to populate a full blown ship-AI (the "common" ones). They have a defined but aggregate power and health, and composition characteristics (again that will allow to actually generate the required ships at higher LOD).
Because fleets are localized, the location of fights in the wars of the cluster as well as the probability of the fight's outcome are much better defined. Fleets repair themselves slowly, or more quickly in their parent planet, or a slave or an ally planet.
Fleets are the agent, at strategic LOD of planetary AIs to conquer other planets. Those should require quite some power so probably the addition of several fleets.
Pirates
A special type of fleet is the "pirates". In some remote locations, pirate nests can be spawned as fleets. They can fight with other fleets or just infect some locations (see below).
Drones - Miners
Drones are at the strategic LOD represented by a number and productivity of miners in a given system belonging to a given planetary AI, as well as a number and capacity of merchants linking planetary-AIs together. Only significant trade routes are simulated, i.e. there is a threshold under which no merchant is simulated as rare contacts do not impact the economy significantly.
For the miners, this is the same level as the historical-LOD (only roughly how many miners are around belonging to a certain civilization in a certain system, and their output). When going to a higher-LOD, the miners are spawned as dependent AI and have no independent objectives (so basically the normal AI after having decided to mine a certain field and to sell the product at location X. Drone AI are simulated like normal ship-AI at local-LOD when having to react to player's interaction. But it will be obvious that they are drones, because they will state that they are employees of XXX flying a company vehicle (so with limited freedom of action).
Mining in a place close to pirates (say 1-2 systems away) means random loss of ships and lower mining efficiency (hiding, fleeing, etc...).
Drones - Merchants
For the merchants, this refines the "tax" and "gives" of ressources as well as the automated commerce of the lower LOD. Each flow of material gets extra information with regards to type of vessels (large container ships, large fleets of small ships), and a probability of success of the trip (thus making loss of ressources) which declines when going close to pirates.
Add a coarse simulation of significant NPCs that the player encountered and this should cover the strategic LOD.
Neighborhood and local LODs
The Neighborhood LOD is basically a local LOD without considering the actual models of the ships or position in the system, so each merchant flow going though the system, fleet present and miner will get instanced as one or several ships.
What about the real AIs
When a player enters a the neighborhood of new system for the first time, a random number of new NPC ("non playing characters") can be generated. They should be descendants of the planetary-AI, or from a planetary AI that has a close trading contact with this system, (and with a low probability of a far away other planetary AI), but with a bit more variance in the traits.
They start with a certain (random) capital and are roughly simulated for a (random) period using a snapshot of the universe as a static playfield. (If too many leave the neighborhood, generate more of them). They represent "interesting" people / corporations to interact with.
To clarify:
set clock to -50 year, spawn first NPC, simulate him at strategic LOD (against current static universe), when time comes for next NPC, instance it, and keep simulation running (both NPC can interact), and keep adding NPCs. When clock reach -10 year, switch to neighborhood LOD until clock goes to present.
At strategic-LOD such NPC can periodically choose an activity, get a random (but obviously modified by traits and environment) result, can grow by buying more ships and have a risk of dying.
At neighborhood and local LOD, they have specific objectives and are basically the AIs that Josh works on.
So I am pretty sure you are now all confused.
Edit (12.01.2013): Note that the Word "spawn" should normaly not be understood as random generation without cause; spawned AIs for planets, fleets or merchants (and even pirates) are instanciations of populations that exists as a consequence of the local conditions. Spawn NPC are "born" in the past without a cause, (like we all), but then evolve and are in the middle of their history as the player meet them. In short, this system is compatible with the full causal universe.