Discuss the massively-multiplayer home defense game.
You are not logged in.
Pages: 1
Bug, or logic peculiarity?
If you chain an inverted switch into another and feed the first one back into itself, the second one will behave as if it is tripped, yet it doesn't show the tripped sprite and an indicator light on that part of the circuit doesn't receive any power.
Offline
Mind. Blown.
I swear that little inverted switch is wigging out there.
The rich aren't safe. Nobody is safe. -jere ...but the smell wafts out from the pit, obviously. - Jason Rohrer
And the more dickish they are, the more I feel like beating a house to destruction after finally figuring it out. -bey bey
Offline
That's no bug, that's just how electronics works in this game
If you think of inverted switches as "not gates", then wiring one into itself is forming a contradiction - the output is on if and only if it is not on. Just as with real electricity and transistors, this leads to strange and cool effects!
Here's how to make sense of it: if you think it through logically, you'll see that the power should be oscillating between two states. In one state the lights are powered, in the other not. The way the game is coded, tiles like lights which need power to activate are only activated if they get continuous, non-oscillating power.
Offline
Ah, yes. I thought as much. My confusion was mainly concerning the lack of visual feedback, but I guess there is no 'oscillation' sprite.
Offline
From the code:
.
// make sure that all looping elements "settle down" into a
// consistent state (otherwise, we see various flip-flops due
// to propagation times elsewhere in the map)
// in case of looping, all elements involved in the loop settle
// down into the lowest-seen state number that they encounter
// during execution of the loop
So, when a loop is detected in power transmission (state keeps changing with each propagation step, but keeps returning to the same house-wide state somewhere in there over and over), then the transmission simulation is run a few more times through the loop, and all elements are watched for their lowest-seen state number during the looping process. That is the state they are set to, individually. So, in this case, the inverted switches here are set to their "untripped" state, and the wires and things on the other side of them are set to their "unpowered" state (those happen to be their lowest state numbers as seen through the looping process).
Yeah, it looks inconsistent. But the point is that ANY visualization of this would look inconsistent. Let's' say the light past the north-most inverted voltage-triggered switch (IVTS) was ON instead. Well, that would mean that there was power on that wire that loops back, which would mean the north-most IVTS should be tripped (so that part would be inconsistent looking). And if we tripped the switch visually AND had the light on, that would look inconsistent too (how is that light and IVTS getting power?). And if we tripped the switch visually and had the light off (how is that IVTS getting tripped)?
So, the code says: if we have to display something inconsistent, at least make it predictable (everything drops down into its lowest-seen state in the loop... which is always its powered-off state).
I agree that this stuff is REALLY confusing. Then again, low-level electronics in real life is quite a bit more confusing than this....
Something much less confusing is using a non-inverted VTS to make a simple set-and-hold flip-flop. This doesn't involve any inconsistencies.
I also realize that some people (ahem, Mr. Zed) are using some of these "nuances" to make really hard houses that have remained unbroken for days. I'm pretty sure that the only way to make progress in cracking such houses is to replicate pieces of the circuitry in your own house and play around with it to figure out how it works.
Offline
Yes, this is in my opinion one of the best features of the game. It allows for some real richness, especially when combined with pets.
It would be nice if the mechanics were more easily discoverable. I recall finding it quite mysterious until I read the source code.
How about animating the switches each turn, so they flash in turn through all states they pass through during propagation, showing the eventual loop twice? That should be enough to give the idea. It would have to be fast enough not to be annoying, and preferably configurable.
Anyway, someone should solve my house. It shouldn't be hard once you grok the ideas of this thread.
Offline
Anyway, someone should solve my house. It shouldn't be hard once you grok the ideas of this thread.
Are you the guy with all the money?
I painstakingly recreated that house (the bottom portion) and then realized memory was involved. Well, damn. That's a little bit more than I was expecting.
Golden Krone Hotel - a vampire roguelike
Offline
Yeah, it looks inconsistent. But the point is that ANY visualization of this would look inconsistent.
I understand that maybe animating it is not viable, but having a third state and a special sprite for such a state would be consistent. After all, the switch is in a new (unstable) state. Since the 3rd sprite would be a static sprite it could be used on the blueprints as well, if showing unstable IVTS on the blueprints is desired.
Offline
Anyway, someone should solve my house. It shouldn't be hard once you grok the ideas of this thread.
Are you the guy with all the money?
I painstakingly recreated that house (the bottom portion) and then realized memory was involved. Well, damn. That's a little bit more than I was expecting.
Sounds like you're nearly there!
Offline
There!
It's not about the money. It's about sending a message.
That was pretty damn difficult though. I almost gave up several times. And I can't claim to have understood most of the wiring. It was a lot of trial and error.
Last edited by jere (2013-05-31 13:20:48)
Golden Krone Hotel - a vampire roguelike
Offline
Oh... good to see a top house fall, but that wasn't mine! Mine's the one with a load of trapdoors just in front of the entrance, and around 140 skulls.
Offline
I know the one Jere was talking about. That was a good one!
I'm sure someone will get you, Zed. And you have no family left as a parachute...
Offline
As a matter of fact, I just completed my new wiring puzzle. It takes up a massive amount of space, but by using some of these electronic idiosyncrasies, like the "sticky" switch made of a voltage and an inverted voltage switch, I built a three-bit lock controlled by only two buttons. I was going to add more bits total, but I built the first three too high up and didn't have room to expand while also letting my family be protected. My next house I'll probably go for a six-bit, three button lock. Just as a tip for robbers, it featured a press counter on one of the switches, my favorite new invention that allows one switch to have multiple outputs depending on the amount of times it is stepped on. Of course, it's an absolutely massive setup, but a cool step forward in CD electronics. I'll probably post the design for the step counter (not the rest of the house, though) once my current house gets robbed.
Current life: Not dead, but I have no clue who I am
The Life and Times of Christopher Alvin Harris
Record: 149 Paintings!
Offline
Amazing!
Offline
That was pretty damn difficult though. I almost gave up several times. And I can't claim to have understood most of the wiring. It was a lot of trial and error.
I see I have been toppled. Congrats. It gave me enough of a headache completing my trial run.
Offline
Pages: 1