Lessons learned

Back to main post

So what did I learn? With focus on the dedicated server.

  • Replication to clients only works when it is set on the server.
  • Often you read the word clients, this is misleading. With characters and playercontrollers for example there is 1 server and 1 client!!. So you can not get access to all clients with a playercontroller or character.
  • My biggest misconception was that if you use for example the switch Has Authority , with authority you can’t get acces to the remote / client by using an custom event or the other way around. Example of how it really works

So the branch is set to client, but by using the event SetNameOnServerGI (runs on server) one gets access to the server anyway!!. Although the branch is set on client!!

Same when you set branch or switch to server, you can get access to the client by using an event which is “Runs on owning client”

  • A widget (menu) lives only on the client, a gamemode lives only on the server. So you need a for example a playercontroller (lives on server and client) to get a widget (menu) to communicate with a gamemode.
  • Probably I use reliable to often.
  • A menu widget can get acces to the gamestate client, but not to the gamestate server.
    You need to use the playercontroller (event run on server) to get something done on the server side of the gamestate from a menu widget.
  • If a variable is replicated and changed on the server side of the gamestate, it is visible for all clients!
  • To get access to player state in menu widget, you have to use the playercontroller
  • In the gamemode you can change the playername in playerstate.

Share Button

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.