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"

How to make sure an actor has finished replicating over the network after server side spawn&initialization?

I am implementing a turn based strategy, in which players can control and give orders to a squad of units (characters). Therefore the player controllers should be able to manage multiple character controllers.

Within a player controller I need a way of accessing client side character instances this player controller manages so that I can display unit information (health etc) on the heads up display.

I thought that the easiest way to do this is to let all GameState instances collect the replicated character data by querrying all actors in the world and cache them within an efficient data structure. This is supposed to be done only once when the game begins.

However the time when I do this caching is important. For instance if some of the actors are yet to be spawned on the client side that means the caching on this client's GameState will fail.

When GameState caching is complete, GameStates can then answer client side querries about these characters efficiently (with minimal search). My characters and players are already set to replicate their data over the network. So their internal information will be kept up to date.

This is what I have in mind as a solution. To do this hoverer, I need to make sure that all characters are safely replicated over the network (they have their copies on client machines) and also their initial data is setup correctly (host initializes them after the actor spawn routine).

Is there a way of putting a barrier on host side initialization routin (within my custom GameMode) such that it waits until all characters and players are spawned, replicated and initialized safely all over the network, so that it can call a Multi Cast RPC on all GameStates to begin their caching?

I can of course put a small delay here via timer but I consider this as an inefficient hack.

As a C++ programmer I have zero experience on Unreal networking. And I find it really hard to find some good network implementation tutorials (on C++ side) except the very trivial ones.

Any help will be greatly appreciated.

Product Version: UE 4.15
more ▼

asked Mar 08 '17 at 01:25 PM in C++ Programming

avatar image

154 17 20 39

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

0 answers: sort voted first
Be the first one to answer this question
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