Actors are invisible to possessed vehicle too far from origin

I’ve had this problem since I can remember (4.4 - 4.9). On clients in a Multiplayer game, we spawn and possess a vehicle. However, when vehicle gets to far from original point it was possessed, nearby actors are invisible including other players. If vehicle is exited (repossessed original player pawn that was attached to vehicle) nearby actors are visible again.

“Always Relevant” actors are always visible but it’s too expensive to set ALL actors with that flag. Setting Vehicle to always relevant doesn’t make other actors visible.

vehicle is templated off VehicleGame while our base character ( one that works) is based off Shooter Game.

This thread Map-specific replication issues - Programming & Scripting - Epic Developer Community Forums has similar issues but again, I can’t set all actors to Always Relevant.

Active Vehicle Replication Flags are (Replicate Movement, Net Load on Client & Replicates). I also tried Net Use Owner Relevancy but it didn’t help.

Hi Xilverback,

I can’t seem to reproduce this behavior in a new project. Does this occur in a new project for you as well, or only your existing project? What happens if you re-enter vehicle on Client after exiting?

If you can reproduce issue in a new project and upload it somewhere for me, I can look into it. Thanks!

It happens in a default version of Advanced Vehicle Demo if you remove barriers , and expand map, then travel too far away from origin. Atleast in 4.5 but I don’t think it’s fixed in 4.9 either. In this case, like in mine, Vehicles won’t see each other but will collide if they hit.

At what distance does this start to occur, approximately? And is it distance from origin or from point of possession?

EDIT: I’m still not able to reproduce this in a new 4.9.2 Advanced Vehicle template project. If you can, please upload test project somewhere so I can look at it. I believe this has more to do with your possession setup than anything else, but I can’t be sure without seeing it.

I’m not in a place where I can build map tonight but What I can say is that it appears to be from place of possession/spawn of vehicle. When I get out and get back in it resets travel radius. If I recall correctly, problem happens after you travel about 1-2 Kilometers from point of possession. best way to test is to run two clients on a dedicated server. I’m upgrading from 4.9.1 to 4.9.2 now, so I’ll see if 4.9.2 demonstrates problem.

4.9.2 broke some other things now in my game that I’m working on fixing. For a quick test I bought “Multiplayer Passenger Vehicle” Blueprint on MarketPlace. After turning off “bAlwaysRelevant” on Jeeps in that example, vehicles exhibited a similar but different behavior. They were Offset from one another. That is other players appeared several yards away from where they were supposed to be on clients. (this may be same behavior as I’m seeing but i may have greater offsets).

Also, Alt+Tab seems to no longer work in 4.9.2.

More info, it looks like clients desyncs and loses track of other objects that are not listed as “bAlwaysRelevant” In this picture, Blueprint is always relevant while green is not!

I’m having trouble uploading a test map here for you. I’ll have to host it here

problem only seems to happen when an actor is possessed after game starts

Hi Xilverback,

Thanks for additional info! I’ll need at least Content and Config folders, as well as map, to build a project. You can them up and upload them someplace like OneDrive and I can grab them from there.

Is problem in test project same as initially reported? I can’t access Multiplayer Passenger Vehicle Marketplace content, unfortunately, and we’d need to test in a template project anyway.

Definitely don’t post it here if it has Marketplace content in it. You can PM me on forums:

Were you unable to reproduce in Advanced Vehicle template?

I can and host whole thing, I just didn’t want to distribute for pay content online. Should I post it here or PM you, etc?

I think problem is same. symptom looks slightly different because Passenger vehicle content is a smaller map. At further distances, non-alwaysrelevant objects disappear completely in this and in my project.

I was unable to replicate problem on 4.9.2 in advanced vehicle template but I noticed scale is much smaller on that one and I’d have to write some possession code to test possession theory. I did see problem in 4.5 on Advanced Vehicle Template but that was only copy I had and was short on time.

PM has been sent.

Hey Xilverback,

What I’m seeing in project you sent is simply an offset between Clients, which is expected: anytime physics is involved and actors affected by physics are not marked as Always Relevant, there can be different results on each Client.

They should never become invisible, however. In situation described in your initial post, did you see actors lose visibility? Were actors that lost visibility all physics actors? I didn’t see that occur in project you sent.

Once Green vehicle leaves 1.5k Relevance range (marked by “Great Line of Fail”) text on test map it is desync’d. test procedure is this:

Test 1

  • Launch in PIE with 2 clients and a dedicated server.
  • Enter a vehicle on each client
  • Drive both clients beyond line marked on map (they should be near one another for test)
  • Drive Green vehicle around and observe Client in not update information

Test 2

  • Launch in PIE with 2 clients and a dedicated server.
  • Enter a vehicle on each client.
  • Drive Green vehicle out of View of Client
  • Try to find Green Client with Client

There are other fail scenarios as well, for instance any Actor that is not bAlwaysRelevant that is spawned outside of Relevance range determined at initial point of entry of vehicle will never be visible to vehicle regardless of how close it gets to it (even colliding). Once player exits vehicle though, position of relevance calculation seems to update and spawned actor may be visible again.

Would it help if i posted a video?

It may, if it’s in this same project. Thanks!

Video Link
It is indeed in same project I sent you.

This behavior is Different than Default player pawn though. If vehicles are never possessed, to player characters (also not marked bAlwaysRelevant) can travel beyond 15000 range together without a problem. Also, If I travel 15000 from original possession an actor spawned just feet from vehicle won’t be seen. I’m investigating update of “WorldSettings->ReplicationViewers” array on possession as a potential root of problem.

Thanks for video. To me, this still seems like expected behavior. If an actor is not marked as Always Relevant, than its position and other values won’t be replicated unless it is within cull distance of Client. Outside of that range (15000 units by default), any changes to that actor will no longer be replicated to Client. In project you let me look at, when you unpossess vehicle, you’re creating a new character, so all current information from actors will be seen by Client anew.

Similarly, an actor spawned outside that cull distance will not replicate to a Client, and moving closer to it will not make it replicate without Server explicitly passing that information to Clients.

You can either adjust Net Cull Distance Squared value in any actor you want to replicate to a larger radius, or set actor to Always Relevant, to avoid this. Otherwise, you’ll need to write some write some code to reapply current position of an actor to Client once Client enters range. I would suggest using a custom event set as an RPC call from Server once a Client is within desired range.

I ran a test and as suspected, FNetViewer “ViewLocation” data in GetWorld()->GetWorldSettings()->ReplicationViewers for client stops updating once vehicle is possessed. So frame of reference to view other actors isn’t being updated to recalculate relevance distances.

My problem is that I cant find where this ViewLocation data gets updated. If i knew that I could hack it. Maybe in pawn MovementComponent or PlayerController?