Replicate position only of character that can be seen by player

Hi there,
i’ve been learning how unreal engine works for some time now, and just as i managed to replicate my character with its animations, i new idea came to my mind. What if i could replicate a character’s position only when they can be seen by someone else?

For example, let’s say that i have 2 players: player A and player B.
At the start of the game, player A and player B can see eachother, and can see replicated movement and animations of eachother.
Player B walks behind a wall.
Now, the server does not send replication data to player A, because he cannot see player B, although player B might still be moving.

Can this be done?
I’ve tried looking into this article but i don’t know how to do this server-side.

I mainly use blueprints, but i know some c++ so all possible help is very appreciated!
Thanks for your time, Tom.

It’s a lot of work and unless you approach it the same way Valorant does you’re going to take a perf hit.

yes but where would you even start?
would you have to re-write the movement component?

You’re going to have to dig deep into the engines C++. Replication, Occlusion Culling etc. Learn these systems and the answer should stick out.

Depends. Would you want to remove the simulated proxy from its last known on the client or leave it idle?

PuBG recently introduced a Fog of War system where hidden players at a given range are being teleported to a set position under the map and disabled (ragdoll state). When they are relevant again they are teleported back and reinstated.