Version 2 multiplayer servers

Yesterday I merged a work branch where I’ve revised the way information about multiplayer servers is stored and distributed. The changes from “mp-serverinfo” are available in build 2144.

There are some important changes to discuss. Doomsday 2 servers are now incompatible and separate from Doomsday 1.x servers. Doomsday 2 uses a new status information format, new master server web API and new, compressed LAN broadcast messages. Doomsday 1.x clients will therefore not detect Doomsday 2 servers, and cannot query information about them (and vice versa).

The new server status information format is more flexible and future-proof than before, thanks to internally being based on Doomsday Script data types, and externally on JSON. The primary motivation for doing this change was that package lists should be included in the status information so that clients can load the right packages before joining (this includes WADs and data files).

When joining a multiplayer game, the client now sets up its state using the same mechanism that is used for local game profiles. The only difference is that the game profile is filled in with information received from the server. This is another step towards eliminating redundant code for handling singleplayer vs. multiplayer games, and in the future MP games will benefit from all the additional information game profiles can contain.

Changing the server status information format means that the dengine.net master server also needed to be updated. The master server is essentially a very simple database interface, so this ended up being quite a trivial task. The Doomsday 2 master server is located on the new api.dengine.net domain that will be used for all future web APIs as well. The master server can receive server information as JSON, and returns the list of running servers as a JSON array. Using JSON allows much more flexibility in the future, particularly since the entire server status information data can be converted to and from JSON without losing anything.

While testing these MP changes I fixed a number of regressions in the Shell. Starting a local server should now be much more robust because it is based on LAN status broadcast messages instead of blindly trying to open a socket before the server has started. If the local server encounters a fatal error, the Shell is able to detect this and show the error message immediately instead of waiting for several seconds. I also improved the way IP addresses are handled internally so that IPv6 works better (particularly on macOS) and local IP addresses should be detected much more reliably.

There are a couple of other noteworthy recent changes:

  • The “-pwadtex” option that previously was available in Snowberry makes a comeback in the form of a toggle in the Renderer Settings dialog (along with two other toggles for controlling external texture use). The changes are applied when the settings dialog is closed.
  • Fixed OpenGL FBO configuration workarounds for older drivers / limited HW: since the recent low-level OpenGL changes, the previous workarounds partially broke. For example, player 3D weapon models may not have been renderered correctly before these fixes.