Download

Free Network Compendium | Gets you started with Multiplayer! | Current Version: 1.5.0

Hey party people!

I released a 100+ Pages strong Network Compendium for UE4 to get you started with Multiplayer.

For more information and a Downloadlink: Click me!

Cheers!

Holy bananas! :eek:

Awesome Exi!!! 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 eXi, looks great!

Thanks, very helpfull! :slight_smile:

Nice. This should be handy! Thanks eXi.

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

Very cool @eXi!

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 @eXi ! 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 @eXi,

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, here 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!