Software Developer for Symbiant Technologies, full time web developer. Mapping and modding since the days of Doom 2. Sci-fi and cyberpunk fan. My most famous map was "co_angst", the first ever combat map for Natural Selection. I have developer a useful little app called "ModMaker" for working with the Source game engine. I am the Lead Developer for "Exterminatus - Rival Species 2" a Warhammer 40,000 mod for Source.

Report RSS You have failed me for the last time...

Posted by on

Once more Source & Steam has me fuming mad. Once more the "server browser" has let me down. It has always been extremely patchy at listing internet servers for RS and RS2, but the Internet is a big place and I figure it needs some leeway. This time though it has failed to find a server on my LAN. The server running on the PC right next to my laptop. The server that my laptop was actually connected to (connected using the console because I knew the IP).

Well Steam has failed me for the last time. I'm not standing for this shit any more. If Valve can't write a server browser I bloody well can. I plan to write it for use in EX and publish the code so other modders won't need to rely on that built in trash any longer (i'm not paranoid enough to assume i'm the only modder being picked on).


Plan for the Open Source Server Browser

How to find LAN servers? When a game server loads a map open a port and listen to it for clients who are browsing. Clients find there local IP and subnet mask, then iterate through all the IPs in their subnet, attempting to contact the port the game servers will be listening to. If contact is made the game server will send the client a message reporting it's status.

How to find Internet servers? OK the internet is a much larger place than my LAN; Iterating though every valid address is therefore not practical. So we need another method. When a game server loads a map it sends a message to a central server who records it's status. When clients want to browse a game, they just ask the central server for a list. When a map ends (or the game server is shutting down) it sends another message. Easy. Except if the central server has down-time, then, like now, no-one can get any games.

So we'll need a second tier of central servers. When they start up they'll try and tell the original central server they exist. Whenever the central server gets game server status reports it replies with a list of central servers. The game server then reports to all the central servers on that list whenever it loads a map. Whenever a client gets a list of game servers from the central servers it also gets a list of central servers. Later if it requests a list of game servers and gets no reply it can then try other central servers from that list.

However if a freshly installed client tries to find a game, when the central server is down, they aren't going to have a list of central servers, so they are kind of screwed. An alternative we could just go with a having the central server in "the cloud" and rely on Google or Amazon or whoever is hosting it to give us 100% up-time. Let some other clever git handle the redundancy issue.

I'm thinking of using a web server as central server, with all the messages being HTTP requests and responses handled by PHP. The PHP pages store the info in MySQL and write the current game server list to disk (which will be quicker for apache to serve than querying MySQL for every request. I'm assuming we're going to get asked for the list much more frequently than servers change maps. ). Having a list of active servers sat on a website means it can be browsed by client's other than EX.

I did consider having the cached list of game servers written as an RSS feed, as it would be kind of cool to get a list of active servers from any feed reader, but server statuses aren't really persistent articles suitable for RSS. Also the XML that RSS uses is rather inefficient if it's not compressed. I'm currently inclined toward using JSON or the similarly structured text files Source already uses to format the list. That way it should be lightweight and trivial to parse in-game and in a PHP page or Javascript.

OK, that's the format, now what about the content? Well at the very minimum all we need is the server's IP, the client could then contact the server directly, for a full status report. Then again having every client in the world bugging every server for a status report whenever they hit refresh sounds like a massive drain. So let's report a few more details to the central server to cache:
Host Name (chrome's place)
Game Name (ex)
Max Players (8)
Number of Players Last Round (they may not have re-connected yet) (4)
Map (ex_lycantium)

Clients would still need to contact a server to find out their ping and the current number of free slots, but at least they would know they are looking at the right game and map. A message from server directly to a browsing client (internet or LAN) would have much the same info, but Number of Current Player would replace Number of Players Last Round.


Woohoo a long one. I consider this massive distraction from adding more fun stuff to EX, one that I shouldn't have to do if Source was doing it's job properly. However if no-one can find a game they are never going to get to see any of the fun stuff anyway.

Comments, Suggestions and Feedback please.

(disclaimer: it's midnight and i'm caffeinated)

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: