Logic Gadgets: Controller Sensor

 

Icon
Name of gadget Controller Sensor
Section Sensors & Input
Number of Tweak pages 6
Author LadylexUK, QuietlyWrong
Last updated 10 March 2020 [v2.06]

Description

This gadget is fundamental to most Dreams as it allows you to read controller inputs and act on them accordingly. It detects when buttons are pressed, joysticks are moved and the controller is turned. It also houses the information on microphone inputs, camera settings (for the default camera), and spawning. You can change it so that button presses are only detected if an object or character is possessed by an imp or at any time, and can control which players can do what in multiplayer games.

It also controls the visibility of the imp when controlling characters or objects, the default settings for the player camera and some built-in gameplay triggers such as dying and resetting from checkpoints. The gadget even comes with an imp “handle” that lets you position where the imp will appear during possession (if at all).

By default, when you stamp a new controller sensor, a couple of wires are already connected. These enable typical behaviours but you may need to delete them if they do not serve your intentions for the gadget:

  • the “Circle button” output is connected to “De-Possess” input
  • The “Is Dead” output is connected to the “Respawn” input.

Example Tutorial (from Media Molecule)

  1. Stamp a controller sensor
  2. On the Important properties page (page 5) select remote controllable.
  3. Switch to sound mode and search sound effects and choose one to stamp in your scene.
  4. Tweak the sound effect (L1+square). Under slice payback mode select once.
  5. Go to the panning page and select controller under pan style
  6. In the controller sensor, Connect the output port of the square to the power port of the sound effect.
  7. Hit start time
  8. When you press square the sound effect will play from the controller itself.

Tweak Menus

Tweak Menu 1: Controller I/O [1]

Image: Beta.
Confirmed identical in v2.06
  1. Tweak Menu page 1:Controller I/O
  2. L2 Button
    2a. Numeric input (0-1)
    2b. Numeric output (0-1) with player data
  3. R2 Button
    3a. Numeric input (0-1)
    3b. Numeric output (0-1) with player data
  4. L1 Button
    4a. Boolean input (0/1)
    4b. Boolean output (0/1) with player data
  5. R1 Button
    5a. Boolean input (0/1)
    5b. Boolean output (0/1) with player data
  6. Triangle Button
    6a. Boolean input (0/1)
    6b. Boolean output (0/1) with player data
  7. Square Button
    7a. Boolean input (0/1)
    7b. Boolean output (0/1) with player data
  8. Circle Button
    8a. Boolean input (0/1)
    8b. Boolean output (0/1) with player data
  9. Cross Button
    9a. Boolean input (0/1)
    9b. Boolean output (0/1) with player data
  10. Power
  1. Menu page indicator
  2. L2 Button
    This slider can detect the amount of pressure applied to the L2 trigger button and will send an output signal when the button is pressed. The output range is 0% (0, not being pressed) to 100% (1, fully pressed in). A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  3. R2 Button
    This slider can detect the amount of pressure applied to the R2 trigger button and will send an output signal when the button is pressed. The output range is 0% (0, not being pressed) to 100% (1, fully pressed in). A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  4. – 9. Button presses
    Each will send an ON signal when one of these buttons is pressed, which is only continuous if the button is held down. A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  1. Power
    This is where you turn the gadget on/off.
Tweak Menu 2: Controller I/O [2]

Image: Beta.
Confirmed identical in v2.06
  1. Tweak Menu page 2: Controller I/O
  2. Left Stick
    2a. 2-dimensional input (-1 – +1)
    2b. 2-dimensional output (-1 – +1)
  3. Right Stick
    3a. 2-dimensional input (-1 – +1)
    3a. 2-dimensional output (-1 – +1)
  4. Direction Buttons
    4a. 2-dimensional input (-1 – +1)
    4b. 2-dimensional output (-1 – +1)
  5. Motion sensor
    5a. 3-dimensional input (-π – +π)
    5b. 3-dimensional ouput (-π – +π)
  6. Touchpad Button
    6a. Boolean input (0/1)
    6b. Boolean output (0/1) with player data
  7. L3 Button
    7a. Boolean input (0/1)
    7b. Boolean output (0/1) with player data
  8. R3 Button
    8a. Boolean input (0/1)
    8b. Boolean output (0/1) with player data
  9. Power
  1. Menu page indicator
  2. Left Stick
    This detects if the left joystick is moved. It produces a fat wire that can be split into left/right (X) and up/down (Y) signals; these vary from -100% to +100% as you move the stick from (negative) fully up/left to (positive) fully down/right with 0% output when they are centred. The output is relative to the camera direction and therefore depends on the relative orientation of the gadget to the current viewpoint. To read the stick position independently of camera orientation, see the next tweak menu tab, “Controller I/O Page 3”.
  3. Right Stick
    This detects if the right joystick is moved. It produces a fat wire that can be split into left/right (X) and up/down (Y) signals; these vary from -100% to +100% as you move the stick from (negative) fully up/left to (positive) fully down/right with 0% output when they are centred. The output is relative to the camera direction and therefore depends on the relative orientation of the gadget to the current viewpoint. To read the stick position independently of camera orientation, see the next tweak menu tab, “Controller I/O Page 3”.
  4. Directional Buttons
    This detects any D pad press in any direction and produces a fat wire that can be split into left/right (A) and up/down (B) directions (negative for up/left, positive for down/right). Signals from the d-pad are normally either 100% or -100% when buttons are pressed. However this tweak is relative to the current camera direction and therefore the output depends on the relative orientation of the gadget to the current viewpoint. To detect any specific d-pad button independently of camera orientation, see the next tweak menu tab, “Controller I/O Page 3”.
  5. Motion Sensor
    This detects any movement of the controller with the motion sensor (the way the imp moves in the default ‘motion sensor function’ control scheme). It outputs a fat wire with rotational data in three axes. If you split them out, these are A (pitching – imagine nodding your head), B (yawing – like shaking your head) and C (rolling – like tilting your head to the side). The outputs are angles in radians, from -pi to +pi. If the imp is under direct control these outputs are limited by the position of the imp, which cannot leave the boundaries of the screen.
  6. Touchpad Button
    This detects if the touchpad is pressed. It cannot detect other movements on the touchpad (such as a stroke, or two-fingered press), nor the location of the press. A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  7. L3 Button
    This detects a press in of the left joystick (often called the “L3” button). A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  8. R3 Button
    This detects a press in of the right joystick (often called the “R3” button). A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  9. Power
    This is where you turn the gadget on/off.
Tweak Menu 3: Controller I/O [3]

Image: Beta.
Confirmed identical in v2.06
  1. Tweak Menu 3: Controller I/O
  2. Left Stick Local
    2a. 2-dimensional input (-1 – +1)
    2b. 2-dimensional output (-1 – +1)
  3. Right Stick Local
    3a. 2-dimensional input (-1 – +1)
    3b. 2-dimensional output (-1 – +1)
  4. Up Button
    4a. Boolean input (0/1)
    4b. Boolean output (0/1) with player data
  5. Down Button
    5a. Boolean input (0/1)
    5b. Boolean output (0/1) with player data
  6. Left Button
    6a. Boolean input (0/1)
    6b. Boolean output (0/1) with player data
  7. Right Button
    7a. Boolean input (0/1)
    7b. Boolean output (0/1) with player data
  8. Enter
    8a. Boolean input (0/1)
    8b. Boolean output (0/1) with player data
  9. Back
    9a. Boolean input (0/1)
    9b. Boolean output (0/1) with player data
  10. Power
  1. Menu page indicator
  2. Left Stick Local
    This detects if the left joystick is moved. It produces a fat wire that can be split into left/right (X) and up/down (Y) signals; these vary from -100% (fully up or left) to +100% (fully down or right respectively). The output is independent of the camera direction.
  3. Right Stick Local
    This detects if the left joystick is moved. It produces a fat wire that can be split into left/right (X) and up/down (Y) signals; these vary from -100% (fully up or left) to +100% (fully down or right respectively). The output is independent of the camera direction.
  4. Up Button
    This detects if the D-pad up button is pressed. The output is independent from the camera direction (unlike the “Directional Buttons” tweak on the previous tab). A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  5. Down Button
    This detects if the D-pad down button is pressed. The output is independent from the camera direction. A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  6. Left Button
    This detects if the D-pad left button is pressed. The output is independent from the camera direction. A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  7. Right Button
    This detects if the D-pad right button is pressed. The output is independent from the camera direction. A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  8. Enter
    This detects if the system-standard “Enter” (or “Confirm”) button is pressed. In most regions this is the Cross Button (in Japan it is the Circle Button) and is therefore best used for menu navigation. A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  9. Back
    This detects if the system-standard “Back” (or “Cancel”) button is pressed. In most regions this is the Circle Button (in Japan it is the Cross Button) and is therefore best used for menu navigation. A fat wire output includes data about which player pressed the button (if relevant) and the colour of the controller.
  10. Power
    This is where you turn the gadget on/off.
Tweak Menu 4: Camera Properties
Controller sensor camera
Image: v2.06
  1. Tweak Menu page 4: Camera Properties
  2. Camera Height
    2a. Numeric input (0 – 1)
    2b. Numeric output (0 – 1)
  3. Camera Distance
    3a. Numeric input (0 – 100)
    3b. Numeric output (0 – 100)
  4. Camera Tilt
    4a. Numeric input (-1 – +1)
    4b. Numeric output (-1 – +1)
  5. Field of View
    5a. Numeric input (0.175 – 2.094)
    5b. Numeric output (0.175 – 2.094)
  6. Aperture
    6a. Numeric input (0 – 1)
    6b. Numeric output (0 – 1)
  7. Platforming Shadow
    7a. Numeric input (0 – 1)
    7b. Numeric output (0 – 1)
  8. Offscreen Indicator
    8a. Boolean input (0/1)
    8b. Boolean output (0/1)
  9. Stay Onscreen
    9a. Boolean input (0/1)
    9b. Boolean output (0/1)
  10. Power

Note: the camera settings here apply to the standard player camera. Any camera gadgets in your scene will override these.

  1. Menu page indicator
  2. Camera Height
    Here you can tweak the height at which the player camera follows the player. The actual camera height is also determined by the scale of the possessed object or puppet and the next two tweaks, Camera Distance and Camera Tilt, as Dreams attempts to keep the player(s) in view.
  3. Camera Distance
    Here you can tweak the distance (in metres) behind which the player camera follows the player. Dreams attempts to keep the player(s) in view, so the actual distance may vary (if this variation is undesirable, you may have to set up your own camera gadget instead).
  4. Camera Tilt
    Here you can tweak the angle at which the player camera is tilted. The limits of the input range approximate to +/- 57.3° (equal to 1/pi radians). Dreams attempts to keep the player(s) in view, so the actual angle may vary (if this variation is undesirable, you may have to set up a camera gadget instead).
  5. Field of View
    Here you can tweak the player camera’s field of view setting, i.e. how much of an angle is visible on screen. Higher values give a wider view of the environment, lower values a narrower one. The limits of the input range (0.175 to 2.094 radians) equate to angles in the range 10° to 120°.
  6. Aperture
    Here you can tweak the player camera’s aperture which affects the degree of focus. At the default value of 0%, the whole scene stays in focus; as this is increased, objects further away from the player controlled object become more and more blurred.
  7. Platforming Shadow
    Here you can choose the intensity of a spot shadow that is cast directly below the player, mainly to assist them when lining up jumps in platforming games.
  8. Offscreen Indicator
    When turned on, this tweak causes a visual indicator to appear on screen whenever the controlling player goes offscreen, indicating the approximate location, to give the player a chance to get back on screen.
  9. Stay Onscreen
    When turned on, this tweak will try to keep the controlling player on screen; if they go off screen, the multiplayer offscreen timeout will begin counting down, until it reaches zero when the possessed object will be destroyed. The time limit is specified with the Global Settings gadget.
  10. Power
    This is where you turn the gadget on/off.
Tweak Menu 5: Important Properties & I/O
controller sensor - important
Image: v1.01.
Confirmed identical in v2.06
  1. Tweak Menu: Page 5: Important Properties & I/O
  2. Possession Mode
  3. Player 1
    3a. Boolean input (0/1)
  4. Player 2
    4a. Boolean input (0/1)
  5. Player 3
    5a. Boolean input (0/1)
  6. Player 4
    6a. Boolean input (0/1)
  7. “Follow Imp” Behaviour
  8. Allow Imp During Possession
    8a. Boolean input (0/1)
    8b. Boolean output (0/1)
  9. Force Possession
    9a. Boolean input (0/1)
    9b. Boolean output (0/1)
  10. Depossess
    10a. Boolean input (0/1)
  11. Possession Visual
  12. Imp Docking Tag
    12a. Input wire to Tag gadget
  13. Disable Controls
    13a. Boolean input (0/1)
  14. Power
  1. Menu page indicator
  2. Possession Mode
    This is where you select when the controller gadget will be active. The choices are

    • None
      No player can possess the controller
    • Possessable
      This is the default. The controller will only work if the character or object has been possessed by the imp
    • Follow Imp
      If you possess an object with this setting, the object will move around the screen with the imp (whether or not the imp is visible). You might use this to create a screen cursor effect, for example
    • Remote Controllable
      This allows the controller to be active all the time. You set this for menu options for example, where there is no imp or possessed characters.
  3. – 6. Multiplayer options.
    Each of the four “Players” can be toggled on or off to determine whether each one can possess this particular Controller Sensor. You might use this to force multiple players into separate teams, for example.
  4. “Follow Imp” Behaviour
    There are two options for the behaviour of any object set to “follow imp”:

    • Maintain Orientation
      The default setting. When you possess the object, it doesn’t change its orientation – so if you pick it up from the back, it will continue to show its back to the player. If the imp’s head or eyes are set to be visible, this can be disconcerting as the imp’s face may be partially or wholly obscured by the object being controlled.
    • Imp Faces Camera
      This alternative behaviour causes the object to automatically rotate itself, on possession, so that the imp is face-up. Even if the imp’s Possession Visual [11] is set to “Invisible Imp”, the object will re-orient itself accordingly. This could be useful in, for example, an adventure game such that when the player “picks up” objects via possession, they are automatically rotated to present a particular view, such as the front of an envelope, regardless of what angle they were picked up from.
  5. Allow Imp During Possession
    If this is activated, it makes your imp remain in the Scene even when you’re possessing a character. In this way you could enable the player to use the left and right stick outputs to move a puppet around while angling the DualShock 4 to control the imp independently to grab obstacles.
  6. Force possession
    When selected this will force each player to take control of the nearest possessable character/object.
  7. Depossess
    Send a signal to the input to force the player to depossess this Control Sensor. The default wires the circle button output to this input so the player can exit possession with a button press.
  8. Possession Visual
    Here is where you choose the imp’s appearance while possessing a character or object. Note that these may be affected by other settings that determine the imp’s visibility in a Scene.

    • Invisible Imp
      The default setting. When the imp possesses a character/object it does not appear at all.
    • Eyes only
      This allows the face of the imp to be seen when it possesses an object.
    • Visible (Body on Target)
      The imp appears in full, attached by its body.
    • Visible (Tip on Target)
      The imp appears in full, attached by its tip.
  9. Imp Docking Tag
    By default, when the imp visibly possesses an object, it attaches to a special handle that starts off immediately above the Controller sensor gadget. You can drag this wherever you need. However by wiring this input (12a) back to a Tag gadget, you can specify the location that the imp will appear at when possessing that object. Then you can dynamically alter the imp’s location in-game by moving the tag.
  10. Disable Controls
    Here you can send a signal to disable all controls on the controller sensor, a useful option for handling cut-scenes, for example.
  11. Power
    Here is where you turn the gadget on/off.
Tweak Menu 6: Miscellaneous I/O
Controller sensor Miscellaneous I/O
Image: v2.06
  1. Tweak Menu page 6 : Miscellaneous I/O
  2. Possessed
    2b. Boolean output (0/1)
  3. Player Ownership
    3b. Boolean output (0/1) with player data
  4. Microphone
    4a. Numeric input (0 – 1)
    4b. Numeric output (0 – 1)
  5. Respawn
    5a. Boolean input (0/1)
  6. Die
    6a. Boolean input (0/1)
  7. Is Dead
    7b. Boolean output (0/1)
  8. Offscreen Death
    8b. Boolean output (0/1)
  9. Camera Transform
    9b. Transform output (position, orientation & scale)
  10. Hover Position
    10b. 3-dimensional location output
  11. Power
  1. Menu page indicator
  2. Possessed
    This outputs a constant signal as long as this Control Sensor is being possessed by a player.
  3. Player Ownership
    Outputs a fat wire signal including a Boolean signal to indicate whether the controller sensor is under player control, plus player data (player ID and controller colour) corresponding to the player currently possessing this sensor.
  4. Microphone
    This is where any noise from the player’s microphone can be determined – requires an active microphone to be plugged into the PlayStation or controller. Based on volume of the sound this output can be used to power gadgets allowing the creator to make mouth animations, sound activated switches, movement and other contraptions.
  5. Respawn
    This is where you send a signal to force the player to respawn. By default, there is a wire connecting the “Is Dead” output (7b) into this input so the player automatically respawns upon dying.
  6. Die
    This is where you send a signal to force the player to “die”. This will cause any logic associated with “Is Dead” to be triggered.
  7. Is Dead
    This output sends a continuous signal for as long as the player is “dead” in a Scene. By default, this is wired into the “Respawn” input (5a) so as soon as the player respawns, they will no longer be “dead” and this output will turn off.
  8. Offscreen Death
    If you have configured an “Offscreen Timeout” using a Global Settings gadget, this will output a signal specifically if the player times out due to being offscreen for too long in a multiplayer game. Note that at the point of offscreen “death”, simultaneous signals are sent from both this and the ‘Is Dead’ output [7].
  9. Camera Transform
    This outputs the “transform” data of the camera currently being used — this can be split out into separate fat wires for the position, orientation and scale of the camera.
  10. Hover Position
    This outputs the X, Y, Z co-ordinates to which the imp tip is currently pointing IF the imp is currently pointing at an element (or, in edit mode, a wire, gadget or canvas). If the imp tip is in empty space, these values are all zero.
  11. Power
    This is where you turn the gadget on/off.

Lex Tips

Outputs from button presses last for as long as the button is pressed, stopping when the button is released. So in order for something to turn on and stay on without you having to hold the button down you need to create something more permanent. Use a counter between the button press and the thing you want to power. (See How to make button presses power things on.)

QW Tips

imp location handle
The imp position handle

Initially found immediately above the Controller Sensor gadget is a handle gizmo by which you can position the imp’s eyes and body (when you want them to be visible). The handle’s appearance depends on the “Possession Visual” setting (Important Properties tab). Simply drag it and orient it anywhere you like with relation to the gadget. To reset it to its default location, hover the imp tip over the gizmo and press the triangle button.

Useful Tutorials

Resident Evil Style Controls

Sound activated switch

Version Updates

v1.01: the VR scale tweak has been removed from the Camera Properties tab. ‘Follow Imp’ Behaviour has been added to the Important Properties & I/O tab. The appearance of the imp handle (for positioning imp eyes/face) has been updated.

v1.02: Menu confirmed same. Added info to microphone. Added link.

v2.06: Two new outputs added to Miscellaneous I/O: “Camera Transform” and “Hover Position”. Two switches moved from Miscellaneous I/O to Camera Properties: “Offscreen Indicator” and “Stay Onscreen”. Text updated to include input/output types, minor additions.

Comments and Feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: