So I’ve been in the making of a project of mine for a bit now, and I’ve been making it and testing it with the dedicated server box checked as I thought using listen servers would be the same, but in the last days, I’ve been testing with listen servers and noticed it wasn’t the case. I thought using listen servers would result in every players being a client, with one running the server on their machine, but apparently it’s not the case and the player hosting the server plays as the server.
This lead me to a few questions, first being, is there really no workaround for this ? I mean, is there a way to have all the players act like clients while one of them host it ? I thought about having one player hosting a dedicated server, but I haven’t looked enough to know if it is a suitable option for my skill.
And what does the option “?listen” do then ?
A listen server is like you discovered one process acting as a host for the other clients while also playing the game as a client itself.
Coding for a dedicated server is easier since you never have to worry about splitting the server and client code up however if you plan ahead and make your logic work for a listen server it should also work on a dedicated server.
The way you split “serving other clients than yourself” (server) logic from “serving your own client” (Owner) logic is to use the IsLocallyControlled function on Pawns/Characters.
If you don’t plan on ever releasing a dedicated server you should avoid it altogether as it complicates the development and testing workflow since you have to build and test two individual programs instead of just one already bundled together. The listen server also runs both server and client in one process so it will also use less Memory and CPU.