Simple problem Network (blueprint)

Hi, I have a little problem and I don’t understand why. Let me explain what I want simply.

Client press on button => Server add + 1 to a INT variable => Client read the new value.

It’s super simple but I don’t know why it doesn’t work. Let me show you my blueprint. Right now only the Server as the ability to update the variable. The Client read perfectly the value but can’t tell to the server to add +1.

I saw all the video share by Epic about networking and I also try the ContentExemple. If you know where I go wrong please tell me.

Have a good day, Gabriel.

PlayerReady is linked with SwitchHasAuthority, so only the server will have access to SetNbrPlayerReady. you need to add a custom event that triggers a custom event Replicated on server, and then you can do that SetNbrPlayerReady. so Player Ready should call a BroadCastImReady (Replicated on Server), BroadCastImReady should call SetNbrPlayerReady(Replicate all).

I understand more what is my error now, I’ll try this tomorrow and give you some news! Thanks a lot :D!

Still doesn’t work, maybe I missundertand something. Here my blueprint =>

This loses me a little but i think only the server can access the GameState. however, gamestate exists on clients too (read it somewhere), but seems like they cant really access it (breakpoints on gamestate from events triggered on clients never pass the cast). so what i did was send the event to a RunOnServer (inside the same playercharacter BP), signal the GameState and thats it.

sorry, im just way too tired. clients can indeed access gamestate (im even using that logic on my main game!), it just doesnt works if you replicate it as Executes on Server (guess the server tries to execute on the client’s game state, which makes no sense at all, ofc). this is my fixed screenshot. note the only the variable is set to replicate

This make more sens, I only want the server to make the operation on my variable. For now, when I am on a Client, the Server receive nothing. I guess my error is stupid but I don’t where it is.

Let me try this right now ! :smiley:

Server can add value to all client but client can’t add value to other client…

Can you show me a way to registe the value inside the server from a client and make it read from any client?

EDIT: let’s forget the value, just the ability to print string something on the server when a client active an Event.

you are right, i fixed it, changed the gamestate event to replicate on server. however you should really stick to my original first screenshot solution (on the other post), that way you can actually know which player is not ready, useful for a lobby to display who are you waiting for, this method is not useful.

I’ll try this. For right know I don’t really need a lobby, my Server will never be a player, I want him to stay in background and be able to interact with player ( and vice versa). They are no word to tell you how much it’s appreciate to have your help!

Now it work well :smiley: thanks again for all your help!!! I have the ability to send request to server from a client. And also don’t worry, if I need a lobby for my player, I’ll certainly take the method that you post on the other answer!

Last question for you:

Can I create multiple session on the server (I don’t want the player to host the game). If not, I guess the alternative would be to create an array with ID of all my game and manage some kind of session with an actor to old the value of each session etc. If you have a better way to done this without session or fake session like as mentioned above, tell me :slight_smile:

Just want to tell you that english is not my native language, if something doesn’t make sens don’t be shy to tell me.

glad it works, if you speak Spanish, feel free to do so. about dedicated servers, im not experienced at all, but based on how the games tells us networking works, you usually “create a server” when making a new game, so my guess is run multiple dedicated servers (just like what you see on mmos, where each instance is a dedicated server). if a player decides to host a game, he becomes a new servers, which is pretty much like running another server.

topic explaining this issue.

also, there is a very good multiplayer plugin, it even lets you invite/receive requests to steam and join the other’s game via blueprint. (not 4.12 compatibility yet)

Close to Spanish, I speak French :p. I have already a better idea on how I’ll make work this. Also these link are usefull, it’s exactly what I search. Do you want me to tell you when I’ll be able to create multiple instance of my server for each session?

sure, add me on epic’s msg, jblaswu. ill most likely use dedicated servers in the future for my projects.