Skip to content

Crossplay

The GOG GALAXY SDK provides a crossplay feature allowing users to create and join each other’s multiplayer games, regardless of whether they use Steam or GOG GALAXY. It is required to implement the GOG GALAXY SDK multiplayer in both builds — Steam and GOG — of the game for a crossplay to work.

How Does It Work?

Steam and GOG GALAXY are two separate environments, and it is not possible to access one from the other. The way crossplay works is that you implement the networking stack from the GOG GALAXY SDK in your game and upload the builds to GOG and Steam via their developer pipeline. Thanks to this, both GOG and Steam game builds use the same (GOG) environment and are able to interact with each other — for example, users on both services are able to play with each other, because GOG GALAXY servers are handling everything. We are able to handle Steam app tickets for users logging in to GOG GALAXY through a Valve client.

Implementing Crossplay

To allow multiplayer connections between GOG and Steam users, you need to add both GOG and Steam Authorization methods to your build, as well as implement the GOG GALAXY Multiplayer feature. You may create two separate builds of your game, one for each platform, then every build would perform authorization process according to the platform, but both builds would use the GOG GALAXY SDK for Multiplayer.

GOG Authorization

galaxy::api::Init(InitOptions);
galaxy::api::User()->SignInGalaxy();

It signs you in to GOG GALAXY backends, using credentials stored in the GOG GALAXY client (you need to be signed in to the GOG GALAXY client first).

Steam Authorization

You also have to put Galaxy.dll (or Galaxy64.dll) in the game folder.

galaxy::api::Init(InitOptions);
galaxy::api::User()->SignInSteam(const void* steamAppTicket, uint32_t steamAppTicketSize, const char* personaName, IAuthListener *const listener=NULL);

where steamAppTicket, steamAppTicketSize and personaName can be retrieved using Steamworks API.

In both cases you should wait (and call galaxy::api::ProcessData) until you receive the AuthListener::OnAuthSuccess (or AuthListener::OnAuthFailure) callback.

GOG Multiplayer

After successfully signing in to GOG or Steam using the GOG GALAXY SDK, you can use the galaxy::api::Matchmaking() interface to create/list or join lobbies and the galaxy::api::Networking() interface to send packets of data inside a lobby. Read more here.

Crossplay and Game Invites

Inviting GOG Friends to multiplayer lobbies is possible and fully supported, but available only when a user is logged in to the GOG GALAXY client. The user is able to invite their GOG Friends only, either via the GOG GALAXY Overlay or directly from the game, using the GOG GALAXY SDK methods.

Inviting Steam friends to a multiplayer game is not supported by the GOG GALAXY SDK, but should be possible by utilizing both the Steam SDK (for handling invitations) and the GOG GALAXY SDK (for handling matchmaking and networking). Of course, this would only be used when a user is logged in to Steam, and it would allow a user to invite their Steam friends only.