Categories
Immersion

Spline

Spline is a very effective tool for path-making and for drawing clouds of points. These clouds do not necessarily need to take the shape of an actual cloud but can represent something less volumetric, like a road or path. I have explored the implementation of these techniques in both landscape and modelling modes. The tutorials I referred to include, but are not limited to, the following sources:

Follow a Spline and Report Distance Along It Using an Actor Component | Epic Developer Community
How to move things along a spline path – Unreal Engine 5 Tutorial

Exploring Splines, Timelines, and Lerp Functions for PCG

Timeline Function

The timeline function is equivalent to the draw function in other programming contexts. It runs repeatedly to create continuous updates.

Lerp Function

The Lerp (Linear Interpolation) function is used to interpolate between two values, A and B. For example, interpolating between the RGB values of orange and blue will produce a smooth colour transition between these two colours.

Setting Up the Blueprint Classes

Two Blueprint (BP) actor classes are required:

  1. BP_Spline: Defines the pathway for the object’s movement.
  2. BP_Cube: Represents the object moving along the pathway. This class contains all the logic, referencing the BP_Spline file.

The entire code is contained in the BP_Cube class, which executes the movement along the spline by referencing BP_Spline.

Code Explanation: BP_Cube

  • In the top-right corner, the Get Actor of Class node references the BP_Spline.
  • The returned value of this function is stored in a variable named Custom Spline.
  • For the object to move along the spline, the function must be explicitly called during execution.

Timeline and Object Movement

The timeline function defines the duration of the movement. This determines how long the object takes to travel along the spline.


Applications and Next Steps

  1. Use PCG techniques to build terrain for large-scale world creation.
  2. Study car movement dynamics, including acceleration, deceleration, and how speed changes based on pathway curves.
  3. For an MVP, experiment with basic movements using a cube before transitioning to a car mesh with mechanics and rigging.
  4. Implement camera tracking for dynamic shots, such as top-down or rotating angles, following the car’s motion.
  5. Research cinematic references for camera movements, such as Kubrick-style angles and transitions to an upside-down world.


PCG implementation/ instructions


The images below are screenshots of my notes, representing the process of PCG implementation, consecutive stages, and exploratory work.

Leave a Reply

Your email address will not be published. Required fields are marked *