The Castle Doctrine Wiki
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Admin noticeboard
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
The Castle Doctrine Wiki
67
pages
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Admin noticeboard
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
Editing
Wiring
(section)
Back to page
Edit
VisualEditor
View history
Talk (0)
Edit Page
Wiring
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Substeps == You'll probably eventually make something like this and wonder what happens: [[File:Substep_Example_1.png]] The power should at first get through, letting it up and around to the top of the switch. This however turns the switch on, which stops power getting through. Now that no power is getting through though the switch should become unpowered and let power through again; it should get stuck in a loop! If you make it though you'll see that it doesn't rapidly change back and forth as fast as the game can handle, or even just when you take a step, it "settles" into a state that looks exactly like it does in the picture. To understand why we first need to understand '''substeps'''. A lot of the following examples will be created in [http://castledraft.com/editor/ castledraft], the map editor, as it allows showing which wires are on and which are off. For the game to figure out the final state of electronics, it goes through many "substeps". This simulation happens every single time a robber makes a move or uses a tool. In a substep, first, power propagates through anything conductive that it can. Then at the start of the next substep, voltage triggered (inverted) switches are triggered according to whether or not they were receiving power at the end of the last turn. The game keeps running through substeps until wiring in the whole house repeats a "state" and one substep exactly matches another. Lets say we make something like this: [[File:Substep_Example_2.png]] When we step onto the switch, power will immediately get through the conductive switch and wire, but won't yet trigger the voltage triggered inverted switch (VTIS). [[File:Substep_Example_3.png]] It will take until the start of the next substep for the switch to update according to whether or not it is receiving power from above: [[File:Substep Example 4.png]] Once this happens, power can immediately get through on this '''same''' (second) substep: [[File:Substep Example 5.png]] And the light is powered. On the third substep the game sees that everything has stayed exactly the same, so stops the simulation at three substeps and gives the above state as the final state that you see. Joshwithguitar put together a castledraft map to act as a visual guide to electronic substeps: http://castledraft.com/editor/2sP62y Each row in the above example represents the substeps that the game goes through in order to determine the state of the different electronic configurations. In the rows the leftmost circuit represents the initial state of a circuit before a pressure switch is turned on. The circuits to the right represent each cycle after the button is pressed until it repeats a state. The to the far right the final state as it will appear to the player. Going back to the initial circuit though, what happens with this?: [[File:Substep_Example_1.png]] This map shows the substeps that it will go through: http://castledraft.com/editor/oJviC2 By the third substep the game detects a repeated state, where everything is exactly the same as it was before, which means that it is going to loop. It doesn't need to go through any substeps after the third. The game simulates this loop again and finds the '''lowest seen state''' of each tile. This means their unpowered state. It then settles each tile individually down into their lowest seen state, and you end up with the circuit shown on the far left, which also happens to be what it looks like in build mode. Even though it looks like power should be getting through, the game has forcefully decided that the wires and VTIS should be off, as that was the lowest state they were seen in during the loop.
Summary:
Please note that all contributions to the The Castle Doctrine Wiki are considered to be released under the CC BY-NC-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab