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"

Need clarification on Networking, Controllers, and Network Ownership

Hi,

I'm playing around with the basic framework for a networked RTS using 4.3 and blueprints. I've just started to enable networking/replication and am running into what I think is strange behavior, but may just be a result of misunderstanding.

PlayerController

My first test was to start up a dedicated server with one client. The first thing I noticed was that the dedicated server is spawning a PlayerController and Player Pawn for itself, but since a dedicated server has no local player why are these being created? Is there a way I can prevent the dedicated server from getting these objects?

AIController

The second thing I noticed was that default AIControllers, on the other hand, were only being spawned on the server. Does the engine dictate that these only spawn on the authority, or does this have something to do with the 'owner' of the pawn?

Owning Clients

That brings me to my final question: how does network ownership work anyway? It's my understanding that every actor in the game has a network owner, and that owner is the only one allowed to execute server-client RPCs. I also assume that this ownership is what directs the Switch Has Authority node. If my understanding is correct, then what determines the network owner of a particular actor? Is it the player who spawned the actor? What about actors that already exist as part of the level, who owns them and can I change their owner? My issue is that I want a client to be able to execute a Server RPC on an actor (for example, a RTS unit) but it looks like the client is not its owner and therefore can't call this RPC.

Sorry to throw a bunch of questions together in one post, but it seems like they're all somewhat related.

Thanks!

Product Version: Not Selected
Tags:
more ▼

asked Aug 13 '14 at 05:59 AM in Using UE4

avatar image

dbc211
121 6 8 14

avatar image dbc211 Sep 11 '14 at 08:18 PM

Shameless bump, though I'm not really sure how question sorting works here. Still looking for answers or directions to answers. Thanks!

avatar image Wobbleyheadedbob Aug 31 '17 at 10:26 AM

I know this was ages ago but do you still need an explanation? I have a better understanding of this myself now.

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

2 answers: sort voted first

Owning Clients

Actors spawned as part of the level are all owned by the Server.

Have a look at this (seem like they're attempting the same thing you are): https://answers.unrealengine.com/questions/41065/controlling-multiple-pawns-rts.html

more ▼

answered Sep 12 '14 at 10:21 AM

avatar image

Wobbleyheadedbob
68 6 9 8

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

The best way i found that if you want to spawn an actor from the client by input event or ui button you must redirect it to the other has the server ownership like player controller or player pawn .etc. then invoke event with [run as server] replicate and [multi cast] to all clients.

more ▼

answered Nov 06 '17 at 02:00 PM

avatar image

godbloc
31 1 1 3

(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