feat(lobby): wait in a weakened version of the map's atmosphere - #254
Merged
Conversation
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.
This comment has been minimized.
This comment has been minimized.
Contributor
Test results 363 files 363 suites 2m 22s ⏱️ 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 isStaticDimensionPreset.BRIGHTtakenlobbyAtmosphereShareof the way towards the game map's own, registered as its own dimension undercygnus:map/<name>/lobby.At the shipped default of 0.3, a
dense_fogmap 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.
GameMapProviderloaded 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
Checklist
7 tests in
BlendedAtmosphereTestcover 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.GameMapProviderIntegrationTestgains 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.GameConfigReaderTestcovers the setting, which is documented inconfig.properties.example.Further comments
StaticDimensionPreset.BRIGHTis 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 inGameConfig, the two config records andGameConfigReader.