[Multiplayer] How to spawn more than one character at start and assign each to different player

Hey Albert Espín,

I’ve created a tutorial on Checkpoints & Respawns. I’ve skipped it to the part where I Spawn Actors and Assign a default controller. I have not personally attempted the server but this should integrate effectively. Only change you would have to assign the specific controllers to the Pawn, in this tutorial I assign the default index 0 controller(Client).

Hi, I’ve been playing with multiplayer and replication for a while and achieved a Server with a fully controllable character and a client with some of the controls working now, but not all. The second character, the client one, is spawned a few seconds after the action starts, at least until now, but that’s giving me some problems, but spawning it at Begin Play kills input capabilities for the client.

So I’m just looking for a more standard blueprint strategy to spawn more than one character when “Begin Play” runs (at start) and assign each one to a player (and give it a different player index). How would one do so? I guess it should be done in the level blueprint and have multiple Game Starts, but what about the graph or default settings for doing something like that?

Thanks for the answer, but it seems that won’t work nicely here; in the meantime checking older threads about different types of multiplayer it seems that player index behaves differently in a local context and in a server-client one, so I’m going to make a thread approaching what I want to achieve from a pretty different point.

Fair enough, I’m looking to do networking in Blueprint. If you come across any threads or documentations. I would appreciate it if you can link me. I only know of such things on UDN, but I don’t believe normal subscriptions have access to it.

I’m trying to get players online first off. So I guess the basic replications, threading server, and accepting connections.

Exactly what are the topics of Blueprint networking you’re most interested in? I’ve recently come a cross many threads and docs on many facets of that so I will remember if I’ve seen that specific feature or stuff being discussed or talked about.

Simply put, you set “Number of clients” to 2 or more in the arrow next to the “Play” button in Editor and you spawn a second blueprint character at a given time, use “Spawn Default Controller”, “Enable Input” and “Possess”. I would do that in the level blueprint, and filter variables with IsValid where you suspect that the engine can think of Accessed Nones.

Check out my question threads from my profile, there are many questions about replication related stuff, even if the name doesn’t look like so.

Okay sweet thanks a lot. Quick question, so if I opened another editor or game how would I be able to connect? Or is this Number of Clients Simulating the connections?

Oh okay, so when you set number of clients. It actually opens multiple games windows. Alright thanks a lot Albert, I will start reading the threads and see how everything operates.

To open multiple windows when playing (clients and server), you don’t need to open the editor multiple times, just go to the arrow next to “Play” and increase “Number of clients”.

If you mean if it’s possible to play a “false” online game between more than one editor instances (so having the editor opened more than once at the same time) I don’t think it’s possible, but possibly when packaging (but with multiple game instances).

Do you mean that chat thing? I’m checking it now.

Here I confused a bit player concept with character one, check out how to spawn a second player here: Local MP: Second player created; how to control it? - Multiplayer & Networking - Epic Developer Community Forums