v50 Steam/Premium information for editors
- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.
Editing User:Vasiln/Build order
Jump to navigation
Jump to search
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | I once did some careful examination of a creature triggering a pressure plate linked to various buildings built either before or after the pressure plate. I added those findings to the [[pressure plate]] page. However, some of the things I found felt inconsistent with [[User:Hussell|Hussell's]] findings regarding build order. In particular, he found that build order of [[gear assembly|gear assemblies]] affected the period of his [[repeater]]s, whereas I found that gear assemblies were always triggered on the same tick, regardless of whether they were built before or after the triggering pressure plate | + | I once did some careful examination of a creature triggering a pressure plate linked to various buildings built either before or after the pressure plate. I added those findings to the [[pressure plate]] page. However, some of the things I found felt inconsistent with [[User:Hussell|Hussell's]] findings regarding build order. In particular, he found that build order of [[gear assembly|gear assemblies]] affected the period of his [[repeater]]s, whereas I found that gear assemblies were always triggered on the same tick, regardless of whether they were built before or after the triggering pressure plate. |
− | + | That's always kind of bothered me, but I think I have a hypothesis that explains it. | |
==The Grand Unified Hypothesis of Build Order== | ==The Grand Unified Hypothesis of Build Order== | ||
Line 8: | Line 8: | ||
*1) Every creature checks its [[speed]] to determine whether it can move to the next tile in its path. If it can, it moves. If its next tile is occupied or inaccessible, it recomputes path. | *1) Every creature checks its [[speed]] to determine whether it can move to the next tile in its path. If it can, it moves. If its next tile is occupied or inaccessible, it recomputes path. | ||
− | *2) | + | *2) Power needs are computed for power generators. If power needs are greater than power output, power generators are considered unpowered. (This one requires a lot of research). |
*3) Every variable-state building is evaluated (more on this later). | *3) Every variable-state building is evaluated (more on this later). | ||
− | * | + | *4) Every tile of [[water]] is evaluated to determine whether it should flow (or maybe teleport), and it does so, if it should. |
− | The important part of this is step | + | The important part of this is step 2. In particular, buildings are evaluated in the reverse order to which they were built. If you build a pressure plate, then a [[door]], the game will first run the door's ''think'' function, then run the plate's ''think'' function. |
Here are the ''think'' functions for various variable state buildings, as far as I can tell: | Here are the ''think'' functions for various variable state buildings, as far as I can tell: | ||
====Door==== | ====Door==== | ||
− | *If a ''close'' signal has been generated for this door, close the door. | + | *If a ''close'' signal has been generated for this door, close the door. (Note that the door doesn't itself evaluate ''open'' signals.) |
− | |||
====Pressure plate==== | ====Pressure plate==== | ||
− | *If triggering criteria are met, and the device most recently sent a ''close'' signal, send an ''open'' signal. Additionally, open any doors or [[hatch cover|hatches]] linked to this pressure plate, and toggle | + | *If triggering criteria are met, and the device most recently sent a ''close'' signal, send an ''open'' signal. Additionally, open any doors or [[hatch cover|hatches]] linked to this pressure plate, and toggle any linked gear assemblies. |
*If triggering criteria are met and the device most recently sent an ''open'' signal, don't do anything, except remember this tick. | *If triggering criteria are met and the device most recently sent an ''open'' signal, don't do anything, except remember this tick. | ||
− | *If triggering criteria are not met, and it has been exactly | + | *If triggering criteria are not met, and it has been exactly 99 ticks since triggering criteria were met, send a ''close'' signal. Additionally, toggle any linked gear assemblies. |
− | *If triggering criteria are not met, and it has been greater than or less than | + | *If triggering criteria are not met, and it has been greater than or less than 99 ticks since triggering criteria were met, don't do anything. |
====Bridge==== | ====Bridge==== | ||
− | *If no open or close | + | *If no open or close scheduled for this device, check for a signal. If ''open'', schedule an open in 100 ticks. If ''close'', schedule a close in 99 ticks. |
*if no signal, or an open or close is already scheduled, don't do anything. | *if no signal, or an open or close is already scheduled, don't do anything. | ||
====Screw Pump==== | ====Screw Pump==== | ||
Line 31: | Line 30: | ||
*Otherwise, don't do anything. | *Otherwise, don't do anything. | ||
====Gear Assembly==== | ====Gear Assembly==== | ||
− | + | *If gear assembly is adjacent to a device with power and is engaged, consider this tile powered. | |
− | + | *If gear assembly is not adjacent to a device with power or is not engaged, do not consider this tile powered. | |
− | |||
− | |||
====Other Furniture==== | ====Other Furniture==== | ||
− | I believe that the think functions described earlier apply to all other forms of furniture. Hatches use the same think function as doors. Grates, bars, and floodgates use the same think function as bridges. | + | I believe that the think functions described earlier apply to all other forms of furniture. Hatches use the same think function as doors. Grates, bars, and floodgates use the same think function as bridges. [[Lever]]s require a special note: I believe they function the same way as a pressure plate. However, there's a chance that the dwarf pulling them actually sends the signals, in which case you would expect to see levers functioning as if they were always built before the furniture they trigger. |
===How this reconciles Hussell's clock and my goblin repeater=== | ===How this reconciles Hussell's clock and my goblin repeater=== | ||
Line 171: | Line 168: | ||
Just to clarify, pressure plates trigger on 2+/7 water, and are linked to the gear assembly of the same color. Device is built in the following order: first the upper pump, then the lower pump, then the gear assemblies, then the pressure plates. Beginning state has 7/7 water in the left-hand reservoir, both gears disengaged. At t=0, we engage the green gear via lever. Let's examine, ''in order'', the events happening during important ticks. | Just to clarify, pressure plates trigger on 2+/7 water, and are linked to the gear assembly of the same color. Device is built in the following order: first the upper pump, then the lower pump, then the gear assemblies, then the pressure plates. Beginning state has 7/7 water in the left-hand reservoir, both gears disengaged. At t=0, we engage the green gear via lever. Let's examine, ''in order'', the events happening during important ticks. | ||
− | + | T=0: Red plate already activated, no action. Green gear becomes powered. Lower pump moves water to right. | |
+ | T=1: Red plate schedules a close to occur at T=99. Green plate toggles green gear. Green gear becomes unpowered. Lower pump stops pumping. | ||
+ | T=99: Red plate sends a close to red gear. Red gear becomes powered. Upper pump moves water to the left. | ||
+ | T=100: Green plate schedules a close to occur at T=199. | ||
+ | T~=125: Water lands on red plate. Red plate sends an open to red gear. Red gear becomes unpowered. | ||
+ | T=199: Green plate toggles green gear. Green gear becomes powered. Lower pump moves water to the right. | ||
+ | T=200: Red plate schedules a close for T=299. Green plate toggles green gear. Green gear becomes unpowered. | ||
+ | T=299: Red plate toggles red gear. Red gear becomes powered. Upper pump moves water to the left. | ||
− | + | Do you see? Hussell's clock '''would not work''' unless pressure plates sent signals 99 ticks after becoming disengaged! | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
====Pressure plate trigger data==== | ====Pressure plate trigger data==== | ||
Line 186: | Line 183: | ||
Here, I'm just going to link you to http://mkv25.net/dfma/movie-2363-timingdetails. | Here, I'm just going to link you to http://mkv25.net/dfma/movie-2363-timingdetails. | ||
− | + | Actually, on reviewing that, it doesn't necessarily demonstrate what I want it to. This could be due to imperfect frame-by-frame capture for movies, or it could be because I screwed up. I will have to confirm. | |
====Dropping a dwarf takes 7 ticks==== | ====Dropping a dwarf takes 7 ticks==== | ||
− | Creatures fall at a constant rate of 6 ticks. However, when you drop a dwarf, it takes 7 ticks for the dwarf to fall the first z-level. This, according to my hypothesis, is because the dwarf doesn't know the ground isn't there during the tick the floor disappears, because the ground doesn't disappear during the dwarf's ''think'', it disappears later, during the hatch's ''think''. | + | Creatures fall at a constant rate of 6 ticks. However, when you drop a dwarf, it takes 7 ticks for the dwarf to fall the first z-level. This, according to my hypothesis, is because the dwarf doesn't know the ground isn't there during the tick the floor disappears, because the ground doesn't disappear during the dwarf's ''think'', it disappears later, during the hatch's ''think''. |
===Testable Predictions=== | ===Testable Predictions=== | ||
Line 236: | Line 233: | ||
*At tick=100, bridges open or close. | *At tick=100, bridges open or close. | ||
− | There are two interesting parts to this finding. First, lever signals are being evaluated before all other signals-- I believe it's happening in the dwarf phase, with completion of the lever pull task. | + | There are two interesting parts to this finding. First, lever signals are being evaluated before all other signals-- I believe it's happening in the dwarf phase, with completion of the lever pull task. Second, open and close signals are being acknowledged by bridges at the same time-- 100 ticks after receipt of signal. Is there some way to rectify this with the behavior of bridges linked to pressure plates? |
====Gear assemblies==== | ====Gear assemblies==== | ||
Line 261: | Line 258: | ||
I'm not going to test 1.1, 1.2, 2.1, or 2.2. I will test the others. Particularly notable is the behavior of 3. | I'm not going to test 1.1, 1.2, 2.1, or 2.2. I will test the others. Particularly notable is the behavior of 3. | ||
− | ==== | + | ====Lever vs pressure plate activated bridges==== |
− | + | To verify my lever findings, and compare to my pressure plate findings, I'm going to make two bridges, such that they are both activated at the same time, but one via lever, while the other via bridge. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | * | + | *1) Build the machine demonstrated in the above gear assembly test. Use build order 1. |
− | * | + | *2) Build a lever and a bridge. Link the lever both to the bridge, and to both gear assemblies. Build order shouldn't matter, but we'll build the lever first. |
− | * | + | *3) Build a bridge. Link the plate to the bridge. |
− | + | Predicted: The plate activated bridge will open 1 tick before the lever activated bridge. |