Holidays??
Obviously, the speed of response is not one of its great values.
Sorry for the wait time. I respond to the email within a few hours but Unity Forums apparently decided to not notify me in any way about any activity on this thread, not even alerts up at the top which I check daily. I am really sorry for that - and no holidays by the way. You may also check my activity on the Wheel Controller 3D thread and you will se that I was active all this time. I also PMed your my Activity feed for the forum lacking any activity info despite the thread being watched. Seems like a bug to me.
Since it has a simple buoyancy feature built in, it will work with the asset. I cannot check and be sure 100% since I do not own it, but if it turns it does not I can offer a refund.
Sorry once again for the wait - I would also suggest that you contact me over publisher mail in the future as your will get response as soon I get notification on my phone.
Regards,
Aron
Thank you, Aron. Everything cleared up. These things happen with the technologies. I hope I can buy your products soon.
Regards.
I got alerted this time
Will this work with PlayWater?
Will this work with VR and if so wold it be as simple as adding a child to the boat and interacting with the wheel and throttle and pass the rotation value back to some class?
Yes, it will work with VR as all the physics is done through the rigidbody and forces. ShipController script that is included is very simple script that takes input from axes and calculates force and rudder rotation from it. So in short, yes you can add wheel and modify current script to receive values or make a new ship controller script since physics script is fully independent from ship controller.
As for PlayWay - it should work and I have tested it BUT PlayWay (both asset store and beta version) have a quite serious bug meaning you cannot get water height, or better said you get it but it seems random at times. I was in contact with author of PlayWay Water but ever since I brough up the issue with water height he has gone silent and does not respond. If he fixes the water height function to return the correct values then yes, it does work. You can PM me for the WaterInterface.cs script for PlayWay, or modify it per included manual. Whichever you like.
Just purchased. Will package work with Hydroform?
I have just sent the developer of Hydroform a mail and will be able to inform you after I get the response. There is no mention of ability to get water height at point and that is something that is needed. Most water assets appear to have that ability but I am not going to assume.
Just tested and DWP works with Ceto ocean out of the box and quite well.
Here is the WaterInterface.cs script for Ceto (as per manual):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Ceto;
public class WaterInterface : MonoBehaviour {
public Ocean ocean;
private void Start()
{
ocean = GetComponent<Ocean>();
}
public float GetWaterHeightAtLocation(float x, float z)
{
return ocean.QueryWaves(x, z);
}
}
Here is the WaterInterface.cs for UltimateWaterSystem (Which is based on PlayWay, but has a lot of the bugs allready mentioned fixed, and from the results, I see that water height seems to be one of them). :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UltimateWater;
/// <summary>
/// Attach this script to your non-flat water system.
/// </summary>
public class WaterInterface : MonoBehaviour {
// Replace "WaterSystem" with your type.
public Water myWaterSystem;
private WaterSample waterSample;
private Vector3 currentWaterLevel;
private Vector3 currentWaterForces;
public float waterHeight;
private void Start()
{
// Ultimate Water System
myWaterSystem = GetComponent<Water>();
waterSample = new WaterSample(myWaterSystem, WaterSample.DisplacementMode.HeightAndForces, 1.0f);
// Hack to let Ultimate Water Wake Up, otherwise it throws an error it can't find water.
Invoke("StartWaterSampling", 0.5f);
}
void StartWaterSampling()
{
waterSample.Start(Vector3.zero);
}
/// <summary>
/// Return water height y in world coordinates at world point x, z
/// </summary>
public float GetWaterHeightAtLocation(float x, float z)
{
waterSample.GetAndResetFast(x, z, myWaterSystem.Time, ref currentWaterLevel, ref currentWaterForces);
waterHeight = currentWaterLevel.y;
// Do not forget to uncheck "Flat Water" under Additional Options of FloatingObject.
//Debug.Log("Water : " + currentWaterLevel); // Will Slow down performance, to further speed this up make waterHeight Private
return waterHeight;
}
}
Note: Updated Code here, as I didnāt want to leave a faulty version in this thread.
Might be nice for UnityDynamicWater to support the Water Current Vector Data [currentWaterForces], to push the ship around.
Great! Thank you very much for the post and great to hear that it was fixed (one way or another).
I am rounding up all the scripts and will include them in the next version.
Ok, you might want to fix the link on the store, because it takes you to the beta(this page) and not the release forum.
I also suggest you have different āAddOnā packages that ship with Dynamic water, that support different water systems. I have updated the script in the main/release Forum area so use that one, this one complains after initialization that the āWaterā object canāt be found. So I built a bit of a delay into the other script, Iām abandoning this one as I assume things will move to the other page.
Also you have my official stated permission to use that script in your product, it took me all of 10 minutes to put together, since Iād done it before with other physics packages, including trying to make my own, which failed miserablyā¦ took forever, and has 1/8āth of the features yours does.
Does anyone know if this work well when you increase the timeScale value (Time.timeScale) to lets say 100x. Many other similar products I tried become unstable at this point, but for our ML purposes this speed-up is essential. If this would work we would definitely consider buying this product.
Hello,
I have just tried it on the clean project and it does work. Since time scale is 100x this will also reduce performance. You might want to play with fixed delta time too if you are thinking of doing such high speedups.
@NWHCoding Iāve been doing some optimizations in my code (trying to track down memory leaks) and noticed that Dynamic Water Physics was generating a lot of garbage each frame. It looks like most of it comes from generating new BuoyTriās and WaterLineās.
I modified the code to instead initialize arrays of BuoyTriās and WaterLineās and just re-use them, I modified the classes to have an update function as well. Let me know if you want the changes that I made for any subsequent updates if this hasnāt already been addressed.
Oh, also I should mention that I am using Ultimate Water System (formerly Playway). You can get the water height queries to work in the Water Interface by not using the WaterSample class, instead just use water.GetUncompensatedHeightAt(x, z, Time.time);
However, this is slower than the WaterSample class, so instead I opted for modifying FloatingObject to create an array of WaterSamples, so thereās 1 sample for each dummyMeshVert. This seems to work fine.
It seems that you spent quite a some time on DWP.
Seems good, did you take into account the fact that each triangle can be split up to three smaller triangles?
If you want you can send the package and I will look into adding it into future updates, also since you spent so much time I can offer a refund.
As for the PlayWay - thank you for the tip. I am pretty sure I tried it back when I was trying it out with PlayWay and it was very buggy. But that was some time ago and it could be that they fixed it since.
Also, sorry for the (very) delayed response.
Yes, its taking the triangle splitting into account, so there is some extra overhead, but the tradeoff is not allocating memory for every fixed update.
No need for a refund, I can shoot you a PM with the changes I made sometime this week.
Sounds good. I actually implemented the same thing in my other asset Wheel Controller 3D a month or so ago and it did help, especially on mobile. DWP is getting an update soon with better ship controller since there is a lot of interest in that, I will put in you optimizations in then.
Hi!
Your simulator looks really close to what I want, just have some questions:
How resource-intensive is the part that creates the dummy meshes?
Iām making ships from up to 50K-ish low vertex(maybe 50 average) parts, they can be modified on the fly and destroying parts of the hull can open up pretty big internal compartments.
Might need an entirely different approach but if this one is working for that case itās plenty to start.
Do you have any way of handling āleaksā(in-game hull isnāt breached, just water getting in)?
If this asset can handle everything else plan B is simply adding some extra force/mass from the water inside, just checking
Do you have something like UWSās āVolume maskingā?
Donāt know if thatās the common term, I mean the removal of water from submerged volumes.