space-station-14 icon indicating copy to clipboard operation
space-station-14 copied to clipboard

Refactor GameMapManager a bit (nukes mapforced)

Open Mervill opened this issue 2 years ago • 4 comments

About the PR

Closes #7192 Fixes an untracked issue where the map name in the lobby screen is sometimes incorrect

changed behavior:

  • cvar mapforced is depreciated
  • cvar map now forces the GameMapManager to always load the given map
  • Set the cvar to the empty string sudo cvar game.map "" or forcemap "" to stop forcing the map.
  • console command forcemap now sets the map cvar (redundant now but eh)
  • voting for maps only works in the pre-round lobby and will display an error message in other situations
    • standard votes should have better code for detecting valid conditions but that's outside scope for this

unchanged behavior:

  • map_rotation (defaults to true) causes GameMapManager to use the rotation queue when selecting the map
  • if map is empty and map_rotation is false, a random eligible map will be selected (I think this is unchanged)

notes:

This started as a simple investigation into removing forcemap and quickly grew into a medium-sized refactor of GameMapManager and connected code. More work is ~~probably~~ needed to push this closer to what it actually needs to be, but that can happen later.

Something to keep in mind is that GameMapManager._selectedMap needs to be unchanged during the round so that the lobby has the correct information. Currently the functions inside GameMapManager don't actually prevent this, so just don't it™. This is why map voting has been restricted to the pre-round lobby.

Mervill avatar Sep 25 '22 06:09 Mervill

cvar map now forces the GameMapManager to always load the given map console command forcemap now sets the map cvar (redundant now but eh)

So how do you unforce a map? ctrl + f shows nothing else changes that CVar but maybe I'm missing something

voting for maps only works in the pre-round lobby and will display an error message in other situations

Why is this desirable behavior?

Elijahrane avatar Sep 25 '22 11:09 Elijahrane

Set the cvar to the empty string sudo cvar game.map "" or forcemap "" to stop forcing the map. (added to op)

I couldn't find a way to make map voting during the round work cleanly. Perhaps I'll take another look for this PR but honestly it's not that bad a restriction. Votes on the whole are kinda broken.

Mervill avatar Sep 25 '22 18:09 Mervill

Ok the lobby is now reading from the MetaDataComponent attached to each loaded station. With that change in mind, should we change the description text in the lobby? From "The current map is" to something like "The current station is"?

Mervill avatar Sep 29 '22 18:09 Mervill

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 04 '22 03:10 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 02 '22 01:11 github-actions[bot]

oh my gosh thanks for doing the merge part of this ❤️ I will look at the feedback right away

Mervill avatar Nov 08 '22 00:11 Mervill