Xonotic Forums
[NEED HELP] g_maplist for all voteable gametypes - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Server Administration (https://forums.xonotic.org/forumdisplay.php?fid=16)
+--- Thread: [NEED HELP] g_maplist for all voteable gametypes (/showthread.php?tid=8289)



g_maplist for all voteable gametypes - savale - 03-30-2020

Hi,
I am running into a problem I am unable to solve. My server runs the latest GIT version (30 march 2020)
I think these are the relevant config entries:
Code:
g_maplist "atelier boil dance implosion solarium space-elevator"
g_maplist_shuffle 1  
g_maplist_votable 5 
gametype dm     // default gamemode
sv_vote_gametype 1   // set to 1 to enable voting for gametypes after every match
sv_vote_gametype_options "dm ctf tdm ca"

The problem: the map voting shows the correct maps when staying in the DM gametype. When another gametype is voted, other maps. i.e. runningmanctf will be showed during the map voting. (this map is not in my g_maplist).
After this  the g_maplist is ignored as it seems and every installed map is showing up at the map votes.
Is this "normal" behavior? Is it something I can fix. Ie. have a g_maplist per gametype?


RE: g_maplist for all voteable gametypes - martin-t - 03-31-2020

I think switching gametype resets g_maplist. This is somewhat expected as different modes have different maps and g_maplist is not just a config cvar, the code also changes it to keep track of the maps - it's a glorified global variable. You have 2 options:

a) disable some maps by overriding their mapinfo and putting "hidden" in it like here: https://github.com/martin-t/xonotic-config/blob/master/maps/gasoline_02.mapinfo

b) set g_maplist per gametype using sv_vote_gametype_hook_ like here: https://gitlab.com/xonotic/xonotic/-/blob/286b6933dad4f814f107ee4f8d0f57d01d3977cf/server/server.cfg#L107 (this is unmerged code because we're still arguing about some details) - not sure this'll actually work but do try


RE: g_maplist for all voteable gametypes - savale - 03-31-2020

(03-31-2020, 05:11 AM)martin-t Wrote: I think switching gametype resets g_maplist. This is somewhat expected as different modes have different maps and g_maplist is not just a config cvar, the code also changes it to keep track of the maps - it's a glorified global variable. You have 2 options:

a) disable some maps by overriding their mapinfo and putting "hidden" in it like here: https://github.com/martin-t/xonotic-config/blob/master/maps/gasoline_02.mapinfo

b) set g_maplist per gametype using sv_vote_gametype_hook_ like here: https://gitlab.com/xonotic/xonotic/-/blob/286b6933dad4f814f107ee4f8d0f57d01d3977cf/server/server.cfg#L107 (this is unmerged code because we're still arguing about some details) - not sure this'll actually work but do try

Thank you Martin, this is very valuable information. I will try to go for option b at first as it's the most flexible.

Ok option B kind of works for me. I made a seperate cfg file that I execute at the hook:

Code:
alias sv_vote_gametype_hook_all "g_instagib 0; exec sv_maps_tdm.cfg"



In my sv_maps_tdm.cfg I have this:
Code:
g_maplist_votable 3
g_maplist "dance solarium space-elevator"
//need to shuffle otherwise will show the first listed maps above.
g_maplist_shufflenow


I always see this in my log:
Code:
Game type successfully switched to dm
execing sv_maps_tdm.cfg

Now I alwasy get 3 maps to choose from. When I go from example DM -> DM it is fine. If I swich from DM -> TDM, the first time I also see other maps. If I then choose TDM again it's the correct map list in the vote.
It looks like the g_maplist is set too late for some reason. A list of possible hooks would be nice, maybe there is another hook I can use that loads the maps in time for the map voting.


RE: g_maplist for all voteable gametypes - savale - 03-31-2020

I decided to go for the mapinfo option. This works well now. It's a bit more setup hassle, but it works like a charm.
The "hooks" are really nice for other things by the way. It enabled me to make an instagib ctf mode for example. Cool stuff