Superfluid Helium Idea

  • NDR149
    13th Sep 2016 Member 3 Permalink

    Superfluid Helium is weird. It's super cold, basically absolute zero, and it creeps up walls when placed in a container. Anybody think they can put together the lua for this? It should also be able to flow through one-pixel thick walls, bonus points if you can make it flow backwards in PIPE

  • TPT_PL
    13th Sep 2016 Member 0 Permalink
    Huh, it would be a bit hard. I'll look at GEL's C code and see what I can do.
  • edr-01
    14th Sep 2016 Member 0 Permalink

    I like the idea. Sometime ago I was thinking about doing a new (lua) element: Liquid Noble, My idea was to make a superfluid and superconductor liquid. The best thing that I made was a very awful element. Here's the code if someone want improve it:

     

    -- code:

    local lnble = elements.allocate("MOD", "LNBL")
    elements.element(elements.MOD_PT_LNBL, elements.element(elements.DEFAULT_PT_MERC))
    elements.property(elements.MOD_PT_LNBL, "Name", "LNBL")
    elements.property(elements.MOD_PT_LNBL, "Description", "Liquid Helium. Extremely cold. Conductive.")
    elements.property(elements.MOD_PT_LNBL, "Colour", 0xFF6026)
    elements.property(elements.MOD_PT_LNBL, "Meltable", 1)
    elements.property(elements.MOD_PT_LNBL, "Temperature", 3)
    elements.property(elements.MOD_PT_LNBL, "HighTemperature", 7.0)
    elements.property(elements.MOD_PT_LNBL, "HighTemperatureTransition", elements.DEFAULT_PT_NBLE)
    elements.property(elements.MOD_PT_LNBL, "Gravity", 0.4)
    elements.property(elements.MOD_PT_LNBL, "Diffusion", 0.2)

     

    (Thanks to NDR149 for improve the code)

    Edited 2 times by edr-01. Last: 15th Sep 2016
  • NDR149
    14th Sep 2016 Member 0 Permalink

    @edr-01 (View Post)

     I think the obvious problem with LNBL is the HighTemperature value. I'll bet it turns into NBLE almost instantly. Or... not? Just tested it, it shouldn't behave like that at all...

  • NDR149
    16th Sep 2016 Member 2 Permalink

    Update on Superfluid Helium: Code nearly ready, but there's room for extra detail

     

    local supfluid = elem.allocate("OUR", "HSFL")

    elem.element(supfluid, elem.element(elem.DEFAULT_PT_SOAP))
    elem.property(supfluid, "Name", "HSFL")
    elem.property(supfluid, "Description", "Helium superfluid, extremely cold, strange behavior in containers.")
    elem.property(supfluid, "Color", 0xFF9900)
    elem.property(supfluid, "Weight", 5)
    elem.property(supfluid, "Temperature", 0)
    elem.property(supfluid, "Flammable", 1000)
    elem.property(supfluid, "HeatConduct", 10)
    elem.property(supfluid, "Meltable", 1)

    elem.property(supfluid, "LowPressure", IPL)
    elem.property(supfluid, "LowPressureTransition", NT)
    elem.property(supfluid, "HighPressure", IPH)
    elem.property(supfluid, "HighPressureTransition", NT)
    elem.property(supfluid, "LowTemperature", ITL)
    elem.property(supfluid, "LowTemperatureTransition", NT)
    elem.property(supfluid, "HighTemperature", ITH)
    elem.property(supfluid, "HighTemperatureTransition", NT)

    local function wallClimb(i, x, y, s, nt)
    local contained
    r = sim.partID(math.random(x-1, x+1), y-1)
    if r ~= nil then
    rtype = sim.partProperty(r, "type")
    contained = (bit.band(elem.property(rtype, "Properties"), elem.TYPE_PART) ~= 0) or (bit.band(elem.property(rtype, "Properties"), elem.TYPE_SOLID) ~= 0)
    rx = (sim.partProperty(r, "x")-sim.partProperty(i, "x"))
    end
    if contained then
    sim.partProperty(i, "vy", -2)
    sim.partProperty(i, "vx", rx)
    end
    end

    elem.property(supfluid, "Update", wallClimb)

     

    function supfluid_Graphics(i, colr, colg, colb)

    return 1, 0x0000001, 255, colr, colg, colb, 0, 0, 0, 0
    end

     

    elem.property(supfluid, "Graphics", supfluid_Graphics)

     

    Edited 2 times by NDR149. Last: 16th Sep 2016
  • edr-01
    17th Sep 2016 Member 0 Permalink

    @NDR149 (View Post)

     I never thought that would be possible make a superfluid on TPT, great work! You can add this if you want the element with blur effect:

    tpt.graphics_func(Lflare, supfluid)

    Edited once by edr-01. Last: 17th Sep 2016
  • TPT_PL
    17th Sep 2016 Member 0 Permalink
    @edr-01 (View Post)
    I support rather elem.property(element, "Graphics", function) than tpt.graphics_func() cause the second one is a bit... old.
    @NDR149 (View Post)
    If you don't mind I will add it to my More Epic Exotic Chemistry, OK? (We worked on it together, you remember, yeah? :P)

    EDIT: It causes extreme lag (FPS reduced to 15 1.50), how did you do that?!
    EDIT 2: Removed the graphics function and transitions (BTW soap hasn't got any transitions, you know?), still laggy as hell (nope, hell is less laggy than this...)
    Edited 5 times by TPT_PL. Last: 17th Sep 2016
  • NDR149
    19th Sep 2016 Member 0 Permalink

    @TPT_PL (View Post)

     I knooow. It's sooo laggy, I don't know what it is. If you want to add it to your mod, go ahead, but put me in the little credits on the startup HUD or something.

  • TPT_PL
    20th Sep 2016 Member 0 Permalink
    @NDR149 (View Post)
    1. Maybe we will cache some values? Nope, we've cached almost all...
    2. Meh. (of course I'll do xp)