Production/Demand Profiles and Blueprint Resource Requirements

Added the ability to associate blueprints and compound commodities with personality attributes
Added the ability to restrict blueprints according to the presence of resources, for resource harvesting infrastructure
Improved the properties panel UI for Sector and Tech tabs
This commit is contained in:
hyperion51 2020-05-03 00:36:47 +01:00
commit 35fb4381ed
16 changed files with 769 additions and 263 deletions

View file

@ -76,7 +76,7 @@ public class ZoneGenerator
planet.Mass > context.GlobalData.PlanetMass ? BodyType.Planet : BodyType.Planetoid);
if ((bodyType & r.ResourceBodyType) != 0)
{
float quantity = context.Random.NextUnbounded(r.ResourceDensity.Aggregate(1f, (m, rdm) => m * resourceMaps[rdm]), r.ResourceDensityBiasPower);
float quantity = context.Random.NextUnbounded(r.ResourceDensity.Aggregate(1f, (m, rdm) => m * resourceMaps[rdm]), r.DensityBiasPower, r.RandomCeiling);
if (r.ResourceFloor < quantity) dictionary.Add(r.ID, quantity);
}
}
@ -128,7 +128,7 @@ public class ZoneGenerator
if (rosette)
{
// Create a rosette with a number of vertices between 2 and 9 inclusive
root.ExpandRosette((int)(random.NextFloat(1, 3) * random.NextFloat(2, 3)));
root.ExpandRosette((int)(random.NextFloat(1, 5) + random.NextFloat(1, 5)));
// Create a small number of less massive "captured" planets orbiting past the rosette
root.ExpandSolar(
@ -146,7 +146,7 @@ public class ZoneGenerator
var m = p.Mass / averageChildMass;
// Give each child in the rosette its own mini solar system
p.ExpandSolar(
count: (int) (random.NextFloat() * random.NextFloat() * m * 5 + 1),
count: (int) (random.NextFloat(1, 3 * m) + random.NextFloat(1, 3 * m)),
massMulMin: 0.75f,
massMulMax: 2.5f,
distMulMin: 1 + m * .25f,