Help find a new gamemode sorting algorithm!

The gamemode list’s sorting is awful. Let’s find a better system!

Here’s the file where the sorting happens. The end result is decided on line 226 (the random part is to settle disputes between 2 gamemodes with equal amounts of players). To understand the code, we need to look at this section. As you can see, all of the information about a gamemode that’s being kept track of is stored up here, and all of the information that we can possibly know about a server is down there. If we wanted to keep track of something about a gamemode that we don’t already have, we’d add an item somewhere in the gamemode “structure” and manipulate it from line 221 (where the players are being added to).

I’ll start with my “fullness” algorithm:

Lines 158-234

function GetGamemode( name, type )
	if ( !ServerTypes[type] ) return;

	if ( ServerTypes[type].gamemodes[name] ) return ServerTypes[type].gamemodes[name]

	ServerTypes[type].gamemodes[name] = 
		name:			name,
		servers:		[],
		num_servers:	0,
		num_players:	0,
		fullness: 		0,
		OrderBy:		'recommended',
		info:			GetGamemodeInfo( name )

	ServerTypes[type].list.push( ServerTypes[type].gamemodes[name] )

	return ServerTypes[type].gamemodes[name];

function AddServer( type, id, ping, name, desc, map, players, maxplayers, botplayers, pass, lastplayed, address, gamemode, workshopid )
	if ( id != RequestNum[ type ] ) return;

	if ( !gamemode ) gamemode = desc;
	if ( maxplayers <= 1 ) return;

	var data =
		ping:			parseInt( ping ),
		name:			name,
		desc:			desc,
		map:			map,
		players:		parseInt( players ) - parseInt( botplayers ),
		maxplayers:		parseInt( maxplayers ),
		botplayers:		parseInt( botplayers ),
		fullness: 		( parseInt( players ) - parseInt( botplayers) ) / parseInt( maxplayers ),
		pass:			pass,
		lastplayed:		parseInt( lastplayed ),
		address:		address,
		gamemode:		gamemode,
		password:		'',
		workshopid:		workshopid

	data.hasmap = DoWeHaveMap( );

	data.recommended =;
	if ( !data.hasmap ) data.recommended += 20; // We don't have that map
	if ( data.players == 0 ) data.recommended += 100; // Server is empty
	if ( data.players == data.maxplayers ) data.recommended += 75; // Server is full
	if ( data.pass ) data.recommended += 300; // If we can't join it, don't put it to the top

	data.listen = data.desc.indexOf('[L]') >= 0;
	if ( data.listen ) data.desc = data.desc.substr( 4 );

	var gm = GetGamemode( data.gamemode, type );
	gm.servers.push( data );

	UpdateGamemodeInfo( data )

	gm.num_servers += 1;
	gm.num_players += data.players

	gm.element_class = "";
	if ( gm.num_players == 0 ) gm.element_class = "noplayers";
	if ( gm.num_players > 50 ) gm.element_class = "lotsofplayers";
	var empty = 0
	if ( gm.num_players == 0 ) empty = 500;

	gm.order = gm.fullness / gm.num_servers - empty

	UpdateDigest( Scope, 50 );

Let’s do something about the innovation-killing server browser and get results!

I feel like player-count should contribute to the score, but it should fall-off if there are too many.
So too popular gets pushed down a little to make room for the moderately popular.

The same for the number of servers running a particular gamemode.

Code it!

I already tried it, people shitstormed me.

[editline]14th September 2014[/editline]

Also I don’t think pushing renamed DarkRP and PropHunt gamemodes is exactly “innovative”

how about a new “discover” section in the browser? People looking to play on unique / experimental stuff could click on it and it could list gamemodes that are not very popular

I believe a “gamemode of the day” would work nicely. Let’s get some other people implementing their ideas and showing what the list looks like in the meantime, though.

Which your average GMod player won’t care about.

Just scrap the damn thing and return to standard browser already.

Can we just do this already goddamnit

Also would it be possible to get sv_tags back? Or something that would allow us to filter servers by installed workshop ids, inclusive or exclusive.

sv_tags still work.

You sure? The convar is missing on both the dedicated server and client for me.

Turns out you’re right, I swear an update or so ago they were working.

The convar got removed and is now set automatically due to how the new server browser works:
Basically each server gets its gamemodes name put in the tags so it can be sorted for gamemodes, as well as the workshop id of the gamemode (if that’s available) so it can display the small download icon on the right

You could actually fake these tags to run lua on each client in the menu state a while ago, but that got fixed

So you want to shift from catering for the players to catering for the servers?

More players isn’t always better.

No, what gives you that idea?

The GMod playerbase enjoys playing on overpopulated servers, it enjoys playing what everyone else is playing. It enjoys playing TTT and DarkRP - if they didn’t, those gamemodes wouldn’t be at the top of the list.

That and you pretty much implied it yourself:

If the average player GMod player not caring about something is the problem, doesn’t that mean your
saying the average GMod player is wrong? So the solution is doing the opposite of what the GMod population wants? Or did I just look at what you read the wrong way?

Yeah, I agree. I just don’t think the matter is very simple at all.

Sure, but it just so happens those are the gamemodes everyone knows, typically due to its position and media via certain tube sites.

I think you are somewhat misinterpreting what I’m saying. I’m not denying or arguing that players don’t want TTT / DarkRP gamemodes. Heck xRP has existed since GMod has and TTT is a generally easy gamemode to jump in to. Both of these are factors in to how and why a gamemode becomes popular.

However my problem is that anything new doesn’t stand a chance outside of someone popular highlighting it, for example Prop Hunt seeing a surge in popularity thanks to YTers and Murder is currently experiencing a similar phenomenon, albeit not as big as most YTers are moving on.
To clarify, I don’t dislike or think your average GModder is wrong for what they choose but at the same time the option of choice is more of an illusion than anything else.

My argument is to return the browser back to what it was - an easily sorted system that allows you to sort by map, player, ping and so on. You get to pick what you want. If you sort by servers with highest # of players, then you’re going to get a somewhat different mix of servers than if you follow the current server list, for example -

[img_thumb][/img_thumb] vs

They’re not wholly different, but there is a difference. Even if you dont feel like playing with so many players,

The server browser itself isn’t to blame for gamemode discoverability ( but it doesn’t help ).

Better targets would be:

The pressure to run one of the popular gamemodes over a relative unknown, especially if the gamemode has a startup cost of required content that would need installed such as custom maps or models.

The amount of drama communities manage to generate if they have similar gamemodes or want the playerbase to come to their server instead - see knockoffs or agressive attacks.

The community that wants the same feature set in every gamemode ( PAC, Pointshop, addons they like on other servers ) or will alter the gamemode to make core features premium or sell advantages under the guise of “donations.”

Pretty much the community is why new gamemodes don’t take off - they have to leave their comfort zone.

Average number of players per gamemode?

To clarify, average number of players on each server ( currentplayers / maxplayers * 100 ) then find the average of all the servers of a certain gamemode together ( add all the averages up and divide by how many you have ).

Then sort from largest to smallest.

edit: stupidity