Launch Character in Network Replicated - Urgent

I’m trying to use the “Launch Character” node. It works great on the “Character” on the server. However, in the “Character” of the Client he stays in the same place only with the animation of falling. It is as if there is a conflict between what the server wants to do and the client. I’ve tried using “Custom Event”, but to no avail.

This was supposed to be a simple thing to solve, but I don’t know why it doesn’t work.

Following is an image of the Event Graph. Here’s a video showing what happens.

https://1drv.ms/v/s!As0dFy-5zTrIgY4VMoFbLlhBs5cTEA?e=uTcm5I

Sincerely, HighRender.

It looks like your multicast event is actually running on the client instead of doing a net multicast. If you select the multicast option instead of the owning client option in the custom events replication settings it should work.

Hi F_Innovations,

I made the changes you mentioned, but the problem persists.
I looked everywhere and so far I haven’t found a solution.

Could you replicate that and send an image to see if I can make it work?

Waiting for an answer.

Sincerely, HighRender.

Can you send me a screenshot? I’m about to go to bed but I’ll make a template and send you the screenshots when I’m up.

Yes.

I sent a Screenshot with the last change you asked for. I removed the variable I had before to be able to see the value I’m using in the “Launch Character”.

This is connected to the “Event Tick”.
The editor is 4.17.

I appreciate the help.

I await your reply.

Sincerely, HighRender.

I can’t test it (running a long packaging process right now), but I wanted to get this to you since it might be a few hours until I can get back to you.

This is how I’d do it. The remote can’t run a multicast event. It has to go through the server first so it’s best to wrap your implementation up as I did here to remove unnecessary overhead.

The internal launch function just cleans up the code a bit, you can just copy and paste if you want to as well.

If it doesn’t work, I’ll play around with it a bit to see what’s wrong. I hope this helps!

I did what you told me.

I copied exactly what is in the image. Does it work for you?

Nothing changed again. The same thing happens with the video.

I just don’t understand why it doesn’t work. Can you help me find a solution before 06/20/2020?

Sincerely, HighRender.

Thas odd. I just tested it and it’s working. The only thing I added was a space bar event to call the function. How are you calling it? Can you send me a screenshot of the full process? Also make sure you’ve ticked the replicates and replicate movement flags.

Edit: I also should add that the events are unreliable, meaning that the reliable flag is left as false. I dont think that should make a huge difference but the only thing I can think of is lag maybe? I didnt set up a player controller and I’m just dropping the players in using the standard setup.

How are you connecting your players to the game? I doubt it’s the issue, but maybe theres an issue with the owning connection?

I created another project, but the same thing happened.

However, I am now using another computer. I did exactly like the other. I created another project and put the same nodes. But in the end, the result was practically the same. Only with the difference that now the two characters are on the ground, only with the animation of falling.

See what I did on that computer.

I set to open different windows and used the Game Mode Base. I put two “Player Start” on the Map. The two Player Start in the option “Auto Receive Input” I put “Player 0”. In the tab that opens next to “Play” I put “Number of Players: 2”.
In the character’s blueprint, “Replicates” is marked as true. And “Replicate Movement” is also true.

Sincerely, HighRender.

I did it both ways. The mode you set up also creates the difference in speed between the Server and the client.

Yes, “Custom Events” are set to “Reliable”.

I did one more test and put a “Delay” in the “Event Tick” before the “Switch Has Authority” node. The Delay I set is 0.053 seconds. And now the opposite happens, the Server goes up first, but a few seconds later, the Character of the “Client” changes speed quickly and reaches and goes ahead of the character of the Server. What irony is not? Did we find any error?

Sincerely, HighRender.

I returned!

I discovered the problem. Never that we were going to find out.

I redid what you told me. But I put the value in “Launch Velocity” instead of 20, I put 100. And it worked normally. There is only a difference in speed between them.

I tested it the way I had done it before and it also worked. :slight_smile:
Really, I had done it right when I created the Post. Just like you. Either way it works. The exact same thing happens.

Final conclusion I reached:
The 20 value that I had chosen for the Launch Character Z is not enough to make the character go up. However, I don’t know why, there is a difference between the speeds of the Server and the Client using the “Launch Character” node. Perhaps it is because he repeats the command twice on the server. For this reason, one of the characters in the video went up and the other did not. The Client did not have the necessary amount to go up. As the Server gains twice the “Velocity”, it went up. At least that’s what I think happens, kkkkkkkkkkkk.

New Issue:
How to adjust the speed difference? The Character that simulates the Server is faster. And both have the same Velocity value. And now?

Sincerely, HighRender.

Awesome! I was pretty confused that you had the issue too lol but I should have caught it either way. I’m not quite sure how to resolve that issue. I didnt notice any difference when I was testing. Did you try it the way I set it up? I usually do that to avoid duplicate calls which could be the issue like you said. It could also be something unrelated causing some latency. Are your events reliable? If you have a lot of rpcs firing off at the same time it can cause some weird issues. You could also try playing with the network smoothing modes but I’m pretty sure character handles that already. I’ll try and reproduce it later. My build had some issues so I have to figure those out before I can use my computer again.

I’d try setting them to unreliable. Without knowing more about the project I can say what’s causing the issue. It seems like there is a lot happening across the network that is creating the lag. AFAIK setting the functions to reliable will make unreal hang the main thread until the function finishes execution. If you look at the c++ for character movement, none of it is reliable mainly to avoid this issue. You will still have times where things dont happen immediately, but that is the nature of networking. You are sending a request up to the server and waiting for it to come back down to the client so you have to assume that there will be some delay. You can get around this by doing client side prediction, but that will only for work the local client. You can try calling launch character before all of the rpcs kick off to mitigate the issue but you’ll still have lag

Thanks for the tips.

I would like to comment on a few things.

On the two computers that I tested with the standard third-person design, exactly the same thing happens. I used two characters on the map, one controlled by the Server and the other by the Client, that is, to test Network Replication. Things happen normally, without any delay of the command call, that is, the character 2 that is the Client makes the command work and he is in perfect sync with his other version on the server. I’m going to create a video and I’m going to show you in more detail what’s going on right now.

The Server Character is faster than the Client character. Here I’m talking about different characters. Player 1 on the server and Player 2 on the Client.

Sincerely, HighRender.

I recorded a video of my screen showing what happens. I also showed the Event Graph.

Two different characters. The server controls one and the Client controls the other.

I hope this video helps you to visualize the current problem.

https://1drv.ms/v/s!As0dFy-5zTrIgY4Zwj26v9TtCY5XMA?e=F4iiXZ

Sincerely, HighRender.

I honestly cant say what the issue is. I see that your functions are still reliable so that could cause an issue though I doubt it’s the real problem. There might be a delay from the client when it connects to the server too. It kinda just looks like the function starts on the server first since the server was the first one in the level. I really cant say what the issue is though.

Thanks for the help. The only way that made it work without a difference in speed, but not exactly what I wanted was to activate the “ZOverride” option in the “Launch Character”. It only gets bad that the speed is continuous, that is, it does not change, but it already serves what I want.

I appreciate the help.

Sincerely, HighRender.