x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[C++] What are the Best Practices for Multiplayer Team DeathMatch Lobby.

I have a Multiplayer Lobby where Clients(LAN) choose their teams, I register their Unique Ids and their teams in The Server's GameInstance(ListenServer) every Client's game instance is also aware of their team. The issue arises when I travel to a new level from the lobby. I can't come up with a way to transfer the information from the server's game Instance to the clients before the characters are spawned. I've tried overriding the GameMode's FindPlayerStart function but there's no game instance at this point. Also, begin play doesn't do the job on the PlayerController or on the Character.

Product Version: UE 4.9
Tags:
more ▼

asked Feb 12 '16 at 04:38 AM in C++ Programming

avatar image

JuanCCS
6 2 5 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

You need to change your ready to start match to wait until all clients have acknowledged the replication of the proper class information. If you have each client acknowledge on the replication of the class which increments a value in the game mode, you can do the following:

 bool ASomeGameMode::ReadyToStartMatch_Implementation()
 {
     return NumClientsReady == TotalClients;
 }
 
more ▼

answered Feb 12 '16 at 05:36 PM

avatar image

joeGraf STAFF
1.5k 35 12 69

avatar image JuanCCS Feb 12 '16 at 07:43 PM

Thanks, this allows me to prevent the players from spawning without being aware of their current teams. In case someone has the same issue my problem was that I was trying to access the GameInstance from inside the PlayerController before it spawned. I need to access the GameInstance from the GameMode. Everything seems to be working ATM. Thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Store the gamestate values?

more ▼

answered Feb 12 '16 at 03:10 PM

avatar image

Aquazi
31 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question