Page 1 of 1

Please make it so map votes have a minimum of 2 options

Posted: Mon Oct 03, 2022 6:59 pm
by Imitates-The-Lizards
As much as I love joking about the map votes being north korean in nature, there should probably be 2 options minimum for map votes.

Re: Please make it so map votes have a minimum of 2 options

Posted: Tue Oct 04, 2022 1:05 am
by Nabski
No Comrade. You will be going to the Ice Box.

Re: Please make it so map votes have a minimum of 2 options

Posted: Tue Oct 04, 2022 11:26 am
by Rohen_Tahir

Re: Please make it so map votes have a minimum of 2 options

Posted: Tue Oct 04, 2022 11:05 pm
by VexingRaven
Pretty sure this would just mean blocking map votes if there's only 1 valid option. Which is probably not a bad idea, so people don't waste the 1 (I guess 2) map votes the server gets.

Re: Please make it so map votes have a minimum of 2 options

Posted: Wed Oct 05, 2022 1:19 am
by oranges
the answer is to simply not hold the vote if there's only one option remaining.

Re: Please make it so map votes have a minimum of 2 options

Posted: Thu Oct 06, 2022 3:16 am
by san7890
oranges wrote: Wed Oct 05, 2022 1:19 am the answer is to simply not hold the vote if there's only one option remaining.
https://github.com/tgstation/tgstation/pull/70340

FYI if you want more than zero/one map options it becomes less of a matter of code and more of a matter of how the map config is set up. Policy Discussion time, I suppose.

Re: Please make it so map votes have a minimum of 2 options

Posted: Thu Oct 06, 2022 11:33 am
by Imitates-The-Lizards
So maybe I'm missing something here, but what exactly is causing map ineligibility? Like, okay, I know Delta has a pop minimum, and Kilo has a pop maximum, but arent the other 3 maps playable under all circumstances?

Re: Please make it so map votes have a minimum of 2 options

Posted: Thu Oct 06, 2022 10:47 pm
by san7890
Imitates-The-Lizards wrote: Thu Oct 06, 2022 11:33 am So maybe I'm missing something here, but what exactly is causing map ineligibility? Like, okay, I know Delta has a pop minimum, and Kilo has a pop maximum, but arent the other 3 maps playable under all circumstances?
We track the last three played maps via SSPersistence, which writes the names into a file in the server's data folder. On the initialize of the next round, the server (via the Persistence subsystem) can see if any map has been played for two (out of three) prior rounds. So, if MetaStation was played the last two rounds, it'll be automatically removed from the vote on initialize since it's been too common, thus forcing a "map rotation" of sorts. Another example would be if you're currently on DeltaStation, and the last few maps were MetaStation, IceBoxStation, and MetaStation- it would filter out MetaStation on the next map vote.

This was broken after a refactor of the vote subsystem a few months ago, and we just recently fixed it again.

Re: Please make it so map votes have a minimum of 2 options

Posted: Fri Oct 07, 2022 4:47 am
by Imitates-The-Lizards
san7890 wrote: Thu Oct 06, 2022 10:47 pm
Imitates-The-Lizards wrote: Thu Oct 06, 2022 11:33 am So maybe I'm missing something here, but what exactly is causing map ineligibility? Like, okay, I know Delta has a pop minimum, and Kilo has a pop maximum, but arent the other 3 maps playable under all circumstances?
We track the last three played maps via SSPersistence, which writes the names into a file in the server's data folder. On the initialize of the next round, the server (via the Persistence subsystem) can see if any map has been played for two (out of three) prior rounds. So, if MetaStation was played the last two rounds, it'll be automatically removed from the vote on initialize since it's been too common, thus forcing a "map rotation" of sorts. Another example would be if you're currently on DeltaStation, and the last few maps were MetaStation, IceBoxStation, and MetaStation- it would filter out MetaStation on the next map vote.

This was broken after a refactor of the vote subsystem a few months ago, and we just recently fixed it again.
Okay, so, let's say delta is ineligible because it's lowpop, and meta is ineligible because it was played 2 of the last 3 shifts.

Shouldn't the vote options then be kilo, ice box, and tram? Where are the other two ineligibilitys coming from to cause a one map vote?

Re: Please make it so map votes have a minimum of 2 options

Posted: Fri Oct 07, 2022 8:06 pm
by san7890
Whoops, I just found a new comment in the code. We check for the three maps in SSPersistence PLUS the current ongoing round.

So, here's what we have on production /tg/ servers:
► Show Spoiler
So, let's say that it's a lowpop server under 25pop, and it's been that way for four consecutive shifts. This means that both Delta and Tram are filtered out during /datum/vote/map_vote/create_vote. Now, out of three, you have Meta, IceBox, and Kilo:

Let's say that the current shift is IceBox. The previous three maps in SSpersistence's files read: "MetaStation, IceBoxStation, MetaStation". Thus, when the map vote initializes on the server booting up /datum/vote/map_vote/New, it will find that MetaStation and IceBoxStation are both filtered out, because they were present in two out of four recent rounds (including the one currently running) because SSpersistence passes that as the blocked_maps.

So, you will only have the choice of KiloStation. The shift after that, you should be able to choose between Meta and Kilo again, but you'll have to mind that potential gap. This doesn't change the underlying fact that this is a config/server operator issue (map voting itself must specifically be turned on in the config settings), and shouldn't really be minded by the codebase (given that any headmin term can touch the population maxima and minima at their will).