Wiki/Building/Components/Radio

{{Wiki_Page | content=

Overview
Radios allow vehicles and people to share numeric, boolean, audio, and video data. Signal strength is worsened by distance and depleted power sources, and improved with larger antennas (which also increase maximum range). Poor signal strength adds static to audio communication and a grain/static effect to video feeds, but numeric and boolean data are reliable until the maximum range is reached (maximum range is affected by both the transmitter and receiver).

Radios are also required to operate train switches, see below for details.

This article was last updated for Stormworks version 1.2.2 (3 June 2021).

Frequencies
Usable frequencies can be any number. 99,999,999 (and higher) is valid, and so is -99,999,999. Train switches are operated using frequency 440. Frequencies from 0 to 8 are used by handheld radios and remote controls. All other radio frequencies can be used by player creations without other in-game interaction.

Power consumption
Every antenna requires a small amount of power to operate, regardless of whether they are receiving or transmitting. Note that the power consumption by antennas is negligible, at only about 0.002 swatts per minute. A single small battery could operate a huge antenna as a relay transmitter for about 38 real-life days without recharging, though with gradually diminishing performance due to power loss.

Radio RX antennas
These are the antennas vehicles use to transmit numeric, boolean, and audio data. Each antenna can either send or receive, depending on the setting of its transmit mode.

Logic nodes:
 * Transmit mode (Boolean input):
 * Off (or not connected): The radio will be in 'listen' mode, and can receive transmissions.


 * On: The radio will be in 'transmit' mode, and can send but not receive transmissions.


 * Frequency (Numeric input): Can be any value, see the frequencies section above.


 * Signal strength (Numeric output): A value from 0 to 1. Will show 0 when no signal is being received. The small radios do not have a signal strength logic node. This can be also be used by radio scanners to automatically detect channels with any active data transfers, and to triangulate transmission locations. Specific types of data transfer can be identified by analyzing the various data channels within the frequency, or checking to see if a microphone connected to the antenna indicates an active audio transmission.


 * Data Send (Composite input): The antenna will transmit all data sent to this node while in transmit mode.


 * Data Recv (Composite output): Provides any data sent from the strongest nearby source broadcasting on the antenna's frequency setting.


 * Audio Send (Audio input): Transmits audio from a microphone, or can relay audio from an antenna on another frequency to bridge communications between distant regions.


 * Audio Recv (Audio output): Provides any audio sent from the strongest nearby source broadcasting on the antenna's frequency setting.

Video antennas
Video transmissions do not interfere with radio communications and vice versa. Video is managed with a separate transmitter and receiver. This can allow a camera on a remotely-operated vehicle to be linked into a monitor display for a control terminal.

Handheld radios
Handheld radios can be used to communicate with players and interact with autonomous vehicles. The signal strength produced by the handheld radio on a specific frequency can be used to detect a received signal, even though only audio data is being transmitted, and even if there's too much static to understand the audio. Vehicles can also distinguish audio data from other types by connecting the audio to a speaker - the speaker has a logic node to indicate if it is being used to receive a transmission. As such, handheld radios can be used to selectively trigger remotely-activated systems and to communicate via Morse code at longer distances while traveling on foot or in minimalist/lightweight vehicles.

Unfortunately, handheld radios cannot receive data back from autonomous vehicles. While it is theoretically possible to place a buzzer near a microphone in the hopes of creating audible Morse code chirps, in practice microphones will only transmit player voice data, and will only transmit when a player is nearby. However, it is certainly possible to receive audio from vehicles piloted by players.

Calculating maximum transmission ranges
In Stormworks transmission ranges are calculated somewhat different than from what you would expect. If you want to send a signal from antenna A to antenna B, the maximum range for a successfull transmission depends on:
 * range of antenna A
 * range of antenna B
 * battery level of antenna A
 * battery level of antenna B

Calculate maximum distance as receiver (you must know distance to sender)
Hint: Small antenna has no output for signalStrength, so this does not work!

distanceToSender must be calculated by gps difference:

Hint: You could transmit the gps coordinates via radio.

Calculate distance to sender (you must know the range of sender antenna and receiver antenna and both battery levels
Hint: Small antenna has no output for signalStrength, so this does not work!

If you know the sender always has a full battery (e.g. diesel generator) and know the antenna type he is using, you can calculate your distance to the sender without any data over composite:

Example
Sender antenna: Huge Receiver antenna: Small Sender antenna range = 20000m Receiver antenna range = 100m

Maximum distance between sender and receiver (in case of 100% batteries):

Maximum distance between sender and receiver (in case of 100% battery for the sender and 50% battery for the receiver): {{code-block | content = maximumDistance = rangeAntennaA * batteryLevelA + rangeAntennaB * batteryLevelB maximumDistance = ( 20000m + 100m ) * 1 * 0.5 maximumDistance = 20100m * 0.5 maximumDistance = 20050m

Controlling train switches
Broadcast Boolean on/off signal on 1st composite channel on frequency(radio channel) 440

Example: Train with antenna (frequency 440) in transmit mode. Connect a push button to composite input (boolean channel 1) of the antenna.

Now if you hit the push button, every train switch in range will toggle!