Announcement

Collapse
No announcement yet.

Clients on Listen Server Sometimes Not Spawning Correctly (More Clients Makes It Occur More Often)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Clients on Listen Server Sometimes Not Spawning Correctly (More Clients Makes It Occur More Often)

    Hello, everyone!

    I am not allowed to post and code based on the nature of where I work, but I have a bunch of threads that I would like to be put together, if someone could help me out!

    I work on a multiplayer simulation that needs to support up to six players (one server, five clients). We have it working about 80% of the time with no issues. On the other 20% of the time one (or more) of the clients will fail to spawn in the correct spot, without a PlayerState, Pawn, and often without a PlayerController. I've tracked this bug down to the Spectator class within Unreal's engine code. For some reason, the game thinks they are still spectators and spawns them without any of their filled out information. I can't quite tell if the Spectator class or the null data is the cause here, but it definitely occurs more often when more clients are in play. I used some ideas I had as well as what I saw on other forum posts to try to come up with a solution. I haven't seen this in several attempts now, but I was wondering if anyone had a sure way of stopping this bug from happening or more indication of what was going on. It appears to be some sort of race condition. When it occurs, the players will be able to look around, but not move or use other actions that require the Pawn or PlayerState. Any help is appreciated, and I will gladly give you more information if it helps. Thank you.

    Here are some links to other forum posts that were never properly resolved regarding the same issue!
    https://answers.unrealengine.com/que...rameter-a.html
    https://answers.unrealengine.com/que...ml?sort=oldest

    #2
    We experienced a bunch of issues while attempting to support Listen Servers.
    In the end, we decided to drop support for them, which, coincidentally, so did the Steam wrapper plugin we were using (Uworks).

    Have you considered getting the "host" client to create a dedicated server process in the background that other clients could then connect to?

    Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

    Comment


      #3
      Originally posted by Kris View Post
      We experienced a bunch of issues while attempting to support Listen Servers.
      In the end, we decided to drop support for them, which, coincidentally, so did the Steam wrapper plugin we were using (Uworks).

      Have you considered getting the "host" client to create a dedicated server process in the background that other clients could then connect to?
      I honestly did not think of that, Kris! That sounds promising, is that what you ended up doing?

      Comment


        #4
        I wanted to update this post after doing more research. Turning this into a dedicated server was not an accepted proposal, so I continue to investigate. I found out that this bug only occurs if the Server and Client are loading in at the same time. Loading the Server in first and letting the Clients join after will result in a 100% success rate. Is this a limitation of Listen servers in Unreal, or is this a problem with our code?

        Comment


          #5
          If you have any reliance on something existing on a client before it can do something else, then yes, it could be a simple timing issue.

          e.g. Need to access a value from the game state, but it hasn't reached the client yet.
          Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

          Comment


            #6
            It seems as though those values are never valid after they fail if the Clients load into the level before the Server (we travel from the Lobby to the map we need). I made sure that all the players that are in the process of joining or we expect to join (depending on the type of session it is) are there before continuing and it worked. It looks like what I was investigating were symptoms of the actual issue. Thanks for your help, Kris!

            Comment

            Working...
            X