NetworkConcealEntity Bug

During my tests with entity concealings, I noticed there is a bug…

For this post, whenever I say setting a vehicle entity to an instance, I actually mean applying NetworkConcealEntity with the correct parameters for the vehicle entity from each player:

When you set a vehicle entity to an instance, the vehicle won’t appear to the players in the instance, unless the owner of the entity is also inside the instance. Once the owner of the entity joins the instance, the vehicle appears to all players inside the instance…
Also, once the vehicle entity owner leaves the instance, the vehicle disappears from players in the instance until the owner joins back in…

P.S. For a more accurate description, the vehicle entity which is set to an instance, will appear for 1 second to all players who are already in the same instance as the vehicle, and then it disappears until the owner of the vehicle joins the instance.

1. Client (production/canary) and FXServer version: canary | FXServer-master SERVER v1.0.0.6231

2. What you expected to happen: The vehicle entities that are instanced should be shown to the players of the instance even if the entity owner is not present in the instance.

3. What actually happens: The instanced vehicle entities are not shown to the players that are in the same instance as the vehicle unless their entity owner is present in the same instance.

4. Category of bug (eg. client, server, weapons, peds, native): client/native

5. Reproducible steps, preferably with example script(s)
Using my in-development resource and its commands for testing
Repro (1) Steps:

  • Have player 1 spawn a vehicle
  • Set the vehicle to an instance
  • Have player 2 join the instance
  • Player 2 cannot see the vehicle until player 1 joins the instance
  • Player 2 cannot see the vehicle after player 1 leaves the instance

Repro (2) Steps:

  • Have player 1 spawn a vehicle
  • Have player 2 join an instance
  • Set the vehicle to the instance
  • Player 2 sees the vehicle for 1 second, then the vehicle disappears until player 1 joins the instance
  • Player 2 cannot see the vehicle after player 1 leaves the instance

Would it be possible to make a smaller repro and state description than your full script? There’s a lot going on in this description and a lot of states to try to figure out.

Sure, I’ll try to come up with a better and smaller repro.

Here is a simpler repro with a showcase of the issue:

The repository that was used in the reproduction of this issue is here.
If you cannot see the uploaded video for whatever reason, I’ve uploaded it to the repository I provided above as well.

Basically, the bug here is if a vehicle entity is concealed for its owner, other players who do not have the vehicle concealed, cannot see the entity as well.

@nta Do you have any update on this? Or at least a temporary workaround?

No, I do not at this time. I also do not know when any such update can be provided.

This is expected game behaviour (in other words: remote clients may conceal an entity but its owner has ultimate authority). Referencing game-code, a network object is considered ‘concealed’ if at least one of two bits are set:

(v1 & 4) != 0 || (v1 & 8) != 0

In NETWORK_CONCEAL_{ENTITY,PLAYER}: the 0x8 bit is set when it is an entity the client owns, while 0x4 is set when the entity is remote (not-owned). If you’re looking for workarounds, reference SET_ENTITY_LOCALLY_{VISIBLE,INVISIBLE}.

Ah. Right, so setting as locally invisible if the local client owns an entity would be a solution here.

Thanks for the reply!
I have not experienced such problem with NETWORK_CONCEAL_PLAYER, the issue only occurs by using NETWORK_CONCEAL_ENTITY. (I assume because the ownership of a player entity always remains the same?)

As you might know, Rockstar achieves instancing (in ipl interiors for example) through conceal natives; therefore I don’t understand how this an expected game behaviour for vehicle entity owners to have full authority and basically override other players concealing native calls. If this is the expected behaviour, I can’t think my mind how they achieve instancing by utilizing these natives as if the entity owner un-conceals a vehicle entity, other players who are in similar ipl/zone, but in a different instance, would be able to see the vehicle, which is not happening with Rockstar garages or tuning shops…

Also, I have thought about using SET_ENTITY_LOCALLY_{VISIBLE,INVISIBLE}, but that doesn’t disable the collision, therfore another native( SET_ENTITY_NO_COLLISION_ENTITY) has to be called as well, but these 2 natives have to be called every frame in order for them to work properly. I was looking for a more optimized solution, and that’s why I went after concealing natives…
P.S. Yes I am aware you can set p3 to false for SET_ENTITY_NO_COLLISION_ENTITY to not call this native every frame, but I could not find a way to re-enable the collision after.