[Free] Multiplayer Network Compendium | Gets you started with Multiplayer in UE!

Hey there,

quite some time ago (2016) I created a PDF called “Multiplayer Network Compendium”, which has been used by a lot of peeps during the last 7 years.

The PDF by now got converted into a Docusaurus Page, with updated examples, utilizing UE5+ and BlueprintUE.

You can fine the new Compendium : Multiplayer Network Compendium | An Unreal Engine Blog by Cedric Neukirchen

Cheers!

5 Likes

Holy bananas! :eek:

Awesome !!! Thank you for this gift! <3

Nice docs, thanks for help the community!

This is going to be a huge help! I’ve been trying to learn from the official docs, but I am still rubbish when it comes to multiplayer… :stuck_out_tongue:

Thanks , looks great!

Thanks, very helpfull! :slight_smile:

Nice. This should be handy! Thanks .

Thank you, thank you, thank you! Did I mention, thank you?

Very cool @!

Pure Diamond! Really thank you for putting up such a great documentation! Fluent sentences and all those graphics really help to enjoy learning about this part of the engine. Absolutely awesome!

Thanks for all the kind words (: Hope you all learn a lot from it.

I updated it to Version 1.2 and fixed a really stupid copy paste mistake in the diagram on page 8. Make sure to always check for new versions!

Thank you so much for this!

Wooooaaaaahhhhhh nice! Thanks so much for sharing!

You-Are-Seriously-Awesome.jpeg

:cool:

thank you very match.

great! I mean GREAT! :slight_smile:

Thank you @ ! That’s a lot of work there, how can we repay you :stuck_out_tongue:

Gnah, repay me by telling me if it’s helpful or not and what could be changed, added or left out for the next one. (:
Also by notifying me if you find mistakes or false information!

Hey @,

i have a question about slide N°20, you said “PlayerArray” variable is replicated and have sense because is an array of PlayerState class but why it not have the two small circles like others replicated variables? Could be not immediate understand is replicated if you don’t go into GameState and PlayerState class definition.

Just curious :slight_smile:

Hey there,

I should have been more clear about that.
The Variable is NOT replicated, but since the PlayerState is replicated, it can fill ITSELF into the the Array on all Clients. Probably doing this in “PostInitializeComponents”. So the client version of a PlayerState adds itself to the Clients PlayerArray.

I will alter/add this information.

Cheers!

EDIT:

Until I find time to add this information, is the Part INSIDE of the PlayerState, that manages adding itself to the PlayerArray:



void APlayerState::PostInitializeComponents()
{
	Super::PostInitializeComponents();

	UWorld* World = GetWorld();
	// register this PlayerState with the game's ReplicationInfo
	if ( World->GameState != NULL )
	{
		World->GameState->AddPlayerState(this);
	}

        .....
}


PostInitializeComponents is called on all instances of the PlayerState. So on the Server and on the Client Versions. So every instance adds itself to the GameState’s PlayerArray.
You could also do this only on the Server and replicated the Array, but why wasting bandwidth? (:

The GameState itself also gathers all PlayerState, for the case there were already some PlayerStates and the GameState wasn’t ready yet:



void AGameState::PostInitializeComponents()
{
	Super::PostInitializeComponents();

       ...

	for (TActorIterator<APlayerState> It(World); It; ++It)
	{
		AddPlayerState(*It);
	}
}


Of course, this is being a “Unique” Add, so no duplicated entries. The “AddPlayerState” function has the following implementation:



void AGameState::AddPlayerState(APlayerState* PlayerState)
{
	// Determine whether it should go in the active or inactive list
	if (!PlayerState->bIsInactive)
	{
		// make sure no duplicates
		PlayerArray.AddUnique(PlayerState);
	}
}


I hope that sorts it for now (:

Exhaustive answer, thanks!