The new body movers, in my case AlignOrientation and LinearVelocity, have an Active property, which is set to true if the constraint is ‘active’ in the world.
I am noticing problems with using these body movers with Streaming Enabled turned on. I have LinearVelocity and AlignOrientation in the two Gliders on a test train chassis shown below. As you can see, they are not all Active:
I am the network owner of all the parts in the entire train, however for some reason the rear coach’s LinearVeloicty isn’t “active”. The front coach however, which I am sat in, is.
Rear Coach:
This results in the rear coach not moving when I update the VectorVelocity in the two gliders of the rear coach, meanwhile the front coach moves perfectly fine. This obviously causes problems as I would expect the entire train to move as I am applying Velocity to all 4 LinearVelocities.
However, when I turn Streaming Enabled off, this doesn’t happen. All of the Linear Velocities are ‘Active’, and both the coaches move as expected, thus meaning that Streaming Enabled is causing this problem. I have tried many Content Streaming settings, such as the StreamOutBehavior, StreamingRadiuses etc, and have even had the train’s ModelStreamingMode set to Persistant so that it’s never streamed out, but the problem still occurs. Thus, something in regards to having Streaming Enabled turned on, is causing the new BodyMovers to not became active when they should be.
Repro file was attached to the internal ticket by a Roblox Staff at the request of OP. When using this file the following should be noted:
At first none of the Linear Velocities are active.
Once the player jumps into the vehicle seat, which sets the player as the network owner of all the parts in the train, the coach which the vehicle seat is in has its Linear Velocity active, meanwhile the rear coach’s Linear Velocities still remain unactive.
Thus when updating the velocity of all 4 gliders, only the front coach moves (note that the coaches are connected via a rod constraint so in order for the front coach to move this must be disabled)
Can you give some detailed instructions on how to drive the train? I’ve entered the driving seat and I’ve tried turning off the brakes with " and accelerating with a but can’t drive the train, even when I have streaming disabled.
That’s because I sent a new file with the simplified train in the images after @Focia19 mentioned the file could be publicly available. I send him the new file with the simplified train after that.
I have dmmed Focia with the updated file incase its gone missing.
I believe the behavior you are seeing is happening because you are using a target radius of 64 with opportunistic stream out. This is resulting in the rear of the train being in a streamed out region while the player is in the front of the train. As a result physics is being disabled on the rear parts since they are in incomplete (partially streamed out) regions and simulation could be incorrect.
If I set the target radius to a larger value I do not see this behavior.
I noticed that too. Yes I am able to use a larger target radius, however I have also seen, at very rare times, the LinearVelocity being ‘inactive’ for a split second on the rear coach which is causing problems with longer consists; obviously having only the front coach work but the rest stop working for a split second can cause physic issues and even derailments.
I therefore replicated the most serious of the problem (having streaming radius at 64 which causes the LinearVelocity to always not be active) in order to report this to you.
Surely if the model is streamed in, the LinearVelocity should be active? That’s what I see the problem as.
This is intentional–what I would suggest is just follow what the other people said in my thread. (Setting network ownership to the server manually, this should solve your problem assuming you don’t need fully client-sided physics.)
It isn’t the LinearVelocity being “inactive”, it’s the physics freezing past a certain point.
I do need client-sided physics, as the player driving the train needs to be the network owner of the train. My fear is that even on a higher streaming radius, a long train could occasionally have one of its coaches LinearVelocity going ‘inactive’ and causing the entire train consist to derail because one of their coaches stops working.
Yeah you’re in the same situation I’m in–there’s no way to have streaming + client-sided physics, even with “persistency”.
Either turn off streaming or pray that they will accept that feature request. For your case, there doesn’t seem to be a workaround.
Good luck.
That sucks. I really didn’t think it was related to that. I have replied on your thread to back this feature. As far as I’m concerned, if the model is streamed in, the LinearVelocity should always be ‘active’.
We are discussing options for better handling your scenario.
As for workarounds you can use currently, I would recommend setting your target radius larger than your longest train. You could also increase your minimum radius, but be careful about using a very large minimum radius as that can result in some impact on engine performance.
Have you tried using RequestStreamAroundAsync to help with this issue? For example, when someone enters the driver’s seat of the train perform a RequestStreamAroundAsync on the farthest end of the train.
Not currently, as my train system is WIP at the moment and not in a position for ‘full trains’ yet. A question regarding this though, would this just need to happen when a player enters the seat, or would this need to be on a recurring loop when the train is moving in order to keep the area around the rear of the train loaded in?
This seems like a bad idea. You’d have to be running it near-constantly to keep up with a train, and as I’d been told before, request stream async can cause performance hits if it’s ran too often.
I ran into this a ton when I was trying to set a specific area to be permanently rendered in, and there was no real way to just set a spot or object to be a seperate focus target for replication without spamming the request and praying it doesn’t de-render it some time after the request is made.
My suggestion was to do the RequestStreamAroundAsync only when you initially start driving the train. Once the train is being driven as long as it fits within the target radius it wouldn’t be streamed out due to opportunistic stream out. If you think low memory clients might stream out due to memory constraints you may need to increase the minimum radius.
Can’t you just set the train model to atomic or persistent?
Also, I am having this issue with my trains (which use a single LinearVelocity in the front carriage) - the active property is always false, however, the issue is not resolved by turning off StreamingEnabled. Enabling the LinearVelocity also freezes the PrismaticConstraints I have connected to the part for suspension. Using a VectorForce instead, the train moves.
Edit: Using a BodyVelocity it works perfectly fine (and a bonus I can change the PID settings). I’m using my own custom VectorForce PID, but it isn’t able to keep the train perfectly still. BodyVelocity sets instantly and applies the force smoothly.
Forgot to mention, this occurs in my game when a LinearVelocity is created under a Part in an assembly on the client. The client has manual network ownership of the assembly.