Steam NAT punch in case of dedicated server

Done something similar and afaik, one part of it is adding some global definitions to your Client and Server Target.cs files.

Here’s with the default Spacewar and its 480 steam id as an example (assuming you’re on UE5). Try replacing with yours.

  • Client.cs:
Type = TargetType.Client;

bUsesSteam = true;

GlobalDefinitions.Add("UE_PROJECT_STEAMGAMEDIR=\"Spacewar\"");
GlobalDefinitions.Add("UE_PROJECT_STEAMSHIPPINGID=480");

ExtraModuleNames.AddRange( new string[] { "YourGame" } );
  • Server.cs:
Type = TargetType.Server;

bUsesSteam = true;
bUseLoggingInShipping = true; // I think host players will need logging

GlobalDefinitions.Add("UE_PROJECT_STEAMPRODUCTNAME=\"Spacewar\"");
GlobalDefinitions.Add("UE_PROJECT_STEAMGAMEDESC=\"YourGame\"");
GlobalDefinitions.Add("UE_PROJECT_STEAMGAMEDIR=\"Spacewar\"");
GlobalDefinitions.Add("UE_PROJECT_STEAMSHIPPINGID=480");

ExtraModuleNames.AddRange( new string[] { "YourGame" } );

Assuming the rest of steam setup is done correctly on your project, these should work.
Now if your game is on UE4, I think you need to change ‘UE’ to ‘UE4’ in the GlobalDefinitions strings but I am not entirely sure.