Logic Gadgets: Randomiser

 

Icon
Name of gadget Randomiser
Section Logic & Processing
Number of Tweak pages 1
Author LadylexUK, QuietlyWrong
Last updated 1 Apr 2019 [Beta]

Description

This gadget is used to create randomness in your game. It has 10 channels and you can choose as many of these as you like. They are labelled A-J but their outputs are 0-9 (with A being 0 and J being 9). Random numbers can be used to add life to your scene (so that everything is not on a fixed time), or life in your NPCs and enemy AI. You can use random numbers like a dice throw and create elements of chance. You can string randomisers together with calculators to get bigger numbers.

Example Tutorial (from Media Molecule)

  1. Stamp a lot of individual sculptures or shapes into your scene (5 should be enough)
  2. Place a timer
  3. Set the timer to 2 seconds
  4. Place a randomiser.
  5. Connect the timer finished (pulse) to reset timer creating a loop
  6. Connect timer finished (pulse) to randomise on the randomiser
  7. Change the no of ports to 5 (or however many objects you put in your scene)
  8. Connect each output A-E to one of the shapes visible toggle
  9. Hit start time
  10. The shapes will randomly appear and disappear as they are chosen by the randomiser

Tweak Menus

  1. Input to randomise
    1a. Input
  2. Randomise
    2a. Input
  3. Number of ports
    3a. Input
    3b. Output
  4. Randomise Mode
  5. Output Ports
    5b. Output
  6. Active Port
    6b. Output
  7. Power
  1. Input to Randomise
    If you want to send a specific signal through a random output port, connect that signal to this input.
  2. Randomise
    Wire a pulse into here to randomly switch between the output ports. At the same time the corresponding number of that port is output from the Active Port output. One output port is chosen for each pulse and the rules for how they can repeat is determined by the Randomise Mode setting.
  3. Number of Ports
    Move this slider to select how many ports will be active. So for example, if you wanted a random number between 0 and 4 you would select 5 and it would activate ports A-E.
  4. Randomise Mode
    The options are:

    • No Repeat
      It will pick one of the active ports randomly, but will be sure not to pick the same port twice in a row.
    • Shuffle
      It will pick one of the active ports randomly and will not pick that again until all of the ports have been cycled through. This way you can get a random sequence of numbers that do not repeat.
    • True Random
      It will pick one of the active ports randomly, using a ‘true’ random number that might pick the same port several times in a row.
  5. Output Ports
    These are what the randomiser chooses when it is randomising. If the is an “Input to Randomise”, this signal is sent to the currently active port only. Otherwise, the output ports simply turn on when active and off when not, outputting signals of 1 and 0 respectively.
  6. Active Port
    This output will give you a number that represents the port currently selected. This is a numeric value corresponding to the ports in turn, with A=0, B=1 and so on up to J=9.
  7. Power
    This is where you can turn your gadget on/off.

Lex Tips

To get a truly random number you need to “seed” this randomiser. You could use a button press to do this, as the time that a button is pressed is providing an extra randomising effect to the gadget. If you just set it off without this you may find the numbers are not “random” in that it produces the same set of numbers each time. You could have a randomiser churning out random numbers continuously and only call on that number when needed. Make the timer to be the smallest as possible (0.1 seconds) and then use a signal manipulator to freeze an output at the point you need it, this way you are guaranteed not to get the same results every time.

The randomiser starts at 0 and goes up to a maximum of 9. To get a choice of 1 to 10 you will need to put the output through a calculator which adds 1 to the number.

To get choices above 10 you will need multiple randomisers. I will be adding a tutorial for that when the game is launched.

Useful Tutorials

Beginners guide to the randomiser gadget

Advertisements

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: