Skip to main content
Version: 1.3.1

Oceanology NextGen - Ship Navigation

🚢 C++ Physics
🛤️ Spline Flow
🎮 Force-Based

Configure ship movement with spline-based flow currents, force-based propulsion, and the ready-to-use BattleShip C++ actors.


Prerequisites

RequirementDetails
EngineUE5.x (latest release)
PluginOceanology NextGen v1.3.0+
SceneWater body with Oceanology Water Volume and buoyancy configured
SkillsBasic familiarity with Blueprints, Physics, and Splines
About Ship Navigation

Starting in v1.3.0, Oceanology includes a complete C++ ship navigation system with two flow modes, a spline-based FlowController actor, and ready-to-use BattleShip actors. The system is fully multiplayer-aware with server-authoritative physics.


Architecture Overview

The ship navigation system consists of three layers:

FlowController (Actor)
↓ Assigns spline to tagged actors
OceanBuoyancyComponent (Flow System)
↓ Applies forces based on spline position
Physics Engine (UE5 Chaos)
↓ Integrates forces with buoyancy
Visual Result: Natural ship movement along currents

FlowController Actor

The OceanologyFlowController is a C++ actor that defines water currents using a spline component. It automatically assigns itself to all actors with a matching tag.

1. Place a FlowController in your level

Use the Quick Add menu and search for OceanologyFlowController. Drag it into your level near your water body.

The FlowController contains a Spline Component that defines the flow path. Edit the spline points in the viewport to create your desired current path.

FlowController Properties:

PropertyDefaultDescription
Actor Tag FilterExampleShipOnly actors with this tag receive flow forces. Change this to match your vessel's tag.
Flow Control Speed500.0Speed of the current in cm/s. Higher values push vessels faster.
Unscaled Spline Width1000.0Width of the current channel in cm. Vessels outside this width are less affected.

How Assignment Works:

  1. On BeginPlay, the FlowController waits 1 second for actors to initialize.
  2. It searches for all actors with the matching Actor Tag Filter.
  3. For each matching actor, it finds their OceanBuoyancyComponent.
  4. It calls SetFlowControlSpline() to assign the spline, speed, and width.
tip

Add the tag to your vessel actor in the Details → Actor → Tags array. The tag must match the FlowController's Actor Tag Filter exactly.

:::

2. Edit the spline path

Select the FlowController and enter spline editing mode. Add, move, and adjust spline points to create the desired navigation path.

Spline Editing Tips:

  • Add points by Alt+clicking on the spline.
  • Curve the path by adjusting tangent handles.
  • Close the loop by connecting the last point near the first for circular routes.
  • Width visualization scales with the FlowController actor's X scale in editor.

Spline Design Guidelines:

GuidelineReason
Avoid sharp 90° turnsShips need space to turn — use wide curves
Keep spline above water surfaceThe Z position is used for direction only, not height
Match width to vessel sizeWidth should be at least 2× the vessel length for comfortable navigation
Use gentle curves for large shipsLarge vessels need longer turning radius

Flow Modes

The OceanBuoyancyComponent supports two distinct flow modes that control how vessels respond to spline currents.

3. Choose a flow mode

In the OceanBuoyancy component, locate the Flow category. The Flow Mode property determines the physics behavior:

ModeBest ForBehavior
Force (Legacy)Simple currents, rivers, environmental driftApplies a directional force push. Ship slides along the current.
Navigation (Natural)Controlled ship movement, patrol routes, cinematic pathsThree-phase system: steering, propulsion, and lateral drag. Ship turns into curves naturally.

Force Mode (Legacy)

Force mode applies a simple directional push based on the spline direction at the vessel's position.

4. Configure Force mode

Set Flow Mode to Force (Legacy) for simple current-based movement.

Force Mode Properties:

PropertyDefaultRangeDescription
Angle Adjusted Force Strength35.00-200Strength of the directional push
Flow Mass Norm1000.0100-100000Reference mass for scaling. A 1000kg ship gets base force; heavier ships get proportionally more.
Orient Mesh Rotation YawBooleanWhen enabled, gradually rotates the vessel to face the flow direction.

How Force Mode Works:

  1. Finds the vessel's position on the spline.
  2. Calculates the flow direction at that point.
  3. Computes an angle-adjusted force based on the vessel's offset from the spline center.
  4. Applies AddForceAtLocation() scaled by mass: Force × Strength × (BodyMass / FlowMassNorm).

Mass Scaling: Force mode scales forces proportionally to vessel mass:

  • 1,000 kg vessel → 1× force (base)
  • 10,000 kg vessel → 10× force
  • 100,000 kg vessel → 100× force

This ensures vessels of any size respond naturally to the same current.

Navigation mode provides realistic ship-like movement with three-phase control: steering, propulsion, and lateral drag.

5. Configure Navigation mode

Set Flow Mode to Navigation (Natural) for natural ship-like movement.

Navigation Mode Properties:

PropertyDefaultRangeDescription
Flow Max Speed2000.0100-10000Maximum speed in cm/s. Ships won't exceed this speed.
Flow Acceleration Smoothing3.00.5-10Propulsion responsiveness. Higher = faster speed changes.
Flow Turn Rate45.05-120Maximum turn rate in degrees/second.
Flow Steering Smoothing4.00.5-10Steering responsiveness. Higher = snappier turns.
Flow Lateral Drag Coeff3.00-10Sideslip resistance. Higher = less sideways sliding during turns.
6. Understand the three-phase control system

Navigation mode uses a three-phase control system that mimics real ship handling:

Phase 1 — Steering (Yaw Control via Torque):

  • Calculates yaw error between the ship's forward direction and a look-ahead point on the spline.
  • The look-ahead distance is speed-dependent: Speed × 1.5 seconds (minimum 500cm).
  • Applies AddTorqueInDegrees() to rotate the ship naturally.
  • Speed-dependent turn rate: faster ships turn more gently.

Phase 2 — Propulsion (Forward Force):

  • Uses a proportional controller: Force = Mass × VelocityError × AccelerationSmoothing.
  • Only applies force in the horizontal plane (buoyancy controls vertical).
  • Alignment factor: reduces speed during sharp turns to prevent overshooting.

Phase 3 — Lateral Drag (Sideslip Prevention):

  • Applies a counter-force against sideways velocity.
  • Formula: -RightDirection × LateralSpeed × LateralDragCoeff × Mass.
  • Prevents the ship from skidding sideways during turns.

Why AddTorque Instead of SetAngularVelocity? Navigation mode uses AddTorqueInDegrees() because it lets the physics solver integrate torque through the buoyancy pontoons. This prevents capsizing — direct angular velocity would bypass buoyancy's roll stabilization.

Why Look-Ahead? Ships look ahead by Speed × 1.5s (minimum 500cm) on the spline. This mimics a helmsman reading ahead — the ship starts turning BEFORE reaching a curve, producing natural cornering behavior.

Flow Mode Comparison

AspectForce (Legacy)Navigation (Natural)
PhysicsAddForceAtLocationAddTorqueInDegrees + AddForce
TurningOptional yaw orientationSpeed-dependent look-ahead steering
SideslipNoneLateral drag coefficient
Speed ControlNone (force determines speed)Velocity-capped with smooth acceleration
Best UseRiver currents, ambient driftShip patrols, cinematic routes, gameplay navigation
ComplexitySimple, 1 parameterRich, 5 parameters for fine-tuning

BattleShip C++ Actors

Oceanology v1.3.0 includes ready-to-use C++ ship actors that demonstrate the complete navigation pipeline.

7. Available BattleShip classes

The plugin provides several BattleShip variants as C++ actors:

ClassDescription
OceanologyBattleShipPawnFull-featured Pawn with camera, input, and player control. Use for player-driven ships.
OceanologyBattleShipBaseNon-pawn base class with buoyancy. Use for AI or flow-driven ships.
OceanologyBattleShipBoxBox collision variant for simple physics.
OceanologyBattleShipCustomCustom collision variant for accurate hull physics.
OceanologyBattleShipGameModeGame mode for battle ship scenarios.

BattleShipPawn Component Hierarchy:

OceanologyBattleShipPawn (Self)
├── CustomCollision ← Root: invisible physics body (5000 kg)
│ └── VisualSmoothRoot ← Smoothing parent for client interpolation
│ ├── ShipMesh ← Main hull visual
│ ├── RopesMesh ← Rope details
│ ├── RudderMesh ← Rudder visual
│ ├── SkeletalShipMesh ← Animated skeletal mesh
│ └── MaskingObjects ← Underwater masking
├── ShipCameraBoom ← Spring arm for camera
│ └── ShipCamera ← Player camera
├── OceanBuoyancy ← Buoyancy + flow physics
└── InteractionVolume ← Box trigger at helm position
8. Player-controlled navigation

The BattleShipPawn supports direct player input for ship control:

Input Controls:

InputActionPhysics
W / SForward / ReverseSetPhysicsLinearVelocity() with smooth interpolation
A / DRudder left / rightSetPhysicsAngularVelocityInDegrees() speed-dependent

Navigation Properties:

PropertyDefaultDescription
Max Speed3500.0 cm/sMaximum forward/reverse speed
Max Turn Rate60.0 deg/sMaximum rudder turn rate
Acceleration Smoothing3.0Speed ramp responsiveness

Speed-Dependent Steering: Turn rate scales with current speed — faster ships turn more gently, stationary ships don't turn at all. This prevents unrealistic spinning in place.

Lateral Drag: An automatic lateral drag force prevents sideways sliding during turns, keeping the ship's movement aligned with its forward direction.


AutoConfigureBuoyancy

The BattleShipPawn includes automatic buoyancy configuration that analyzes the physics body and sets optimal pontoon positions.

9. How AutoConfigureBuoyancy works

When bAutoConfigureBuoyancy is enabled (default), the ship automatically configures itself on BeginPlay:

Pontoon Layout (6 points):

PositionCountDensityPurpose
Bow2250Front stability, wave riding
Midship2360Primary flotation
Stern2300Rear stability, prevents nose-diving

Mass-Proportional Tuning: All damping values scale with vessel mass:

  • Linear Damping: Clamp(MassFactor × 0.25, 0.5, 1.5)
  • Angular Damping: Clamp(MassFactor × 0.8, 1.0, 3.0)
  • Default Mesh Density: 620 kg/m³
  • Water Fluid Density: 1030 kg/m³

This means a 5,000 kg ship and a 50,000 kg ship both float naturally without manual parameter adjustment.


Multiplayer Support

All ship navigation features are fully multiplayer-aware.

FeatureServerClient
Flow Forces✅ Calculated and applied❌ Not applied (server-authoritative)
Spline Assignment✅ Assigned via FlowController✅ Replicated via push-based networking
Player Input✅ Received via Server RPC✅ Sent to server
Position✅ Authoritative✅ PredictiveInterpolation (smooth)
Visual Smoothing❌ Not needed✅ VisualSmoothRoot with frame interpolation

Flow properties (FlowControlSpline, FlowControlSpeed, UnscaledSplineWidth) are replicated with push-based networking. Changes on the server automatically propagate to all clients.


Preset Configurations

Vessel TypeFlow ModeMax SpeedTurn RateAccel. SmoothingLateral DragNotes
Patrol BoatNavigation2000604.03.0Fast, agile, tight turns
Cargo ShipNavigation800151.55.0Slow, wide turns, stable
Fishing BoatForce----Drifts with current
BattleshipNavigation3500453.03.0Balanced power and handling
River RaftForce----Pushed by river flow
Cinematic ShipNavigation1500302.04.0Smooth, predictable path

Troubleshooting

ProblemLikely CauseSolution
Ship doesn't follow splineTag mismatchEnsure vessel actor has the tag matching FlowController's Actor Tag Filter
Ship overshoots curvesTurn rate too low or speed too highIncrease Flow Turn Rate or reduce Flow Max Speed
Ship slides sideways in turnsLow lateral dragIncrease Flow Lateral Drag Coeff (3-5 recommended)
Ship capsizes during turnsUsing SetAngularVelocity instead of TorqueEnsure Flow Mode is set to Navigation which uses AddTorque
Flow forces feel weakMass scaling mismatchAdjust Flow Mass Norm to match your vessel's mass range
Ship doesn't move at allFlowController not assignedCheck Output Log for assignment messages, verify tag filter
Jerky movement on clientsMissing PredictiveInterpolationEnsure bDisableClientPhysicsSimulation is enabled and NetUpdateFrequency ≥ 30
Ship spins in placeZero forward speedNavigation mode prevents turning at zero speed by design

Summary

In this guide, you learned how to:

  1. Place a FlowController - Define spline-based water currents with configurable speed and width.
  2. Edit spline paths - Create navigation routes with curves and loops.
  3. Choose a flow mode - Select between Force (simple push) and Navigation (natural ship handling).
  4. Configure Force mode - Set up simple current-driven movement with mass-proportional forces.
  5. Configure Navigation mode - Fine-tune the three-phase control system for realistic ship movement.
  6. Understand the control phases - Steering, propulsion, and lateral drag working together.
  7. Use BattleShip actors - Leverage ready-to-use C++ ship actors with complete navigation pipelines.
  8. Enable player control - Configure input-driven ship movement with speed-dependent steering.
  9. Auto-configure buoyancy - Let the system optimize pontoon layout based on vessel physics.

With these tools, you can create any ship navigation scenario from simple river currents to complex patrol routes with natural cornering behavior.