Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4]

Author Topic: Fixing the Water wheel/pump perpetual motion exploit  (Read 16086 times)

Pilsu

  • Bay Watcher
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #45 on: June 24, 2011, 06:46:35 am »

If the pump takes 10 ticks of uninterrupted power to move one unit of water, the waterwheels would function only as the water mulls about and then stop again before they finish the next surge.
Logged

Root Infinity

  • Bay Watcher
  • Why?
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #46 on: June 24, 2011, 07:21:25 am »

If the pump takes 10 ticks of uninterrupted power to move one unit of water, the waterwheels would function only as the water mulls about and then stop again before they finish the next surge.
...
Eh, to be fair, it still wouldn't prevent trivial perpetual motion. You would still be able to very easily power an arbitrarily-large set-up of waterwheels with some pumps.
Logged
Classic Medieval sexist views are awesome when they work out in your favor.
Noone likes my witty comments enough to sig them.

G-Flex

  • Bay Watcher
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #47 on: June 24, 2011, 08:04:40 am »

Yep, doesn't matter how little power a single waterwheel provides compared to what a pump uses, because you can still line up thirty (or forty, or fifty) of them in a row.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

Root Infinity

  • Bay Watcher
  • Why?
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #48 on: June 24, 2011, 10:07:28 am »

Yep, doesn't matter how little power a single waterwheel provides compared to what a pump uses, because you can still line up thirty (or forty, or fifty) of them in a row.
Or 100, or 1000...

Anyways, what's wrong with the original poster's suggestion of a [FORCE_FLOW] tag? It seems to have been ignored entirely, and although it's a "hack", I don't really see the problem with it.
Logged
Classic Medieval sexist views are awesome when they work out in your favor.
Noone likes my witty comments enough to sig them.

irmo

  • Bay Watcher
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #49 on: June 24, 2011, 11:44:38 am »

Anyways, what's wrong with the original poster's suggestion of a [FORCE_FLOW] tag? It seems to have been ignored entirely, and although it's a "hack", I don't really see the problem with it.

In general this is the same sort of system as the 2d version's handling of "channeled" versus "open" water. In which, I will point out, the game would frequently get confused about the difference and flood the entire map.

First, waterwheels run on horizontal flow, but pumps don't force water to flow horizontally. So for this to work, the flag has to be contagious. The outlet square of a pump would always be flagged (at least when the pump is on), and then any wet squares connected to a flagged square also get flagged. Once a square has been flagged, the only way to remove the flag is to empty all the water out of the square. (This prevents some easy exploits that would no doubt end up on the wiki within about two days under the title "dwarven water purifier" or something.)

So how do you avoid accidentally dumping flagged water back into a river and killing all your waterwheels forever? The OP mentions having "the regular flow tag supersede the forced flow", but there is no "regular flow tag". For the forced flag to work, it has to supersede the state of not being forced. If natural rivers have their own flag that behaves the same way, then any water drawn from the river is going to be permanently non-forced and the flag doesn't work. (They can't both be contagious!) If the river flag doesn't spread to connected water, then effectively it's only possible to build waterwheels in the original bounds of the riverbed. Which would also solve the problem, I guess.

A much simpler solution would be a rule that you can't build waterwheels except on z-levels that contain a natural river. Of course this still allows some cheating (either DWRs built on the surface or just diverting the river through a ridiculous labyrinth and covering the entire map with waterwheels), and rules out many useful and realistic designs. But to properly fix this, we need to either keep track of the kinetic energy of water somehow, or make waterwheels run on potential energy (i.e. require water to fall through them).
Logged

Root Infinity

  • Bay Watcher
  • Why?
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #50 on: June 24, 2011, 12:01:09 pm »

Anyways, what's wrong with the original poster's suggestion of a [FORCE_FLOW] tag? It seems to have been ignored entirely, and although it's a "hack", I don't really see the problem with it.

In general this is the same sort of system as the 2d version's handling of "channeled" versus "open" water. In which, I will point out, the game would frequently get confused about the difference and flood the entire map.

First, waterwheels run on horizontal flow, but pumps don't force water to flow horizontally. So for this to work, the flag has to be contagious. The outlet square of a pump would always be flagged (at least when the pump is on), and then any wet squares connected to a flagged square also get flagged. Once a square has been flagged, the only way to remove the flag is to empty all the water out of the square. (This prevents some easy exploits that would no doubt end up on the wiki within about two days under the title "dwarven water purifier" or something.)

So how do you avoid accidentally dumping flagged water back into a river and killing all your waterwheels forever? The OP mentions having "the regular flow tag supersede the forced flow", but there is no "regular flow tag". For the forced flag to work, it has to supersede the state of not being forced. If natural rivers have their own flag that behaves the same way, then any water drawn from the river is going to be permanently non-forced and the flag doesn't work. (They can't both be contagious!) If the river flag doesn't spread to connected water, then effectively it's only possible to build waterwheels in the original bounds of the riverbed. Which would also solve the problem, I guess.

A much simpler solution would be a rule that you can't build waterwheels except on z-levels that contain a natural river. Of course this still allows some cheating (either DWRs built on the surface or just diverting the river through a ridiculous labyrinth and covering the entire map with waterwheels), and rules out many useful and realistic designs. But to properly fix this, we need to either keep track of the kinetic energy of water somehow, or make waterwheels run on potential energy (i.e. require water to fall through them).


Thank you for the answer to that...

There is no regular flow tag? I thought otherwise...
Quote from: DFWiki on Flow
Many water sources such as rivers and brooks are constantly flowing with natural flow. This is different from other flow effects in that it is always considered to be flowing water. This remains true even when the water flows into a complete dead end channel or even when blocked off with a floodgate. Any channels that link up to a naturally flowing source will soon become naturally flowing water as long as they remain on the same z-level.

What if pumps simply didn't set the flow tag at all?
Logged
Classic Medieval sexist views are awesome when they work out in your favor.
Noone likes my witty comments enough to sig them.

Pilsu

  • Bay Watcher
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #51 on: June 24, 2011, 11:28:51 pm »

One unit of water splashing about would not provide continuous power. The waterwheels would spin every now and then but it wouldn't pump anything as it keeps cutting off before the next splash is spawned.

Wait, doesn't it take 10 ticks for a dwarf to take a step? I meant 100.
Logged

Root Infinity

  • Bay Watcher
  • Why?
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #52 on: June 25, 2011, 11:02:31 am »

One unit of water splashing about would not provide continuous power. The waterwheels would spin every now and then but it wouldn't pump anything as it keeps cutting off before the next splash is spawned.
I assume you're referring to this?
If the pump takes 10 ticks of uninterrupted power to move one unit of water, the waterwheels would function only as the water mulls about and then stop again before they finish the next surge.

The problem with this is you could simply line up enough pumps in a row sideways so they do provide continous flow, and just have a VERY long line of water wheels powering them all. In other words, it's the same idea as this:
Yep, doesn't matter how little power a single waterwheel provides compared to what a pump uses, because you can still line up thirty (or forty, or fifty) of them in a row.
As long as a waterwheel provides ANY power currently*, and a pump pumps any amount, you CAN create perpetual motion simply by adding more pumps and/or waterwheels.

*(Yes, you could theoretically make one even if the waterwheels produced 1 net power)
Logged
Classic Medieval sexist views are awesome when they work out in your favor.
Noone likes my witty comments enough to sig them.

Pilsu

  • Bay Watcher
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #53 on: June 26, 2011, 02:45:19 am »

I don't think the single unit of water moves around rapidly enough to cause constant flow even if the entirety of the trench is covered in wheels. I suppose I could be wrong.
Logged

Soralin

  • Bay Watcher
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #54 on: June 26, 2011, 03:35:39 am »

Well here's a simple way to solve it with a couple of steps:

1.  Make waterwheels required to move water down a level.  Essentially make them like screw pumps in reverse, where they take water from one side, and move it to the other side, and down a level, and generate power in the process.

2.  Screw pumps are not digital devices.  For mechanical designs of this sort, if you have more power, they work faster, and if you have less power, they don't stop working, they just slow down.  Right now, as long as screw pumps have power, they can move absolutely massive quantities of water around.  Change the power system around, such that 1 unit of water, moving down 1 level through a waterwheel, provides enough power to move 1 unit of water up 1 level through a screw pump.

So they way it would work would be something like, during a tick, the waterwheels move water down to the lower level, and each unit moved provides a unit of power, which is added up.  During that same frame, that power (minus axles or efficiency losses or such), is then distributed to each of the pumps, and each can move a unit of water up a level if they are able.  If there's enough power, then they can each move a 2nd, or 3rd, or so on, unit of water up on that tick.  If the system is really underpowered, then not all pumps may be able to move water that tick.  So say there's only enough power for the first half of the pumps to move a unit of water up, then next tick, it would start with the pumps that didn't move last turn, and so on, to approximate a steady flow for all of them.  The same would apply for any non-integer result, like if you're making enough for all pumps to move 1.5 units of water/tick.  You could then use multiple waterwheels to power a single, or smaller number of pumps, but there would likely be a limit of usefulness of 7 units/tick, which would likely look like current pumps do.

Interesting side effect, you need a lot of power to move water around quickly, but you could still make a big pump tower and power it off of only a small number of waterwheels.  The water would flow up the pump stack, even without much power, it just wouldn't do so very quickly.

Anyone see any way of breaking physics with that system? :)
« Last Edit: June 26, 2011, 03:57:13 am by Soralin »
Logged

G-Flex

  • Bay Watcher
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #55 on: June 26, 2011, 03:47:55 am »

The second point wouldn't fix much, but the first would... unless I'm missing something.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

Soralin

  • Bay Watcher
    • View Profile
Re: Fixing the Water wheel/pump perpetual motion exploit
« Reply #56 on: June 26, 2011, 04:06:16 am »

The second point wouldn't fix much, but the first would... unless I'm missing something.
Well if you only use point #1 alone, there's still some possible corner cases, like using 1 pump to loop water through a pair of waterwheels side-by-side.  Or abusing the rate at which a pump can move water, like have a pump move a reservoir of water up a level very quickly with a short burst of power, and then flow back down again much slower, or such.  Some potential edge cases, although add #2, and it should seal those edges tight.  It also helps ease the need for power, since there's a middle step between a bunch of pumps that don't work at all, and a bunch of pumps that work at blazing speed.  Where whatever power you have can be put toward running the pumps and moving water around, even if it's not enough to run everything at full power.
Logged
Pages: 1 2 3 [4]