4.11 P4 Spawned Actors not Replicating

For some reason, I haven’t found this issue by searching for it, so I’m hoping it is just me.

To put it simply, if I place an actor in a level it will show up on clients, but, if spawned, nothing I do will get it to spawn/replicate. I’m testing with an ultra basic Pawn class.

I’ve set “Replicates”, “Net Load on Client”, and “Replicates Movement” (defaults), but nothing I Spawn on Server ends up on my clients.

77045-2016-02-02+12_35_48-dc_pawn_base.png

As a side note, same is happening for variables, as they refuse to replicate even on actors placed directly in level. I’ve tested this by setting an Int to replicate on same Pawn and I increment Int on server (works on server), but variable never changes on actor on clients.

As another side note, I’m getting a GameMode on server and all clients, which documentation says should only exist on Server.

I’m really hoping this is something that can be fixed, because I simply can’t make a network multiplayer game at this point.

Hi ,

GameMode should only exist on Server. How are you determining it’s on Client?

Can you give me some step-by-step instructions to reproduce issue in a new project? I’m not seeing this behavior, but maybe I’m setting it up differently. Use images of your BP setup when appropriate. If it’s easier, you can send me a link to a test project, as I asked with other issue you posted.

Thanks!

Alright. I posted this one in addition to other issue because I had done more testing. I’m not 100% sure everything in my first post is accurate, but I do know some of it is really weird.

One thing I haven’t tried yet is to run my project on another machine, so I may do that later, which is what it appears you might also want to do.

I will attempt to get a link shortly for project itself, but in meantime I’ll show how I’m seeing multiple game modes:

77051-2016-02-02+13_52_21-dc_gamemode.png

77052-2016-02-02+13_52_31-dc_gamemode.png

In addition to those Debug filters, I can set breakpoints and they show up on both client and server, both with Authority, but only server version knows it is server. (IsServer returns true on one, but not other)

Here is compressed project - running UE4 on Windows 8.1 and package is 7zip

DC.7z

Should be just under 15MiB.

Also, I tend to be shy, so I might not respond super quickly every time, but I will try really hard for this. Hopefully I can help you guys out with some use cases. For some reason, I often end up breaking things in ways never before seen.

Small update - I decided to run a Verify on 4.11 P4 Engine. It downloaded a few MB and wants to run UE4 Prerequisites (x64). Not sure if that means anything or not. I said yes, and it backed up a few files (looks like a few map files [Entry.umap] and [Template_Default.umap] )

I’m really starting to worry that issue is with my install of engine. Not sure why that is, though.

Edit: Forgot to add that it didn’t change anything.

Well, good news is that I can see this behavior in project you sent me, and if I can see it then it’s probably not an installation problem (since it’s running same on my engine installation). I also see two instances of GameMode, and IsAuthority check seems to be failing for pawn you dropped into level. None of this occurs in a new project that I set up to test.

I have some more things to check and I’ll let you know what I find. Let me know if you think of anything else that you might have done to reproduce this. Thanks!

Out of curiosity, does same thing occur for you in a 4.10.2 project, if you set up a project same way?

Okay, so I’ve definitely narrowed it down to that Game Mode. I tried recreating it and replacing references, and a new Game Mode doesn’t reproduce problem. Can you do same, and if it still occurs, give me step by step instructions for how you created Game Mode? I might be missing a step somewhere. Thanks!

So far, I can say same thing occurs in 4.10.2 for me (different project, not a copy or anything).

I’ll create a new project, and document in more detail exactly what I’m going, but that GameMode I’m using right now is ultra basic. I have a few thoughts on why it might be happening, but I’ll have to test and get back later today.

I will have to post my response via file, as I’m 9000 characters over limit. I’m sure this will be enlightening. Sorry for verbosity.

Link to current project setup to follow.
DC2.7z

Please give it 15 minutes or so, my internet connection is caca.

Detailed Rundown

Follow up on further testing:

Everything seems to be ok as long as I disable “Component Replicates” on both Actor Components. That’s DC_5x5, and DC_Node.

Looks to me like there is some broken replication going on with Actor Components, maybe?

I just had a thought to try Scene Components instead. If that works, perhaps I’m misusing Actor Components?

*** Tested Scene Components and same result ***

Come to think of it, though, I might only really need an array of structs for what I’m trying to do at this point. Now I feel a bit stupid, but hopefully I’ve found a bug that can be fixed for later.

I find it strange that scene and actor components wouldn’t be allowed to replicate, though.

Thanks for thorough investigation! Definitely helped narrow this down!

So, first thing, I saw same problem with timers not stopping on Server when pausing simulation with players set higher than 1. I was able to reproduce that in a new project: looks like Client pauses just fine, but for some reason Server does not. This doesn’t appear to affect actually pausing a game in a packaged game, but is rather simply an editor bug. I’ve created a report for that (UE-26471) and I’ll post here when I see any update on it.

Second, reason you’re seeing a second GameMode and a new Player Controller is because Client is being disconnected from Server, thus sending it to its own game (thus a new GameMode and PC). GameInstance should be only thing remains when Client is disconnected (maybe GameState as well). This would also explain any replication issues after this point: nothing is replicated because connection doesn’t exist.

What’s causing disconnect appears to be Component Replicates setting on your Actor Components. As you mentioned, disabling those stops this problem. I’m guessing this is because it’s actually being set twice: in component’s defaults, and again once when you spawn component. I’m going to test that scenario in a new project and get back to you with results.

As an update, I was able to reproduce disconnect by Adding an Actor Component that is set to Replicate to an Actor that is also set to Replicate. It’s really as simple as that, which is probably what caused all other issues you faced.

I’ve entered a bug report for that as well (UE-27454) because it happens in 4.11 Preview and earlier versions, however I can say that it is already fixed in our internal build and should at very least make it into 4.12. I entered bug in hopes that developers would be able to identify change that fixed this issue and bring it to 4.11 branch before release, but I can’t guarantee that’s possible.

Thanks again for thorough investigation, it was very helpful in nailing down these two problems. Someone will post here when we see any updates on either.

Glad to see this post I was have same problem. My project casts a weapon to character which is set to replicate for its future animations and effects as well.

Bout to turn off replication to see if it suddenly in breaks simple initialize health text Etc I followed from one of your tutorials on ue4 .