Skip to content

Simulation ‐ Basics

Katy Fox edited this page Feb 19, 2024 · 1 revision

The new simulation system that was introduced with the release of DV: Simulator consists of two main concepts: Components and Ports.

image

Sim Components

Sim components can be thought of as representing the different sub-systems of your vehicle. These can represent anything from a diesel engine, to a fuel tank to, to a traction motor, or even things like the "definitions" of powered wheels or cab controls. Each component contains code that is run on each "tick" of the game clock, and this code takes the input values that a control receives and transforms them into output values for other components to use. These input and output values are transmitted through named wires or pipes known as Ports. Each component has a unique ID that is used to look up its connections at runtime.

Ports

Ports are the "outlets" where a component can transmit or receive data. Each port has three properties that defines it: a Port Type, a Value Type, and a unique ID. The port type determines the "direction" of the flow of information. For example, an "OUT" port can only be connected to a corresponding "IN" port. "External In" ports receive their data either from scripts on another prefab or from scripts controlling the physical state of the world - data such as the state of cab inputs or the current speed of the vehicle.

Port References

Port references allow a component to "inspect" the state of a port. Unlike normal port connections, where a single port can connect to another single port, multiple references can inspect the same source port. References can also sometimes overwrite the value of the source port, though this is less common compared to reading from the source port.

Port Value Types

  • GENERIC
  • CONTROL
  • STATE
  • DAMAGE
  • POWER
  • TORQUE
  • FORCE
  • TEMPERATURE
  • RPM
  • AMPS
  • VOLTS
  • HEAT_RATE
  • PRESSURE
  • MASS_RATE
  • FUEL
  • OIL
  • SAND
  • WATER
  • COAL

Clone this wiki locally