Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
982f270
first step
fenndragon Apr 26, 2026
7f5ea93
new touches
fenndragon Apr 27, 2026
de702d4
fix
fenndragon Apr 27, 2026
9ca82ee
planetside generation
fenndragon Apr 28, 2026
b30eca6
fixes
fenndragon Apr 29, 2026
0a3302a
MapManager warnings cleanup Server Edition 2003 (#36781)
VerinSenpai Jun 9, 2025
0adcb5f
Weather entities (#41427)
TheShuEd Mar 8, 2026
615107c
fix
fenndragon Apr 29, 2026
f60f9b1
fixes
fenndragon Apr 29, 2026
03d7e41
fix
fenndragon Apr 29, 2026
9c0b9a9
fix
fenndragon Apr 29, 2026
a016657
Update weather.yml
fenndragon Apr 29, 2026
c85e74b
Update PersistenceSaveCommand.cs
fenndragon Apr 29, 2026
351a553
Update SectorWorldSystem.cs
fenndragon Apr 29, 2026
564cb3f
fixes
fenndragon Apr 29, 2026
cbf9c71
fix
fenndragon Apr 29, 2026
4ca9736
Update salvage_mods.yml
fenndragon Apr 29, 2026
c7598d0
fix
fenndragon Apr 29, 2026
058d53c
fix
fenndragon Apr 29, 2026
de1477d
fix
fenndragon Apr 29, 2026
55eb0d4
fix
fenndragon Apr 29, 2026
6a9f44d
Update SectorWorldExpeditionIntegrationTest.cs
fenndragon Apr 29, 2026
cd86564
fix
fenndragon Apr 29, 2026
232b3bb
fixes
fenndragon Apr 30, 2026
5074603
Merge branch 'master' into new-world-generation-
fenndragon Apr 30, 2026
5f95eee
Potential fix for pull request finding 'Dereferenced variable may be …
fenndragon Apr 30, 2026
0e97dde
Potential fix for pull request finding 'Dereferenced variable may be …
fenndragon Apr 30, 2026
ee74c77
Potential fix for pull request finding 'Dereferenced variable may be …
fenndragon Apr 30, 2026
048ab7a
Potential fix for pull request finding 'Dereferenced variable may be …
fenndragon Apr 30, 2026
14b7f3e
Potential fix for pull request finding 'Dereferenced variable may be …
fenndragon Apr 30, 2026
896ec08
Potential fix for pull request finding 'Generic catch clause'
fenndragon Apr 30, 2026
19b5456
Potential fix for pull request finding 'Call to 'System.IO.Path.Combi…
fenndragon Apr 30, 2026
81420a0
Potential fix for pull request finding 'Call to 'System.IO.Path.Combi…
fenndragon Apr 30, 2026
10f279b
Potential fix for pull request finding 'Missed opportunity to use Sel…
fenndragon Apr 30, 2026
8012721
fixes
fenndragon Apr 30, 2026
04add60
Potential fix for pull request finding 'Dereferenced variable may be …
fenndragon Apr 30, 2026
5741084
Potential fix for pull request finding 'Call to 'System.IO.Path.Combi…
fenndragon Apr 30, 2026
7b4d9ae
Potential fix for pull request finding 'Missed opportunity to use Where'
fenndragon Apr 30, 2026
96a4bcc
Potential fix for pull request finding 'Missed opportunity to use Where'
fenndragon Apr 30, 2026
a6690b0
Potential fix for pull request finding 'Missed opportunity to use Where'
fenndragon Apr 30, 2026
07836fb
Potential fix for pull request finding 'Missed opportunity to use Where'
fenndragon Apr 30, 2026
e3b38a1
Potential fix for pull request finding 'Missed opportunity to use Where'
fenndragon Apr 30, 2026
9e38a74
Potential fix for pull request finding 'Missed opportunity to use Where'
fenndragon Apr 30, 2026
e45999d
Potential fix for pull request finding 'Missed opportunity to use Where'
fenndragon Apr 30, 2026
2fee5fe
Potential fix for pull request finding 'Missed opportunity to use Where'
fenndragon Apr 30, 2026
46817b9
fixes
fenndragon Apr 30, 2026
954fd32
fixes
fenndragon Apr 30, 2026
6b4fb84
Update SectorWorldSystem.cs
fenndragon May 1, 2026
4922f1d
Update GatewaySystem.cs
fenndragon May 2, 2026
01010e7
fix
fenndragon May 2, 2026
ca49ec2
fixes
fenndragon May 2, 2026
e00f5eb
Merge branch 'master' into new-world-generation-
fenndragon May 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-height-label'}" />
<Control HorizontalExpand="True"/>
<Slider Name="HeightSlider" MinValue="0.8" MaxValue="1.2" Value="1.0" HorizontalAlignment="Right" MinSize="200 0" />
<Slider Name="HeightSlider" MinValue="0.4" MaxValue="1.5" Value="1.0" HorizontalAlignment="Right" MinSize="200 0" />
<Button Name="HeightResetButton" Text="{Loc 'humanoid-profile-editor-reset-button'}" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Width -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-width-label'}" />
<Control HorizontalExpand="True"/>
<Slider Name="WidthSlider" MinValue="0.8" MaxValue="1.2" Value="1.0" HorizontalAlignment="Right" MinSize="200 0" />
<Slider Name="WidthSlider" MinValue="0.4" MaxValue="1.5" Value="1.0" HorizontalAlignment="Right" MinSize="200 0" />
<Button Name="WidthResetButton" Text="{Loc 'humanoid-profile-editor-reset-button'}" HorizontalAlignment="Right" />
</BoxContainer>
</BoxContainer>
Expand Down
16 changes: 8 additions & 8 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public HumanoidProfileEditor(

HeightSlider.OnValueChanged += args =>
{
SetHeight((float)args.Value);
SetProfileHeight((float)args.Value);
};

HeightResetButton.OnPressed += _ =>
Expand All @@ -419,7 +419,7 @@ public HumanoidProfileEditor(

WidthSlider.OnValueChanged += args =>
{
SetWidth((float)args.Value);
SetProfileWidth((float)args.Value);
};

WidthResetButton.OnPressed += _ =>
Expand Down Expand Up @@ -1937,29 +1937,29 @@ private void SetSpawnPriority(SpawnPriorityPreference newSpawnPriority)
SetDirty();
}

private void SetHeight(float newHeight)
private void SetProfileHeight(float newHeight)
{
Profile = Profile?.WithCharacterAppearance(Profile.Appearance.WithHeight(newHeight));
Profile = Profile?.WithCharacterAppearance(Profile.Appearance.WithHeight(Math.Clamp(newHeight, HumanoidCharacterAppearance.MinScale, HumanoidCharacterAppearance.MaxScale)));
SetDirty();
ReloadPreview();
}

private void ResetHeight()
{
SetHeight(1.0f);
SetProfileHeight(HumanoidCharacterAppearance.DefaultScale);
UpdateHeightControls();
}

private void SetWidth(float newWidth)
private void SetProfileWidth(float newWidth)
{
Profile = Profile?.WithCharacterAppearance(Profile.Appearance.WithWidth(newWidth));
Profile = Profile?.WithCharacterAppearance(Profile.Appearance.WithWidth(Math.Clamp(newWidth, HumanoidCharacterAppearance.MinScale, HumanoidCharacterAppearance.MaxScale)));
SetDirty();
ReloadPreview();
}

private void ResetWidth()
{
SetWidth(1.0f);
SetProfileWidth(HumanoidCharacterAppearance.DefaultScale);
UpdateWidthControls();
}

Expand Down
71 changes: 40 additions & 31 deletions Content.Client/Overlays/StencilOverlay.Weather.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Numerics;
using Content.Shared.Light.Components;
using Content.Shared.StatusEffectNew.Components;
using Content.Shared.Weather;
using Robust.Client.Graphics;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;

namespace Content.Client.Overlays;

Expand All @@ -14,8 +14,7 @@ public sealed partial class StencilOverlay
private void DrawWeather(
in OverlayDrawArgs args,
CachedResources res,
WeatherPrototype weatherProto,
float alpha,
HashSet<Entity<WeatherStatusEffectComponent, StatusEffectComponent>> weathers,
Matrix3x2 invMatrix)
{
var worldHandle = args.WorldHandle;
Expand All @@ -27,47 +26,57 @@ private void DrawWeather(
// Cut out the irrelevant bits via stencil
// This is why we don't just use parallax; we might want specific tiles to get drawn over
// particularly for planet maps or stations.
worldHandle.RenderInRenderTarget(res.Blep!, () =>
{
var xformQuery = _entManager.GetEntityQuery<TransformComponent>();
_grids.Clear();

// idk if this is safe to cache in a field and clear sloth help
_mapManager.FindGridsIntersecting(mapId, worldAABB, ref _grids);

foreach (var grid in _grids)
worldHandle.RenderInRenderTarget(res.Blep!,
() =>
{
var matrix = _transform.GetWorldMatrix(grid, xformQuery);
var matty = Matrix3x2.Multiply(matrix, invMatrix);
worldHandle.SetTransform(matty);
_entManager.TryGetComponent(grid.Owner, out RoofComponent? roofComp);
var xformQuery = _entManager.GetEntityQuery<TransformComponent>();
_grids.Clear();

foreach (var tile in _map.GetTilesIntersecting(grid.Owner, grid, worldAABB))
// idk if this is safe to cache in a field and clear sloth help
_mapManager.FindGridsIntersecting(mapId, worldAABB, ref _grids);

foreach (var grid in _grids)
{
// Ignored tiles for stencil
if (_weather.CanWeatherAffect(grid.Owner, grid, tile, roofComp))
var matrix = _transform.GetWorldMatrix(grid, xformQuery);
var matty = Matrix3x2.Multiply(matrix, invMatrix);
worldHandle.SetTransform(matty);
_entManager.TryGetComponent(grid.Owner, out RoofComponent? roofComp);

foreach (var tile in _map.GetTilesIntersecting(grid.Owner, grid, worldAABB))
{
continue;
}
// Ignored tiles for stencil
if (_weather.CanWeatherAffect((grid.Owner, grid, roofComp), tile))
continue;

var gridTile = new Box2(tile.GridIndices * grid.Comp.TileSize,
(tile.GridIndices + Vector2i.One) * grid.Comp.TileSize);
var gridTile = new Box2(tile.GridIndices * grid.Comp.TileSize,
(tile.GridIndices + Vector2i.One) * grid.Comp.TileSize);

worldHandle.DrawRect(gridTile, Color.White);
worldHandle.DrawRect(gridTile, Color.White);
}
}
}

}, Color.Transparent);
},
Color.Transparent);

worldHandle.SetTransform(Matrix3x2.Identity);
worldHandle.UseShader(_protoManager.Index(StencilMaskId).Instance());
worldHandle.DrawTextureRect(res.Blep!.Texture, worldBounds);
var curTime = _timing.RealTime;
var sprite = _sprite.GetFrame(weatherProto.Sprite, curTime);

// Draw the rain
worldHandle.UseShader(_protoManager.Index(StencilDrawId).Instance());
_parallax.DrawParallax(worldHandle, worldAABB, sprite, curTime, position, Vector2.Zero, modulate: (weatherProto.Color ?? Color.White).WithAlpha(alpha));
foreach (var (uid, weather, status) in weathers)
{
var alpha = _weather.GetWeatherPercent((uid, status));
var sprite = _sprite.GetFrame(weather.Sprite, curTime);

// Draw the rain
worldHandle.UseShader(_protoManager.Index(StencilDrawId).Instance());
_parallax.DrawParallax(worldHandle,
worldAABB,
sprite,
curTime,
position,
weather.Scrolling ?? Vector2.Zero,
modulate: (weather.Color ?? Color.White).WithAlpha(alpha));
}

worldHandle.SetTransform(Matrix3x2.Identity);
worldHandle.UseShader(null);
Expand Down
24 changes: 9 additions & 15 deletions Content.Client/Overlays/StencilOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Content.Client.Parallax;
using Content.Client.Weather;
using Content.Shared.Salvage;
using Content.Shared.StatusEffectNew;
using Content.Shared.StatusEffectNew.Components;
using Content.Shared.Weather;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
Expand All @@ -28,6 +30,8 @@ public sealed partial class StencilOverlay : Overlay
private readonly SharedMapSystem _map;
private readonly SpriteSystem _sprite;
private readonly WeatherSystem _weather;
private readonly StatusEffectsSystem _statusEffects;
private HashSet<Entity<WeatherStatusEffectComponent, StatusEffectComponent>>? _weatherSet = new();

public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;

Expand All @@ -38,21 +42,22 @@ public sealed partial class StencilOverlay : Overlay
private static readonly ProtoId<ShaderPrototype> StencilMaskId = "StencilMask";
private static readonly ProtoId<ShaderPrototype> StencilDrawId = "StencilDraw";

public StencilOverlay(ParallaxSystem parallax, SharedTransformSystem transform, SharedMapSystem map, SpriteSystem sprite, WeatherSystem weather)
public StencilOverlay(ParallaxSystem parallax, SharedTransformSystem transform, SharedMapSystem map, SpriteSystem sprite, WeatherSystem weather, StatusEffectsSystem statusEffects)
{
ZIndex = ParallaxSystem.ParallaxZIndex + 1;
_parallax = parallax;
_transform = transform;
_map = map;
_sprite = sprite;
_weather = weather;
_statusEffects = statusEffects;
IoCManager.InjectDependencies(this);
_shader = _protoManager.Index(WorldGradientCircleId).InstanceUnique();
}

protected override void Draw(in OverlayDrawArgs args)
{
var mapUid = _mapManager.GetMapEntityId(args.MapId);
var mapUid = _map.GetMapOrInvalid(args.MapId);
var invMatrix = args.Viewport.GetWorldToLocalMatrix();

var res = _resources.GetForViewport(args.Viewport, static _ => new CachedResources());
Expand All @@ -63,22 +68,11 @@ protected override void Draw(in OverlayDrawArgs args)
res.Blep = _clyde.CreateRenderTarget(args.Viewport.Size, new RenderTargetFormatParameters(RenderTargetColorFormat.Rgba8Srgb), name: "weather-stencil");
}

if (_entManager.TryGetComponent<WeatherComponent>(mapUid, out var comp))
{
foreach (var (proto, weather) in comp.Weather)
{
if (!_protoManager.TryIndex<WeatherPrototype>(proto, out var weatherProto))
continue;

var alpha = _weather.GetPercent(weather, mapUid);
DrawWeather(args, res, weatherProto, alpha, invMatrix);
}
}
if (_statusEffects.TryEffectsWithComp(mapUid, out _weatherSet))
DrawWeather(args, res, _weatherSet, invMatrix);

if (_entManager.TryGetComponent<RestrictedRangeComponent>(mapUid, out var restrictedRangeComponent))
{
DrawRestrictedRange(args, res, restrictedRangeComponent, invMatrix);
}

args.WorldHandle.UseShader(null);
args.WorldHandle.SetTransform(Matrix3x2.Identity);
Expand Down
4 changes: 3 additions & 1 deletion Content.Client/Overlays/StencilOverlaySystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Client.Parallax;
using Content.Client.Weather;
using Content.Shared.StatusEffectNew;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;

Expand All @@ -13,11 +14,12 @@ public sealed class StencilOverlaySystem : EntitySystem
[Dependency] private readonly SharedMapSystem _map = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
[Dependency] private readonly WeatherSystem _weather = default!;
[Dependency] private readonly StatusEffectsSystem _status = default!;

public override void Initialize()
{
base.Initialize();
_overlay.AddOverlay(new StencilOverlay(_parallax, _transform, _map, _sprite, _weather));
_overlay.AddOverlay(new StencilOverlay(_parallax, _transform, _map, _sprite, _weather, _status));
}

public override void Shutdown()
Expand Down
55 changes: 52 additions & 3 deletions Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
using Content.Shared._Mono.GridEdgeMarker; // Mono
using Content.Shared.Maps; // Mono
using Content.Shared.Shuttles.Components;
using Content.Shared.StepTrigger.Components;
using Content.Shared.Light.Components;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
Expand Down Expand Up @@ -55,6 +57,9 @@ public partial class BaseShuttleControl : MapGridControl
private Vector2 CenterVec = new Vector2(0.5f, 0.5f); // Mono

private EntityQuery<TransformComponent> _xformQuery; // Mono
private EntityQuery<RadarTileMaskComponent> _radarMaskQuery;
private EntityQuery<StepTriggerComponent> _stepTriggerQuery;
private EntityQuery<TileEmissionComponent> _tileEmissionQuery;

private Vector2[] _allVertices = Array.Empty<Vector2>();

Expand All @@ -70,6 +75,9 @@ public BaseShuttleControl(float minRange, float maxRange, float range) : base(mi
Maps = EntManager.System<SharedMapSystem>();
_lookup = EntManager.System<EntityLookupSystem>(); // Mono
_xformQuery = EntManager.GetEntityQuery<TransformComponent>(); // Mono
_radarMaskQuery = EntManager.GetEntityQuery<RadarTileMaskComponent>();
_stepTriggerQuery = EntManager.GetEntityQuery<StepTriggerComponent>();
_tileEmissionQuery = EntManager.GetEntityQuery<TileEmissionComponent>();
Font = new VectorFont(IoCManager.Resolve<IResourceCache>().GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 12);

_drawJob = new GridDrawJob()
Expand Down Expand Up @@ -160,8 +168,14 @@ protected void DrawGrid(DrawingHandleScreen handle, Matrix3x2 gridToView, Entity
if (gridData.LastBuild < grid.Comp.LastTileModifiedTick)
{
gridData.Vertices.Clear();
gridData.HazardVertices.Clear();
_gridTileList.Clear();
_gridNeighborSet.Clear();
var maskedGrid = _radarMaskQuery.TryGetComponent(grid.Owner, out var radarMask);
HashSet<string>? hiddenTiles = null;

if (maskedGrid && radarMask != null)
hiddenTiles = radarMask.HiddenTileIds.Count > 0 ? new HashSet<string>(radarMask.HiddenTileIds) : null;

// Okay so there's 2 steps to this
// 1. Is that get we get a set of all tiles. This is used to decompose into triangle-strips
Expand All @@ -172,6 +186,12 @@ protected void DrawGrid(DrawingHandleScreen handle, Matrix3x2 gridToView, Entity

// Mono - drawing logic rewritten
var def = (ContentTileDefinition)_tileDef[tileRef.Value.Tile.TypeId];
var hiddenTile = hiddenTiles != null && hiddenTiles.Contains(def.ID);
var hazardTile = hiddenTile && IsRadarHazardTile(grid, index);

if (hiddenTile && !hazardTile)
continue;

_gridTileList.Add((index, def));

// since our shape has to be convex, just draw it by taking our first vertex as origin
Expand All @@ -181,9 +201,10 @@ protected void DrawGrid(DrawingHandleScreen handle, Matrix3x2 gridToView, Entity
for (var i = 2; i < def.Vertices.Count; i++)
{
var vert = bl + def.Vertices[i] * tileSize;
gridData.Vertices.Add(origin);
gridData.Vertices.Add(prev);
gridData.Vertices.Add(vert);
var verts = hazardTile ? gridData.HazardVertices : gridData.Vertices;
verts.Add(origin);
verts.Add(prev);
verts.Add(vert);
prev = vert;
}

Expand Down Expand Up @@ -339,9 +360,36 @@ protected void DrawGrid(DrawingHandleScreen handle, Matrix3x2 gridToView, Entity
handle.DrawPrimitives(DrawPrimitiveTopology.TriangleList, new Span<Vector2>(_allVertices, start, count), color.WithAlpha(alpha));
}

if (gridData.HazardVertices.Count > 0)
{
var hazardVerts = new Vector2[gridData.HazardVertices.Count];
var hazardJob = new GridDrawJob
{
Matrix = gridToView,
Vertices = gridData.HazardVertices,
ScaledVertices = hazardVerts,
};

_parallel.ProcessNow(hazardJob, hazardVerts.Length);
handle.DrawPrimitives(DrawPrimitiveTopology.TriangleList, hazardVerts, Color.Red.WithAlpha(0.2f));
}

handle.DrawPrimitives(DrawPrimitiveTopology.LineList, new Span<Vector2>(_allVertices, gridData.EdgeIndex, edgeCount), color);
}

private bool IsRadarHazardTile(Entity<MapGridComponent> grid, Vector2i indices)
{
var anchored = Maps.GetAnchoredEntitiesEnumerator(grid, grid.Comp, indices);

while (anchored.MoveNext(out var entity))
{
if (_stepTriggerQuery.HasComp(entity.Value) || _tileEmissionQuery.HasComp(entity.Value))
return true;
}

return false;
}

private record struct GridDrawJob : IParallelRobustJob
{
public int BatchSize => 64;
Expand All @@ -365,6 +413,7 @@ public sealed class GridDrawData
*/

public List<Vector2> Vertices = new();
public List<Vector2> HazardVertices = new();

/// <summary>
/// Vertices index from when edges start.
Expand Down
Loading
Loading