Common Issues

This page contains all common issues and their solutions, starting with connection issues. Please read fully and if you still need help feel free to DM me @Mattiefm or join the discord.


Networking & Connection Guide

This section covers everything about how the multiplayer mod connects players, what connection methods exist, why connections fail, and how to fix every known issue. Read the section relevant to your problem, or read the whole thing for a full understanding.

How the Multiplayer Mod Connects Players

The Fear & Hunger Multiplayer Mod is peer-to-peer (P2P). There is no central game server that players connect to. Instead, one player acts as the Host and other players connect directly to them as Clients. The mod supports two connection methods: PeerJS (WebRTC) and TCP Direct Connect (Fallback).

Connection Flow Overview

  1. The Host clicks "Host Game" in the multiplayer menu. The mod opens a connection and generates a connection code.
  2. The Host shares the connection code with friends (via Discord, text message, etc.).
  3. The Client clicks "Join Game" and pastes the connection code into the "Connection Key" field.
  4. The client's game establishes a direct connection to the host.
  5. Once connected, both players appear in the lobby. The host clicks "Start Game" to begin.

Connection Methods Explained

Method 1: PeerJS / WebRTC (Default)

This is the default and recommended connection method. It uses a technology called WebRTC (Web Real-Time Communication) through a library called PeerJS.

How it works:

  1. Broker Server: When you host, the mod contacts the PeerJS broker server (a free public server at 0.peerjs.com). This server does NOT relay your game data. It only helps the two players find each other by exchanging connection information. Think of it as a matchmaker — once players are introduced, the broker steps aside.
  2. STUN/TURN Servers: After the broker introduces the two peers, the mod uses STUN and TURN servers to establish the actual connection:
  3. Direct P2P: Once the handshake completes, data flows directly between the two players' computers. The broker and STUN servers are no longer involved.

Connection Code Format:

The connection code you share is a Base64-encoded PeerJS ID. It looks like a random string of letters and numbers. It does not contain your IP address directly — the broker server handles the IP mapping behind the scenes.

Pros:

Cons:

Method 2: TCP Direct Connect (Fallback)

TCP Direct Connect is the fallback connection method. It bypasses PeerJS entirely and creates a raw TCP socket connection between the host and client on port 6878 (by default).

How it works:

  1. The Host's game starts a TCP server listening on port 6878.
  2. The mod attempts to detect the host's public IP address automatically using DNS lookup (OpenDNS) or HTTP fallback (AWS CheckIP).
  3. The connection code displayed is a Base64-encoded IP address with port and a random suffix (e.g., 203.0.113.50:6878_a1b2 encoded).
  4. The Client decodes the code and connects directly to that IP and port via TCP.
  5. A handshake is exchanged to identify the client, then data flows directly over TCP.

Connection Code Format:

The TCP connection code, when decoded, looks like an IP address: 203.0.113.50:6878_a1b2. The mod auto-detects whether a code is an IP address or a PeerJS ID and switches modes accordingly.

When TCP is used:

Pros:

Cons:

TCP IP Warning:

The first time you enable TCP mode, the game will display a warning: "TCP directly reveals your IP — only send this code to trusted friends." You can choose to suppress this warning for future sessions.

Quick Comparison: PeerJS vs TCP

Feature PeerJS (WebRTC) TCP Direct Connect
Default modeYesNo (fallback)
IP exposed to other playerNoYes
Requires external serversBroker + STUN/TURN (for setup only)None
Port forwarding neededUsually no (TURN relay handles it)Yes (for internet play)
Works on LAN without internetNoYes
Works through strict firewallsUsually (via TURN relay)Only if port is forwarded
Default portN/A (uses WebRTC data channels)6878 (TCP)
Auto-fallbackN/AAuto-enables after 10s PeerJS timeout

Not Connecting? Step-by-Step Troubleshooting

If you have been sent here by the game, your connection is taking longer than expected. Work through the following checklist in order. Each step resolves the most common cause before moving to the next.

Step 0: Check the Broker Server Status (PeerJS mode only)

The PeerJS broker server is a free public service that helps players find each other. If it is offline, PeerJS connections will not work until it comes back. This does not affect TCP Direct Connect.

If the broker is down: Wait 1-2 hours and try again, or switch to TCP Direct Connect (see the section below on how to enable it). If it stays down for more than a day, check the project Discord or message @Mattiefm.

Step 1: Verify the Connection Code

Step 2: Ensure Both Players Are Using the Same Connection Method

Step 3: Restart the Game

Step 4: Switch Who Is Hosting

Step 5: Check Your PC Firewall

Your operating system's firewall may be blocking Fear & Hunger from accepting incoming connections.

Windows:

  1. Open Windows SecurityFirewall & network protectionAllow an app through firewall.
  2. Click "Change settings", then "Allow another app...".
  3. Browse to your Fear & Hunger Game.exe (or nw.exe / nwjs.exe in the game folder) and add it.
  4. Ensure both Private and Public network checkboxes are enabled.
  5. If you are using TCP mode, also make sure port 6878 (TCP) is not blocked. You can create an inbound rule in Windows Defender Firewall with Advanced Security for port 6878.

Mac / Linux:

Step 6: Check Your Router Firewall & NAT

Your home router also has a firewall and uses NAT (Network Address Translation) which can block incoming connections.

Step 7: WiFi Hotspot / Mobile Data Issues

Mobile hotspots and cellular networks frequently use Carrier-Grade NAT (CGNAT), which makes direct connections extremely difficult or impossible.

Step 8: VPN Troubleshooting

VPNs can both help and hurt connectivity:

Step 9: Antivirus / Security Software

Step 10: Try TCP Direct Connect

If PeerJS simply will not connect (broker down, WebRTC blocked, strict campus/corporate network), switch to TCP:

  1. On the Host menu, click the "TCP: OFF" button to toggle it to "TCP: ON".
  2. The first time you do this, you will see a warning that TCP exposes your IP address. Acknowledge it.
  3. Wait for the new connection code to generate. Copy and share it with the client.
  4. The client pastes the new code and joins. The client's game should auto-detect the TCP code format.
  5. Remember: TCP mode requires port 6878 to be forwarded on the host's router for internet play (not needed for LAN).

Step 11: Try PeerJS Mode (if you were on TCP)

If TCP is not working for you, switch back to PeerJS:

  1. On the host menu, click "TCP: ON" to toggle it to "TCP: OFF".
  2. A new PeerJS code will be generated. Share it with the client.
  3. PeerJS does not require port forwarding for most users.

Step 12: University / Corporate / Public WiFi Networks

These networks frequently block P2P connections of all kinds. Common restrictions:

Solutions:

Step 13: Reinstall the Mod / Game

Step 14: Ask in the Discord

If you have exhausted all the above steps, join the project Discord and ask for help. Provide the following information:

Known Connection Error Messages & What They Mean

"NOT CONNECTED, Taking longer than expected..."

Appears after 15 seconds of the client lobby being open without a connection. This is a warning, not a failure. The connection may still succeed. If it persists for more than a minute, the connection has likely failed.

"NOT CONNECTED!"

Appears after 25 seconds. The connection has almost certainly failed. The game will automatically open the connection help page. Follow the troubleshooting steps above.

"Please wait for connection to broker"

The host is waiting for the PeerJS broker server to assign an ID. If this message stays for more than 10 seconds, the broker may be unreachable. The mod will automatically switch to TCP after 10 seconds if the broker doesn't respond.

"Error getting ID"

The mod was unable to get an ID from the PeerJS broker. This means the broker is likely down or unreachable. Switch to TCP mode.

"port 6878 was taken, the next free available port was XXXX"

(TCP mode) Another application or a previous instance of the game is already using port 6878. The mod automatically found the next available port. If you are port forwarding, update your router rule to forward the new port number shown.

"UNABLE TO DETECT PUBLIC IP" / "Falling back to Local Private IP"

(TCP mode) The mod tried to detect your public IP address via DNS (OpenDNS) and HTTP (AWS CheckIP), but both failed. This usually means you have no internet connection, or your network blocks those services. The code generated will only work for LAN play (same local network). For internet play, you will need to manually find your public IP (search "what is my IP" in a browser) and share it along with the port to your friend.

"TCP directly reveals your IP — only send this code to trusted friends."

This is a safety warning shown the first time you enable TCP mode. The TCP connection code contains your IP address. Only share it with people you trust.

"Failed to connect to host after multiple attempts"

The client tried to connect to the host 5 times (with 2-second intervals and 5-second timeouts each) and all attempts failed. The host is either unreachable, the code is wrong, or a firewall/NAT is blocking the connection.

Special Connection Scenarios

LAN Play (Same Local Network)

If both players are on the same local network (same WiFi, same house), connections are much easier:

Playing Across the Internet (Different Networks)

Local Co-Op (Two Instances on the Same PC)

See the Local CO-OP section below for instructions on running two instances on one machine.

Reconnecting After a Disconnect

Quick Connection Checklist

# Check Applies To
1PeerJS broker server is onlinePeerJS only
2Connection code is correct and pasted into the right fieldBoth
3Both players are on the same connection mode (PeerJS or TCP)Both
4Pressed Enter (not Z or another game key) to submit the codeBoth
5PC firewall allows Fear & Hunger (Game.exe / nw.exe)Both
6Port 6878 (TCP) is forwarded on host's routerTCP internet play
7Not on a mobile hotspot / CGNAT networkBoth (especially Host)
8VPN tested on/offBoth
9Antivirus firewall is not blocking the gameBoth
10Tried switching who is Host vs ClientBoth
11Game was fully restarted (not just returned to menu)Both

Technical Details (Advanced)

This section is for users who want deeper understanding or are debugging non-standard setups.

PeerJS Configuration

TCP Direct Connect Configuration

Auto-Fallback Behavior

Client Retry Logic

Network Packet Rate


Getting UnStuck

Girl costume Error

Please see this discord thread: https://discord.com/channels/1148766509406093342/1170411865759817888

File Decrypter link

In the readme of the discord server: https://discord.gg/PAUddX5g2x

How do I trade items

use the drop menu, drop an item and let your friend pick it up

How do marriages work

currently marraiges are overworld only, player's get merged and movement combined, in combat they fight seperately as though they both formed marraiges with npcs.

Difficulty

There is an entire tab in the config for scaling of enemies, you can configure most things that you would need for Difficulty. By default this mod increases enemy health by 1.3 1 +.2 number of players. All of this can be configured. IN THE CONFIG MENU ENSURE TO HIT ENTER AFTER EDITING A FIELD.

remove the big "allies" and "viewing" tabs from combat scene

On the first page of the config menu for this mod. just change true to false.

Body blocking

config option on first page of config menu

local CO-OP

Please view install instructions

Misc

All solutions below assume you have the DevTools mod active as it provides tools that will allow you to fix a lot. I cannot connect, ensure that you are copying the correct code, ensure you are copying the code into the connection-key field and not the username field. Make sure you are copying just the code itself and nothing else, ensure the host has sent you the current code. I pressed 'N' and I got an error: N is a debug keybind that is sometimes useful for fixing major bugs, it tries to teleport you to another player in the server. Just try not to press it for the time being. I pressed Other key and something bad happened, you probably pressed something that is a keybind for something, open your keybinds and unbind it or just don't click it. some tiles are moving around the map when they shouldn't be. This occurs sometimes and most of the time is purely cosmetic, I know how to fix it, it is just more effort than I want to spend on a visual bug I am on a different vairant of the map than a friend. you can try to press 'n' to teleport to the correct variant, and the vars taht control variant should sync eventually, for avoiding this in the future, just make sure the host loads into the game before anyone starts exploring the dungeons I am stuck in an event and cannot move, try to press 'n' or 'v' if either of those free you great, if not try to have another player run around you, stepping on traps or action tiles, if taht doesn't work you will need to restart, and then please file a bug report of where this occured There are multiple copies of an npc or an event is playing when another player triggered it IE: friend triggers legard event and it plays for both of you, just file a bug report of where it occurs I cannot see another player, shouldn't occur much, but hitting escape will reload you onto all other players screens so if you can't see someone ask them to open and close the menu Coin flip is stuck on my screen, press 'v' for phase step or reload the area and it will go away talk option for a player poped up in a menu: should not occur anymore, if you see this please tell me where it occured. "I am stuck somewhere and cannot move." Open your keybinds and bind "tp to spawn" to a key, then press that key, you should be teleported to the fortress spawn area, this might resolve you being stuck.