Weaponry and Materials in The Powder Toy

  • Jakav
    12th October Member 2 Permalink

    The Powder Toy (TPT) is very complicated. This post talks about some of the things that go into complicated weaponry, and things that I have learned in general

     

    Serialization

    Serialization is a feature that some elements with FILT which can be very useful many ways. For a tutorial and more information, see id:2446165

     

    Particle Order and Subframe

    In TPT, particles have an update order. This allows for creations that do multiple things within a single frame. It is very useful, basic information can be found at id:2028385. id:2232626 is a very useful tutorial, which I highly reccomend, although not all of it applies for weapons and bombs.

     

    Layering

    Multiple particles can be within one space. This is easily noticeable in EHOL, but it can happen outside of EHOL. Putting multiple particles in one space can allow for easier subframe, better materials, and better weapons as well. It makes things more compact too! The script manager (https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=19400) has a very useful script that helps with this as well as other subframe things. It is called the Subframe Chipmaker Script, and it lets you see what is layered in a material as well.

     

    Source code
    The source code for TPT can be found on GitHub. If you can understand it, it can tell you a great deal about the inner working of elements, and how the simulation works in general. This is how I have found out about some of the things in this document.

     

    CONV modes

    CONV is a very powerful element, because it can convert some elements to other elements.

    It's ctype determines what element it will convert things into. It's tmp converts what elements it will convert. If the tmp is WATR, for example, it will only convert water elements. The tmp2 of CONV can change what the tmp does. If the tmp2 is 1, CONV will convert anything but what the tmp is set to. For example, if the tmp is PCLN, and the tmp2 is 1, the CONV wil convert anything but PCLN.

    By default, CONV will not convert CONV and DMND, will will convert everything else.

    One interesting thing about CONV that can sometimes be used is that it will first try to convert energy particles, and then only other particles if it did not convert an energy particle.

     

    The pmap and photons map

    Although more than one particle can be in a pixel at a time, the particle on top is stored in the pmap (if it is a powder, liquid, gas, or solid), or in photons (if it is an energy particle). I did not coin these terms, these are names of the variables in the code of TPT (the Powder Toy).

    The particle which is on top matters a lot, because almost all elements only interact with which particle is on top, or in the pmap. Some interactions are interactions that affect the particle looking at the pmap, and some interactions affect the particle on the pmap.

     

    Regenerative materials

    Because of layering, materials can be created that can regenerate the top layer. For these, a layer of CONV is typically used with layers of CLNE.

    PCLN is special here, because PCLN (PHOT) will create eight particles at once reliably: one in every single direction. This allows regerative materials to be reliable, and is commonly used. PBCN functions like PCLN here, but because pressure breaks it we use it less.

     

    Transparency

    There are some things that PHOT, PROT, and GRVT cannot go through. For example, nothing can go through DMND. PHOT cannot go through many things, but it can go through CLNE, PCLN, PBCN, BCLN. PHOT can pass through a good few materials, but only the ones with the PROP_PHOTPASS property. Here, the code can be very useful.

    Anyway, it turns out that for something to be created by CLNE and its variants, the top layer needs to be transparent to the thing being created.

    Because transparency is needed, in most good regenerative materials, there is PCLN (PHOT) on the bottom, CONV in the middle to convert the photons created into the desired material, and PCLN (PHOT) or another clone variant on top so that the PCLN (PHOT) on bottom can actually make the photons and the material can regenerate the top layer.

     

    Unpowering regenerative materials
    For PCLN (and PBCN) to function, they must be powered, that is, they must have a life equal to 10. If this is not the case, they will not function. If PCLN with a life between 1 and 9 is moved above PCLN, it will unpower the PCLN, and it will cease producing photons. This instantly breaks the material.

    Unfortunately, there is no counter to this method, because PCLN unpowers itself when it sees a PCLN on the pmap above between two pixels left and two pixels right of itself. Using PBCN instead of PCLN is only a temporary fix, unfortunately, because PBCN can be unpowered in the exact same way, although it requires PBCN. PCLN can only unpower PCLN, and the same for PBCN.

    Sparked NSCN can also be used to unpower regenerative materials. It works similarly, and for both PCLN and PBCN, but it has more flaws, partly because of EMP, I think.

    DRAY is typically used to put the PCLN, PBCN, or NSCN on top of a regenerative material to destroy it.

     

    Overstacking

    When particles are layered with more than 5 layers, they slowly collapse into BHOL. Most particles count here, but not energy particles, THDR, EMBR, FIGH, or PLSM. This mechanic can destroy many things, and limits layering.

    In EHOL, the limit of 5 becomes a limit of 1500, allowing EHOL materials to be much stronger.

    In order to overstack something, you need to use some method to increase the number of layers on top of it.

    With weak materials, simply pushing GRVT onto them will destroy them, because the CONV in them converts the GRVT to somethat that will, unlike GRVT, trigger overstacking.

    In stronger materials, this is prevented by using materials like VIBR, VOID, PRTO, PRTI, or really just anything that energy particles cannot pass through. DMND (when allowed), INSL, BVBR, and PVOD, along with the previously mentioned four, are the only particles that can fully prevent overstacking in this way.

     

    VIRS overstacking
    Many materials that are resistant to being destroyed by conventional overstacking can be destroyed by converting the top layer to VIRS, and then using GRVT, or perhaps PROT, to go on top of that and have existing CONV in the material cause it to overstack after that happens. This technique can be very effective, but is much more difficult around strong gravity fields, or when SOAP is involved.

     

    Zain tech

    Zain tech is a type of immensely complicated technology inspired by what VIBR (the player) had made already in the form of Jain tech. Jain tech is, unfortunately, very obscure. The best version of Jain tech was lost entirely.

    Jain tech uses VIRS and portals to destroy things with VIRS that might even have SOAP. The VIRS the travel through the portals, and be cured, effectively allowing solids to pass through portals. It can then be infected again. This allows for unconventional destruction. Jain nodes filled the network of portals with some WARP, PRTI, PRTO, VIRS, etc. keeping it going.

    Zain tech initially built on this by making Zain nodes that created VIRS with the properties of anything infected that was desired. This massively increased the possibilities of this destructive method, and made it rather powerful. Unfortunately, this requires the use of DRAY to create the VIRS, as it requires very special properties. Perhaps some complicated methods of synthesis could make it not necessary to use DRAY.

    The next thing I discovered was that elements in PIPE can travel through portals. This allows solids to travel directly through portals, along with anything else. This made it so that SOAP was not necessary, and that temperatures could be whatever I wanted because setting VIRS on fire was not a risk.

    This new type of Zain node is used in my complicated azure save, and I have also published several other Zain nodes, all tagged zain.


    Methods of destroying DMND

    DMND is very difficult to destroy; as far as I remember, the only ways are overstacking, PSTN, and DRAY. DRAY activated by PSCN can overwrite DMND, directly destroying it. PSTN can push it beyond the boundaries of the screen, also destroying it immidiately. It is impossible to overstack DMND in almost all cases, but if there is a layer on top of the DMND, or if there are more than 5 layers of DMND, it can be overstacked.

     

    Phantom matter

    Not discovered by me, and originally named fantom matter, by diniumrock, I think, this is an interesting innovation. It allows for many complicated interactions.

    Phantom matter is called phantom matter because, when you hover over it, it says that it is empty, even though you can clearly see that there is something there.

    Phantom matter regenerates with PCLN (PHOT), and converts the photons into LIGH, which destroys itself the moment it updates. This clears the pmap, and makes it possible for elements to travel through phantom matter. It also makes phantom matter rather powerful.


    Preventing VIBR explosions in stacked materials

    While VIBR is bomb-immune, and resistant to many things, including overstacking, it can explode, and if what remains from the explosion is converted to VIBR, overstacking can occur. To prevent this, it is best to convert VIBR to VOID, or to another material, every frame, and then back.

     

    The particle limit
    The maximum number of particles in the simulation is exactly 235,008; the width of the screen multiplied by the height of the screen. If any element attempts to create more particles when there are this many particles in the scene, it will not work, no particle will be created, and the number of particles will not increase.

    Because of the particle limit, weapons can be created that fill the particle limit, preventing regenerative materials from healing. I have made some weapons that use the particle limit to destroy things. id:2917232 is one example of this, and it works well at destroying regenerative materials.

     

    Strange overstacking
    To understand this, it is necessary to know that

    - the ids of newly created are assigned in the first opening
    - when particles are destroyed, openings are created
    - The order of particles in a stack is determined by particle order.

    Due to these three things, whenever particles of a lower particle order are destroyed, overstacking can occur. This, in turn, destroys more particles, and further overstacks the material, and so on. This makes it very, very important to ensure that the first few particles in a save will not be destroyed.

    For this reason, we typically omit the top layer of regerative materials, leaving PCLN or clone variants on top.

    My Party Bunker (id:2846870) is a good example of why we do this. Putting DUST on it can overstack the outermost regenerative layer.

     

    Destroying phantom matter

    There are a few ways to destroy phantom matter. One of these is to fill the particle limit, after which its effect no longer occurs. Another way is to overstack it, which is not incredibly difficult with DRAY, as you can DRAY some CLNE on top of it, which will join the stack.

    Without DRAY, there are only a few other ways to break phantom matter. The methods are, overall, unreliable, but they can work. The difficulty with most of these is that good phantom matter will remove things stacked on top of it.

     

    EHOL materials
    As mentioned earlier, while in EHOL, the number of particles needed to overstack increases all the way to 1500. This makes it much more difficult to overstack something. It also can make de-powering not a problem anymore.

    Because of the increased stack limit, CLNE can be used to make GRVT on top of an EHOL material. CONV is used, of course, and typically VIBR, VOID, or something else that GRVT cannot go through is put on top, so that it will not overstack itself or fill the particle limit. These materials solve many problems that happen in normal materials, but take many more particles as well. Because GRVT can go through CONV, a transparent layer on top is not needed. All these factors make the material extremely strong.


    Updates to the pmap

    It appears that, before each frame, the pmap is updated. This makes it so that, typically, neither more than one layer of a material can be destroyed at once. This limits the fastest speed you can destroy a material with DRAY to the number of layers that material has, unless that material destroys itself in some way.

     

    PSTN pullers

    These are definitely an interesting type of weapon, and work on a variety of things. PSTN extends and contracts within a frame to pull the top layer towards the device. Once the top layer is near the device, various methods are employed to destroy the particles that have been pulled. I think CONV (EMBR) and CONV (LIGH) typically work, with DRAY to destroy it working very well and CRAY also being one method to destroy the things.

     

    Azure bombs

    Although azure bombs have been around for more than ten years, they have their uses, still. They can do a variety of things. A basic tutorial can by found by simply searching azure.

    Edited once by Jakav. Last: 15th October
  • Desty
    12th October Member 0 Permalink

    Nice. I'd include a bit more specifics about weaponry but this is great.

  • Jakav
    12th October Member 0 Permalink

    As for specifics about weaponry, well, my saves have a lot of that. I agree though, this is primarily just talking about concepts and not specific weapons.