Element:FILT

From The Powder Toy
Revision as of 00:48, 5 September 2017 by suibian (talk | contribs) (Filter for Photons)
Jump to: navigation, search
FILT.png Filter
Properties
Section Solids
Spawn temperature 22°C
Heat Conductivity 100%
Relative weight 100
Gravity 0
Acid dissolve rate 0.1%
Flammability 0
State Solid
Misc properties
Source code


Usage

When created, Filter's color is based on its temperature. It will scale from dark blue to dark red, corresponding roughly to temperatures between 200 and 840°C. Filter has high temperature conductivity, and its color-changing makes it easy to see the flow of heat.

Filter will color BIZR and white BRAY passing through it. FILT can also change the color of passing PHOT and BRAY using binary logic, described in detail later. FILT is one of those seemingly boring, but in reality extremely complex and interesting elements. Here are some uses of FILT:

Heat Conductor

Probably the simplest way to use FILT, for a beginner at least, is to transfer heat. FILT has a very high (but not the highest) thermal conductivity and is nearly indestructible, making it ideal for transferring heat away from reactors to cooling fluids. It is also useful for debugging, as it changes color from blue at 0°C to red at 1000°C. (more detail on this in later sections). Note that if ambient heat is enabled, FILT's temperature will not be affected by the 'air temperature' around it, only items touching it.


ARAY Conduit

The basis of most modern electronics in TPT is FILT/ARAY conduits. If you SPRK a pixel of ARAY from a basic conductor (a conductor that is not PSCN, INST or INWR), it will create a beam of BRAY with a life of 30 that will SPRK any conductors in the way except for INWR. This is useful for transferring current over long distances with greater compression than INST matrices, however it is clunky and slow as one must wait 30 frames before the ARAY can be SPRK'd again compared to 8 for INST.

If a pixel of FILT is pressed up against ARAY, and another pixel of conductor is on the end, it will conduct instantly with no wait time, since no BRAY is created. This is a fast, reliable method of conducting electricity.

Note that both white and brown BRAY can pass through it, and can enter, exit and re-enter the FILT without stopping the beam. White BRAY will pick up the display color of the FILT, and can be used for wavelength transfer and operations like PHOT.

Filter for Photons

Waves.gif

BIZR/G/S and PHOT particles store their wavelengths in the ctype field. Wavelengths are stored in binary, using 30 out of 32 available bits. A set bit indicates that a specific wavelength is present, a zero bit means it is absent.

The visible color depends only on amount of bits in 5 bit groups: red, yellow, green, cyan, and blue. They are 9, 3, 6, 3, and 9 bits long, respectively. The position of bits within a group is preserved, but does not affect particle's color. More specifically color only depends on proportions of those amounts. To get white color, set the ctype to 0x3FFFFFFF or -1, which will enable all the wavelengths. A photon dies if its ctype is 0, which means that no wavelengths are present.

FILT uses the ctype field to store wavelengths too, however if ctype is 0, wavelengths are calculated from its temperature: it slowly changes from blue when cold, to red when hot. More specifically, a group of 5 bits is set, and starting from 0°C, every 40°C the group is red-shifted by 1, and after 25 shifts, at 1000°C, the group is shifted to the most red wavelengths.

FILT has many operation modes determined by its tmp property:

FiltTmp.gif
  1. "set" mode: FILT's spectrum is copied into PHOT particles that pass through it
  2. "and" mode: A bitwise and is performed on PHOT's and FILT's spectrums and the result is stored in the PHOT particle, any wavelengths not present in FILT will be removed from PHOT.
  3. "or" mode: Performs a bitwise or: all wavelengths present in FILT are "enabled" in PHOT, if not already.
  4. "sub" mode: Performs a bitwise and-not: all wavelengths present in FILT are subtracted from PHOT.
  5. "red shift" mode: The wavelengths of a photon are red-shifted. The distance of the shift is calculated from the temperature only: the ctype value of the FILT is ignored..
  6. "blue shift" mode: Like "red shift", but the shifting direction is opposite, wavelengths are moved towards the blue end.
  7. "nothing" mode: No spectrum changes are performed. Useful if you want to cross beams of PHOT and ARAY without mangling the spectrum
  8. "xor" mode: Performs a bitwise xor: all wavelengths present in FILT are "flipped" in PHOT's spectrum, that is, if some color was on, it turns off, and vice versa.
  9. "not" mode: Performs a bitwise not: all wavelengths of PHOT are flipped. Note that FILT's spectrum is ignored.
  10. "QRTZ scattering" mode: Randomizes photons' velocity and randomly changes their color, just like QRTZ in old versions of The Powder Toy.
  11. "variable red shift" mode: Like "red shift", but ctype value of the FILT isn't ignored
  12. "variable blue shift" mode: Like "blue shift", but ctype value of the FILT isn't ignored

Any other tmp value makes FILT do nothing, like the "nothing" mode. It is strongly recommended not to use any tmp's above those listed here, as the developers may add more modes for those tmp values in the future, which would break your save.

DTEC can be used to modify FILT's ctype: when PHOT or BRAY hits DTEC, DTEC copies the spectrum into a line of directly adjacent FILT blocks, if any are present.

Decoration Color Changing

When CRAY fires through FILT, the deco color of the particles change to match the color of the FILT. BIZR also changes its deco color to the color of FILT when it passes through it.

Examples

A thermometer done with using FILT.
A spectrum analyzer, which can detect the color of incoming photons.