Networking Custom Movement Character Spawning Bug, UML & Screenshots provided

Hello all,

I’m encountering an odd issue with spawning characters with my first person shooter template. I need to solve the spawning issue before I can begin my journey testing net code for my custom implementation. I am having inconsistent spawning problems when I try to spawn 2 clients (non dedicated), however when I spawn 3 or more the pawns spawn with issue but the possession is not working properly. With a default game mode it behaves the same way except I can move my clients around but not with my own custom Game Mode. I am using the default spawning built in as I tried overriding the game mode and player controller to spawn my characters with no success.

Overview: I’ve successfully ported over VQ3 (Quake 3) movement physics to the UCharacter Class. I’ve created my own character movement component which has a square collision capsule and movement code. With the custom movement code I override the PhysCustom function and run my code there. Here are useful screen shots below.

UML: (Legend* Blue is Variables, Orange are functions, Grey is aggregation, Empty Arrow is Inheritance)

C++ PhysCustom code lives here:

BP_FirstPersonCharacter

Server Perspective:

Client Perspective:

Tried:

  1. I have tried several combinations to my world overrides like using default player controller, my own controller, I’ve also tried the default game modes and my own.
  2. I have also tried placing Start Point actors with no success.
  3. I wrote some code to try and spawn some character pawns on Player Start points with iterators inside my game mode and possess it.

I’ve spent a long time time reading documentation and tutorials I have also done replication before and took a course to network vehicle APawn classes (did the prediction, physics etc), I never came across any spawning issues until now. I’ve tried different implementation approaches with no success. I am looking for some steps in c++ solution to this problem.

Thanks so much as this would mean a lot to me to learn and move forward.

I think I may have pin pointed the issue. I’ve looked at the original source code designed for the VQ3 movement collision component. I’m deducing it from how the collision box is attached to the player.

In the Movement Component Class

void UDefragrPlayerMoveComponent::BeginPlay()
{
Super::BeginPlay();

Origin = Player->GetTransform().GetLocation();
}

Additionally the Collider on the player location is set to this origin value on the Tick component

//This is inside the tick component
Player->Collider->SetWorldLocation(Origin);

What could be happening is on BeginPlay the collision box is set to where the player spawns. Then the player for some reason is falling through the map and is hitting the kill zone, while the player falls every tick the collision box is being pulled down vertically but it can’t obviously fall through the floor. Then the pawn is unpossessed and that’s why the camera that’s tied to the player is under the map.

Any thoughts on this?