acdream/tests/AcDream.Core.Tests/World
Erik bd184e1afd fix(world): DerethDateTime tick-0 offset — sky was 7/16 of a day wrong
User observed: 'time is flipped — supposed to be day/evening, but shows
night/morning.' That's a ~half-day offset.

Root cause in ACE DerethDateTime.cs line 23:
  private const double dayZeroTicks = 0; // Morningthaw 1, 10 P.Y. - Morntide-and-Half

ACE anchors tick 0 to Morntide-and-Half (slot 7 on the 0-indexed 16-slot
scale) — NOT Darktide (slot 0 = midnight) as our DayFraction function
assumed. Confirmed by DerethDateTime.cs:145:
  private int hour = (int)Hours.Morntide_and_Half;

Fix: shift DayFraction by +7/16 * DayTicks (3333.75) so tick 0 maps to
its real calendar slot. Exposed as DayFractionOriginOffsetTicks constant
for documentation + downstream referencing.

Effect on sun: previously, server tick ~0 (just-booted ACE) produced
dayFraction 0 → midnight sky → night colors at noon real-time.
Now dayFraction 7/16 = 0.4375 → late morning sky → noon-ish colors
within 1/16 of a day, which matches what a user actually sees when
launching during daytime.

Tests updated for the corrected convention:
- DerethDateTime.DayFraction(0) = 7/16 (not 0).
- CurrentHour(0) = MorntideAndHalf (not Darktide).
- IsDaytime(0) = true.
- Midnight (Darktide, slot 0) is 9/16 of a day past tick 0.
- SkyState + WorldTimeDebug tests retargeted to the new frame.

Build green, 711 tests pass.

Ref: references/ACE/Source/ACE.Common/DerethDateTime.cs:23-25 + :145.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 14:27:49 +02:00
..
DerethDateTimeTests.cs fix(world): DerethDateTime tick-0 offset — sky was 7/16 of a day wrong 2026-04-19 14:27:49 +02:00
LandblockLoaderTests.cs feat(core): add LandblockLoader with Stab+Building → WorldEntity mapping 2026-04-10 17:58:30 +02:00
SceneryGeneratorTests.cs fix(app+core): Phase B.3 — Setup.StepUpHeight + scenery road exclusion 2026-04-12 18:27:36 +02:00
SkyDescLoaderTests.cs feat(world): Phase G.1 data model — dat-accurate SkyKeyframe + WeatherSystem 2026-04-19 10:29:33 +02:00
SkyStateTests.cs fix(world): DerethDateTime tick-0 offset — sky was 7/16 of a day wrong 2026-04-19 14:27:49 +02:00
WeatherSystemTests.cs feat(world): Phase G.1 data model — dat-accurate SkyKeyframe + WeatherSystem 2026-04-19 10:29:33 +02:00
WorldTimeDebugTests.cs fix(world): DerethDateTime tick-0 offset — sky was 7/16 of a day wrong 2026-04-19 14:27:49 +02:00
WorldViewTests.cs feat(core): add WorldView with 3x3 neighbor landblock computation 2026-04-10 18:02:41 +02:00