I’ve made simple character selection level and change some stuff like clothes and pants mesh and when it’s done open level which is running on server, when player joins it multicast it’s changed meshes and see own changes, ok working. But when another player joins it can see own changes but cannot see previously joined players change. I did all the run on server and multicast events on set skeletal mesh blueprint. How can i tell previous players to broadcast their meshes when new player joins?
Have you checked the component replication on the character mesh?
Of course, and my main question is last sentence any idea? ps: Previously joined players can see later joined player changes since they(latejoiners) are broadcasting their clothes when joining, but early joined players already broadcasted theirs, I could use loop so players are always broadcasting their clothes but wouldn’t it be bad structure?
You have to manually set the mesh of the player before you again, so your mesh settings must be replicated. That is to say, after each player enters the game, you need to set the mesh of all the previous players.
Yeah i was thinking when new player joins all other player broadcast their clothes, i used dispatchers but no use. Can player access all other players controller and set their clothes?
I don’t think you understand what I’m saying. What I mean by that is that every time a new player joins the game, first that player needs to set his skin via broadcast, second use server events to get other players from GameState (filter himself with ForEachLoop), and then call client events on those players to set his skin. My English expression may not be very good, maybe you can contact me through email, I can give you help. My email is 1281688965@qq.com
when you change attributes of character, you should call event running on server from remote pin, has authority node will help, so that server got what is changed, and before multicast it to every client, you need to make sure this change is validated on server character at the same time, then it will be new for new players after the new players join in, actually, this case is not relavent to which player join first or second ^-^
PS: since you use dedicated server, and open level node will cause current level and all instances in it vanish, you need to make sure things not happened before open level, cuz it will be a new gamesession, almost every thing will be like server present, make sure what already exists not be refreshed by server, game instance may help
Yes, i’m first using run on server event then multicast event to set mesh. And i was using has authority node before, but didn’t seem to affect anything other than recognizing which is server and which is client, could you explain why has authority node matters? ps: I’m using gameinstance to store the changed variables, will post screenshot down below
First player that joins server
Second player that joins
Default character is male with white shirt.
sorry if they are same character on first player screen, i’m calling same variables just for testing purpose!
I have a similar scenario in my project which I already solved. Here’s my solution. I created a level database actor which contained nothing other than an array that stored the data of each player. The level database actor is replicated from the server to all clients. The server will update the array when each player joins the game or changed their skin. When a new player joins, the player’s pawn will read the data from the level database actor and update other players’ skins.
Can i see some of the blueprint? how would i recognize which variable is for which players?
very similar like a case i recently did, indeed, yes, some logic will not affect, what i did is printing all excution branches, analyze logs of client and server both, thats the best way to know how it works and whats not work and why, you will make it after that, it will be a very good experience
I was wrong about the previous post. The server actually tells the new player which skin each existing player has. (In my case it is the team and bodycolor)
I didn’t receive your email, but I decided to write something in the hope that it would help others.
First, skin settings and color settings are stored in “Player State”.When the controller controls the character,server will call “On Possess” at “Player Controller”.We can do something in this step to set up skin and color of other player.Just like this.
Then,We need to go through all the “Player State” from “Game State” to get their skin settings and color settings.Just like this.
The color settings are similar. “CR Set Mesh” is a client event.At this point, the skins and colors of the other players have been set.
I think you’ve dealt with the player’s own skin and color settings.If you have any questions, please get back to me.
Hi, have you done it? what about your solution?
I’ve stuck to looping multicast since i’m getting the values for the clothes from DB, other solutions were same workaround as loop just use different requirements.
I have recently got very same problem, this video have helped to solve it: Learn Unreal Engine Networking in 30 Minutes - YouTube
The solution is near 00:11:00 timeframe, but it is a good idea to watch whole video.
Mentioned near 00:17:00, teacher said multicast only do once, and next player join game will not see the change, that is the problem you got, so he delete multicast event then, before that, he only used server event, but checked its reliable option, and set a bool which is replicated notify which executes a function, so the new player will also see the change. I will try that way later, maybe this is the very simple way to solve the problem