Skip to content

feat(lobby): wait in a weakened version of the map's atmosphere - #254

Merged
theEvilReaper merged 2 commits into
mainfrom
feat/lobby-fog-preview
Sep 8, 2026
Merged

feat(lobby): wait in a weakened version of the map's atmosphere#254
theEvilReaper merged 2 commits into
mainfrom
feat/lobby-fog-preview

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Proposed changes

Players met the map's atmosphere all at once, in the same moment the round started: a walk out of a vanilla sky straight into fog that closes in at forty blocks. The lobby now waits in a weakened version of that same atmosphere, so the start of a round reads as the world tightening rather than as a cut.

BlendedAtmosphere (common/.../dimension/) reads one atmosphere off the straight line towards another, colours channel by channel, distances and the sky-light factor linearly. The lobby's atmosphere is StaticDimensionPreset.BRIGHT taken lobbyAtmosphereShare of the way towards the game map's own, registered as its own dimension under cygnus:map/<name>/lobby.

At the shipped default of 0.3, a dense_fog map gives a lobby with fog from roughly 11 to 137 blocks in a washed-out version of the map's green, against 0 to 48 blocks in the map itself. Recognisable, still bright enough to be the room players wait in.

Two things worth a look in review:

The constructor's order is reversed. GameMapProvider loaded the lobby first and read the game map afterwards. The lobby's dimension is derived from the game map's atmosphere, so the map has to be known before the lobby instance can be created. The registration itself stays in the constructor for the reason already documented there: registry data only reaches a client during its configuration phase, so a dimension registered later is one no player already online can be moved into.

Both opt-outs land on the overworld, which is exactly where the lobby was before this PR: a map that declares no atmosphere has nothing to prepare anyone for, and a share of zero asks for nothing. Neither registers a dimension.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING.md
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

7 tests in BlendedAtmosphereTest cover both ends, a share in between on every value, per-channel colour mixing, clamping, blending an atmosphere with itself, and that a blend never collapses the span the fog fades over. GameMapProviderIntegrationTest gains the lobby's dimension key, the proof that the lobby sees further than the map but not as far as the open end, and the overworld fallback. GameConfigReaderTest covers the setting, which is documented in config.properties.example.

Further comments

StaticDimensionPreset.BRIGHT is the open end rather than a new set of hand-picked numbers — it already exists as "open, airy, well-lit, long sightlines, minimal fog", which is what a lobby was.

The blend runs through MapAtmosphere, so that record's own corrections apply to the result: a blend that would leave the fog no span to fade over is repaired there rather than in the blending code.

Heads up on a conflict: #253 removes the six slenderStatic* settings this branch adds a config entry next to. Whichever merges second will need a trivial fixup in GameConfig, the two config records and GameConfigReader.

A player walked from a vanilla sky straight into a map that closes in at forty
blocks, and met the whole atmosphere in the same moment the round started. The
lobby now carries the map's own colours and haze, held at a distance he can still
see across, so the start of a round reads as the world tightening rather than as
a cut.

BlendedAtmosphere reads one atmosphere off the line towards another, colours
channel by channel. The lobby's is StaticDimensionPreset.BRIGHT taken
lobbyAtmosphereShare of the way towards the game map's, registered as
cygnus:map/<name>/lobby.

The registration happens in the provider's constructor, next to the game map's
own dimension, because registry data only reaches a client during its
configuration phase. That reverses the order inside the constructor: the game map
has to be read before the lobby is loaded now, since the lobby's dimension is
derived from it.

A map without an atmosphere has nothing to prepare anyone for, and a share of
zero asks for nothing; both leave the lobby on the overworld, where it was.
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Test results

  363 files    363 suites   2m 22s ⏱️
  608 tests   602 ✅  6 💤 0 ❌
1 827 runs  1 809 ✅ 18 💤 0 ❌

Results for commit 89eff42.

♻️ This comment has been updated with latest results.

The filter that was meant to keep the lobby out of the game map selection never
matched: getDirectoryRoot() is a whole path, so it never equals "lobby" and every
entry passed through. That stayed invisible while loadLobbyMap() ran first and
removed the entry, and broke the moment the previous commit reversed the order to
derive the lobby's dimension from the game map.

macOS picked the lobby as the game map and six tests failed with it; ubuntu
happened to pick the arena. findAny() over a stream owes nobody an order.

The lobby entry is now taken out explicitly before the pick, and the check reads
the entry's own directory name instead of the path leading to it - a checkout
below a folder called "lobby" would otherwise make every map the lobby.
@theEvilReaper
theEvilReaper merged commit 22511cf into main Sep 8, 2026
7 checks passed
@theEvilReaper
theEvilReaper deleted the feat/lobby-fog-preview branch September 8, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants