Network Ownership randomly being switched to the Server

Game: War Tycoon

We are running into an issue where a vehicle switches network ownership from client to the server even though there is a player still controlling the vehicle.
This issue started happening since a couple days ago, we didn’t touch anything with our vehicle system when it started happening.

This specifically happens when players switch from the flying mode to “Taxi” mode which allows them to drive the vehicle, I attached the code that handles this in the private message.

Here is a video of the issue:
https://streamable.com/hb1ttm

Expected behavior

Network ownership should get set to the server when specified in the code or if the person is not touching/sitting in the vehicle like how it was before.

A private message is associated with this bug report

2 Likes

Are you able to create a simple repro place? Does it occur if you just have the vehicle by itself in a place and you change the mode?

Are you explicitly setting the network owner to be the player driving?

Can you narrow down when this started occurring? I assume it is still happening? We had a physics related issue that was resolved recently.

Sent the repro place in private messages :+1:

Just leaving an update here in case if anyone else has this issue:

The bug happens when a new object from the server gets welded to the player such as the forcefield in our game.

Even if the object is unanchored and massless, it still causes the issue with resetting network ownership to the server.

A temporary simple fix is to just apply network ownership on the object being welded to the player.

CorvusCoraxx let me know that they will look into fixing the bug.

We are experiencing a similar bug but except it’s the exact opposite. Objects that should be owned by the server are attempting to get force-set to a client, causing everything to glitch out.


There is nothing in our code reverting the network owners for these instances, they are set to nil on creation and should remain nil. Our game never had this issue until just around when this was reported, as in it only started occurring within the past month. You can see in the video what happens when the game tries to assign ownership to a client, it causes the vehicle to glitch out into NAN-space briefly. This video was taken from perspective of the client. If viewed from perspective of the server, the vehicle continues to move forward without any issue.
The console is printing out the network owner every Stepped.
Even if we try resetting the owner to nil every Stepped, it still breaks through and forces the assignment to a player briefly.

1 Like

Hey guys! Sorry, I had replied to the post in DM’s, but forgot to reply publicly.

Without getting into too many details (in order to protect KizmoTek’s script), when the Server simulates an automatically-Client-owned Part (i.e. via a ServerScript setting Velocity), it’ll shift NetworkOwnership back to the Server automatically. This needs to work this way (at least, at the moment) because we’ll enter bad state if we allow multiple peers to authoritatively simulate the same part.

The way to tackle this problem is to do exactly what KizmoTek said they did: manually assign network ownership to the Client if you don’t want the Server to take ownership back when simulating the Client-owned part. Manually assigning NetworkOwnership of an object being welded to the avatar will manually assign ownership of the entire “Physics Object” to the Client, solving this issue.

1 Like

That’s not good - if you manually set the network owner to nil, that shouldn’t change. This sounds like it is an Engine problem. Would it be possible for you to PM me a repro file? It would really help speed up our investigation.

The issue suddenly stopped occurring on our game about 13 days ago, the network ownership loop now seems to work as intended

Gotcha - I wonder if someone else submitted a fix without my knowledge. Please let me know if this occurs again!

We were also experiencing this issue in Drive World, but don’t seem to be seeing it anymore. It was 100% not our code resetting ownership to the server though.

We’ve made several changes ourselves, so it’s possible we are somehow bruteforcing a fix - but if someone fixed it internally that would also explain why we aren’t seeing it!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.