Compare commits

...
1 Commits
Author SHA1 Message Date
KOTOBandpre-commit-ci[bot] d8cfd70cc8 Akashic Fold Part 0 (#4350)
* lowkey might have messed up lighting

* make it awesome

uncopy code steamhappy

* yuh!

* goidagen

todo: steal EVERYTHING from goob

* goidamerge my beloved

* 1984 goidamerge (for now)

i dont think it worked properly anyways (?)

* chromite weather ops

* sobbing i hate thsi...

* Revert "sobbing i hate thsi..."

This reverts commit 5dff16743f.

* temp base fix

* the great culling

* untouch upstream

* the recommenting

* the great reindenting

* miniscule tweakops

* lgtm

* okay for real this time

* broken lockers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* got eaten my my revert guh

* i am blind

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-05 08:07:51 +11:00
10 changed files with 2050 additions and 1 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ public sealed class ParallaxOverlay : Overlay
protected override bool BeforeDraw(in OverlayDrawArgs args)
{
if (args.MapId == MapId.Nullspace || _entManager.HasComponent<BiomeComponent>(_mapSystem.GetMapOrInvalid(args.MapId)))
if (args.MapId == MapId.Nullspace) // DeltaV - re-enable biome parallax
return false;
return true;
@@ -0,0 +1,94 @@
using Content.Server._DV.Planet;
using Content.Server.GameTicking.Events;
using Content.Server.Parallax;
using Content.Shared._DV.AkashicFold;
using Content.Shared._DV.Planet;
using Content.Shared.Light.Components;
using Content.Shared.Parallax.Biomes;
using Robust.Shared.EntitySerialization.Systems;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Server._DV.AkashicFold;
public sealed class AkashicFoldSystem : EntitySystem
{
[Dependency] private readonly BiomeSystem _biome = default!;
[Dependency] private readonly SharedMapSystem _map = default!;
[Dependency] private readonly MapLoaderSystem _mapLoader = default!;
[Dependency] private readonly PlanetSystem _planet = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
private readonly ProtoId<PlanetPrototype> _foldPlanet = "AkashicFold";
private readonly ResPath _baseGridPath = new("Maps/_DV/AkashicFold/akashic_base.yml");
private static EntityUid? _mapEntUid;
private static MapId _mapId;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RoundStartingEvent>(OnRoundStart);
}
private void OnRoundStart(RoundStartingEvent ev)
{
LoadFold();
}
private void LoadFold()
{
var map = _planet.SpawnPlanet(_foldPlanet, runMapInit: false);
_mapEntUid = map;
_mapId = Comp<MapComponent>(_mapEntUid.Value).MapId;
LoadFoldGrid(_baseGridPath, new Vector2i(0, 0)); // base camp, always centered
PlaceRuins();
_map.InitializeMap(map);
}
// placeholder until smarter ruin placement is done
private void PlaceRuins()
{
if (_mapEntUid == null)
return;
// to get available ruins: _proto.EnumeratePrototypes<AkashicRuinPrototype>().ToList();
}
private bool LoadGridRuin(AkashicRuinPrototype ruin, Vector2i coords)
{
if(!(LoadFoldGrid(ruin.MapPath, coords) is { } ruinGrid))
return false;
if(!ruin.RoofEnabled)
RemComp<ImplicitRoofComponent>(ruinGrid);
return true;
}
private Entity<MapGridComponent>? LoadFoldGrid(ResPath path, Vector2i coords)
{
if (_mapEntUid == null)
return null;
if (!_mapLoader.TryLoadGrid(_mapId, path, out var spawnedBoundedGrid))
{
Log.Error($"Failed to load Fold grid {path.Filename}!");
return null;
}
var spawned = spawnedBoundedGrid.Value;
_transform.SetCoordinates(spawned, new EntityCoordinates(_mapEntUid.Value, coords));
_biome.ReserveTiles(_mapEntUid.Value,
Comp<MapGridComponent>(spawned).LocalAABB,
new List<(Vector2i, Tile)>(),
Comp<BiomeComponent>(_mapEntUid.Value),
Comp<MapGridComponent>(_mapEntUid.Value));
return spawned;
}
}
@@ -1,6 +1,7 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Parallax;
using Content.Shared._DV.Planet;
using Content.Shared.Parallax;
using Content.Shared.Parallax.Biomes;
using Robust.Shared.EntitySerialization.Systems;
using Robust.Shared.Map;
@@ -31,6 +32,8 @@ public sealed class PlanetSystem : EntitySystem
var map = _map.CreateMap(out _, runMapInit: runMapInit);
_biome.EnsurePlanet(map, _proto.Index(planet.Biome), mapLight: planet.MapLight);
var parallax = EnsureComp<ParallaxComponent>(map);
// add each marker layer
var biome = Comp<BiomeComponent>(map);
foreach (var layer in planet.BiomeMarkerLayers)
@@ -0,0 +1,27 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Shared._DV.AkashicFold;
/// <summary>
/// Prototype for any ruin that spawns in the Akashic Fold.
/// </summary>
[Prototype()]
public sealed partial class AkashicRuinPrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
public string ID { get; } = default!;
/// <summary>
/// Relative directory path to the given grid, i.e. `Maps/_DV/AkashicFold/Ruins/example.yml`
/// </summary>
[DataField(required: true)]
public ResPath MapPath;
/// <summary>
/// Keep the grid's roof? Enable for ruins that are mostly indoors. Mainly matters for planetary lighting.
/// </summary>
[DataField]
public bool RoofEnabled;
}
@@ -0,0 +1 @@
map-name-akashic-fold = Akashic Fold
File diff suppressed because it is too large Load Diff
+1
View File
@@ -1897,6 +1897,7 @@
footstepSounds:
collection: FootstepAsteroid
heatCapacity: 10000
weather: true # DeltaV
#Hull tiles
- type: tile
@@ -0,0 +1,29 @@
# stealing the lavaland ruins for prototyping purposes
- type: akashicRuin
id: Bait
mapPath: /Maps/Lavaland/bait.yml
- type: akashicRuin
id: BrokenCargo
mapPath: /Maps/Lavaland/broken_cargo.yml
- type: akashicRuin
id: CatwalkCrossroad
mapPath: /Maps/Lavaland/catwalk_crossroad.yml
- type: akashicRuin
id: CaveMurder
mapPath: /Maps/Lavaland/cave_murder.yml
- type: akashicRuin
id: CommieOutpost
mapPath: /Maps/Lavaland/commieoutpost.yml
- type: akashicRuin
id: CrashedPodTrail
mapPath: /Maps/Lavaland/crashed_pod_trail.yml
- type: akashicRuin
id: CrashedDropship
mapPath: /Maps/Lavaland/crasheddropship.yml
@@ -0,0 +1,173 @@
- type: biomeTemplate
id: Fold
layers:
# Sparse vegetation
- !type:BiomeDecalLayer
allowedTiles:
- FloorPlanetGrass
divisions: 2
threshold: -0.50
noise:
seed: 0
noiseType: Cellular
frequency: 1
decals:
- BushDOne
- BushDTwo
- BushDThree
- !type:BiomeDecalLayer
allowedTiles:
- FloorPlanetGrass
noise:
seed: 0
noiseType: OpenSimplex2
frequency: 1
divisions: 2
threshold: -0.2
decals:
- Flowerspv1
- Flowerspv2
- Flowerspv3
- Bushj1
- Bushj2
- Bushj3
- Grassc1
- Grassc2
- Grassc3
- Grassc4
# Dense vegetation
- !type:BiomeDecalLayer
allowedTiles:
- FloorPlanetGrass
divisions: 1
threshold: -0.35
noise:
seed: 0
noiseType: Cellular
frequency: 0.2
fractalType: FBm
octaves: 5
lacunarity: 2
cellularDistanceFunction: Euclidean
cellularReturnType: Distance2
decals:
- Grassa1
- Grassa2
- Grassa3
- Grassa4
- Grassa5
- Grassb1
- Grassb2
- Grassb3
- Grassb4
- Grassb5
- !type:BiomeEntityLayer
threshold: 0.5
noise:
seed: 0
noiseType: OpenSimplex2
fractalType: FBm
frequency: 2
allowedTiles:
- FloorPlanetGrass
entities:
- FloraTree
- FloraTreeLarge
- LightTree
- ShadowTree
# Rock formations
- !type:BiomeEntityLayer
allowedTiles:
- FloorPlanetGrass
- FloorPlanetDirt
threshold: -0.25
noise:
seed: 0
noiseType: Cellular
frequency: 0.05
lacunarity: 2
fractalType: FBm
octaves: 5
cellularDistanceFunction: Euclidean
cellularReturnType: Distance2
entities:
- WallRock
- !type:BiomeDummyLayer
id: Loot
# Water
- !type:BiomeEntityLayer
allowedTiles:
- FloorPlanetGrass
- FloorPlanetDirt
threshold: 0.95
noise:
seed: 3
noiseType: OpenSimplex2
frequency: 0.003
lacunarity: 1.50
fractalType: Ridged
octaves: 1
entities:
- FloorWaterEntity
# Fill remainder with Chromite
- !type:BiomeTileLayer
threshold: -1.0
tile: FloorChromite
- !type:BiomeTileLayer
threshold: -0.65
tile: FloorPlanetGrass
noise:
seed: 0
frequency: 0.02
fractalType: None
# Water sand
- !type:BiomeTileLayer
tile: FloorPlanetDirt
threshold: 0.95
noise:
seed: 3
noiseType: OpenSimplex2
frequency: 0.003
lacunarity: 1.50
fractalType: Ridged
octaves: 1
# Chromite decoration
- !type:BiomeDecalLayer
allowedTiles:
- FloorChromite
threshold: -0.25
noise:
seed: 0
noiseType: Cellular
frequency: 0.1
lacunarity: 2
fractalType: FBm
octaves: 5
cellularDistanceFunction: Euclidean
cellularReturnType: Distance2
decals:
- Rock06
- Rock07
- !type:BiomeEntityLayer
threshold: 0.2
noise:
seed: 0
noiseType: OpenSimplex2
fractalType: FBm
frequency: 2
allowedTiles:
- FloorChromite
entities:
- ShadowBasaltRandom
- FloraRockSolid
# Evil space rivers
- !type:BiomeTileLayer
tile: Space
threshold: 0.6
noise:
seed: 2
noiseType: OpenSimplex2
frequency: 0.0045
lacunarity: 0.75
fractalType: Ridged
octaves: 2
+15
View File
@@ -75,3 +75,18 @@
- OreBluespace
- OreArtifactFragment
- GlacierGibtonite
- type: planet
id: AkashicFold
biome: Fold
mapName: map-name-akashic-fold
mapLight: "#583d7a" # purple
addedComponents:
- type: Parallax
parallax: CosmicFinaleParallax
atmosphere: # glacier but warm
volume: 2500
temperature: 310
moles: # 119kPa, 21% O2
- 42
- 158