FANDOM


Please note that Circuits are not yet for the faint of heart! This is an early version, so there'll be bugs and incompleteness. We absolutely apologize for any frustration this causes!
 
— Against Gravity, Update Page


Dice Output

Example of a simple circuit: a 20-sided die wired to an Output chip to display the rolled number.

About

Circuits are editable networks of Chips, Gizmos, other gadgets, and dynamic props that can be used in Custom Rooms to execute more or less complex programs. These programs can control animated and interactive elements of a room, for example, animated or interactive spot lights, sound effects, holotar projections, or complete games.

The pages about Chips and Gizmos describe those elements in more detail. The other gadgets and dynamic props are described below.

The capability of using a Maker Pen and editing circuits is determined by your Permissions in a room; by default, only creators and co-owners may edit circuits in Custom Rooms. Most elements of circuits are created with the Maker Pen and the "Gadgets" tab of the Palette. The exception are dynamic props, which are available in the "Props" tab of the Palette. Chips, gizmos, and objects can be configured with the Configure mode of the Maker Pen. They can be connected and disconnected with the Wire mode of the Maker Pen – usually by connecting their pins, but Gizmos can also be connected to whole objects. You can get information about most pins (function of input pins and current values of output pins) by pointing with the ray of the Maker Pen (for example in Wire mode) at a pin for about 2 seconds.

Circuit nodes (such as chips, gizmos, or other gadgets/props) process their signals about 10 times per second. The system evaluates chips in a particular order, i.e., a chip that produces a signal for another chip is usually evaluated before the other chip is evaluated (except in case of cycles where the evaluation order depends on the order in which the chips were connected). Thus, if there are no cycles, a signal can travel from a chip at one end of a circuit to a chip at another end of the circuit within just 1/10 of a second. This is referred to as a "circuit tick".

If you have questions about specific circuits or the system in general, don't hesitate to ask them in the #circuits channel of Against Gravity's discord.

Examples of Circuits

Rec Room Variable Chip Basics Update

Rec Room Variable Chip Basics Update

YouTube video by Vigorous Rapscallion

Several players have produced YouTube videos about circuits, e.g., Vigorous Rapscallion.

Several examples of useful circuits are documented in Circuit Diagrams.

You can see many circuits in Rec Room by going to Custom Rooms like ^CircuitAcademy0, ^CircuitsForDummies, ^circuitdemo, ^circuitrecipes, ^TeamandStatscircuits, ^GameModeCircuits, ^GizmosAndTags, ^DoorGizmos, ^Gizmos2WavesItemspawns, ^TutoNPC, etc. To find these rooms, open your Watch Menu, click on the Play button and then the Search tab. Click on "Enter name here," type in the name, and then click the "Search" button. Some of the rooms are also accessible via the custom room ^FeaturedRooms.

Data Types

Circuit nodes can only exchange integer values with each other, but internally they might use different types. Therefore internal values might have to be converted to and from integers.

Integer

The native circuit values are 32-bit signed integers: They range from −2,147,483,648 to 2,147,483,647 and cannot produce fractions or real numbers.

Boolean

Many inputs and outputs use an integer value to represent only two Boolean values, i.e., false (a value equal to 0) and true (any value unequal to 0). For inputs, that means that 0 is interpreted as false, any other value as true. For outputs, that means that 0 is emitted for false and 1 for true.

Float

Gizmos for example convert their inputs to floats. The value range of floats is larger than that of integers, so you can pass any integer number and it can be used. However the precision of a float depends on how close the number is to 0; the precision falls below 1 outside the range of -16,777,217 to 16,777,216. In other words, you can input and use 16,777,216 just fine, but 16,777,217 will have the exact same result as it is rounded to 16,777,216.

ID

Some chips use integer IDs as inputs or outputs. Those are numbers that uniquely identify entities:

  • Player ID: Every player gets an ID when the player joins the room that is valid until the player leaves. When players join the room again, they get a new ID. The ID is the lowest integer that has not been used yet, starting from 1. In other words: the first player in a room has ID 1, the next has 2 and so on.
  • Team ID: Every team color has a different ID, starting from 1.
  • Object ID: Every object has a unique object ID. These are sent by Trigger Volumes and can be mapped to player IDs with the Object Mapper chip. Ids of objects stay the same until a room is saved or restored, then everything gets new ids.

Pitfalls

The current version of circuits has some known pitfalls that can be hard to understand if you are not aware of them.

Invisible Circuits

The capability of using a Maker Pen and viewing gadgets is controlled by Permissions in a room. Thus, if you don't have the Permissions to edit circuits for a particular room, you might have to ask the creator of the room to give you such permissions.

Additionally, some objects, such as respawn points, can be grabbed and moved by players, even when circuits are not visible.

Connecting Frozen Objects

Connecting/wiring frozen objects is currently not possible. You have to unfreeze both objects with the Freeze mode of the Maker Pen before connecting them.

Connecting Shapes to Gizmos

You cannot connect Maker Pen shapes to Gizmos, but you can connect Maker Pen objects to Gizmos. To turn a shape into an object, press the "Done Editing" button of the Maker Pen.

Value Range

Circuits currently support only 32-bit singed integers as signals. They range from −2,147,483,648 to 2,147,483,647 and cannot produce fractions or real numbers.

Ring Evaluation Order

A Chip that produces a signal for another chip is usually evaluated before the other chip. However, this does not work if signals travel in cycles formed by connections between chips. Rings that consist of more than one chip do not have a defined evaluation entry point. That means the chip inside the ring store that gets evaluated first cannot be defined designing the circuit. Therefore they sometimes get evaluated in an unexpected order. For example the Number Pad often produces a 0 too much at the end (i.e. the result is 10 times what it should be).

If the execution order of the chips inside a ring appears wrong, it helps to exchange the chips in the ring. To do so, swap the chip that appears to be executed first with the chip that should be executed first. Then swap their functions and connections. The result is the exact same circuit, only that the chips that execute the steps are different ones. The ring should then be evaluated in the desired order.

There is a solution to the ring evaluation order problem, if you would like it to be implemented, vote on this canny post.

Authority Player

Circuits (among other things) are evaluated not on any RR server, but on the client of the player who enters a room first; that player is called authority player. When the authority player leaves, another player becomes the new authority player.

The client of the authority player publishes circuit results to other players in the room. This causes extreme lag (in the order of full seconds), if other players than the authority player cause circuit evaluations (by triggering zones or buttons, shooting people, etc.). In addition to that, the implementation of the authority player functionality has always been buggy and still causes synchronization problems between clients. As a result, the game state observed by the authority player and the state observed by anyone else often do not match, the world might even change when a new authority player is chosen (sandbox radios for example start playing again).

Global Chip Update Tick

GlobalUpdateIssue
Changes:
  • Rec Royale Alpha Update: The random number generator chip is not affected anymore. The effect can still be observed with the new player stat and team change chips.
  • Pizza & Potions Update: No change.
  • Locomotion Update: No change.
  • Isle of Lost Skulls Update: Currently this issue only affects random number generator chips.

The first example on the right demonstrates the issue. Note that the button is not connected to anything at all. Every time the button gets pressed, the output increases by 2.

All Chips in one room are evaluated every time any chip gets evaluated (about 10 times per second); otherwise they are usually not evaluated. The result may be confusing and counterintuitive - in particular if you rely on this "lazy" evaluation. For example a ring store that has an external input signal usually does not change until a signal is triggered. However, it does change when an unrelated signal in an unrelated circuit in the same room gets triggered. If you encounter values that appear to be changing randomly while building a circuit or when triggering signals at the other end of the room, this is probably the reason. The simplest way to reproduce this issue is to build an alternating circuit, for example by connecting the output of a Not chip to its input and observing the output.

Currently there is no known workaround for this issue, other than designing the circuits in a way that they are not affected by it. (For an example, see the two variants of the Copy Value circuit: the first one is not affected by the issue but takes one more tick to perform its function.) According to Against Gravity, this issue is not a bug but an expected behavior. However, they understand that it is confusing and are considering to change the expectation.

GlobalUpdateInducer

To help you building circuits in a way that they are not affected by the global update, you can add the circuit on the right to your room during construction. It will constantly induce chip updates (about 10 per second), so you will notice problems in your design early.

Gadgets

Most elements of circuits are listed in the "Gadgets" tab of the Palette.

Chips

See Chips.

Gizmos

See Gizmos.

Other Gadgets

Radio

Radio

There are two radios: the radio and the ambience radio. When the red input arrow receives a true value, the radio starts or stops.

Bugs: Currently it is a bad idea to control the radio by circuits for rooms that allow more than 1 player. The state of the radio (playing/stopped) is purely client based and will always start in the playing state for a player when he enters a room. If the actual/supposed state is stopped, the radio status will always appear reversed to the player. Another problem appears when a client misses the chip tick that is supposed to change the radio's state, then that client's radio will be out of sync, too. Additionally a stopped radio will start playing again if the player that has been in the room the longest leaves.

The songs available to you on each radio are:

Radio Ambience radio
Sport Funk AmbianceSummerOutdoor
In the Basement Paintball_Ambiance_ClearCut01
Secret Room Quest_Goblin2_Ambiance_Mines01
Goat Attitude Kiosk_PowerUpAmbianceLoop
Organism Quest_Pirate1_CrowdAmbiance
River Predator Quest_Pirate1_Ambiance_BrookLocal01
Flight Beam Quest_Pirate1_Caves_GhastlyAmbiance01
Electar Paintball_Dam_Crickets_AmbianceFill01
JumboTron - Explore
Arena Intense
Clear Shot
Food Court
Clear Shot
Range Finder
Spillway
Golden Trophy - Explore
Golden Trophy - Combat 2
JumboTron - Combat 1
Emitter

Emitter

The emitter creates an animated particle system.

  • Various particle systems can be set with the Configure mode of the Maker Pen (Confetti, Boost, Explosion, Fireflies, Firework, Fog (invisible on PSVR), Hit 1, Hit 2, Leaves, Flash, Wind).
  • If the cyan input pin receives a value unequal to 0, new particles are emitted. If it receives 0, no new particles are emitted (unless the "Looping" setting is checked).
  • If "Looping" is checked, the particle system emits particles even if the cyan input pin is not connected. If it is checked and the cyan input pin is connected, then the particle system starts (and continues) as soon as a value unequal to 0 is received.
  • The signal on the purple input pin determines the color of some particle systems.
  • If "Use Maker Pen Custom Colors?" is checked and no signal is received by the purple pin, the Recolor model of the Maker Pen can be used on the emitter to set the color of some particle systems.
  • The signal on the yellow pin determines the size of the particle system (typical values are between -10 and 100, but some effects also allow larger values.
  • The signal on the blue pin determines the speed of the particles (typical values are between -10 and 100).
Objectrespawner

Object Respawner

An object respawner can teleport objects from anywhere in a room to the position of the object respawner. Send an object ID from a Trigger Volume that tracks objects to the red input ("Respawn Object by ID") to respawn that object. Send any signal unequal to 0 to the green input ("Respawn Object by Tag") to respawn one of the objects with the tag that is specified for the object respawner with the Configure mode of the Maker Pen. If more than one object has the tag to be respawned, the respawner chooses the tagged object farthest away from it. If "Respawn item politely?" is checked in the settings, then objects that are held by players will not respawn. If "Clear velocity on respawn?" is checked, then the object will always rest at the position of the object respawner after respawning.
Respawn Point

Respawn Point

When a player ID is passed to the green input arrow, the player with that ID is respawned at the point. The red input arrow sets which team the respawn point belongs to, so that you can actively change it in a game. There are 16 teams and the team colors repeat after 10. -1 (or any other negative value) is any team, 1 is blue, 2 is red, 3 is orange etc. By default the spawn point is set to any team. The spawn point's team can also be set with the Configure mode of the Maker Pen for teams 1-16 and any team.

If an object tag is specified for the primary or secondary hand, then the player is equipped with an item that has this tag if one is available. If "Respawn this item politely?" is checked then an item that is held by another player is not considered to be available.
Sampler

Sampler

Samplers can play recorded audio clips of up to 30 seconds. Red input: "Play on Signal"; green input: "Playback Speed"; blue input: "Volume (Max 10)".

The default volume when unconnected, or outside the range of 1-10, is 10.

The playback speed specifies a factor relative to the recording speed. The factor is 1 if g = 0, otherwise the factor is g/10. The range of g is from -500 to 500.
Trigger zone

Trigger Volume

Trigger volumes are created with the Maker Pen and the Palette in a similar way as Cube shapes. They have two modes that can be set with the Configure mode of the Maker Pen: either they keep track of players or of objects. If an object tag is specified under "Filter By", then only objects with this tag are tracked.

If tracking players, the red pin outputs 0, or the player ID of a player who just entered the trigger volume. The green pin outputs the number of players in the trigger volume. The blue pin outputs 0, or the player ID of a player who just exited the trigger volume.

If tracking objects, the red pin outputs 0, or the object ID of the object which just entered the trigger volume. The green pin outputs the number of objects in the trigger volume. The blue pin outputs 0, or the object ID of the object that just exited the trigger volume. (To identify the player who most recently has interacted with this object, use the Object Mapper chip.)

Dynamic Props

Most of the "dynamic" props in the Palette either receive or send circuit signals if their colored pins/arrows are connected to other circuit elements.

Button

Button

Depending on the configuration, the red output is set either to a momentary 1 or the player ID when the button is pressed. The green output is set either to a ticking 1 or the player ID while the button is pressed. The blue output is set either to a momentary 1 or the player ID when the button is released.

Costumedummy

Costume Dummy

A Costume Dummy sends the player ID of a player who wears the costume on the red pin. Otherwise it sends -1 or 0.

Dice Output

Dice

When a dice rolls, the connection outputs the value of the roll momentarily. You could use a pulse to steady conversion circuit or a copy value circuit to store the dice roll result.

Disc golf goal

Disc Golf Goal

When a disc hits the goal, the red output arrow outputs a momentary 1.

Holotar Projector

Holotar Projector

When the green input arrow receives a True value, the holotar starts playback. When the red input arrow receives True, the holotar stops playback.

Object Goals

Object Goal

When an object passes through the goals, the red output arrow outputs a momentary 1.

Player Goals

Player Goal

When a player passes through the goal, the red output arrow outputs a momentary 1.

Modify room door

Room Door

When the red input arrow is receiving a True value (any value other than 0), the door is locked.

20- Sign

Sign

The sign can display one of 5 text messages that can be set with the Configure mode of the Maker Pen. The cyan input signal determines which message is displayed (0 to 4). Use "{R}", "{G}", and "{B}" in the text messages to display the value of the red, green, and blue input signals.

Stage Light

Lamp operational
Lamp

The stage light looks like a spotlight that creates a square pyramid of light originating from the source that gradually tapers off several meters away from the source. The cyan input controls the On/Off state with 0 being off and non-zero being on. The magenta input controls the color of the lamp. The yellow input controls the intensity of the lamp, with 0 being no intensity and 100 being max intensity.

The light cone passes through objects, so there are no shadows. The circuit stage light is an environmental object that is not influenced by physics.