Difference between revisions of "Subframe"

From The Powder Toy
Jump to: navigation, search
(Page about Subframe (work in progress))
(No difference)

Latest revision as of 16:48, 12 July 2021

What's Subframe?

Subframe is a general name for technology that abuses particle update order.

Particle Order

Every frame in The Powder Toy all the particles are updated one after another according to their ID.

When you hover over a particle the ID is visible next to X and Y values but only when the debug HUD (toggle it with "D" key) is enabled.

Every time you load a save all the particles are ordered from left to right and top to bottom. That means they will also be updated in that order. You should always assume that order or your contraptions can break when reloading the save.


Solid Spark

Solid sparks are used to activate other particles like ARAY, DRAY, CRAY etc. every frame. It can bypass the spark cooldown and how spark normally blinks.


How to build it: A solid spark is made using at least 3 particles:

1. Any element that can be sparked (like METL)

2. CONV with the CTYPE of the element above

3. BTRY or CONV with CTYPE of SPRK

Their IDs have to be in that order to work

ID of 1 < ID of 2 < ID of 3

How it works: In the first frame nothing happens and at the end the 1st particle gets sparked by the 3rd particle.

In the second frame:

1st particle (now being a SPRK) life decreases (from 4 to 3) and now can trigger elements like ARAY, DRAY etc.

2nd particle replaces the sparked 1st particle, so its not sparked anymore.

Now that the 1st particle isn't sparked the 3rd particle can spark it again (thus avoiding the spark cooldown and blinking).

So the 1st particle gets sparked, the spark is replaced, and gets sparked again.

Language: English