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"

Multicast not running on client

I'm having some issues with some networking code currently.

Here is the code that is running: http://screenpresso.com/=6jnCg

And here is the resulting output: http://screenpresso.com/=rHZ5f

You can see from the prints that the multicast event is being called from the server, but then after the multicast still is only running on server. I have used a similar setup a few other places in my project and it works fine, I'm not sure why this one is different. Are there other things that affect whether a multicast event will be executed on clients?

Product Version: Not Selected
Tags:
more ▼

asked Oct 14 '14 at 03:15 AM in Blueprint Scripting

avatar image

Hennez
202 16 15 27

avatar image Ben Halliday STAFF Oct 15 '14 at 08:25 PM

Hey Hennez,

I wasn't able to reproduce this behavior. Are you able to reproduce this in a new project, or does it only happen in your current project? If you can reproduce in a new project, please provide some exact steps for me here and I will attempt to find the source of the problem here. Thanks!

avatar image Hennez Oct 16 '14 at 12:22 PM

I did actually manage to produce it in a bare bones project.

It has 2 classes:

TestObject - http://screenpresso.com/=sjIsc

MyCharacter - http://screenpresso.com/=9ta9c

The result is that the server (and ONLY the server) will print 'Should Print This On All'.

Not sure if this is me misunderstanding the networking, or if it's a bug, would love to know which!

avatar image Ben Halliday STAFF Oct 16 '14 at 09:39 PM

Okay, I tried this in a new Third Person template project with the BPs set up as you described. When I started PIE (with Number of Clients set to 3) and pressed LMB in any window (client or server), it printed Server: "Should Print This On All", meaning the Server printed the string to all Clients. Is that what you are getting, and do you expect something else?

I think what you're running into is that you have two Events that you're setting replication on, and how you have each set effects the other in the chain. So when you click LMB on any client or server, with the OnServerLeftMousePressed set to Run on Server, the MyCharacter BP is telling only the Server to run the MulticastPrintTest function, which is then replicated to all clients.

avatar image Hennez Oct 16 '14 at 10:52 PM

Yes that's what I was getting, and I was expecting each client to print it themselves. It looks like my understanding of the multicast may be wrong.

I essentially expected that if a multicast event was run by the server, it would force each client to run that code itself, thus each client would print the string.

The way it is currently, if the event in 'TestObject' is set to 'no replication' or 'multicast' it doesn't change the outcome at all.

Translating the test to an actual project, the train of logic is: 'Server determines event occurs, tells clients to spawn their own particles'. My understanding was to use a multicast there, which would allow the server to force all the clients to spawn their own particles, at current they only appear on the server (as the print does in this example).

avatar image Hennez Oct 16 '14 at 10:55 PM

Note if you shift the multicast from the object to the character itself, it behaves as I expected. So this logic here: http://screenpresso.com/=ug0Zf

Prints 'Does actually print on all' from each client on every screen. I'm unsure why that doesn't occur when you call it on another object.

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

1 answer: sort voted first

Hi Hennez,

I apologize for the delay in responding, this post got lost in my stack somehow.

I think the problem you're running into is that your TestObject isn't set to replicate, so it only exists on the server. Go to the Blueprint's Defaults tab and enable Replicates. When you run it this way, the server and then each client should print "Should Print This On All." Let me know if that doesn't work and we'll take another look.

more ▼

answered Nov 01 '14 at 07:57 PM

(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