Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

[Solved ]Networking unity 5

YoirglYoirgl Posts: 142 Oculus Start Member
Hello everyone.
I read the documentation here
https://developer3.oculus.com/documentation/avatarsdk/latest/concepts/avatars-gsg-unity/
But as I am working on a project where potentially lots of avatars might be in the same place at the same time i was wondering if there was any way i could customize the amount of data being recorded and if not, if there's any way for me to update manually a remote avatar pose using only simple positions (head position, head rotation, hand position, hand rotation) I've been trying to update my avatar poses manually with no luck.
Anyone ? :)

Comments

  • YoirglYoirgl Posts: 142 Oculus Start Member
    *bump*
    @Oculus ?
    Anybody could help me on this ?
    for the moment, if i test with 50 clients, it means i'm getting (50 players* 50 players positions  * 20 updates per seconds * 600byte pose (compressed byte[]) / 1024 = 29.3MB/s upload on the server and that's just for 50 players seeing each other.
    I really need some assistance on this or am I forced to discard the avatar system and build my own ?
    Yoirgl
  • YoirglYoirgl Posts: 142 Oculus Start Member
    Hi,

    I am currently looking into this and will advise you on what information I find that is applicable to your situation.

    Did you find anything so far ?
    I found that i can send my positions updates in 60-100 bytes but I still can't find a way to apply them to the remote avatar.
  • YoirglYoirgl Posts: 142 Oculus Start Member
    Here is an update for you regarding your query:

    Customizing the amount of data being sent is not supported at this time. However, you can drive the update functions with whatever data you want.

    To accomplish the hand position/rotation and head position/rotation you mentioned, look into the code inside "OvrAvatar.cs" and adjust the "Update()" method. In there the way that the SDK underneath is actually driven is through calls like these:

                        CAPI.ovrAvatarPose_UpdateBody(sdkAvatar, bodyTransform);

                        CAPI.ovrAvatarPose_UpdateHands(sdkAvatar, inputStateLeft, inputStateRight);

                        CAPI.ovrAvatarPose_Finalize(sdkAvatar, Time.deltaTime);



    If you provide other state to those functions it will drive the avatars differently.


    Excellent that's what i needed indeed.  Thanks :)
  • masterchopmasterchop Posts: 41
    Brain Burst

    Excellent that's what i needed indeed.  Thanks :)
    If this worked for you how much did it change on your build?
    Did you notice a big change? Did you manage to keep 50 players on the same room? 
    Another question, how did you manage 50 players at the same time. I mean how to test that?
  • YoirglYoirgl Posts: 142 Oculus Start Member

    Excellent that's what i needed indeed.  Thanks :)
    If this worked for you how much did it change on your build?
    Did you notice a big change? Did you manage to keep 50 players on the same room? 
    Another question, how did you manage 50 players at the same time. I mean how to test that?
    Well it changed quite a lot yes.
    By playing around with compression of data and sending only what i needed and updating the poses manually i went from 600 bytes every 20th of a second to 30-50 bytes every 10th of a second per player. I couldn't test properly the 50 people in one room as i'm struggling with unity's LLAPI and am thinking about creating my own socket client-server system and have something robust before i can do some load test :)
    And about how to test, I would guess the best system is for the server to emulate players,  sending packets for virtual players who are not there and doing the same actions/pose as the main character.
    but according to my calculations (considering you have 50 players stacked together) if it's 50 players *50 playerupdates * 50 bytes *10per second =  1.19MB/s for the server + some overhead + some other info (spells being cast, etc)
    And that is the worst case scenario as my packets are more often closer from 30 bytes than 50 and 50 players stacked on one spot is also quite a lot.
    Now if anyone has in-depth knowledge of MMO networking, i would loooove some assistance with it so feel free to contact me ^^

    Yoirgl.
Sign In or Register to comment.