Return to “Suggestions”

Post

LOD Simulation and historical simulation

#1
TL;DR: Discussions about the simulation of LOD, with proposition for historical and economy simulation. Key is the planet AI, a special AI that represent many people at the same time. Sorry for the wall of text... :mrgreen:

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!).
History generation and economical simulation is nothing else than the coarsest and second coarsest LOD for the simulation. Hence the LOD simulation is probably the toughest open issue. So here are some thoughts certainly inspired by many other posts in those forums.

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.
Universe
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.
Historical LOD
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).
Interactions and politics
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
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. :monkey:


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.
Image
Post

Re: LOD Simulation and historical simulation

#2
*bumped*

Because this post deserves some actual attention for the detail that was put into it. While I may require some time to fully digest it (somehow I missed it until Thymine pointed it out in a different post), this is definitely well thought out.
Image
Early Spring - 1055: Well, I made it to Boatmurdered, and my initial impressions can be set forth in three words: What. The. F*ck.
Post

Re: LOD Simulation and historical simulation

#3
DWMagus wrote:*bumped*

Because this post deserves some actual attention for the detail that was put into it. While I may require some time to fully digest it (somehow I missed it until Thymine pointed it out in a different post), this is definitely well thought out.

Ditto... I want to say something constructive... but I am still absorbing it all... I will come back to this though :D
"The person who says it cannot be done should not interrupt the person doing it" ~Confucius
Post

Re: LOD Simulation and historical simulation

#5
CSE wrote:The Dev Log today has included, in a very elegant way with a black box task network, the concept that planets must be sources and sinks of resources. I hope that they will get a "personality" as well, i.e. a governmental AI....
If planets can be represented by the actions of a governmental AI with a personality, how should the accumulated simulated actions of a whole star system be handled? Would that be a sort of vector product of all planetary actions in a system? Or would one planet usually account for so much of a system's activity that every system can be considered as just that one planet's simulated actions?

What about entire regions of systems?

Not criticizing -- just interesting to think about. :)
Post

Re: LOD Simulation and historical simulation

#6
Alright, now that I've had some time to digest this...

How do you propose interactions between clusters or do you intend to have each cluster be self-contained?

I don't mind if they are self-contained as long as each cluster is big enough so the walls of said cluster are not easily noticeable.
Image
Early Spring - 1055: Well, I made it to Boatmurdered, and my initial impressions can be set forth in three words: What. The. F*ck.
Post

Re: LOD Simulation and historical simulation

#7
Flatfingers wrote:
CSE wrote:The Dev Log today has included, in a very elegant way with a black box task network, the concept that planets must be sources and sinks of resources. I hope that they will get a "personality" as well, i.e. a governmental AI....
If planets can be represented by the actions of a governmental AI with a personality, how should the accumulated simulated actions of a whole star system be handled? Would that be a sort of vector product of all planetary actions in a system? Or would one planet usually account for so much of a system's activity that every system can be considered as just that one planet's simulated actions?

What about entire regions of systems?
Well, actually in my view, the planet is the smallest unit for the historical LOD. So they do not get aggregated, but each actor (e.g. Each planet with a population that has its AI) is simulated independently. That means that entire regions of systems ( say 1000 inhabited planets) will have 1000 active actors. However each actor has a comparatively easy task at low LOD: compute some aggregate input/output, define average commerce flows and average war impact, and seldom change a planetary AI due to conquest. No deep thinking, no flying around, no long term planning. Should take a negligible fraction of the processor.

If after some time there is so many sectors that this makes a drain, you can always make bigger "time steps" (as the coarse simulation is sort of "turn based" - it simulates broad effects averages around a period of time, not small variations).

Hope this is understandable....
Image
Post

Re: LOD Simulation and historical simulation

#8
DWMagus wrote:Alright, now that I've had some time to digest this...

How do you propose interactions between clusters or do you intend to have each cluster be self-contained?

I don't mind if they are self-contained as long as each cluster is big enough so the walls of said cluster are not easily noticeable.
I view clusters are being "mostly independent".
I imagine that within a cluster, interstellar travel is quick and cheap (and has many routes). Across clusters, however, it is much longer and expensive (and only few routes exist), due to topological hand-waving excuses, such as the absence of stable wormholes, or dense black matter regions that mess with your hyperdrive.

So each is sort of self-contained. But, as the software generates the next cluster a bit in advance, and as travels are hard but possible, this allow to have a minor influence in border systems. Information exchange is the most obvious (maps, perhaps not fully up to date, brought by seldom travelers), special tech items, one or two NPC adventurer that came from the other side. Seldom, but possibly a bridge-head of a great civilization with a planet being a colony of a civilization of another neighboring cluster. Due to the cost of travel, this colony would not have a dense connection with the home worlds, nor expect an easy military assistance from there. But it could serve as important commercial counter for key, high value items that get transported across clusters, and for technological advances sharing. In seldom cases, such bridgehead could even evolve (independently, during the historical generation of that cluster) to a dominant civilization, thus letting the option to have civilization spanning several clusters (as exceptions).

This means also that the walls between clusters are noticeable, they are "features" within the game lore and with gameplay impact, not "technical limits" to hide in shame :lol:
(The gameplay impact is obviously that the player that want to change cluster will not easily keep contact and material flow with his faction back there, and that the Darwinian historical generation is broken by discontinuities thus making higher variability in the universe).
Image
Post

Re: LOD Simulation and historical simulation

#9
Nice!

So, since Minecraft is about the only one I draw parallels to, I'm seeing these clusters equivelent to MC's biomes. The only thing I'd advocate is to make the clusters large enough that it doesn't feel like a small number of planets in their own little universe.
Image
Early Spring - 1055: Well, I made it to Boatmurdered, and my initial impressions can be set forth in three words: What. The. F*ck.
Post

Re: LOD Simulation and historical simulation

#10
Quickest answer, is that you define a simpler common interface for the bigger systems, containing just statistical properties for inter-system interactions.

Anything else (like advertising strong specialisms) would be expensive-to-simulate detail, as specific instanced data structures, but it can still be done... just be careful to limit the number of instances.

After that, it's a balance of knowing how much granular background simulation to support, especially in a game where the player has covered many locations.
Post

Re: LOD Simulation and historical simulation

#11
This is a really elegant idea imo.
CSE wrote:I view clusters are being "mostly independent".
I imagine that within a cluster, interstellar travel is quick and cheap (and has many routes). Across clusters, however, it is much longer and expensive (and only few routes exist), due to topological hand-waving excuses, such as the absence of stable wormholes, or dense black matter regions that mess with your hyperdrive.
You could just design the existing system to naturally produce clusters - imagine sampling a gaussian distribution to determine the level of connectivity between two arbitrary regions. Most of the time, you'll get regions that are connected with a pretty average level of connectivity. Occasionally, you'll get regions that are very highly connected (what kind of gameplay dynamics would this lead to in those regions?). And sometimes, you'll get very weakly connected regions - these will naturally form the boundaries to clusters. You'd probably need some kind of connectivity threshold to determine when two regions can be considered to be parts of different clusters in order to allow for the other mechanics you propose to work. This also means that clusters will likely be of pretty different sizes.

The strength of connectivity between regions doesn't just have to depend on the number of paths connecting them, but other factors like the stability of the paths between them, or the time/money involved in crossing them, or the level of technology required, etc.
Post

Re: LOD Simulation and historical simulation

#12
ThymineC wrote:The strength of connectivity between regions doesn't just have to depend on the number of paths connecting them, but other factors like the stability of the paths between them, or the time/money involved in crossing them, or the level of technology required, etc.
This is certainly an option. However, for the purpose of the LOD and for the engine, a clear cut-off is probably necessary.
One could however imagine different sort of (weak) connection between sectors, with different gameplay effect:
  • very slow connection - in game time the "jump" lasts years, even if the player see it as instantaneous. This means as gameplay that you basically have to trust any "active" possession or faction to an NPC and loose any direct control.
  • dangerous path - 50% of the ships disappear during jump. No direct effect on the player (he survives, anyway he can reload), but loss of part of his escort. Makes commerce very expensive, basically one delivery costs you twice + the lost ships. However information can be exchanged via cheap automated drones.
  • hidden path - require expensive equipment to use it, thus putting a high price tag per ship that needs to cross.
  • ....
By the way, love the idea of having clusters of wildly different sizes :thumbup:
Image
Post

Re: LOD Simulation and historical simulation

#13
We're also talking about mostly historical and LOD simulation.

It seems that if one cluster is more rich in a specific element than another, then once the history is done generating and once a few clusters are discovered, it may be completely possible the AI will then 'see' this other cluster as you traverse boundaries (utilizing the idea that was put out a long time ago that information travels with ships) and trade may establish between the two regions.
Image
Early Spring - 1055: Well, I made it to Boatmurdered, and my initial impressions can be set forth in three words: What. The. F*ck.
Post

Re: LOD Simulation and historical simulation

#14
DWMagus wrote:We're also talking about mostly historical and LOD simulation.

It seems that if one cluster is more rich in a specific element than another, then once the history is done generating and once a few clusters are discovered, it may be completely possible the AI will then 'see' this other cluster as you traverse boundaries (utilizing the idea that was put out a long time ago that information travels with ships) and trade may establish between the two regions.
Yeah. But as this is not very realistic that the player has such an impact, this is the reason why commerce must be very costly - thus have a limited influence due to marginal volume. Impact is on information mostly, and the fact that we generate a new cluster when the player is still some distance away should "hide" somewhat the fact that exchange happens only "recently". Not perfect though.
Image
Post

Re: LOD Simulation and historical simulation

#15
CSE wrote:
ThymineC wrote:The strength of connectivity between regions doesn't just have to depend on the number of paths connecting them, but other factors like the stability of the paths between them, or the time/money involved in crossing them, or the level of technology required, etc.
This is certainly an option. However, for the purpose of the LOD and for the engine, a clear cut-off is probably necessary.
I know. That's why I proposed a threshold:
ThymineC wrote:You'd probably need some kind of connectivity threshold to determine when two regions can be considered to be parts of different clusters in order to allow for the other mechanics you propose to work.
Would this not be sufficient? Edit: Or I guess what you mean is, there needs to be a big difference between normal connections and those linking clusters. That would make sense, and yeah.
CSE wrote:One could however imagine different sort of (weak) connection between sectors, with different gameplay effect:
  • very slow connection - in game time the "jump" lasts years, even if the player see it as instantaneous. This means as gameplay that you basically have to trust any "active" possession or faction to an NPC and loose any direct control.
  • dangerous path - 50% of the ships disappear during jump. No direct effect on the player (he survives, anyway he can reload), but loss of part of his escort. Makes commerce very expensive, basically one delivery costs you twice + the lost ships. However information can be exchanged via cheap automated drones.
  • hidden path - require expensive equipment to use it, thus putting a high price tag per ship that needs to cross.
  • ....
I'm not a fan of 1) because I don't like the idea of in-game years passing just so I can enter another cluster. I'm not a fan of 2) because what makes the player so special that he can safely navigate a path that can destroy anyone else (it's even worse if the player can be destroyed, because I don't want my efforts to explore to be punished by me dying because of a dice roll). 3) could work.
Last edited by ThymineC on Fri Mar 28, 2014 7:14 pm, edited 1 time in total.

Online Now

Users browsing this forum: No registered users and 1 guest

cron