User Tools

Site Tools


manual:subwaysim:vehicle_development:simple_vehicle_blueprint

Creating a Simple Vehicle Blueprint

In this chapter, we will create a Simple Vehicle Blueprint.

Vehicle Blueprints are responsible for combining all previously created assets — such as the Skeletal Mesh, Animation Blueprint, and Control Rig — into a single, functional vehicle entity.

They define:

  • What is loaded into the game
  • How the vehicle is positioned on the tracks
  • Where bogies and couplings are located
  • How the vehicle interacts with the simulation

In simple terms, the Vehicle Blueprint acts as the master container for everything related to the vehicle that will later be spawned and used in SubwaySim 2.


Creating the Vehicle Blueprint

As a first step, we create an empty Vehicle Blueprint.

Navigate to the root folder of your vehicle, for example:

`SubwaySim_SDK_Testplugin_Content/TestVehicle`

Inside the Content Drawer:

  • Right-click
  • Select Blueprint Class
  • Click All Classes
  • Search for Rail Vehicle
  • Select it and click Select

This creates a new Blueprint based on the Rail Vehicle class.

Name the Blueprint using a clear naming convention:

  • Prefix: BP_
  • Example: `BP_TestVehicle`

Opening the Vehicle Blueprint

Open the newly created Vehicle Blueprint.

You will now see an empty Blueprint with no components assigned yet. This is expected and serves as the foundation for assembling the vehicle.


Setting the Lua Class Name

Before adding any components, we must define which Lua class this vehicle belongs to.

In the Details panel of the Vehicle Blueprint, locate the field: Lua Class Name

Set this value to:`RailVehicle`

This step is required so SubwaySim 2 knows which Lua logic is responsible for controlling this vehicle.


Adding Required Components

To ensure the vehicle can be placed correctly on the tracks and function properly in SubwaySim 2 (including AI usage), several components must be added.


Skeletal Mesh Component

Add a Skeletal Mesh component:

  • Click Add in the Components panel
  • Search for Skeletal Mesh

The name of this component can be chosen freely, but a clear structure is recommended.

Example:

  • Exterior (for the exterior vehicle mesh)

In the Details panel:

  • Assign the Skeletal Mesh that was imported earlier

Assigning the Animation Blueprint

To enable animations (including the Control Rig), the Animation Blueprint must be assigned manually.

In the Details panel of the Skeletal Mesh component:

  • Locate the field Anim Class
  • Select the Animation Blueprint (ABP_) created earlier

Use the Animation Blueprint defined in the chapter: Creating a Simple Animation Blueprint

This Animation Blueprint internally references the Control Rig and is required for bogie and axle animation to function correctly.


Collision Settings

To ensure that the vehicle uses the collision data defined in the Physics Asset, the collision preset must be set correctly.

In the Details panel of the Skeletal Mesh component:

  • Locate the Collision section
  • Set Collision Preset to Vehicle

This step is mandatory.

Without this setting:

  • The Physics Asset collisions will not be applied correctly
  • The vehicle may not collide properly with the environment
  • Interaction and physics behavior can break in-game

Scene Components for Bogies and Couplings

Next, we need to add Scene Components, which act as reference points for the simulation.

Add four Scene Components:

  • Click Add
  • Search for Scene (Utility → Scene Component)

The naming of these components is extremely important and must follow this exact structure:

  • Bogie1 – First bogie
  • Bogie2 – Second bogie
  • Coupling_F – Front coupling
  • Coupling_B – Rear coupling

These names are required so SubwaySim 2 can correctly identify each reference point.


Positioning the Scene Components

Correct positioning of these Scene Components is critical.

  • Bogie1 / Bogie2
    • The origin must be exactly at the center of the respective bogie
    • Z-position must be 0
  • Coupling_F / Coupling_B
  • The origin must be placed at the rotation or mounting point of the Scharfenberg coupling

SubwaySim 2 uses these reference points to:

  • Determine how the vehicle is placed on the tracks
  • Calculate correct vehicle alignment
  • Connect vehicles into train formations

Incorrect positioning will result in faulty coupling behavior or incorrect track placement.


Initializing Bogie Data

After adding all required components, we must initialize the bogie data so SubwaySim 2 knows where the bogies are located and how they should behave during simulation.

This setup is done inside the Event Graph of the Vehicle Blueprint.


4

Adding the Required Nodes

Open the Event Graph of your Vehicle Blueprint.

First, create the initialization event:

  • Right-click in the graph
  • Search for Event Initialize Bogies
  • Add the node

This event is called automatically and is used to register all bogies of the vehicle.

Next, add the bogie nodes:

  • Right-click in the graph
  • Search for Add Bogie
  • Add the node

Repeat this step so that you have two Add Bogie nodes — one for each bogie.


Preparing the Bogie Data

On each Add Bogie node:

  • Locate the Bogie Data pin
  • Right-click on the pin
  • Select Split Struct Pin

This exposes the internal data fields of the Bogie Data structure.


Assigning the Bogie Scene Components

Now we assign the previously created Scene Components to the bogies.

For each Add Bogie node:

  • Locate the Bogie Socket pin
  • Drag a connection from the pin
  • Search for Get
  • Select the Scene Component corresponding to the bogie

Assign them as follows:

  • First Add BogieBogie1
  • Second Add BogieBogie2

This ensures that SubwaySim 2 knows the exact position of each bogie on the vehicle.

Once both Add Bogie nodes are connected correctly, the bogie initialization is complete.


Linking the Scene Components

Each Add Bogie node must be linked to the corresponding Scene Component created earlier:

  • First Add Bogie → assign Bogie1
  • Second Add Bogie → assign Bogie2

Make sure you select the correct Scene Components, otherwise the bogie positions will be wrong and the vehicle will not be placed correctly on the track.

Once both bogies are added and linked, the bogie initialization is complete.

(Continuation follows: further setup of couplings, AI placement, and additional vehicle configuration.)


Completion of the Simple Vehicle Blueprint

With the bogie data initialized, the setup of the Simple Vehicle Blueprint is complete.

This blueprint structure is intentionally kept minimal and is suitable for:

  • Simple AI-controlled vehicles
  • Static or basic rolling stock
  • Vehicles without interactive systems or advanced functionality

It provides only the essential components required for correct placement on the tracks and basic movement within SubwaySim 2.


Important Note

This setup does not include:

  • Player interaction
  • Advanced vehicle systems
  • Door, coupling, or cab interaction logic
  • Additional animation or gameplay features

At this point, the basic structure of the Vehicle Blueprint is complete. or vehicles that require more advanced functionality, please continue with the dedicated chapter: Creating a Complex Vehicle Blueprint

That chapter builds upon the foundation created here and explains how to extend the Vehicle Blueprint with advanced systems and features.

manual/subwaysim/vehicle_development/simple_vehicle_blueprint.txt · Last modified: by dcs

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki