Difference between revisions of "Subframe"
(Grammar/Spelling/General Looks changes.) |
(MaterialBtns, grammar, making it look better in general) |
||
Line 6: | Line 6: | ||
Every frame in The Powder Toy, all the particles are updated one after another according to their ID. | Every frame in The Powder Toy, all the particles are updated one after another according to their ID. | ||
− | When you hover over a particle with debug mode ("D" key to toggle) the ID is visible next to the X and Y values. | + | When you hover over a particle with debug mode (use the "D" key to toggle) the ID is visible next to the X and Y values. |
− | Every time you load a save | + | Every time you load a save, 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 the order of your contraptions can break when reloading the save. | + | That means they will also be updated in that order (because the IDs are also ordered). You should always assume that the order of your contraptions can break when reloading the save. |
[[File:ParticleUpdateOrder.gif]] | [[File:ParticleUpdateOrder.gif]] | ||
Line 20: | Line 20: | ||
'''How to build it:''' | '''How to build it:''' | ||
− | A solid spark is made using at least | + | A solid spark is made using at least three particles: |
1. Any element that can be sparked (like {{MaterialBtn | METL}}) | 1. Any element that can be sparked (like {{MaterialBtn | METL}}) | ||
− | 2. {{MaterialBtn | CONV}} with the CTYPE of | + | 2. {{MaterialBtn | CONV}} with the CTYPE of element one (if you place this while unpaused, it automatically sets the CTYPE, assuming there are no other elements nearby) |
− | 3. {{MaterialBtn | BTRY}} or {{MaterialBtn | CONV}} with CTYPE of {{MaterialBtn | SPRK}} | + | 3. {{MaterialBtn | BTRY}} or a {{MaterialBtn | CONV}} with a CTYPE of {{MaterialBtn | SPRK}} |
− | Their IDs have to be in | + | Their IDs have to be in this order to work: |
ID of 1 < ID of 2 < ID of 3 | ID of 1 < ID of 2 < ID of 3 | ||
'''How it works:''' | '''How it works:''' | ||
− | In the first frame | + | In the first frame, the 1st particle (the sparkable element) gets sparked by the 3rd particle (the {{MaterialBtn | BTRY}} or {{MaterialBtn | CONV}}). |
In the second frame: | In the second frame: | ||
− | 1st particle (now | + | The life of the 1st particle (which is now a {{MaterialBtn | SPRK}}) decreases from 4 to 3 and now can activate powered materials. |
− | 2nd particle replaces the sparked 1st particle, so | + | The 2nd particle (the {{MaterialBtn | CONV}}) replaces the sparked 1st particle with the original material, so that it's not sparked anymore. |
− | Now that the 1st particle isn't sparked the 3rd particle can spark it again (thus avoiding the spark cooldown | + | Now that the 1st particle isn't sparked anymore, the 3rd particle can spark it again (thus avoiding the spark cooldown, so it doesn't blink). |
− | So the 1st particle gets sparked, the spark is replaced, and gets sparked again. | + | So the 1st particle gets sparked, the spark is replaced with the original material, and then gets sparked again. |
Revision as of 00:33, 20 November 2023
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 with debug mode (use the "D" key to toggle) the ID is visible next to the X and Y values.
Every time you load a save, the particles are ordered from left to right and top to bottom. That means they will also be updated in that order (because the IDs are also ordered). You should always assume that the order of your contraptions can break when reloading the save.
Solid Spark
Solid sparks are used to activate powered materials every frame. It can bypass the spark cooldown (which is why spark blinks).
How to build it:
A solid spark is made using at least three particles:
1. Any element that can be sparked (like )
2. with the CTYPE of element one (if you place this while unpaused, it automatically sets the CTYPE, assuming there are no other elements nearby)
Their IDs have to be in this order to work:
ID of 1 < ID of 2 < ID of 3
How it works:
In the first frame, the 1st particle (the sparkable element) gets sparked by the 3rd particle (the or ).
In the second frame:
The life of the 1st particle (which is now a ) decreases from 4 to 3 and now can activate powered materials.
The 2nd particle (the ) replaces the sparked 1st particle with the original material, so that it's not sparked anymore.
Now that the 1st particle isn't sparked anymore, the 3rd particle can spark it again (thus avoiding the spark cooldown, so it doesn't blink).
So the 1st particle gets sparked, the spark is replaced with the original material, and then gets sparked again.
Language: | English |
---|