fgamez1020
fgamez102017h ago

Networking

I have a game with 4 players and when its user turn I transfer ownership of all the items to the current user, as the game moves forward networking starts feeling really slow and weird when grabbing objects and things
9 Replies
kapa.ai
kapa.ai17h ago
Hi @fgamez1020. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I understand you're experiencing slowdowns in your multiplayer game when transferring ownership of items between players. This is a common issue when handling multiple ownership transfers in Normcore. Let me explain what might be happening and how to address it. Why This Is Happening The slowdown you're experiencing is likely due to several factors: 1. Ownership Transfer Overhead: Constantly transferring ownership of multiple objects creates network traffic that can build up over time. 2. Delayed Updates: When you transfer ownership of many objects at once, the datastore updates can become delayed. Normcore sends updates at a default rate of 20Hz, and these can get backed up when there's a lot of state changing at once . 3. Non-Linear Scaling: Multiplayer networking doesn't scale linearly. Even with just 4 players, the server is managing 16 total streams (4 incoming, 12 outgoing), and this complexity increases with each object that needs synchronization . Solutions to Consider Here are some approaches to improve your game's networking performance: 1. Minimize Ownership Transfers Instead of transferring ownership of all items to the current player, consider a more selective approach: - Only transfer ownership of objects that the current player needs to interact with - Use a central authority model where one client (or the server) maintains ownership of game state 2. Use RealtimeTransform Properly If you're using RealtimeTransform for your objects: - Only request ownership when you actually need to move an object - Remember that you only need to request ownership of the transform, not the entire view 3. Adjust Datastore Frame Duration You can modify how frequently updates are sent:
// Adjust the datastore frame duration (default is 1.0/20.0 = 20Hz)
realtime.room.datastore.datastoreFrameDuration = 1.0f/10.0f; // Set to 10Hz
// Adjust the datastore frame duration (default is 1.0/20.0 = 20Hz)
realtime.room.datastore.datastoreFrameDuration = 1.0f/10.0f; // Set to 10Hz
A lower update frequency (like 10Hz) can work well and reduce bandwidth usage. 4. Consider Object Pooling Instead of constantly creating and destroying objects (which requires ownership transfers), use object pooling to reuse existing objects. 5. Rethink Your Game Architecture Your turn-based game might benefit from a different networking approach: - Consider using a server-authoritative model for game state - Avoid RPC-style events for game state changes, as these can lead to desynchronization issues By implementing these changes, you should see improved performance in your multiplayer game, especially as play sessions get longer. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai17h ago
<@1053407831916822528> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
fgamez1020
fgamez1020OP17h ago
@rMadrid13 checa esto
rMadrid13
rMadrid1317h ago
simon, aqui lo reviso
fgamez1020
fgamez1020OP17h ago
son dos 3 cosas por ejemplo yo si le estoy dando el ownerhisp de todo el view no nomas del transform entonces eso puede ser tambien
s_q_u_i_s_h
s_q_u_i_s_h17h ago
"central authority model" lower update frequency turn-based game might benefit from a different networking approach varias opciones
maxweisel
maxweisel16h ago
This AI answer is totally wrong changing ownership should not be introducing latency What would really help is a video of the issue you’re seeing. “Feeling slow and weird” doesn’t really help our team diagnose what’s going on If you’re on Quest, including the OVR Profiler overlay in the video would be a huge help too
rMadrid13
rMadrid1311h ago
Many thanks Max, we're on Apple Vision Pro
fgamez1020
fgamez1020OP11h ago
Thank for the feedback Max, appreciate it

Did you find this page helpful?