Dynamic space world generation and debris. (#15120)
* World generation (squash) * Test fixes. * command * o * Access cleanup. * Documentation touchups. * Use a prototype serializer for BiomeSelectionComponent * Struct enumerator in SimpleFloorPlanPopulatorSystem * Safety margins around PoissonDiskSampler, cookie acquisition methodologies * Struct enumerating PoissonDiskSampler; internal side * Struct enumerating PoissonDiskSampler: Finish it * Update WorldgenConfigSystem.cs awa --------- Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com> Co-authored-by: 20kdc <asdd2808@gmail.com>
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
- key: enum.ShuttleConsoleUiKey.Key
|
||||
type: ShuttleConsoleBoundUserInterface
|
||||
- type: RadarConsole
|
||||
- type: WorldLoader
|
||||
radius: 256
|
||||
- type: PointLight
|
||||
radius: 1.5
|
||||
energy: 1.6
|
||||
@@ -102,6 +104,8 @@
|
||||
- Syndicate
|
||||
- type: RadarConsole
|
||||
maxRange: 1536
|
||||
- type: WorldLoader
|
||||
radius: 1536
|
||||
- type: PointLight
|
||||
radius: 1.5
|
||||
energy: 1.6
|
||||
|
||||
76
Resources/Prototypes/Entities/World/Debris/asteroids.yml
Normal file
76
Resources/Prototypes/Entities/World/Debris/asteroids.yml
Normal file
@@ -0,0 +1,76 @@
|
||||
- type: entity
|
||||
id: BaseAsteroidDebris
|
||||
parent: BaseDebris
|
||||
name: Asteroid Debris
|
||||
abstract: true
|
||||
components:
|
||||
- type: MapGrid
|
||||
- type: BlobFloorPlanBuilder
|
||||
floorTileset:
|
||||
- FloorAsteroidCoarseSand0
|
||||
blobDrawProb: 0.5
|
||||
radius: 6
|
||||
floorPlacements: 16
|
||||
- type: SimpleFloorPlanPopulator
|
||||
entries:
|
||||
FloorAsteroidCoarseSand0:
|
||||
- id: WallRock
|
||||
prob: 0.5
|
||||
- id: WallRockGold
|
||||
prob: 0.01
|
||||
- id: WallRockSilver
|
||||
prob: 0.04
|
||||
- id: WallRockPlasma
|
||||
prob: 0.09
|
||||
- id: WallRockTin
|
||||
prob: 0.2
|
||||
- id: WallRockUranium
|
||||
prob: 0.07
|
||||
- id: WallRockQuartz
|
||||
prob: 0.2
|
||||
- type: GCAbleObject
|
||||
queue: SpaceDebris
|
||||
- type: IFF
|
||||
flags: HideLabel
|
||||
color: "#d67e27"
|
||||
|
||||
- type: entity
|
||||
id: AsteroidDebrisSmall
|
||||
parent: BaseAsteroidDebris
|
||||
name: Asteroid Debris Small
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: MapGrid
|
||||
- type: BlobFloorPlanBuilder
|
||||
floorPlacements: 8
|
||||
|
||||
- type: entity
|
||||
id: AsteroidDebrisMedium
|
||||
parent: BaseAsteroidDebris
|
||||
name: Asteroid Debris Medium
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: MapGrid
|
||||
- type: BlobFloorPlanBuilder
|
||||
floorPlacements: 16
|
||||
|
||||
- type: entity
|
||||
id: AsteroidDebrisLarge
|
||||
parent: BaseAsteroidDebris
|
||||
name: Asteroid Debris Large
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: MapGrid
|
||||
- type: BlobFloorPlanBuilder
|
||||
floorPlacements: 24
|
||||
|
||||
- type: entity
|
||||
id: AsteroidDebrisLarger
|
||||
parent: BaseAsteroidDebris
|
||||
name: Asteroid Debris Larger
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: MapGrid
|
||||
- type: BlobFloorPlanBuilder
|
||||
radius: 12
|
||||
floorPlacements: 36
|
||||
@@ -0,0 +1,6 @@
|
||||
- type: entity
|
||||
id: BaseDebris
|
||||
abstract: true
|
||||
components:
|
||||
- type: OwnedDebris
|
||||
- type: LocalityLoader
|
||||
82
Resources/Prototypes/Entities/World/Debris/wrecks.yml
Normal file
82
Resources/Prototypes/Entities/World/Debris/wrecks.yml
Normal file
@@ -0,0 +1,82 @@
|
||||
- type: entity
|
||||
id: BaseScrapDebris
|
||||
parent: BaseDebris
|
||||
name: Scrap Debris
|
||||
abstract: true
|
||||
components:
|
||||
- type: MapGrid
|
||||
- type: BlobFloorPlanBuilder
|
||||
floorTileset:
|
||||
- Plating
|
||||
- Plating
|
||||
- Plating
|
||||
- FloorSteel
|
||||
- Lattice
|
||||
blobDrawProb: 0.5
|
||||
radius: 6
|
||||
floorPlacements: 16
|
||||
- type: SimpleFloorPlanPopulator
|
||||
entries:
|
||||
Plating:
|
||||
- prob: 3 # Intentional blank.
|
||||
- id: SalvageMaterialCrateSpawner
|
||||
prob: 1
|
||||
- id: SalvageCanisterSpawner
|
||||
prob: 0.2
|
||||
- id: SalvageMobSpawner
|
||||
prob: 0.7
|
||||
- id: WallSolid
|
||||
prob: 1
|
||||
- id: Grille
|
||||
prob: 0.5
|
||||
Lattice:
|
||||
- prob: 2
|
||||
- id: Grille
|
||||
prob: 0.2
|
||||
- id: SalvageMaterialCrateSpawner
|
||||
prob: 0.3
|
||||
- id: SalvageCanisterSpawner
|
||||
prob: 0.2
|
||||
FloorSteel:
|
||||
- prob: 3 # Intentional blank.
|
||||
- id: SalvageMaterialCrateSpawner
|
||||
prob: 1
|
||||
- id: SalvageCanisterSpawner
|
||||
prob: 0.2
|
||||
- id: SalvageMobSpawner
|
||||
prob: 0.7
|
||||
- type: GCAbleObject
|
||||
queue: SpaceDebris
|
||||
- type: IFF
|
||||
flags: HideLabel
|
||||
color: "#88b0d1"
|
||||
|
||||
- type: entity
|
||||
id: ScrapDebrisSmall
|
||||
parent: BaseScrapDebris
|
||||
name: Scrap Debris Small
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: MapGrid
|
||||
- type: BlobFloorPlanBuilder
|
||||
floorPlacements: 8
|
||||
|
||||
- type: entity
|
||||
id: ScrapDebrisMedium
|
||||
parent: BaseScrapDebris
|
||||
name: Scrap Debris Medium
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: MapGrid
|
||||
- type: BlobFloorPlanBuilder
|
||||
floorPlacements: 16
|
||||
|
||||
- type: entity
|
||||
id: ScrapDebrisLarge
|
||||
parent: BaseScrapDebris
|
||||
name: Scrap Debris Large
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: MapGrid
|
||||
- type: BlobFloorPlanBuilder
|
||||
floorPlacements: 24
|
||||
15
Resources/Prototypes/Entities/World/chunk.yml
Normal file
15
Resources/Prototypes/Entities/World/chunk.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
- type: entity
|
||||
id: WorldChunk
|
||||
parent: MarkerBase
|
||||
name: World Chunk
|
||||
description: |
|
||||
It's rude to stare.
|
||||
It's also a bit odd you're looking at the abstract representation of the grid of reality.
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: WorldChunk
|
||||
- type: Sprite
|
||||
sprite: Markers/cross.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: blue
|
||||
4
Resources/Prototypes/GC/world.yml
Normal file
4
Resources/Prototypes/GC/world.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- type: gcQueue
|
||||
id: SpaceDebris
|
||||
depth: 512 # So there's a decent bit of time before roids unload.
|
||||
minDepthToProcess: 256
|
||||
26
Resources/Prototypes/World/Biomes/basic.yml
Normal file
26
Resources/Prototypes/World/Biomes/basic.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
- type: spaceBiome
|
||||
id: AsteroidsStandard
|
||||
priority: 0 # This probably shouldn't get selected.
|
||||
noiseRanges: {}
|
||||
chunkComponents:
|
||||
- type: DebrisFeaturePlacerController
|
||||
densityNoiseChannel: Density
|
||||
- type: SimpleDebrisSelector
|
||||
debrisTable:
|
||||
- id: AsteroidDebrisSmall
|
||||
- id: AsteroidDebrisMedium
|
||||
- id: AsteroidDebrisLarge
|
||||
prob: 0.7
|
||||
- id: AsteroidDebrisLarger
|
||||
prob: 0.4
|
||||
- type: NoiseDrivenDebrisSelector
|
||||
noiseChannel: Wreck
|
||||
debrisTable:
|
||||
- id: ScrapDebrisSmall
|
||||
- id: ScrapDebrisMedium
|
||||
- id: ScrapDebrisLarge
|
||||
prob: 0.5
|
||||
- type: NoiseRangeCarver
|
||||
ranges:
|
||||
- 0.4, 0.6
|
||||
noiseChannel: Carver
|
||||
21
Resources/Prototypes/World/Biomes/failsafes.yml
Normal file
21
Resources/Prototypes/World/Biomes/failsafes.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
- type: spaceBiome
|
||||
id: Failsafe
|
||||
priority: -999999 # This DEFINITELY shouldn't get selected!
|
||||
noiseRanges: {}
|
||||
|
||||
- type: spaceBiome
|
||||
id: AsteroidsFallback
|
||||
priority: -999998 # This probably shouldn't get selected.
|
||||
noiseRanges: {}
|
||||
chunkComponents:
|
||||
- type: DebrisFeaturePlacerController
|
||||
densityNoiseChannel: Density
|
||||
- type: SimpleDebrisSelector
|
||||
debrisTable:
|
||||
- id: AsteroidDebrisSmall
|
||||
- id: AsteroidDebrisMedium
|
||||
- id: AsteroidDebrisLarge
|
||||
prob: 0.7
|
||||
- id: AsteroidDebrisLarger
|
||||
prob: 0.4
|
||||
|
||||
44
Resources/Prototypes/World/noise_channels.yml
Normal file
44
Resources/Prototypes/World/noise_channels.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
- type: noiseChannel
|
||||
id: Density
|
||||
noiseType: Perlin
|
||||
fractalLacunarityByPi: 0.666666666
|
||||
remapTo0Through1: true
|
||||
clippingRanges:
|
||||
- 0.4, 0.6
|
||||
clippedValue: 1.658 # magic number for chunk size.
|
||||
inputMultiplier: 6 # Makes density hopefully low noise in the local area while still being interesting at scale.
|
||||
outputMultiplier: 50.0 # We scale density up significantly for more human-friendly numbers.
|
||||
minimum: 45.0
|
||||
|
||||
- type: noiseChannel
|
||||
id: DensityUnclipped
|
||||
noiseType: Perlin
|
||||
fractalLacunarityByPi: 0.666666666
|
||||
remapTo0Through1: true
|
||||
inputMultiplier: 6 # Makes density hopefully low noise in the local area while still being interesting at scale.
|
||||
outputMultiplier: 50.0 # We scale density up significantly for more human-friendly numbers.
|
||||
minimum: 45.0
|
||||
|
||||
- type: noiseChannel
|
||||
id: Carver
|
||||
noiseType: Perlin
|
||||
fractalLacunarityByPi: 0.666666666
|
||||
remapTo0Through1: true
|
||||
inputMultiplier: 6
|
||||
|
||||
- type: noiseChannel
|
||||
id: Wreck
|
||||
noiseType: Perlin
|
||||
fractalLacunarityByPi: 0.666666666
|
||||
clippingRanges:
|
||||
- 0.0, 0.4
|
||||
clippedValue: 0
|
||||
remapTo0Through1: true
|
||||
inputMultiplier: 16 # Makes wreck concentration very low noise at scale.
|
||||
|
||||
- type: noiseChannel
|
||||
id: Temperature
|
||||
noiseType: Perlin
|
||||
fractalLacunarityByPi: 0.666666666
|
||||
remapTo0Through1: true
|
||||
inputMultiplier: 6 # Makes wreck concentration very low noise at scale.
|
||||
9
Resources/Prototypes/World/worldgen_default.yml
Normal file
9
Resources/Prototypes/World/worldgen_default.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
- type: worldgenConfig
|
||||
id: Default
|
||||
components:
|
||||
- type: WorldController
|
||||
- type: BiomeSelection
|
||||
biomes:
|
||||
- AsteroidsFallback
|
||||
- Failsafe
|
||||
- AsteroidsStandard
|
||||
Reference in New Issue
Block a user