Steam protocol server connection

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
psiwray
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jun 15, 2025 2:58 pm
Contact:

Steam protocol server connection

Post by psiwray »

TL;DR
Support connecting to a multiplayer game with a Steam protocol URL

What?
Steam adds support for a steam:// URL with its own protocol on Windows machines when it's installed. It allows to do multiple things, one of which is directly connecting to a multiplayer game server. For example, steam://connect/1.2.3.4:9999 would try to connect to a game hosted on server 1.2.3.4 on port 9999 by trying (I suppose using their own communication protocol) to get the app id to launch from the server. If it's a Half Life multiplayer server, then the server responds with an app id of 70.

I was developing a simple Factorio server list and I got curious if it was possible to launch the game and make it immediately connect to the server, directly from a browser URL. It seems to me it's not possible because the Factorio server does not send its app id to the Steam clients that query it.

Would it be possible to add this feature? Is it complicated?
Why?
I guess it would help making fan projects nicer/more useful with little effort (I didn't look at how to integrate this Steam functionality into the game, I admit) and eventually even an official web-based server list.
eugenekay
Filter Inserter
Filter Inserter
Posts: 573
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Steam protocol server connection

Post by eugenekay »

Factorio itself does not speak "steam://", but it is already possible to "launch the game and make it immediately connect to the server". There are existing Command Line Parameters --mp-connect and --password to have the client automatically connect when launched.

I have previously experimented with custom registry settings to automatically load a Savegame; this mostly works right. It is also possible to Register a Custom URL Protocol; I am not sure of the best way to integrate with the existing steam:// Protocol; possibly just a simple wrapper script to launch Factorio using the existing parameters is all that is needed?
User avatar
psiwray
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jun 15, 2025 2:58 pm
Contact:

Re: Steam protocol server connection

Post by psiwray »

My idea was more like "one-click play" for inexperienced users. For example from the browser when you click on a link with a certain protocol the browser lets you choose an app and I assume Steam will be the one you'd select to open. From there, the game could be launched directly. Instead, with commands, you need to know how to open a command prompt (if you don't register the association like you said) although simple enough for intermediate PC users.

This would be simpler if Steam allowed to specify the app id in the steam://connect/ endpoint but it seems like it doesn't.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15867
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Steam protocol server connection

Post by Rseding91 »

This sounds like something steam would have to implement since it would be the one to get the command line options and then pass them along to the process once started.
If you want to get ahold of me I'm almost always on Discord.
eugenekay
Filter Inserter
Filter Inserter
Posts: 573
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Steam protocol server connection

Post by eugenekay »

I think the whole process is supposed to look like:

1) User clicks a link “steam://connect/Ser.Ver.Add.Ress:34197
2) Windows passes the Steam URL to the Steam application
3) Steam Client tries to connect to the Address:Port to determine what Game it is
4) Game Server replies with the Steam AppID
5) Steam Client launches the Game Client with the options
6) Game Client connects to the server as normal

So this Feature Request would be to add support for Step 4 & 5? I was not able to find a Public Valve Software Developer Documentation for this part of the Steam API. :-( Factorio’s usage of UDP rather than TCP for the Server-Client protocol will probably make it much harder to implement if a HTTP style request is used.
User avatar
atomizer
Fast Inserter
Fast Inserter
Posts: 137
Joined: Sat Sep 22, 2018 3:18 pm
Contact:

Re: Steam protocol server connection

Post by atomizer »

connect command works only with servers that use the Steam Game Server API, which would need to be implemented in the server.

Alternatively, you could use the run command with parameters (note the double slash):

Code: Select all

steam://run/427520//--mp-connect%20<ip:port>/
eugenekay
Filter Inserter
Filter Inserter
Posts: 573
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Steam protocol server connection

Post by eugenekay »

atomizer wrote: Sun Jun 15, 2025 10:08 pm connect command works only with servers that use the Steam Game Server API, which would need to be implemented in the server.
This is the API page I was looking for; thanks! Factorio would need to add SteamWorks support in order to implement this properly… that seems like a lot of change.
Post Reply

Return to “Ideas and Suggestions”