x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Blueprint Components & Replication

  1. preview 7. Created a blueprint (actor) component with various variables, all are set to replicated, also the component itself. Added component to Playercontroller, called an event in the component (Run on Server) which sets some variables to their correct values. During that processing i call a multicast event for spawning some effects which rely on some of the variables being replicated; These still are set to none, while having the correct value on the server.

If, instead of setting the variable and letting it replicate, a multicast event with one var as param is called, which is then used to set the variable on all clients, everything works correctly.

Update: here a simplified setup in the screenshot for the server and the multicast function (multicast set to reliable since it wont do otherwise).

alt text

When i call Server_Execute from my PlayerController i then get the following Output: Server: true Client1: false Client2: false

Cheers, Indy

Product Version: Not Selected
Tags:
bug1.png (236.6 kB)
more ▼

asked Feb 15 '15 at 12:23 AM in Bug Reports

avatar image

indygoof
830 26 15 41

avatar image Rudy Q ♦♦ STAFF Feb 16 '15 at 04:46 PM

Hello indygoof,

I was unable to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Could you show the blueprint that is firing off the Server_Execute custom event node?

  2. Can you reproduce this in a clean project?

  3. The screen shots are very helpful, however if you can reproduce this in a clean project, could you provide a detail list of steps to reproduce this on our end?

avatar image indygoof Feb 16 '15 at 08:07 PM

Hi Rudy,

even better, i attached a sample project consisting of:

  1. A custom GameMode (to have a custom playercharacter and controller)

  2. the BP_Testcomponent with the 2 calls and a replicated var in there

  3. a BP_Controller which calls the Server function inside the component on Left mouse click

  4. a BP_Character which calls the Server function inside the component on Right mouse click

So if you open the project and click on play (at least 2 players) you should see with a left - or right - mouseclick the messages Server: true Client1: false

So the variable is not replicating (as it has the value "true" on the server and "false" on the client(s)).

Cheers, Indy link text

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hello indygoof,

I was able to reproduce this issue with the project provided. I have written up a report (UE-10013) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your information and time.

Make it a great day

more ▼

answered Feb 18 '15 at 02:18 PM

avatar image

Rudy Q ♦♦ STAFF
47.2k 545 132 525

avatar image ElliotB Apr 05 '15 at 06:00 PM

Hi Rudy,

Is this still broken/can we have an update? I'm still observing that blueprint replication of variables does not work. This is almost two months since this question was first asked, and its a pretty serious bug (for example, I have a multiplayer blueprint driven game that is currently completely broken by this replicating issue). Is the bug fixed on the c++ source? When can we expect a fix on the engine downloaded/compiled by the launcher?

Many thanks, Elliot

avatar image Rudy Q ♦♦ STAFF Apr 06 '15 at 01:13 PM

Hello ElliotB,

I went ahead and double checked the status of this issue. However, the status has not be changed to fixed as of yet. This issue is on the developers to do list and I will be sure to bump the community interest for this issue.

avatar image ElliotB Apr 06 '15 at 06:24 PM

Thanks for the update Rudy! Is there something like a trello/ticket we can view for this issue incase we find anything else to add?

avatar image lugit Apr 08 '15 at 05:16 PM

Facing the same problem. Quite annoying as i use a modular design, based on scene components - project is currently on HALT because of that

avatar image Rudy Q ♦♦ STAFF Apr 08 '15 at 06:10 PM

Hello lugit,

I went ahead and double checked the status of this issue. However, the status has not be changed to fixed as of yet. This issue is on the developers to do list and I will be sure to bump the community interest for this issue.

avatar image ElliotB Apr 13 '15 at 08:15 PM

Any update? Like Lugit I have a modular design based on scene components and cannot make progress because of this flaw.

I have to say I am suprised this issue has not been fixed faster. Am I using a branch that is considered 'unstable'? I have serious concerns about using ue4 in future projects given that such a core functionality can be so badly broken and remain that way for such a long time.

avatar image Rudy Q ♦♦ STAFF Apr 13 '15 at 08:57 PM

Hello ElliotB,

There is not a definite time frame in place for this issue at this time. The status has not be changed to fixed as of yet. I would suggest looking through the next set of release notes for the jira number (UE-10013) that was provided above.

avatar image mpie Apr 14 '15 at 04:46 PM

Hey,

this PR should fix the issue: https://github.com/EpicGames/UnrealEngine/pull/1052

@ElliotB There is also a solution that does not require modifying the engine source code. Did you have a look at the answer I posted?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The issue is, that ActorComponent::GetLifetimeReplicatedProps does not include the variables generated in the blueprint. A workaround is to subclass ActorComponent with a component (NetworkActorComponent) that does include those variables. You can then reparent your class to the new component.

I only made a small test, so I don't know if this works for you, but I hope it helps.

NetworkActorComponent.h

 #pragma once
 
 #include "NetworkActorComponent.generated.h"
 
 UCLASS(Blueprintable, BlueprintType, meta = (BlueprintSpawnableComponent), Abstract)
 class [PROJECT_API] UNetworkActorComponent : public UActorComponent
 {
     GENERATED_BODY()
 
     virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
 };

NetworkActorComponent.cpp

 #include "[ProjectPCH].h"
 #include "NetworkActorComponent.h"
 
 // This function is copied from ActorReplication.GetLifetimeBlueprintReplicationList, only the class of the first parameter changed
 // The first parameter may event not be needed
 static void GetLifetimeBlueprintActorComponentReplicationList(const UActorComponent* ThisActorComponent, const UBlueprintGeneratedClass* MyClass, TArray< FLifetimeProperty > & OutLifetimeProps)
 {
     if (MyClass == NULL)
     {
         return;
     }
     uint32 PropertiesLeft = MyClass->NumReplicatedProperties;
 
     for (TFieldIterator<UProperty> It(MyClass, EFieldIteratorFlags::ExcludeSuper); It && PropertiesLeft > 0; ++It)
     {
         UProperty * Prop = *It;
         if (Prop != NULL && Prop->GetPropertyFlags() & CPF_Net)
         {
             PropertiesLeft--;
             OutLifetimeProps.Add(FLifetimeProperty(Prop->RepIndex));
         }
     }
 
     return GetLifetimeBlueprintActorComponentReplicationList(ThisActorComponent, Cast< UBlueprintGeneratedClass >(MyClass->GetSuperStruct()), OutLifetimeProps);
 }
 
 void UNetworkActorComponent::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
 {
     Super::GetLifetimeReplicatedProps(OutLifetimeProps);
     GetLifetimeBlueprintActorComponentReplicationList(this, Cast< UBlueprintGeneratedClass >(GetClass()), OutLifetimeProps);
 }
 
more ▼

answered Apr 12 '15 at 08:22 PM

avatar image

mpie
211 9 3 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question