wicked
wicked3mo ago

Creating multiple servers using Normcore VR

Hi, I'm creating a VR game using normcore and Unity, and I have the basics set up. However, my game is supposed to have only two players, and currently, more than 2 can join. My ideal situation is to have a lobby and allow people to create and join each other's rooms. I'm aware that you can put people in scenes, but can I create the same scene so that my game could support pairs of 2 playing in the same scene without seeing each other? (Example: Lobby is scene 1, Game is scene 2, one pair who joins scene 2 can't see other pairs in scene 2)
9 Replies
kapa.ai
kapa.ai3mo ago
Hi @wicked. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, you can achieve this by using Normcore's room feature. In Normcore, rooms are used to separate groups of players. They’re most commonly used to host a single match for a game or a persistent space for a productivity app. Players who join the same room name will be automatically connected to the same room. You can create as many rooms as you’d like, and Normcore will automatically determine the ideal region to host the room based on the players connecting. In your case, you can create a new room for each pair of players. When a pair of players decide to start a game from the lobby, you can create a new room and move these two players to that room. This way, each pair of players will be in their own room and won't be able to see other pairs. Here is the relevant information from the knowledge source (https://normcore.io/documentation/architecture/client):
Rooms in Normcore are used to separate groups of players. They’re most commonly used to host a single match for a game or a persistent space for a productivity app. Players who join the same room name will be automatically connected to the same room. You can create as many rooms as you’d like, and Normcore will automatically determine the ideal region to host the room based on the players connecting.
Remember, Normcore allows you to connect to multiple room servers simultaneously. This can be especially useful if you need to segment a large open-world into multiple quadrants that players can freely move between. Here is the relevant information from the knowledge source (https://normcore.io/documentation/essentials/common-questions#can-i-connect-to-multiple-rooms-at-the-same-time):
Normcore allows you to connect to multiple room servers simultaneously. You can use them to split large MMORPG spaces into smaller shards or to group traffic to host large events like concerts.
Please note that the number of players that can fit in a room will vary based on how much bandwidth your application uses. For instance, VR applications typically use 5-10 times more bandwidth than a typical FPS or racing game. Here is the relevant information from the knowledge source (https://normcore.io/documentation/room/room-server-options#how-many-players-can-i-fit-in-a-single-room):
Normcore regularly hosts rooms of 4 - 250 players. The headcount per room will vary based on how much bandwidth your application uses. For instance, VR applications typically use 5-10 times more bandwidth than a typical FPS or racing game.
---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@776872129001816066> kapa.ai is still learning and improving, please let us know how it did by reacting below
wicked
wicked3mo ago
@Normcore Assistant can you show me an example script to make a scene a room
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Sure, here's an example of how you can create a room using Normcore's Realtime component. This script should be attached to a GameObject in your scene.
using UnityEngine;
using Normal.Realtime;

public class RoomCreator : MonoBehaviour {
private Realtime _realtime;

private void Awake() {
// Get the Realtime component on this game object
_realtime = GetComponent<Realtime>();

// Set the room name
_realtime.roomName = "Your Room Name";

// Connect to the room
_realtime.Connect();
}
}
using UnityEngine;
using Normal.Realtime;

public class RoomCreator : MonoBehaviour {
private Realtime _realtime;

private void Awake() {
// Get the Realtime component on this game object
_realtime = GetComponent<Realtime>();

// Set the room name
_realtime.roomName = "Your Room Name";

// Connect to the room
_realtime.Connect();
}
}
In this script, we first get a reference to the Realtime component. Then, we set the roomName property to the name of the room we want to create. Finally, we call the Connect method to connect to the room. If the room doesn't exist, it will be created. Please note that this is a very basic example. In a real-world scenario, you would probably want to add some user interface for players to enter the room name, and some error handling to deal with cases where the room can't be created or the connection fails. You can find more information about creating and joining rooms in the Normcore documentation (https://normcore.io/documentation/guides/creating-a-player-controller#making-it-multiplayer). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@776872129001816066> kapa.ai is still learning and improving, please let us know how it did by reacting below
wicked
wicked3mo ago
@Normcore Assistant is there a way to see all available rooms?
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Currently, Normcore does not provide a built-in way to get a list of all available rooms and the number of players in them. This is something they are working on, but for the time being, it's something you'll need to manage yourself. You can find this information in the knowledge source (https://normcore.io/documentation/architecture/common-questions#how-do-i-get-a-list-of-all-rooms-and-how-many-players-are-in-them). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@776872129001816066> kapa.ai is still learning and improving, please let us know how it did by reacting below
Mechabit
Mechabit3mo ago
use unity lobby or wait for normcore lobby to come out