GAME DEV · AUG 2026
Networked Coop Interactions
Two-player cooperative multiplayer prototype in Unreal Engine 5.6 and C++, built for an external studio. The details of the game are under NDA and stay private.

At a glance
- ROLE
- Team lead, peer-to-peer connection, host migration and game state persistence
- TEAM
- 7 people
- CONTEXT
- School project at Forsbergs Skola, built for an external studio
- DURATION
- Weekly sprints
Leading the team
- Led a team of 7: prepared and organised the Trello tickets, kept the board up to date and split a ticket whenever only part of it was finished.
- Broke big features into small tickets, each with its own Definition of Done, so progress was easy to check.
- Ran the standups and the weekly sprint reviews: collected a status from each teammate, flagged blockers and planned the next days.
- Set the priorities and kept the scope small: the core features first, and no time spent on integrating with other teams.
- Agreed merge rules for the dev branch with the team after early merge problems, and a Discord channel per system where everyone posted progress. The channels also gave me a log to prepare each review.
- Followed up with teammates who were blocked, resolved disagreements about how to split the work, and split tickets so two people did not build the same system.
- Helped teammates with Git: walked one of them through reverting a broken merge, and fixed an oversized file and a folder deleted by mistake.
What I built
- Peer-to-peer connection with Epic Online Services: no VPN and no dedicated server. The host shares a connect key and the other player joins with it.
- Device ID login, so nobody needs an account to test. The engine plugin did not support it in UE5, so I patched a local copy of it.
- Hosting and joining sessions, plus the main menu and pause menu that go with them.
- Host migration: when the host drops, the other player becomes the host, a new session is created and the level reloads.
- Game state persistence: objects, inventory and player position survive the migration, kept in copies (mirrors) that live outside the level.
Technical decision
Every machine keeps its own copy of the world
When the host drops there is no server left to ask, so each machine records the state of its own objects in the game instance, which survives the level reload. The component pushes only when an object has moved more than 1 unit, so float drift does not flood the copy. After the new host loads the level, the saved transform is applied with TeleportPhysics so the physics engine does not read it as a collision.
MigratableComponent.cpp
void UMigratableComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
if (!bAutoTrackTransform || MigrationId.IsNone()) return;
AActor* Owner = GetOwner();
if (!Owner) return;
// Every peer's own GameInstance mirror stays current, not just the server's -
// the same reasoning as OnRep_ running on all machines for doors/inventory.
const FTransform Current = Owner->GetActorTransform();
if (!Current.Equals(LastPushedTransform, 1.0f)) // 1 unit tolerance, avoids spamming on float drift
{
LastPushedTransform = Current;
PushMirror();
}
}
void UMigratableComponent::PushState(uint8 StateByte)
{
LastStateByte = StateByte;
PushMirror();
}
void UMigratableComponent::PushMirror()
{
if (MigrationId.IsNone()) return;
AActor* Owner = GetOwner();
if (!Owner) return;
if (UEOSGameInstance* GI = Cast<UEOSGameInstance>(GetWorld()->GetGameInstance()))
{
FMigratableState State;
State.ActorId = MigrationId;
State.Transform = Owner->GetActorTransform();
State.StateByte = LastStateByte;
GI->UpdateWorldMirror(State);
}
}
void UMigratableComponent::RestoreState(const FMigratableState& State)
{
if (AActor* Owner = GetOwner())
{
Owner->SetActorTransform(State.Transform, false, nullptr, ETeleportType::TeleportPhysics);
}
LastStateByte = State.StateByte;
LastPushedTransform = State.Transform;
OnStateRestored(State.StateByte);
}