Skip to content

Hosting and Joining

starfi5h edited this page Jul 13, 2024 · 6 revisions

Ensure DSP is in the firewall whitelist for both host and client!

Hosting

Nebula uses listen server architecture, so the hosting player need to have an accessible IP address for clients to join.
Nebula uses WebSocket (TCP) to transfer packets, with a default port of 8469, which is configurable in the settings.
Type /info in the in-game chat (open with Alt + ~ by default) to see the port status reported by ipify.
info
The command will show multiple addresses (click to copy). Choose the address given different situations:

  • Local IP: If both Host and client are in the same LAN.
  • IPv4 IP: If the port is opened (host is not behind NAT).
  • IPv6 IP: If the port is opened, and both host and client support IPv6.

If the status shows Unavailable, you can use different online port checkers to check the port status.
If WAN ports are closed, you have to port forwarding or use tunneling software.
Below are different solutions. For networking beginners, it's recommended to use Radmin or Playit.gg.

(A) Port forwarding

This solution is good for lowering latency, but it's hard for beginners.
How to Port Forward – General Guide to Multiple Router Brands
If the router managing the NAT is accessible, you can do port-forwarding. Once forwarded, check the port status using /info or an online port check tool. It should show Port status: Open.
If your ISP uses CGNAT, then standard port forwarding won't work for you without you taking out a plan with your ISP to allow it.
More and more ISP are using CGNAT these days due to the IPv4 Shortage. If this is the case you have no choice but to use a tunneling solution.

UPnP/NAT-PMP support

Click to expand

Enable UPnp/Pmp support - When enabled, it will try to use Open.NAT to forward the port if your NAT devices support UPNP (Universal Plug & Play) or PMP (Port Mapping Protocol).

upnp-pmp

(B) Reverse proxy

Nebula has built-in Ngrok support (Video guide). Other options like FRP (Fast Reverse Proxy) can work too.
These solutions only require host to install the tunneling app.

Playit.gg

Click to expand

Video guide. The difference is step 7 (tunnel type and port).

  1. Create an account on https://playit.gg/
  2. Download and install the app at https://playit.gg/download
  3. Open the app (playit.exe) and keep it running during hosting.
  4. Copy and paste the link in the app into your browser.
  5. Create a tunnel.
  6. Agree to not post malware on playit.gg.
  7. Set the tunnel type to TCP and the local port to 8469.
    playitgg
  8. Set the IP to 127.0.0.1 if it hasn't already.
  9. Check the app; it should be connected.
    playitgg2
  10. Copy the public address and give it to the players.
    playitgg3

Ngrok support

Click to expand

Note: The new Ngrok account requires credit card info now. It's not recommended anymore for the new players.
For free Ngrok account the address will be reset each time the Host disconnects, and it has limited bandwidth and usage.

In Settings -> Multiplayer -> Network, there are Ngrok options:

  • Enable Ngrok support: When enabled, the game will try to start up Ngrok. It will download Ngrok to the mod folder when hosting for the first time.
  • Ngrok Authtoken: By registering in Ngrok, you'll get an authtoken from the dashboard. Copy and paste it here.
  • Ngrok Regions: Available regions are us, eu, au, ap, sa, jp, in.

ngrok-2

After installation, type /info in chat and copy the Ngrok address. The clients can join by inputting the Ngrok address.
info2
For example, client can now join by 0.tcp.jp.ngrok.io:16416

(C) VPN

There are many VPN services, such as Radmin, Zerotier or Hamachi.
When using a VPN, port checkers can't determine if the connection is accessible. So port status in /info can be ignored.
Instead, use the address provided by the VPN to connect.
These solutions require both host and client to install the tunneling app.

Radmin

Click to expand
  1. Install and open the Radmin app
  2. Go to Network -> Create New Network. Set name and password.
  3. Let clients join the network. They can then connect using the IP shown in Radmin.

After connection
For example, client can now join by 26.81.236.68

ZeroTier

Click to expand

How to Create a VPN tunnel with ZeroTier (Windows) is a tutorial on paperspace. For the latest version the difference is that in step 5 and 6 you'll need to open the control panel and enter Network ID there.

Start ZeroTier app, click Open Control panel
zeroTier1

Enter Network ID in the input field below. After joining, the device will get a managed IP.
zerorTier3a

If the network is private, the network owner will need to go to ZeroTier Central and click on the Auth button to approve each device.
zeroTier5a
After joining the network, clients can now join the game by inputting the host's managed IP.


Joining

Players join by IP, or by Discord rich presence.

Join by IP

Go to Multiplayer -> Join Game, then enter the IP address of Host. If the port is not specified, it will use the default port of 8469.

join1

Join by Discord rich presence

This option requires Host to have either public IP or Ngrok address for client to connect.
You can accept an invitation from the Host, or send the Host a request to join the game. See discord rich presence for more info.

In order to send invites the host must go to Discord's User Settings -> Activity Status and make sure Display current activity as a status message. is turned on.

send invite to clients send join request to host


Reference

Factorio wiki - Multiplayer - Joining a Multiplayer game section
Dyson Sphere Program Nebula multiplayer mod using Ngrok
Enable online multiplayer in Single player world with playit.gg - 1 minute
戴森球计划FRP联机教程 - 14 minute video for FRP
連線到Minecraft基岩版伺服器:使用ZeroTier建立虛擬區域網路 - 3 minute video for ZeroTierOne v1.8.3