Physics Controller's API "FacingDirection" and "MovingDirection" consumes network more than it should

recently i ported the optimized code of mine from the previous game since my goal is to have many enemies rendered in one single screen, im impressed with how it turns out and my FPS remains 60 but the way this works rn kills my game a lot, i thought my code was unoptimized for a little bit but turns out 2 of these properties are not compressed like how humanoid does, moving the controller for all 100 with MovingDirection takes only about 40% while FacingDirection uses 60%

if you want to repo on this, i mostly used this as a setup first
https://create.roblox.com/docs/physics/character-controllers

after setting up the controllers, you would then spawn 100 of these, with whatever you want, note that it’s different from a traditional humanoid so both properties of ControllerManager requires Unit Vector3 which is a direction

A private message is associated with this bug report

1 Like

Can you provide more details? We don’t understand what is the bug.

the problem with this is the way it replicates 2 of these properties for ControllerManager, if you see the “Recv” up right next to ping you’ll see it going up to 100 kbs which for my game could contribute to pings if one of the other parts also sends huge amount of datas, my expectation was that it’ll be as optimized as current humanoid (which trades low bandwidth with bad performance)

my goal was to render more than 100 NPCs which i managed to pass 40 since that’s my goal, these 2 APIs accept unit vector and it’s easier to work with it but seeing how this turned out after looking at the bandwidth seems worrying in the future

i tried swapping with any physics constraint like AlignOrientation and LinearVelocity but neither of these solve the issues, rn im forced to make my own humanoid system with custom physics as a replacement

Are you seeing any issues from the higher “recv”? I tried the repro file but it looks fine.

Network receive is way higher when using ControllerManager compared to either Humanoids or using LinearVelocity and AlignOrientation. Replicating AI movement manually especially with buffers costs way less and doesn’t even come close in terms of bandwidth.

It shouldn’t be this expensive to handle basic movement. FacingDirection also ends up costing more than AlignOrientation, even though they’re doing almost the same thing. There was also a reply on the ControllerManager release thread bringing up the same issue with high network usage.

3 Likes

We have now implemented a change that should significantly mitigate the network traffic resulting from very frequent changes to NetworkDirection, FacingDirection, and UpDirection in ControllerManager. Please let us know if you are still running into issues with this. Thank you for bringing this to our attention!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.