Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: An unfortunate glitch with lava physics.  (Read 682 times)

Vanguard Warden

  • Bay Watcher
    • View Profile
An unfortunate glitch with lava physics.
« on: March 10, 2011, 08:02:55 pm »

I was recently testing a lava-based defense mechanism of mine for use in a future fortress and discovered an unfortunate bug regarding screw pumps and magma. The design is as follows:

Game View:
Code: [Select]
Z-2 Z-1 Z-0
... ███ ███
.#. █ç█ █.█   ≈ - Magma
... ███ █.█   % - Screw Pump
███ ███ █.█   # - Floor Grate
█_█ █_█ █.█   ç - Floor Hatch
█%█ ███ ███   . - Floor
█%█ ███ ███   _ - Channel
█_█ ≈≈≈ ███
███ ███ ███

Side View:
Code: [Select]
██████      ≈ - Magma
█ %% █_#_   % - Screw Pump
█≈██ ██ç█   # - Floor Grate
████____█   ç - Floor Hatch
█████████   _ - Floor

I have the floor hatch attached to an external lever, and the screw pumps are just always pumping on their own. I open and close the floor hatch to control the flow. As the pump is on the same level as the ground, the pump would force the magma back up the pipe and out the grate, flooding the nearby area around the 'vent'. I planned to have one pump at ground level in the center of the map, and then have a bunch of these grated vents around the perimeter of the map connected to it with the flow hatches hooked to corresponding levers, so I could open a specific hatch and flood sections of the map with magma at will.

When I first turn on the pumps with the hatch open, it works perfectly. The magma flows up to the level of the pump out of the vent, flooding the area. I then close the hatch and the flow is stopped, as expected. However, when I re-open the hatch, nothing happens. The hatch visibly closes and opens successfully (magma safe materials for both the hatch and the mechanisms), but the magma will no longer flow up the tube. If I 'disturb' the magma in some way (like digging a hole into the side of the lower tunnel, letting the magma spread out briefly) the magma immediately begins flowing up the tube until I close the hatch again.

I assume my mechanism would function properly if I replace the floor hatch in the vertical tube with a flood gate/wall hatch in the horizontal tube. It should 'disturb' the magma by creating an open space for the magma to flow when it opens. My original design, however, felt much cooler. :(
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: An unfortunate glitch with lava physics.
« Reply #1 on: March 10, 2011, 08:18:44 pm »

Install a floodgate in the area of the pipe.  Open and close it to reset the flow.  This will atom-smash the lava on the flood gate's tile, and disrupt the flow to make it "reset".

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: An unfortunate glitch with lava physics.
« Reply #2 on: March 11, 2011, 12:18:55 am »

As I understand it, there's a "flow" flag to mark whether or not liquids are flowing or sitting still.  This prevents DF from having to do all those complex liquid calculations all of the time for simple things like ponds of water, but it can create weird things like what you're seeing here.

So yeah, use a floodgate or something to induce some flow and hopefully that will reset things and make it shoot out magma again.
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: An unfortunate glitch with lava physics.
« Reply #3 on: March 11, 2011, 12:23:20 am »

Coincidentally, this will help be in a future project, when/if my tower is completed.