#Using SceneCondition vs custom condition

4 messages · Page 1 of 1 (latest)

tawdry meteor
#

Hello,

I have a lobby and chat room in a scene:

  • lobby:
    • a lobby where player starts from after logged in.
    • players can create a chat room inside the lobby.
    • only one lobby exist for a whole time in a game.
  • chat room:
    • a room where room members can chat.
    • multiple chat rooms can exist in a game.

I am wondering which is the correct way of achiving the above.

  1. a lobby and a chat room in a scene.
  • In this case, it is necessary to attach a custom condition which checks in which room players exist (something like room ID) to the NetworkObserver.
  1. a lobby in a lobby scene, and a chat room in another scene.
  • In this case, SceneCondition should be attached to the NetworkObserver.

In both cases, the server checks which NetworkObjects to be share to the clients, and looks same to me.
What is the advantage of using SceneCondtion ?


using FishNet 3.11.9

rotund anchor
#

One large advantage of using the scene condition is being able to use seperate physics per scene. If that's not needed then you don't always need to use seperate scenes.
You can use the match observer condition to manage which clients see what

tawdry meteor
#

Thank you for your reply.
I already have a custom condition whose ConditionMet returns true when they are in the same group.
I think that would suffice what MatchCondition is doing, am I correct ?

One large advantage of using the scene condition is being able to use separate physics per scene.
When the condition doesn't meet and other players are invisible from a client, physics would not be shared and the client player would not collide the other players, is this correct ?

For example, in case players create their own rooms but actually the rooms have exactly same static room interior (ex chairs that doesn't move, walls that doesn't change, etc.), and something that changes when they enter each room is only the players inside the room, then does that mean separate physics is not needed ?
(It seems that this can be achieved by putting a condition on player NetworkObject and controlling the visibility of the players by room. And by doing so, I think there's no need to create a new room instace per room, so that would improve the server performance)

rotund anchor