NWH Dynamic Water Physics 2 Integration

Necopoles

New member
In a recent release, we got an integration with NWH Vehicle Physics, but are there any plans to integrate with their other asset, NWH Dynamic Water Physics? I've tried many workarounds to get my character to play nice with this asset but the dynamic physics of the ship combined with the kinematic character makes this a tough solution for me to find.
 
I haven't used that asset before but I've made a note of it. In theory you should be able to perform similar steps as the Vehicle Physics integration but without seeing how Dynamic Water Physics works I'm not sure.
 
I haven't used that asset before but I've made a note of it. In theory you should be able to perform similar steps as the Vehicle Physics integration but without seeing how Dynamic Water Physics works I'm not sure.
I'm going to take a look tonight at trying to adapt the vehicle physics integration. I don't know if the fact that the player can walk around on a boat/ship vs sitting stationary in a car makes a difference, but I'll report back if I figure anything out.
 
I'm going to take a look tonight at trying to adapt the vehicle physics integration. I don't know if the fact that the player can walk around on a boat/ship vs sitting stationary in a car makes a difference, but I'll report back if I figure anything out.
I recently had a customer doing a boat system, unsure what they were using for the boat, but they wanted to be able to walk around on it, So I added a platform passenger system also. Basically they wanted to be able to walk around on a boat and then take control of the wheel. They did achieve this with my asset. With that said check out the Ultimate Seating Controller add-on :) I have seen it used for various other vehicle systems with great success. I have also done tests with some of the vehicle assets I own. The crest submarine was very fun and a great example so I included in the documentation how to do it.
 
I recently had a customer doing a boat system, unsure what they were using for the boat, but they wanted to be able to walk around on it, So I added a platform passenger system also. Basically they wanted to be able to walk around on a boat and then take control of the wheel. They did achieve this with my asset. With that said check out the Ultimate Seating Controller add-on :) I have seen it used for various other vehicle systems with great success. I have also done tests with some of the vehicle assets I own. The crest submarine was very fun and a great example so I included in the documentation how to do it.
FastSkillTeam,

I picked up your asset and it has integrated perfectly with my boat. It can even use multiple platforms to act as walls and allow the player to move inside my ship. Very versatile and easy to implement, so thanks for the recommendation.

The only thing I wanted to ask about is the jittery movement when in motion. It's almost like a sort of rubber banding, not game breaking but definitely noticeable. Is this an issue of the update function in one of these assets or is there something else you can think of in play? I've played around with the physics a bit with no luck. Thanks.
 
Could you let me know what settings your boat has on the rigidbody and how your seats are setup please?

I thought the best thing to do would be to start a fresh project with default settings rather than try to isolate the issue in my complex project. Without doing anything and just hitting play, you still get that rubber banding when standing on the moving platform. But when I went to record what was happening to show you, I stumbled upon something kind of hilarious. When recording, the physics are buttery smooth. You can see the video in the attached link (attaching media here wasn't working for me).

I'm guessing it's due to the recorder targeting a constant frame rate? Is the platform script updating each frame or when the physics engine is updating? Thanks.
 
I will have a look into this as soon as I get a chance and get back to you. Thanks for breaking it down to the demo scene, that makes it easier to diagnose.
 
Just to let you know, I have this fixed for next update, but I found some other issues with the platform setup, bear with me as I get this fixed up. The other issue I found is not too dramatic, I am just trying to sort out the most robust solution and tidy up BoardSource platforms overall (it was added hastily I will admit).
 
Also I would love your opinion here... copy/pasted from my discord channel for USC...


Do you think a seat change is actually necessary for BoardSource Platforms? Or would it be enough to just walk up and interact (provided the BS is empty) instead of both? Considering you have switched to a platform, I guess the seat change is not truly required and maybe a feature creep thing I should not have added... Since I revised the code and am thinking of it, it kinda does not make sense... say a player was on an oil tanker, switched to platform and walked 1km+ to the other end, they could just switch back and teleport to an empty... I think that is a game killer tbh. I have a fix for BoardSourcePlatforms coming and have been doing other work on them to polish them up, which led me to this question...
 
Also I would love your opinion here... copy/pasted from my discord channel for USC...


Do you think a seat change is actually necessary for BoardSource Platforms? Or would it be enough to just walk up and interact (provided the BS is empty) instead of both? Considering you have switched to a platform, I guess the seat change is not truly required and maybe a feature creep thing I should not have added... Since I revised the code and am thinking of it, it kinda does not make sense... say a player was on an oil tanker, switched to platform and walked 1km+ to the other end, they could just switch back and teleport to an empty... I think that is a game killer tbh. I have a fix for BoardSourcePlatforms coming and have been doing other work on them to polish them up, which led me to this question...
I can’t speak for how others use the platform system, but for me I was able to easily adapt it to start upon the player standing on the platform pretty easily anyway. So for me, no I don’t utilize the seat change to get to the platform. But if it’s an issue of needing to overhaul the platform system, I personally don’t think it’s an urgent thing because I was able to tweak it easily enough. The stuttering did stump me though.
 
Also I would love your opinion here... copy/pasted from my discord channel for USC...


Do you think a seat change is actually necessary for BoardSource Platforms? Or would it be enough to just walk up and interact (provided the BS is empty) instead of both? Considering you have switched to a platform, I guess the seat change is not truly required and maybe a feature creep thing I should not have added... Since I revised the code and am thinking of it, it kinda does not make sense... say a player was on an oil tanker, switched to platform and walked 1km+ to the other end, they could just switch back and teleport to an empty... I think that is a game killer tbh. I have a fix for BoardSourcePlatforms coming and have been doing other work on them to polish them up, which led me to this question...
The platform was working smoothly in the demo at first, but it went back to rubber banding and I can't seem to get it to work smoothly again. I reloaded my project files because I thought it might be an serialization thing but no luck. I'm using a large number of colliders as platforms on my ship and they work fine regardless of the number but still jitter when moving. Instead of requiring the player to enter using a seat I have the UCC MoveWithObject ability activate when the player enters the trigger collider of my ship.

The platforms behave fine using this method, and I don't believe it's the reason for the jitter because it was doing it when the player would enter via seat as well. Interpolation is set on all platforms. I have noticed that when I disable UCC Locomotion and parent the character to the ship, the colliders still stop the player but the jitters stop. This is obviously not a viable solution, just an observation. Personally, I don't need any feature except for the colliders stopping the character without my ship flying off into space or something like it would with normal colliders. Anything I can do to the code to slim things down more to my project's needs? Thanks for your patience with this.
 
The platform was working smoothly in the demo at first, but it went back to rubber banding and I can't seem to get it to work smoothly again.
That is odd, are you modifying CharacterInterpolation at all? it is set by code, and there is the option exposed per seat. Also with the platforms, just hopping on one should set the seat it is tied to active, you shouldn't even need to use MoveWithObject.
 
That is odd, are you modifying CharacterInterpolation at all? it is set by code, and there is the option exposed per seat. Also with the platforms, just hopping on one should set the seat it is tied to active, you shouldn't even need to use MoveWithObject.
No changes to character interpolation. All I have is my script setting the move with object target when inside the ship's collider. I also haven't changed anything in your scripts either. But the character doesn't inherit the transform of the platforms automatically as you said.

It seems like the platforms themselves are jittering, and therefore whatever is on them will do the same.

It's weird, it's almost like I'm stuck on the old version of your asset and updating it won't fix it. That's why I thought it might be a serialization thing but reloading my project files didn't fix it.
 
No changes to character interpolation. All I have is my script setting the move with object target when inside the ship's collider. I also haven't changed anything in your scripts either. But the character doesn't inherit the transform of the platforms automatically as you said.

It seems like the platforms themselves are jittering, and therefore whatever is on them will do the same.

It's weird, it's almost like I'm stuck on the old version of your asset and updating it won't fix it. That's why I thought it might be a serialization thing but reloading my project files didn't fix it.
In the demo scene does the platform automatically set when jumping on? I have tried to reproduce this in the demo and unable to. If you'd like to send me a package I can take a look at it for you.
 
In the demo scene does the platform automatically set when jumping on? I have tried to reproduce this in the demo and unable to. If you'd like to send me a package I can take a look at it for you.
I figured out where I was going wrong. None of my platforms were triggers, so it wasn't activating the platform ability. I think the disconnect could have something to do with our setups. I have a decently powerful computer but I'm getting about 60-70 fps in your demo scene. When I'm standing on the platform and the ability is activated, when running at a normal FPS it is smooth. If I click on another vehicle or otherwise do something to drop the framerate down to 30-40, it jitters again. The lower the frame rate, the worse it is. I've been able to make it work well enough regardless, but if you can figure out a way to artificially drop your FPS, I'm curious to know if you'll see the same result?
 
For anyone else having this issue here's how I fixed it:

1. I downloaded Cinemachine and followed the UCC guide for setting the cameras up however you need it configured. That guide is in the UCC documentation on this website.
2. Set the update method and blend update methods on the Cinemachine brain to Fixed Update.
3. This still left a noticeable jitter, so I reduced the fixed timestep in Project Settings/Time/Fixed Timestep from 0.02 to 0.01 and that just about eliminated the problem. I've read that doing this can impact performance, but I haven't noticed anything severe.
 
Top