Liquid Placement Bug.

  • tmo97
    1st Nov 2014 Banned 0 Permalink
    This post is hidden because the user is banned
  • boxmein
    1st Nov 2014 Former Staff 0 Permalink
    Probably meant so that you can push out a lot of liquid in a short amount of time - the liquid sorta gets out of the way of the rectangle brush, if you notice.
  • jacksonmj
    1st Nov 2014 Developer 0 Permalink

    Did you create the OIL in the box in the same way, with the rectangle tool?

     

    It is "just the way liquids behave", combined with particle IDs.

     

    When a liquid particle moves:

    If there is an adjacent empty space in the direction of its velocity for it to move into, it moves into it.

    If its path is blocked by liquid particles of the same type, it attempts to move sideways by up to 30 pixels - this is what makes TPT liquids level out. If this succeeded, it then attempts to skip over the liquid particles below it, moving down by up to 30 pixels to find an empty space - this makes the liquid spread out downwards in addition to sideways, otherwise the sideways spreading looks rather odd.

     

    When creating a box of particles with the rectangle tool, the created particles have IDs increasing from left to right, top to bottom. Particle movements occurs in order of particle ID. Particle 0 moves first, then particle 1, then particle 2, etc.

     

    For particles on the left side of the box, particle 0 is able to move left by 1 pixel and does so. This leaves a space, so particle 1 is able to move left by one pixel into the space and does so. Etc. Since previous particle movements leave a space, the path left is never blocked, so no skipping occurs to the left.

    The path right is always blocked, since those particles haven't moved yet. So a lot of the particles on the right side of the box immediately skip up to 30 pixels outside the box. Same goes for the bottom - path down is always blocked, so skipping occurs.

     

     

    Short of entirely rewriting the movement code, the only thing that can be done is changing the order in which particles are created. This is probably not too difficult for rectangle and brush, but rather tricky for line and flood fill.

    Edited 3 times by jacksonmj. Last: 1st Nov 2014
  • CeeJayBee
    2nd Nov 2014 Member 0 Permalink
    Edited once by CeeJayBee. Last: 2nd Nov 2014