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!