Roulace
Roulace5d ago

Can't connect to certain rooms?

We've been having issues lately where we can't connect to certain rooms on normcore. It's possible it might have something to do with storing too much persistent data (maybe?) but we're unsure on how to clear it if that's a problem. The same scenes work on other room names.
24 Replies
kapa.ai
kapa.ai5d ago
Hi @Roulace. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It sounds like you're experiencing connection issues with specific Normcore rooms. This could indeed be related to persistent data storage. Here's what might be happening: Persistent Data in Normcore When a room server shuts down (typically 30 seconds after the last player leaves), any objects marked as persistent are saved to storage and restored when someone rejoins that room Room > Datastore. If you have a large amount of persistent data in specific rooms, it might be causing issues during reconnection. Lifetime Flags and Persistence Normcore uses lifetime flags to determine how long model data should be retained. By default, models with destroyWhenOwnerOrLastClientLeaves set to false will persist between sessions Server Authority + Ownership + Lifetime Flags. Possible Solutions: 1. Create a new room with a different name: As you've noticed, using different room names works because they don't have the accumulated persistent data. 2. Clear persistent objects programmatically: You could create a "reset" function that destroys persistent objects before disconnecting. 3. Change lifetime flags: Ensure objects that don't need to persist have destroyWhenOwnerOrLastClientLeaves set to true. 4. Use offline mode temporarily: Connect to the problematic room in offline mode, which creates a separate instance that doesn't share data with the online room Offline Mode. This won't clear the persistent data but might help diagnose if that's the issue. If these solutions don't resolve your issue, I'd recommend reaching out to the Normcore team through their Discord as mentioned in their Common Questions documentation for more specific assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5d ago
<@224651563107483649> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Roulace
RoulaceOP5d ago
Just so we're clear, how do I know if an object is marked as persistent?
maxweisel
maxweisel5d ago
it shouldn’t be possible to store too much data (Normcore will send the initial datastore over in chunks first connect) I have seen bugs around too many scene views being initialized in one packet what error are you getting on connect?
Roulace
RoulaceOP5d ago
I'm not sure how to get an error. It doesn't print any. A try / catch on "normcore.connect()" didn't return any error either. I have a function that checks didConnect and attempts to reconnect if it fails.
maxweisel
maxweisel5d ago
Normcore will print an error log. Could there be another issue if you’re not getting a log at all? Does it move to a connected state ever? I have seen folks get immediately disconnected with no error if they’re initializing too many scene views on connect
Roulace
RoulaceOP5d ago
Only 1 scene should be loaded. Wait, is this the error we're looking for?
No description
Roulace
RoulaceOP5d ago
No wait, that's mine. Yeah sometimes it connects, but there's weird bugs after it does. Like, some interactive/networked objects don't appear.
Roulace
RoulaceOP5d ago
The error above only shows because I'm checking for room connection like this:
No description
Roulace
RoulaceOP5d ago
Is this not the way I'm supposed to check for connection?
Roulace
RoulaceOP5d ago
Here's the normcore variable declaration:
No description
Roulace
RoulaceOP5d ago
And again, it's only certain rooms. I see "Realtime: Connecting to room "<room name>"", then the next log message is "Disconnected from room "<room name>"". Well, I'm not sure what else to do. For now we're changing all room names slightly. Hopefully this isn't a problem again in the future. 😅
maxweisel
maxweisel5d ago
are you able to connect to a stuck room with a blank project if you use the same app key / room name?
Roulace
RoulaceOP5d ago
Same thing happens with a new project. Rooms 1, 2, 3, and 6 connect and disconnect, but other numbers work fine.
Roulace
RoulaceOP5d ago
No description
No description
Roulace
RoulaceOP5d ago
If I change the "3" to a "99" I get this: (works fine)
No description
Roulace
RoulaceOP3d ago
Im still thinking it has to do with persistent data. @kapa.ai how do I clear persistent data from a specific room?
kapa.ai
kapa.ai3d ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- You're right to focus on persistent data as a potential cause of your connection issues. Normcore doesn't provide a direct API to clear persistent data for a specific room from outside the room, but there are several approaches you can take: Methods to Clear Persistent Data from a Specific Room 1. Create a "Room Cleaner" Script: - Connect to the problematic room - Find and destroy all persistent objects using Realtime.Destroy() - For example, you could create a tool that erases brush strokes by calling Realtime.Destroy() on them Creating a Multiplayer Drawing App 2. Change Lifetime Flags Temporarily: - Connect to the room - Find all persistent objects and set their destroyWhenOwnerOrLastClientLeaves flag to true - Disconnect as the last client, which will trigger their destruction 3. Use Ownership to Clear Objects: - Connect to the room - Request ownership of persistent objects using RequestOwnership() - Then destroy them with Realtime.Destroy()
RealtimeView myObjectView = persistentObject.GetComponent<RealtimeView>();
myObjectView.RequestOwnership();
Realtime.Destroy(persistentObject);

RealtimeView myObjectView = persistentObject.GetComponent<RealtimeView>();
myObjectView.RequestOwnership();
Realtime.Destroy(persistentObject);

Requesting ownership of a RealtimeView Remember that when the last player leaves a room, the room server remains running for about 30 seconds before shutting down. Any objects not flagged for destruction will be written to persistent storage Common Questions. If these approaches don't work for your specific situation, you might need to contact Normcore support directly as they may be able to clear persistent data for specific rooms on their backend. I hope this helps with your connection issues! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3d ago
<@224651563107483649> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Roulace
RoulaceOP3d ago
@kapa.ai these would work if I could connect to the room. Also, one of them is apparently a scene view. What is a scene view?
kapa.ai
kapa.ai3d ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I understand your frustration - these solutions would only work if you could connect to the room in the first place. Let me explain what a scene view is and suggest some alternative approaches. Scene View in Normcore A scene view refers to a RealtimeView component that exists in a Unity scene file (as opposed to being instantiated as a prefab at runtime). Scene views have a unique identifier called a Scene View UUID that helps synchronize the view's model in the datastore when clients connect to a room Realtime > RealtimeView. Scene views are different from prefab views in that: - They have a Scene View UUID property in the Inspector - They're synchronized using this UUID when clients first connect - They're part of your scene hierarchy rather than being instantiated at runtime Alternative Approaches for Rooms You Can't Connect To Since you can't connect to the problematic room, here are some alternatives: 1. Use Offline Mode as a Workaround: Connect to the room in offline mode first, which creates a separate instance that doesn't share data with the online room:
_realtime.Connect("ProblemRoom", new Room.ConnectOptions {
offlineMode = true
});

_realtime.Connect("ProblemRoom", new Room.ConnectOptions {
offlineMode = true
});

Then switch back to online mode with a different room name Room > Offline Mode. 2. Contact Normcore Support: Since you can't access the room directly, reaching out to Normcore support is likely your best option. They can potentially clear persistent data for specific rooms on their backend. You can contact them through their Discord as mentioned in their documentation Essentials > Common Questions. 3. Use a Different Room Name: As you've already discovered, using a different room name works because it doesn't have the accumulated persistent data. This might be your simplest solution for now. If the issue is specifically with a scene view that's causing problems, you might need to reset its View UUID in the editor for future deployments, though this won't help with the currently problematic room Realtime > RealtimeView > Advanced Settings. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3d ago
<@224651563107483649> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Roulace
RoulaceOP3d ago
I apologize, i thought a "scene view" meant i was loading multiple Unity scenes at the same time. We do have several realtime views initialized through the scene, but wouldnt that be a problem for all rooms not just a select few? Ive found a realtime component that might be saving too much data over normcore without clearing it. To confirm that theory id like to clear data on specific rooms which I can no longer connect to. Any chance you could help me go about that?
maxweisel
maxweisel3d ago
hmm, what version of Normcore are you on?

Did you find this page helpful?