Gel - sponge water exchange is broken

  • U42
    9th Oct 2025 Member 0 Permalink

    id:3291557
    logically this should work
    as sponge would decrease the water level to zero by evaporation
    causing the heat conduction to stop
    Instead what we get is that it remains at 1 and nothing happens
    because of the fact it is broken

    for some unholy reason
    the value of sponge = value of gel -1 preventing it from being ever usable to dry the gel

    Edited once by U42. Last: 9th Oct 2025
  • jm211
    21st Nov 2025 Member 0 Permalink

    Hi there. This is not broken at all. Just as life=0 spng can never drain tmp=1 gel, tmp=100 gel can never fully saturate life=99 spng.

    Gel and spng are not "equals", rather, gel has a *slightly* higher affinity for water, so if 1 spng and 1 gel are together, if you put 1 pixel of water on the spng, then if the gel gets near it will steal this saturation.

    The relevant code is shown below. I have bolded the relevant sections. Note that the exchanges between gel and spng only happen when life[spng]+1=/=tmp[gel]
    So when tmp is 100 and life is 99, these are equal. When tmp is 1 and life is 0, they are also equal. 

    (From GEL.cpp) https://github.com/The-Powder-Toy/The-Powder-Toy/blob/master/src/simulation/elements/GEL.cpp

    case PT_SPNG:
    // Concentration diffusion
    if (parts[ID(r)].life>0 && parts[i].tmp<100 && ((parts[ID(r)].life+1)>parts[i].tmp))
    {
    // SPNG -> GEL
    parts[ID(r)].life--;
    parts[i].tmp++;
    }
    else if (parts[i].tmp>0 && (parts[ID(r)].life+1)<parts[i].tmp)
    {
    // SPNG <- GEL (saturation limit of SPNG is ignored here)
    parts[ID(r)].life++;
    parts[i].tmp--;
    }


    Tldr its not a bug its a feature

    Edited once by jm211. Last: 21st Nov 2025
  • U42
    23rd Nov 2025 Member 0 Permalink

    @jm211 (View Post)

     great now i cant do shit  due to this "feature"

    Edited once by U42. Last: 23rd Nov 2025