Upgrade Notes
Version terminology
The current Dynamic Water Physics product release and UPM package
com.nwh.dynamicwaterphysics both use version 14.3.0. Earlier sections below
refer to historical product releases, including the 2.x and 3.x lines.
Current package prerequisites
The current package manifest declares:
- Unity 6000.0.80f1 or newer.
- Input System 1.11.2.
- Universal Render Pipeline 17.0.3.
- NWH Common 14.3.0.
Package Manager resolves these declared dependencies. Optional water-integration samples can require additional third-party packages; install those before importing the sample. The Unity HDRP Water sample additionally requires a compatible HDRP installation.
Product 14.2 beta to 14.3.0
- Shipped Input Actions wrappers no longer regenerate during package import, preventing supported Input System versions from rewriting package-cache source. Use runtime rebinding or a project-owned action asset/provider for custom controls. Maintainers editing a writable embedded package must explicitly enable Generate C# Class, regenerate and review the wrapper, then disable generation again before publishing.
- Custom
WaterDataProviderintegrations remain source compatible.GetWaterHeightsFlowsNormals(...)is now virtual so a provider can optimize the combined query; its parameters and default behavior are unchanged.RaycastWaterDataProvider.OnDisable()remains public and virtual through its override and now also performs the base provider cleanup. - The Lux Water sample retains the serialized public
timeOffsetfield. The PUN2 sample retainssimulateWaterObjectsOnClient; ownership detection no longer requires the Photon 2.22 callback API, but the water-simulation choice and serialized data contract are unchanged. - The Crest integration sample assembly is named
NWH.DWP2.Integration.Crest, matching its asmdef filename and the other integration samples. A project asmdef that listed the formerCrestDWP2Asmdefby name must be updated; references by GUID are unaffected. - Re-resolve packages after upgrading. DWP UPM 14.3.0 requires NWH Common 14.3.0.
com.unity.burstis no longer a declared dependency. Nothing in the package uses it and URP still brings it in, so a URP project resolves the same set as before. A project that relied on DWP to install Burst must declare it itself.- The package no longer ships markdown files or test assemblies.
README.mdis nowReadme.txt; the manual lives at the documentation URL in the package manifest. WaterObject.submergedVolumeis now a geometric volume in m3. Code that divided the former value byfluidDensitymust remove that division.- Hydrodynamic pressure now follows
0.5 * rho * speed^2 * submergedArea * Cd. The older solver effectively used a different speed law, so there is no single coefficient that preserves force at every speed; retune customhydrodynamicForceCoefficient, slam, and suction values around the vessel's intended operating speed. skinDragCoefficientis now a conventional skin-friction coefficient in0.5 * rho * speed^2 * area * Cf, weighted by the tangential fraction of each patch. The shipped prefabs and the component default use0.004(the practical ITTC range is roughly 0.003-0.005). Migrate custom values near the old 0.01 baseline to 0.004, then play-test top speed and turning response; the changed angular weighting prevents exact scalar equivalence.GetRollAngle()now follows its API contract: positive is starboard down and negative is port down. Invert custom stabilization or UI code that compensated for the old sign.- Sail lift and drag curves are evaluated over -180 to +180 degrees. Lift is read as an absolute
value and drag is clamped non-negative, so a curve authored as a magnitude (even about zero) and
one authored conventionally (odd about zero, negative lift at negative angles) behave the same.
The apparent wind picks the side the force acts on. The shipped square preset uses
liftScale = 0.6and re-authored curves. SailControllermeasures angle of attack along the chord from the leading edge (a/b) to the trailing edge (c/d), which is the convention published sail coefficient tables use. The 14.2 beta measured from the opposite end, so reported angles are offset by 180 degrees. A custom preset authored against the old readout has to be re-authored; see Angle of Attack.Thruster.Inputreturns the sign of its own input channel instead of the negated value. Applied thrust and propeller rotation are unchanged, so no prefab or tuning value moves, but project code reading the property must drop the compensating negation.- PUN2 ownership is detected without
IOnPhotonViewControllerChange, so the optional sample remains compatible with releases before PUN 2.22 as well as current PUN2.
Historical product-version migrations
Product 2.x to 3.x
- Clean import through Package Manager is required.
- NWH Common became a package dependency.
- Third-party water integrations moved to the Dynamic Water Physics 2 Samples tab in Package Manager.
- Use the integration sample's assembly definition instead of modifying the
package's
NWH.DWP2assembly.
2.6 to 2.7
- Clean import required.
- Required adjustment of CenterOfMass on VariableCenterOfMass script since the CoM is now set as an absolute value instead of an offset.
2.5.5 to 2.5.6
- Clean import required.
- WaterDataProviders moved from renaming the files to remove the .txt extension to using Scripting Define Symbols. Check the WaterDataProvider documentation for the new instructions.
2.5.3 to 2.5.4
- Clean import required.
2.5.2 to 2.5.3
- VariableCenterOfMass
Center Of Mass OffsetandInertia Scalemight need re-adjusting due to changes in the VariableCenterOfMass script. Effective inertia in the new version will be ~3 times lower than the calculated value in the previous version. Due to the bug fix that affected center of mass calculation, the center of mass with the new version will be different if anyIMassAffectors have been attached.
2.4.x to 2.5
WaterObjectswill need to have their simulation meshes re-generated by pressing Water Object => Update Simulation Mesh.WaterObjectManagerhas been removed and the settings have moved to individualWaterObjects.WaterDataProvidercan have an optionalColliderattached to the sameGameObjectwithIs Triggerenabled. Objects that are inside this trigger volume will use the data from thatWaterDataProvider.WaterObjectcan now work without anyWaterDataProviders present.defaultWaterHeight,defaultWaterNormalanddefaultWaterFlowwill be used in this case.
WaterObjectManager removal in product version 2.5
WaterObjectManager and its manual synchronization API do not exist in current
releases. Simulation is performed by each WaterObject during its own physics
update. A WaterObject instantiated or enabled at runtime does not need
registration or synchronization with a manager.
When upgrading a pre-2.5 scene:
- Remove the obsolete
WaterObjectManagercomponent. - Regenerate each
WaterObjectsimulation mesh. - Move former global simulation choices to the corresponding
WaterObjectcomponents.
2.4.1 to 2.4.2
- Asset now uses single assembly definition placed in the root directory of the asset, named NWH.DWP2. Any references that need to be added to external water assets now have to be added here instead of the NWH.DWP2.WaterData assembly definition.
2.3 to 2.4
- Clean import is required.
Project Settings > Player > API Compatibility Levelneeds to be set to.NET 4.x.CenterOfMassscript was replaced withVariableCenterOfMass.- Product release 2.4 introduced assembly definitions. In the current UPM
package the runtime assembly is
NWH.DWP2and is auto-referenced by Unity's predefined assemblies. Code in a custom assembly definition must addNWH.DWP2explicitly. Do not delete or edit package assembly definitions; current water integrations ship as separate samples with their own assembly definitions.
2.2 to 2.3
Due to asset restructure it is recommended to do a clean import of DWP2 when upgrading from 2.2 to 2.3.
2.1 to 2.2
Due to the number of changes, changed script names and locations it is recommended to do a clean import of DWP2 when upgrading from 2.1 to 2.2.
The update from 2.1 to 2.2 is a large one. Things to note:
WaterObjectmaterial settings have been moved to a separate script:MassFromVolumeand now requires button press (or a function call) to apply the mass.WaterObjectmaterials are nowScriptableObjects instead of a static list.- Cameras,
VehicleChangerand other scene scripts are now shared between NWH Vehicle Physics 2 and Dynamic Water Physics 2. This improved the quality of DWP2 scripts but unfortunately it means that these scripts will need to be re-added and reconfigured. - Input System needs to be installed and Project Settings > Input Handling needs to be set to both for demo scenes to work properly.
- Version 2.2 has a different approach to support for water systems. This has been greatly simplified but a re-setup will be needed. Check Water Asset Setup Guide for more info.
- Input in 2.2 works differently. Check Input page for more info.
- If using InputManager (old/classic Unity input) make sure to add
ThrottleandSteeringaxes to Project Settings => Input Manager asHorizontalandVerticalare no longer used.
1.x to 2.x
Due to a large number of changes between DWP1 and DWP2 most, if not all, objects will need to be reconfigured. DWP1 and DWP2 can co-exist in the same project due to different namespaces. Some scripts might have the same name in the AddComponent dialog if both versions are present.
Warning: Due to Unity Asset Store importer not recognizing different namespace scripts as different files you can not directly import one version from the Store while the other is present. Download and import the new version into an empty project and then copy it over manually to be able to use both assets side by side.
This is happening because some scripts retained their names in the new version and despite having completely different namespace Unity will still think they are the same script (only the filename is checked) and overwrite the one already inside the project. This means that if DWP2 is imported after DWP1, some of the scripts from DWP1 will be overwritten by those in DWP2.
Import Steps
The steps to import DWP2 with DWP1 present in the project:
- Make sure that your project is using Unity 2018.4 or newer.
- Create a new project using Unity 2018.4 or newer.
- Import DWP2 from Asset Store into the new project.
- Close the new project - ignore any errors if present (check README later for those).
- Open file explorer and copy the DWP2 folder from the new project into the project you are upgrading.
You could of course just delete DWP1 and import DWP2 but that will cause a lot of missing script errors on the existing objects, and it would make the upgrade method described below impossible.
Water Object Manager
The first DWP2 releases (product versions 2.0 through 2.4) required a
WaterObjectManager. Product version 2.5 removed it. When bringing an old DWP1
scene into the current package, do not add a manager; follow
WaterObjectManager removal in product version 2.5.
WaterObject
WaterObject (previously known as FloatingObject) editor has been rewritten and therefore the old one can not be used with the new system. Fastest way to upgrade would be removing the old Floating Object script, together with the old water effects system, and adding WaterObjectWizard component which will automatically configure the object. It is possible to run WaterObjectWizard on multiple objects at the same time.
Before upgrading it is always a good idea to make a backup.
Step-by-step:
- Filter out WaterFX objects and remove WaterFX components
- Do the same for FloatingObject. Do not deselect the objects afterwards.
- Add to the same objects that you have filtered WaterObjectWizard component
- Tick the option for WaterParticleSystem (replaces WaterFX) if needed and run the wizard
- Regenerate and review each new
WaterObjectsimulation mesh.
The scene is now upgraded. The settings will not carry over from WaterFX and FloatingObject to the new scripts so some manual tweaking is needed.