cancel
Showing results for 
Search instead for 
Did you mean: 

[Solved ]Networking unity 5

Yoirgl
Expert Protege
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 ? 🙂

http://unwise.software/
5 REPLIES 5

Yoirgl
Expert Protege
*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
http://unwise.software/

Yoirgl
Expert Protege


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.
http://unwise.software/

Yoirgl
Expert Protege


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 🙂
http://unwise.software/

masterchop
Protege



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?

Yoirgl
Expert Protege





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.
http://unwise.software/