Weight

  • explosivos
    16th Apr 2014 Member 0 Permalink

    I would be nice to see that they implemented a tool to add or substract weight from a "item".

  • NF
    17th Apr 2014 Member 0 Permalink

    @explosivos (View Post)

     Maybe. Do you know, how to code? if you do make it yourself. There are many, mods of The Powder Toy of lua and probably of C++.

    Edited once by NUCLEAR_FOX. Last: 16th Apr 2014
  • zBuilder
    17th Apr 2014 Member 0 Permalink

    the weight so far seems to only determine how far it will fall in a stack. setting it high displaces particles. I guess it would be cool if there was a way to calculate deforming but it would probably be CPU intensive and require a different method of calculation than the current.

  • boxmein
    17th Apr 2014 Former Staff 4 Permalink
    Right now, the weight system is as simple as it gets - it checks if one particle can swap with the other when it's trying to move into its place. So let's say a piece of BCOL falls into a pile of DUST, at the exact frame it tries to fall into the DUST it asks the game, "Hey, am I even allowed to move inside the dust?", and the game responds, "Sure bro, but swap the dust into where you just were". And then it falls where it wants and the dust replaces its position. If it can't, the particle just falls on top of the element it's supposed to not fall into.

    image
  • zBuilder
    17th Apr 2014 Member 0 Permalink

    boxmein:

    Right now, the weight system is as simple as it gets - it checks if one particle can swap with the other when it's trying to move into its place. So let's say a piece of BCOL falls into a pile of DUST, at the exact frame it tries to fall into the DUST it asks the game, "Hey, am I even allowed to move inside the dust?", and the game responds, "Sure bro, but swap the dust into where you just were". And then it falls where it wants and the dust replaces its position. If it can't, the particle just falls on top of the element it's supposed to not fall into.

    image

     

    exactly. the only minor thing is it doesn't matter how much heavier or lighter it is, it just checks wheather it's heavier than a threshold or not. a single speck of coal will imediately fall to the bottom of a pile of DUST with no resistance, rather than taking multiple particlea to weigh down and displace. that would be more complex though

  • h4zardz1
    18th Apr 2014 Member 0 Permalink
    1.we have MERC, which is heavier than a dust.
    2.but if we subtract weight from any solids, what would happen?
  • greymatter
    18th Apr 2014 Member 0 Permalink
    @explosivos (View Post)
    Realistically we cannot just add or substract weight from an element..
    unless we remove neutrons which would cause it be unstable.....

    However weight is a variable in the game code and if we could use the PROP tool to modify this variable then this could be done.
  • boxmein
    18th Apr 2014 Former Staff 0 Permalink
    Point is, the weight variable is used before running the game (or, rather, creating a Simulation object) to generate a table called
    can_move[source_type][destination_type]
    which is like a weird kind of reference to check what happens when a target element tries to move into the destination element - it either
    (0) doesn't move or bounces back (for photons),
    (1) swaps like it does in the gif,
    (2) allows the particle to move except doesn't swap, like two photons overlapping for example,
    (3) handled elsewhere or in some update function.
    So changing the Weight variable means that nothing actually happens unless you regenerate the can_move table.
    You can experiment by using the Lua function however, to try and see what changing various can_move entries does.

    Also, I think the possibly easiest way of doing what OP wanted is to find out which can_move entries changing something's weight changes, then changing them. You can already see how this is going to be really complex.
    Edited 4 times by boxmein. Last: 18th Apr 2014
  • CeeJayBee
    18th Apr 2014 Member 0 Permalink
    @boxmein (View Post)
    Couldn't you just get it to change how the element weight is defi- Wait, crap, that would involve either
    A. Creating temporary elements to represent the newly defined elements
    or
    B. Changing all the elements weights permanently.
    I can see how this is a problem

    tl;dr: OP, this will probably never happen