Update weather system to improve accuracy and detail; increase weather grid size to 12x12 for finer resolution, enhance weather layer rendering to accurately reflect localized conditions, and implement new sampling methods for precipitation and cloud cover. Refactor related components for better performance and clarity in weather data handling.

This commit is contained in:
Leonid Pershin
2026-08-17 10:26:01 +03:00
parent cb5117edba
commit c80c9f14e2
11 changed files with 387 additions and 104 deletions
@@ -258,6 +258,32 @@ public sealed class WorldSimulationTests
Assert.True(pressures > 1, "The field is uniform - the pressure systems are not being sampled.");
}
/// <summary>
/// The whole point of a field is that it has shape. A system wide enough to cover the map evenly reads
/// as one flat value with no edge, which is what makes a front invisible however carefully it is drawn.
/// </summary>
[Fact]
public void A_stormy_world_has_real_structure_across_the_map()
{
var summary = ReadySummary() with { Climate = ClimateKind.Oceanic, Latitude = 51.51 };
// Sample a few independent skies: any one roll can happen to be flat, a dozen cannot.
var structured = 0;
for (var attempt = 0; attempt < 12; attempt++)
{
using var simulation = WorldSimulation.Create(
summary with { Id = $"storm-{attempt:00000000}" }, catchUp: false);
var pressures = simulation.SnapshotWeatherField().Nodes
.Select(static node => node.PressureHpa)
.ToArray();
if (pressures.Max() - pressures.Min() > 2.0) structured++;
}
Assert.True(structured >= 8, $"Only {structured}/12 skies had any shape across the map.");
}
[Fact]
public void Neighbouring_field_nodes_stay_close_together()
{