Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How do objects move during bridge flinging or water displacement?  (Read 2482 times)

Ash_Mantle

  • Escaped Lunatic
    • View Profile

Hey, folks. Glad to be posting on a nicely active forum for a great game with a great community. Couple conceptual questions for you, though.

I was reading the DF wiki and came across a few mentions of water pressures and dwarves being washed away a few blocks during setup for farm irrigation, as well as objects being hurled by drawbridges. In itself, this isn't terribly confusing, but I could use clarification on the following points:

-First, does water really wash dwarves or objects away? I haven't been able to model this in-game yet, as I'm not quite there yet in my games, but I can't find a lot of recordings of it on DFMA or elsewhere.

-If so, is it predictable or controllable? Can one flood and pressurize a small space with objects on the floor, then open a floodgate and have the objects be washed out with the current? Can one flood water into a small space and move the objects in that space along with the force of the water? What about dwarves or other creatures, will they be injured?

-If the above is possible, how much water is required to move an object a certain distance? Does it need to be pressurized?

-Second, with bridge-flinging, the DFMA movie I saw illustrated how a few dozen stones flew in every direction after being flung by a drawbridge, but there's also the question of where they come down. If they fall back down into the space the drawbridge occupies and the bridge is re-lowered, does it destroy the objects ala dwarven atom smasher (a simple solution here seems to be leaving empty space under the drawbridge)?

-Can one put walls eleven z-levels high around the drawbridge to prevent the flung objects moving too far in certain directions? Do the objects bounce off these walls and change direction, travelling further in a cardinal direction, or do they bounce and drop straight back down?

-Is the height to which an object may be flung dependent on the dimensions of the bridge? If so, is it the short dimensions or the long ones that create a ceiling in terms of z-levels flung? Is it the dimension corresponding to the length of the bridge that pitches up or down, or to its width (would make more sense if a long, skinny bridge could throw things further than a broad, short one, as there'd be more length to lever the objects into the air overall, I think)? What about for retracting bridges?

If you got this far, thanks for taking the time to bother reading my post, and I hope it's not too confusing to create useful answers.
Logged

slink

  • Bay Watcher
  • Crazy Cat Dwarf
    • View Profile
    • Slink's Burrow Online
Re: How do objects move during bridge flinging or water displacement?
« Reply #1 on: November 17, 2009, 04:08:49 pm »

The only thing I can contribute is that I have a retracting drawbridge across my moat in the fortress I am playing right now.  To my surprise, it does fling things.  I expected items (and creatures) on the bridge to fall more or less straight down, but they don't.  Some were apparently flung as high up as the top of the second-story fortifications flanking the bridge.  Some did end up in the moat, but may have been flung sideways.  Some landed on dry land on either end, which was lucky in the case of a pair of pets that I failed to see when I went to seal off the entrance.  The two were flung back onto the far shore, stunned but otherwise unharmed.

My moat is three tiles wide.  The retracting bridge is 5 tiles long, to reach across and sit firmly on both banks, and 4 tiles wide, to match the width of the road on either side of the moat.

I have a lowering drawbridge at the front door, and it does atom-smash anything under it when it is lowered.  There is no empty area under it.
Logged
There is only one cat, and all cats are that cat.
Almost losing is sometimes fun.

Derakon

  • Bay Watcher
    • View Profile
Re: How do objects move during bridge flinging or water displacement?
« Reply #2 on: November 17, 2009, 04:12:36 pm »

Flowing water can push objects, yes, but only if the water is less than 7/7 deep. This greatly restricts your flow rate if you want to use water flows for pushing things. In general people just don't bother.

Any items "under" a bridge when it lowers get obliterated. Items flung by a bridge that hit a wall simply stop and fall. I don't think items traverse Z-levels when they get flung, so the height of the wall shouldn't matter.
Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

Ash_Mantle

  • Escaped Lunatic
    • View Profile
Re: How do objects move during bridge flinging or water displacement?
« Reply #3 on: November 17, 2009, 04:15:09 pm »

Thanks very much for the information, slink.

Quick question.

Some were apparently flung as high up as the top of the second-story fortifications flanking the bridge...My moat is three tiles wide.  The retracting bridge is 5 tiles long, to reach across and sit firmly on both banks, and 4 tiles wide, to match the width of the road on either side of the moat.

So the objects flung by your 5X4 bridge go up only two z-levels? Or is it more than that? I'm going by your mention of 'second-story fortifications' here.

Thanks again.
Logged

Ash_Mantle

  • Escaped Lunatic
    • View Profile
Re: How do objects move during bridge flinging or water displacement?
« Reply #4 on: November 17, 2009, 04:21:16 pm »

Flowing water can push objects, yes, but only if the water is less than 7/7 deep. This greatly restricts your flow rate if you want to use water flows for pushing things. In general people just don't bother.
Any idea if people have looked at this more closely in the recent past? I'd be pretty keen to find out.

Quote
Any items "under" a bridge when it lowers get obliterated. Items flung by a bridge that hit a wall simply stop and fall. I don't think items traverse Z-levels when they get flung, so the height of the wall shouldn't matter.
Interesting. Glad I understood the atom smasher thing correctly. On the second point, though - the DFwiki article on bridges says something different:
Quote
Any item sitting on the drawbridge has a 1/4 chance of being flung. They can be flung anywhere from zero to 11 Z levels upward and up to 11 units in any other direction.
Is this out of date?

Again, thanks for the prompt reply.
« Last Edit: November 17, 2009, 04:24:04 pm by Ash_Mantle »
Logged

MrFake

  • Bay Watcher
  • Legendary Elficidal Maniac
    • View Profile
Re: How do objects move during bridge flinging or water displacement?
« Reply #5 on: November 17, 2009, 05:00:35 pm »

Flowing water can push objects, yes, but only if the water is less than 7/7 deep. This greatly restricts your flow rate if you want to use water flows for pushing things. In general people just don't bother.
Any idea if people have looked at this more closely in the recent past? I'd be pretty keen to find out.

He means that when all the water tiles are at 7/7, there is no flow in this context.  Even more generally, if all the tiles of water are at the same level, there is no flow, though all 7/7 is easier to reproduce.  Pushing flow only happens when water moves from a tile with more water to a tile with less water, though I don't know what the specific numbers have to be (i.e. it's possible 2/7 water cannot push, but that's an unqualified statement on my part.  Don't take it as fact!).

Since pushing relies on water movement, and water movement is more or less random, then item or creature movement will be more or less random depending on how the water is flowing.  Also, since pushed items can bug out and disappear, ceasing all interaction with fluids (and just about everything else), item pushing is far from deterministic.

Quote
Any items "under" a bridge when it lowers get obliterated. Items flung by a bridge that hit a wall simply stop and fall. I don't think items traverse Z-levels when they get flung, so the height of the wall shouldn't matter.
Interesting. Glad I understood the atom smasher thing correctly. On the second point, though - the DFwiki article on bridges says something different:
Quote
Any item sitting on the drawbridge has a 1/4 chance of being flung. They can be flung anywhere from zero to 11 Z levels upward and up to 11 units in any other direction.
Is this out of date?

Wiki history says it was added 26th of September this year.
Logged
Swordbaldness: a trial of patience.

Jim Groovester

  • Bay Watcher
  • 1P
    • View Profile
Re: How do objects move during bridge flinging or water displacement?
« Reply #6 on: November 17, 2009, 05:04:26 pm »

There was some bridge flinging experiment that was done by somebody who probably added that information.

Ah yes, here we go.
Logged
I understood nothing, contributed nothing, but still got to win, so good game everybody else.

slink

  • Bay Watcher
  • Crazy Cat Dwarf
    • View Profile
    • Slink's Burrow Online
Re: How do objects move during bridge flinging or water displacement?
« Reply #7 on: November 17, 2009, 05:25:07 pm »

That's a great link, Jim, thanks!   :)

Edit:

Here is the picture of my bridge.  I had some debris from a battle on the bridge when I retracted it.  One piece ended up stuck in the first slot of the fortifications on the right-hand side.  One piece ended up on top of the fortifications on the left-hand side (there is a floor up there).  One piece ended up on the walkway behind the left-hand fortifications.  The rest landed scattered around on the ground.

Spoiler (click to show/hide)
« Last Edit: November 17, 2009, 05:35:07 pm by slink »
Logged
There is only one cat, and all cats are that cat.
Almost losing is sometimes fun.

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: How do objects move during bridge flinging or water displacement?
« Reply #8 on: November 17, 2009, 05:54:15 pm »

-Is the height to which an object may be flung dependent on the dimensions of the bridge? If so, is it the short dimensions or the long ones that create a ceiling in terms of z-levels flung? Is it the dimension corresponding to the length of the bridge that pitches up or down, or to its width (would make more sense if a long, skinny bridge could throw things further than a broad, short one, as there'd be more length to lever the objects into the air overall, I think)? What about for retracting bridges?
From what experiments I have done, the size and shape of the bridge seems to have nothing to do with how far objects are thrown.  Retracting bridges throw objects up to three tiles X,Y and Z.  Raising bridges throw objects up to 11 tiles X, Y and Z.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

KenboCalrissian

  • Bay Watcher
    • View Profile
Re: How do objects move during bridge flinging or water displacement?
« Reply #9 on: November 17, 2009, 05:54:50 pm »

Any items "under" a bridge when it lowers get obliterated. Items flung by a bridge that hit a wall simply stop and fall. I don't think items traverse Z-levels when they get flung, so the height of the wall shouldn't matter.

Actually, it does go up at least one z-level.  Note that there is no access to the items in the POI.  The drawbridge that flung these items is 1 z-level down from these items.

Also, water indeed pushes objects, such as sweeping a baron off a precarious ledge.  My understanding of fluid is that an object will be pushed, but only if water can move from one tile to an adjacent one.  That's an extremely over-simplified statement that isn't necessarily always true, I know, so someone else should better explain it.
« Last Edit: November 17, 2009, 05:56:30 pm by KenboCalrissian »
Logged
I've never tried it and there's a good chance it could make them freak out.
Do it.
Severedcoils - the Baron Consort accumulation challenge
Severedcoils II: The Reckoning - a DnD 5e Adventure set in the world of Severedcoils

Ash_Mantle

  • Escaped Lunatic
    • View Profile
Re: How do objects move during bridge flinging or water displacement?
« Reply #10 on: November 17, 2009, 11:23:16 pm »

...Here is the picture of my bridge.  I had some debris from a battle on the bridge when I retracted it.  One piece ended up stuck in the first slot of the fortifications on the right-hand side.  One piece ended up on top of the fortifications on the left-hand side (there is a floor up there).  One piece ended up on the walkway behind the left-hand fortifications.  The rest landed scattered around on the ground.
 
Spoiler (click to show/hide)
Thanks very much for the picture, it clarifies a few things and the other posts answer my questions to you completely. Glad you contributed what you could, as it was pretty darn useful for wrapping my head around this.
There was some bridge flinging experiment that was done by somebody who probably added that information.

Ah yes, here we go.
That link is pretty wunderbar, and I'm obliged to you for bringing it into play :) This sorta material is really useful for folks with my mindset. And speaking of...
From what experiments I have done, the size and shape of the bridge seems to have nothing to do with how far objects are thrown.  Retracting bridges throw objects up to three tiles X,Y and Z.  Raising bridges throw objects up to 11 tiles X, Y and Z.
Thanks, and thanks for doing the tests in the linked thread above! Dwarf science owes you a great debt. If I make something innovative from it, I'm naming a portion of the mechanism after your forum account :P
Any items "under" a bridge when it lowers get obliterated. Items flung by a bridge that hit a wall simply stop and fall. I don't think items traverse Z-levels when they get flung, so the height of the wall shouldn't matter.

Actually, it does go up at least one z-level.  Note that there is no access to the items in the POI.  The drawbridge that flung these items is 1 z-level down from these items.

Also, water indeed pushes objects, such as sweeping a baron off a precarious ledge.  My understanding of fluid is that an object will be pushed, but only if water can move from one tile to an adjacent one.  That's an extremely over-simplified statement that isn't necessarily always true, I know, so someone else should better explain it.
Righto, always good to have one's suspicions confirmed. Glad I wasn't completely off.

He means that when all the water tiles are at 7/7, there is no flow in this context.  Even more generally, if all the tiles of water are at the same level, there is no flow, though all 7/7 is easier to reproduce.  Pushing flow only happens when water moves from a tile with more water to a tile with less water, though I don't know what the specific numbers have to be (i.e. it's possible 2/7 water cannot push, but that's an unqualified statement on my part.  Don't take it as fact!).

Since pushing relies on water movement, and water movement is more or less random, then item or creature movement will be more or less random depending on how the water is flowing.  Also, since pushed items can bug out and disappear, ceasing all interaction with fluids (and just about everything else), item pushing is far from deterministic.
Thank you for expanding on the previous bit of input there, it was damn helpful, as was the third point you made, which I left off. I should've checked the wiki edit history meself.

***

Well, this leaves only a few relevant inquiries for my purposes:

1) In the thread Jim linked to, someone (think it was a poster by name of Winner) posted that pitching drawbridges (the ones that lift up and fold away) atom-smash water when they're lowered without flinging it anywhere, but didn't mention if either variety of bridge could fling water in any of its states (different water heights, full squares, extending bridge retracting in/telescoping out, pitching drawbridge lifting). Anyone know the characteristics (or, well, ability of water to be flung) in these other conditions?

2) Can water-wheels be made to turn and create flow, movement, or current in a body of still water? Is there any method of creating flow, movement, or current in said body short of adding in water or altering the means of drainage in the watershed mechanically (like by opening a floodgate into an empty, adjacent space so water drains out)?

3) Do grates drain water at a set rate related to number of system steps, or a variable one related to CPU cycles and performance? What does it take to clog a drain, and how easy is it to do so? Does the flow into them create a suction effect on any nearby objects and, if so, to what degree can one balance this out by placement of other drains or whatever else ingenuity provides?

4) What's known about the error rate in relation to water currents making objects disappear (or 'bug out') when said objects are moved randomly? Does it happen only in certain cases, and if so, are they at all controllable (for example, they only bug out when moving diagonally into a corner, or whatever)?

5) What DO we know about required height/water level in order to push objects, and how universal are these numbers?

6) Are grates, hatches, or lowered floodgates obstacles to objects being carried by flow or water-current?

I'll be using my search function some to answer the stuff on the list as much as possible, but voluntary contributions are quite welcome.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: How do objects move during bridge flinging or water displacement?
« Reply #11 on: November 17, 2009, 11:33:20 pm »

These are all great questions. You might want to look at http://www.bay12games.com/forum/index.php?topic=32453.0
Logged

Firnagzen

  • Bay Watcher
  • [CURIOUSBEAST_INSANE]
    • View Profile
Re: How do objects move during bridge flinging or water displacement?
« Reply #12 on: November 18, 2009, 12:52:06 am »

Woot, someone else posting that topic. Anyway,

1) Not sure. Shouldn't think water gets thrown, though.
2) Waterwheels can't move water, sadly. Pumps can create flow, but only, as you said, by changing the watershed.
3) Interesting question. Now, I'm not exactly sure how much flow a grate provides, but it's no more or less than unimpeded vertical flow. As such, a single grate is insufficient to drain a pump; pumps are frighteningly efficient in DF, and will cause water to spill everywhere unless carefully contained. This applies for any other water invoking Kanddak's second law of DF hydrodynamics. (The teleport rule.)
4) Little, I'm afraid. But we have assurance that it is known to Toady One.
5) As long Kanddak's first law holds true for that body of water, it will push the item.
6) Yes, yes and no if by 'lowered' floodgate means retracted. (See the answer to Q5.)
Logged
Christ, are you dwarves or are you elves? If you think Hell has too many demons, then you kill them till the population reaches an acceptable number.

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: How do objects move during bridge flinging or water displacement?
« Reply #13 on: November 18, 2009, 09:46:45 am »

1) In the thread Jim linked to, someone (think it was a poster by name of Winner) posted that pitching drawbridges (the ones that lift up and fold away) atom-smash water when they're lowered without flinging it anywhere, but didn't mention if either variety of bridge could fling water in any of its states (different water heights, full squares, extending bridge retracting in/telescoping out, pitching drawbridge lifting). Anyone know the characteristics (or, well, ability of water to be flung) in these other conditions?
Water (and magma) aren't treated as objects, and aren't flung by raising or retracting bridges.
Quote
2) Can water-wheels be made to turn and create flow, movement, or current in a body of still water? Is there any method of creating flow, movement, or current in said body short of adding in water or altering the means of drainage in the watershed mechanically (like by opening a floodgate into an empty, adjacent space so water drains out)?
No, forcing a water-wheel to turn will have no effect on water the waterwheel is over.  The movement of water is determined completely by the physical geometry of the space the water is contained in and adjacent to.  Waterwheels turn if built over moving water, but don't affect the movement of that water in any way.
Quote
3) Do grates drain water at a set rate related to number of system steps, or a variable one related to CPU cycles and performance? What does it take to clog a drain, and how easy is it to do so? Does the flow into them create a suction effect on any nearby objects and, if so, to what degree can one balance this out by placement of other drains or whatever else ingenuity provides?
As far as I've been able to tell, grates are transparent to water.  Objects are also transparent to water, so no number of objects on a grate will block the flow of water.
Quote
4) What's known about the error rate in relation to water currents making objects disappear (or 'bug out') when said objects are moved randomly? Does it happen only in certain cases, and if so, are they at all controllable (for example, they only bug out when moving diagonally into a corner, or whatever)?
This I don't know.  I've only seen this happen a few times and haven't tried to reproduce it under controlled conditions.
Quote
5) What DO we know about required height/water level in order to push objects, and how universal are these numbers?
The important thing to remember about water in DF is that it isn't actually a simulation of fluid dynamics.  Water in DF doesn't have inertia, and doesn't so much flow as teleport.  Think of it as being less like a fluid, and more like a collection of little blue imps that want to travel downwards, but can only move by teleporting through connected squares already occupied by other little blue imps.  Pushing of objects seems to be a special-case code hook that only happens when there is less than 7 water in a tile.  I suspect that pushing of objects actually occurs when you have two adjacent tiles with different levels of water in them, but I haven't tested this yet.
Quote
6) Are grates, hatches, or lowered floodgates obstacles to objects being carried by flow or water-current?
Grates will be transparent to water but block objects.  Retracted grates, open hatches, and lowered floodgates are transparent to water and objects - they act as if they aren't there at all for flow and object movement purposes.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.