# Replication or Loading Problem?

**URL:** <https://forums.unrealengine.com/t/replication-or-loading-problem/1701379>\
**Category:** Multiplayer & Networking\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [February 20, 2024, 7:22am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379 "2024-02-20T07:22:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 20, 2024, 7:22am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/1 "2024-02-20T07:22:31Z")

</div>

Someone know what this problem is?

I have an actor placed in world.  
The actor spawn a Niagara System loop.  
When the map is loaded only the host can see the first loop.  
Clientes can see the second loop too.

Watch video:

This is the actor code:

 ![Captura de pantalla 2024-02-20 070452](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/6/a96df20675f4872ca1161461c77953bbc08dc506.png)

This is the project files:

[Project.zip](https://forums.unrealengine.com/uploads/short-url/eJoTeM9Tvkcp7XAfq2mSBMKFWJI.zip) (535.9 KB)

The actor BP and the Niagara System are in this folder…

 ![Captura de pantalla 2024-02-20 070813](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/a/6ba00c3f68a7a14fd8ff65fcb2f38cc28335b88a.png)

What the problem is?  
How can i fix it?

Thank you so much!!

* * *

This man says about to use multithreads to wait for levels loaded (min 7:15) (FAsyncTask)

He says that when the level is loaded you receive a notification.  
Is this the solution?  
Can someone provide an example of this please? (C++ or BluePrint, everything is fine for me)

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/0/710a716e9530f4c976e13820ca4a01e8abdfdc76.jpeg "Async Loading Screens and Transition Levels | Unreal Fest Europe 2019 | Unreal Engine") ](https://www.youtube.com/watch?v=ON1_dEHoNDg)

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [February 21, 2024, 8:27pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/2 "2024-02-21T20:27:31Z")

</div>

Your First instance is only playing on the server by your design.

Should be…  
Begin play → Switch has Authority [Auth]: MulticastSpawn → Server Respawn

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 22, 2024, 5:10am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/3 "2024-02-22T05:10:41Z")

</div>

Do you mean like this?

 ![Captura de pantalla 2024-02-22 045840](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/a/8/ba8ad10688acc41eae00489f44a13321bf95f385.png)

Like this it does not work neither…  
In this case i have exactly the same problem.

Thank you so much for your help ♥

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [February 22, 2024, 7:49am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/4 "2024-02-22T07:49:11Z")

</div>

If the clients aren’t seeing the first spawning, then they aren’t loaded enough to receive and process it. After the Switch has authority add a 2 second delay.

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 22, 2024, 12:42pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/5 "2024-02-22T12:42:27Z")

</div>

Ok, the delay does work “In my computer”!!

But… It is going to work in a real scenery?  
I mean… the loading time could be different depending of the kind of CPU, RAM, SSD, bandwidth…  
So it may be that a client takes more than two seconds to load.

How can I handle this situation?  
I mean, is there a way to synchronize the start of the game when all the client machines have loaded the map?

Thank you so much!! ♥

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [February 22, 2024, 1:54pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/6 "2024-02-22T13:54:05Z")

</div>

given its a niagara effect, does it even need to be in sync with server? if not you could just run it on beginplay (ie not authority only)

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 22, 2024, 5:22pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/7 "2024-02-22T17:22:39Z")

</div>

I understand what you mean.  
In some cases that is the best solution (do not replicate it).  
But in this specific case I am interested in all clients seeing exactly the same as the server.  
It is not a cosmetic particle system. It does critical things for the game.

Furthermore, I think it is an excellent example that shows very well the problem of loading maps and synchronizing players.

I want to learn to handle it correctly. I think it is something very basic and fundamental in a multiplayer game.

Thank you so much for your help!! ♥

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [February 22, 2024, 7:19pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/8 "2024-02-22T19:19:02Z")

</div>

Depending on the game complexity and the map size, clients can take well up to a minute to load a level on connect.

I’d use the game mode and a client polling setup.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [February 23, 2024, 3:39am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/9 "2024-02-23T03:39:06Z")

</div>

this thing is, itll never be truely in sync with the server, even if you start them at the same time the multicast will take a delay to execute, ie lag.

otherwise, have the client tell the server its loaded in an RPC then when all clients are loaded send the multicast

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [February 23, 2024, 6:16am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/10 "2024-02-23T06:16:24Z")

</div>

> [@Auran131](#):
>
> otherwise, have the client tell the server its loaded in an RPC then when all clients are loaded send the multicast

Hence the polling recommendation. Even then you still won’t get proper sync. Servers will always be ahead of clients. Clients ping differences will always desync client to client views of the game world.

Furthermore, FX shouldn’t be played on the server. It’s a waste. They don’t render anything, nor play audio.

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 23, 2024, 7:07am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/11 "2024-02-23T07:07:25Z")

</div>

Thank you very much for your answers @Rev0verDrive and @Auran131  
I guess the problem now is knowing when the clients have finished loading.  
(Knowing how to do the client polling setup).

You are right, in the case of a dedicated server the FX does not need to run on the server. But if the host is a player then it is necessary.

The problem seems to be more complex than I thought.

Any information on how to do the client polling setup is welcome.

Thank you so much!! ♥

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [February 23, 2024, 11:41am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/12 "2024-02-23T11:41:56Z")

</div>

just use begin play on remote

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 23, 2024, 7:01pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/13 "2024-02-23T19:01:45Z")

</div>

Something like this? This seems to work…  
However, I’m not sure if it works because of the timer or if this is really the way to do it.  
I would like to do it without the timer but I do not know how.

Game Mode:

 ![Captura de pantalla 2024-02-23 185200](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/f/7ef98e1633e0d3bdf0b26938043eb28c9b352642.png)

Player Controller:

 ![Captura de pantalla 2024-02-23 185250](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/3/aa3ef2995bcf1c3f62db30ed89c7ca69f6844afb.png)

Actor/Niagara:

 ![Captura de pantalla 2024-02-23 185331](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/0/b/60bde0315deaa62254834e51fa21de6c1cf38ba8.png)

Thank you so much!!

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [February 24, 2024, 4:20am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/14 "2024-02-24T04:20:38Z")

</div>

you could set the expected number of players in the game instance. you’d likely know this before you load a map/gamemode. obviously your timer will fail if they take longer than 3 seconds.

other than that if it works it works 🙂

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 24, 2024, 2:44pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/15 "2024-02-24T14:44:00Z")

</div>

Thanks a lot for your help @Auran131  
And @Rev0verDrive thanks a lot for your help too.  
Without the help of you two I would be very lost in this matter.  
I would like to accept all your answers as a single solution.  
This is a dilemma!! 🙃

Maybe a moderator reads this and knows what to do in these cases.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [February 24, 2024, 8:01pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/16 "2024-02-24T20:01:12Z")

</div>

This isn’t telling the GM that the player has loaded their world (map). It’s just counting connections.

When we connect to a server it creates a controller. The GM then spawns the pawn assigned in the settings then the possesses it with the control. The pawn is then replicated. At the same time we are getting world information and starting to load the map on our end. Reality here is the pawn will load and start falling before the map is ever ready. This isn’t an issue on simple content example maps, but full production ones it is.

What’s needed is a way to have the pawn notify the GM when the level is loaded on their end. The way I do this is with a barebones pawn class set as the default in the GM settings. When it determines the level is loaded it calls it RPC’s the server controller which calls the GM to swap out the loading pawn to the actual character.

The swap point is where you’d want to do the counting.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [February 24, 2024, 8:45pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/17 "2024-02-24T20:45:44Z")

</div>

My Loading Pawn process.

Game mode Classes… Note the Default Pawn  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/4/124cb0e59938b8307393d03bfbc9f3faa6815993.png)

BP\_LoadingPawn is the base Pawn class. No input, no mesh, no movement.

For simplicity the code shown does a simple delay then calls the controller event. In production you’d have code to determine if your level was sufficiently loaded in order to spawn the main character without it falling through the map.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/9/ff9662af7ce1f9f44a9564983cf308dfec604d23.png)

**Controller class event:**

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/8/9281adf3d9dac78851665b9e868c295ed3f9d394.png)

**Game Mode**

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/3/f936254c3f7850df37d4be5d57ccd3c748503309.png)

Replace Loading pawn w/main character class

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/9/6/3962e8129fe59d5a233e818b3e911edc5111c67c.png)

* * *

For clarity I should note that most production levels have a 15 to 30s+ loading time. Sometimes its drastically longer, but that depends on the clients hardware and the overall performance of the level.

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 25, 2024, 11:00am UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/18 "2024-02-25T11:00:10Z")

</div>

I have tried it and the simulation works.  
I just need to know how to do exactly this step for a real context.

 ![Captura de pantalla 2024-02-25 103129](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/8/e/58eda824421be45ce6dd631f0018169e6d711277.png)

I tried this but it doesn’t work (the loop is infinite)…

 ![Captura de pantalla 2024-02-25 113932](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/4/2f4348dbb5b7e5d3745456b8843ca273f7d14302.png)

The Level Display Name is “Persistent Level” when it should be “First Person Map”… I don’t know why it’s pointing to the wrong map.

![Captura de pantalla 2024-02-25 125256](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/8/7a886919b6a6d19da18a5e929f68fcccdec7dad4.png)

I am looking for information about it.  
But any example about this is welcome.

Thank you very much for your help and your time @Rev0verDrive !! ❤

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [February 25, 2024, 8:22pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/19 "2024-02-25T20:22:00Z")

</div>

I prefer checking for the existence of specific large actors inside a radius of the player. I also do line traces downward checking for ground underneath the player.

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 25, 2024, 9:40pm UTC](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379/20 "2024-02-25T21:40:52Z")

</div>

i will do as you say.

I was all day looking for the reason why the “is loaded” function is failing.  
i found nothing.  
Then it must be bugged.

Thank you so much @Rev0verDrive !! ❤

[Next page](https://forums.unrealengine.com/t/replication-or-loading-problem/1701379.md?page=2)
