Jump to content

Zombietronics: Digital Circuits Using Zombies


Sithdarth

Recommended Posts

The Zombie Oscillator

 

Awhile ago I found out that if you try to pull to much wattage from a generator bank it powers what it can and everything else remains off. I found that I could use that to make a NAND gate by setting up a pair of switches each connected to a 25 watt load and powered by a generator bank with a single engine (The Almost NAND Gate). It was pretty cool but there was no way to chain them and the switches were super manual. Later I was thinking about other designs for AND/OR gates that used motion sensors and powered doors and I realized that using those I could create an inverter.

 

Basically the motion sensor connects to a 50 watt load when it sees a zombie (which I trapped in a box with a powered hatch over it). So powered hatch opened means 50 watt load (well 49 watt plus the motion sensor) which means the generator bank powering the motion sensor won't power anything else. So powering the hatch (an input of 1) results in no power available to anything else (an output of zero) and thus an inverter. If you then connect the generator bank powering the motion sensor to the powered hatch you get an oscillator (the first link up top). When the hatch is closed the load on the generator is less than 50w and the hatch is powered which opens it. Once the hatch is powered the load is greater than 50w and the hatch no longer receives power closing it. That reduces the load below 50w and the cycle repeats.

 

Now if instead of one motion sensor with a 49w load behind it I had two motion sensors with 24w loads and two powered hatches with two zombies powered off one generator I would have a true NAND gate (the power going to the hatches is the input) that can be chained and can have the output wired back into the input. This is a universal gate and with this and the demonstration of a stable oscillator all possible logic gates are possible and zombies can be used to build a fully functioning (albeit terrible) computer.

Link to comment
Share on other sites

Forgive me if my takeaway from this is severely short-sighted but it sounds to me like you could conceivably create a base which has two doors which, when open, create a "best route" for the zombie pathing AI, and wire them to open/close based on conditions which would result in the zombies ping-ponging back and forth between the two doors without ever managing to make it inside?

Link to comment
Share on other sites

6 minutes ago, Shelgeyr said:

and wire them to open/close based on conditions which would result in the zombies ping-ponging back and forth between the two doors without ever managing to make it inside?

Pretty easy with the current basics as well; doors/hatches can be placed so that zombies will path across them when they're closed, but not when they're open. Add a trigger a couple blocks before the door to open it. Doesn't work too well with the randomness of the zeds, but it wouldn't improve much with new forms of control.

Link to comment
Share on other sites

6 hours ago, Shelgeyr said:

Forgive me if my takeaway from this is severely short-sighted but it sounds to me like you could conceivably create a base which has two doors which, when open, create a "best route" for the zombie pathing AI, and wire them to open/close based on conditions which would result in the zombies ping-ponging back and forth between the two doors without ever managing to make it inside?

 

You could do something like that already as theFlu says. In theory with this generator method of building an inverter you could build some latches and a counter. Then assuming you have zombies coming down a corridor one at a time you could set it up to close a door after a certain number had passed. You could then trigger traps or deal with that group personally and reset the counter when the kill room is clean which would open the entrance door and hopefully lure in the next bunch to kill.

 

Also the motion sensors can trigger on players as well so a latch could be used to indicate if anyone happened to visit your base. A counter would give you info on the number of times which would indicate the number of times the motion sensor triggered and sort of the amount of activity happening around your base.

Link to comment
Share on other sites

On 1/25/2022 at 8:59 PM, Sithdarth said:

Basically the motion sensor connects to a 50 watt load when it sees a zombie...

 

Works like a charm. Well done.

 

Generator -> Hatch

Generator -> Sensor

Sensor -> 49W of assorted lights and relays

 

Blinks like an airport beacon.

 

image.png.a084dd2ae8c264ebf0142a3ba79e90a8.png

Link to comment
Share on other sites

5 hours ago, Boidster said:

Obviously I had to try. Working NAND gate. Switches are the inputs, light at the bottom is the output. The 7-segment light is just makework at this point.

 

I'm going to need more Arlenes.

 

 

I've been experimenting with alternatives. The motion sensor doesn't seem to trigger on animals so that's out. Then I thought maybe pressure plates and doors pushing vehicles but apparently vehicles don't trigger pressure plates even with a player in them which is interesting. Then I tried vehicles and trip wires and they will trigger trip wires but I can't seem to reliably push them by clipping doors into them and the vehicles seem to ignore powered drawbridges when unoccupied (or at least the truck does). I did figure out the animals do trip pressure plates but somehow don't seem to trip the tripwires (which is weird). So maybe something with a pressure plate, doors, and an animal assuming I can get it to reliably move when the door opens. Basically just want something easier than zombies that maybe won't kill themselves. Its looking like I'm just going to end up using myself and any friends I can rope into helping to stand in front of motion sensors. 

Link to comment
Share on other sites

One problem (I think?) is that the output of the NAND gate isn't at full strength. So I built an amplifier (aka Repeater in Minecraft redstone lingo) using another Arlene-in-a-box. Available output is 45w on one engine, but it could be scaled easily.

 

I propose we call this system "Deadstone Circuitry". Whoops, it already has a name: Zombietronics!

 

I think you could make a modlet to add animals (or even just a particular type of animal - chickens perhaps) into one of the motion sensor factions. Make them count as "stranger" and the system ought to work.

 

image.png.fe7d617fcf200006eb79e27d08dd18a2.png

Edited by Boidster (see edit history)
Link to comment
Share on other sites

13 hours ago, Boidster said:

One problem (I think?) is that the output of the NAND gate isn't at full strength. So I built an amplifier (aka Repeater in Minecraft redstone lingo) using another Arlene-in-a-box. Available output is 45w on one engine, but it could be scaled easily.

Well the always powered circuitry definitely does eat some power for sure. I believe each motion sensor is like 5 watts. Also, you could have done that whole setup with one Arlene by placing the other two motion sensors on the sides of the box. The wiring for the hatches would be more complicated and you might need a transparent block to keep Arlene from damaging the cameras but it should work. That's basically my plan for doing anything if I'm going to use myself for testing. Just point a bunch of motion sensors at one spot with hatches right in front of them. As long as you're in the control room the circuit would work. I've also started using Solar Banks because a single solar bank with a lower level cell is less than 25w output which makes for much smaller loads. This is helpful when building the smaller circuits.

 

Quote

I propose we call this system "Deadstone Circuitry". Whoops, it already has a name: Zombietronics!

 Deadstone Circuitry isn't a bad name either. I just went with Zombietronics and the Zombocillator because it sounded like something The Professor from Futurama would say.

 

Quote

I think you could make a modlet to add animals (or even just a particular type of animal - chickens perhaps) into one of the motion sensor factions. Make them count as "stranger" and the system ought to work.

Yeah this was basically my next steps if I couldn't find something to improve this. There are a couple of approaches in terms of modding or editing xml files if I'm lucky (I'm probably not lucky). The first is add animals to the motion sensor trigger. The second and possibly most ideal way is to find a way to hack motion sensors to detect empty vehicles. The third idea I had is that doors do have collision boxes so you just have to find a way to make that trigger a tripwire. The final and most direct idea is to let generators accept a parent connection that controls its on/off state and add an option in the interaction panel that lets you select the behavior. Basically is the generator on when its getting power from the parent connection or is it off.

 

Any one of those would significantly simplify this whole thing.

Link to comment
Share on other sites

48 minutes ago, Sithdarth said:

Also, you could have done that whole setup with one Arlene by placing the other two motion sensors on the sides of the box.

 

That was the next thing I tried. I'm having some sort of issue, though, 'cause the output stays high even with both doors open. With the relay + light on the output, it sure looks like the 50w generator is supporting 56w of load. Generator shows 50w load and if I disconnect the output components and then reconnect them, they stay off. Cycle the switches and output (and everything else) stays on. Weird.

 

image.png.dc7fe9f5d23a577fa2d9fbf0d2916a1b.png

 

1 hour ago, Sithdarth said:

The first is add animals to the motion sensor trigger. The second and possibly most ideal way is to find a way to hack motion sensors to detect empty vehicles.

 

This is the beginning of the code which controls the targeting. It gets a list of entities within the cone of vision of the camera. The bit in orange is probably going to trip you up for an "easy" (i.e. XML-only) change to vehicles. They certainly could be given the "alive" tag in XML, but who knows what other behaviors would suddenly be attached to them. Will they wander off if not enclosed? Will zombies and bears and whatnot start attacking the 4x4? Worth a try I suppose. Could be fun!

 

private bool hasTarget()  {
    List<Entity> entitiesInBounds = GameManager.Instance.World.GetEntitiesInBounds(typeof (EntityAlive),

 

Having my toe dipped ever so slightly into DLL modding, I might actually take a shot at altering that one statement so it will detect, say, bicycles (only). Probably it could be modified (by someone with an entire foot in the DLL modding pool) to detect any specific block, but to start I'll probably limit to entities.

Link to comment
Share on other sites

54 minutes ago, Boidster said:

I'm having some sort of issue, though, 'cause the output stays high even with both doors open. With the relay + light on the output, it sure looks like the 50w generator is supporting 56w of load. Generator shows 50w load and if I disconnect the output components and then reconnect them, they stay off. Cycle the switches and output (and everything else) stays on. Weird.

Is the old 'stability' issue gone? It used to be that the overloaded parts could change between loads (not entirely sure if only loads of game, or was loading just the chunk enough) The setup doesn't really force the part which won't get power (you'd have to have all the components in series for that, I'd assume)

Link to comment
Share on other sites

Adding this to the chicken entity will make the camera see it.

 

  <property name="IsEnemyEntity" value="true"/>

 

So far, the chicken has not attacked, but despawning is a problem. And if you don't want to be CM-ing chickens into the game, a vehicle-based solution will be better.

Link to comment
Share on other sites

6 hours ago, Boidster said:

Adding this to the chicken entity will make the camera see it.

 

  <property name="IsEnemyEntity" value="true"/>

 

So far, the chicken has not attacked, but despawning is a problem. And if you don't want to be CM-ing chickens into the game, a vehicle-based solution will be better.

 

Nice! Apparently the enemy Entity tag is tied to the despawn mechanic then. Any recommendations for guides to messing with the XML files? I know XML in general but would love something specific for 7 Days if you know anything good.

Link to comment
Share on other sites

On 1/28/2022 at 10:13 AM, Boidster said:

 

That was the next thing I tried. I'm having some sort of issue, though, 'cause the output stays high even with both doors open. With the relay + light on the output, it sure looks like the 50w generator is supporting 56w of load. Generator shows 50w load and if I disconnect the output components and then reconnect them, they stay off. Cycle the switches and output (and everything else) stays on. Weird.

 

Did some work on this. The second motion sensor doesn't trigger on seeing the chicken but it does trigger when it sees me if I set it to target me and the circuit works as intended. Something about how the game gets the entities in bounds stops two motion sensors from seeing the same entity. Not sure if that was done intentionally or just a side effect of how it was coded. Maybe something cleaver to optimize things and avoid possible performance issues.

 

Looking through the XML I'm seeing nothing that obviously marks and entity as alive so I'm guessing its baked into the entity classes in the code itself. Which makes sense because what sane person would want/need to be able to mark a random entity as alive or not. I guess its time to start learning how to poke around in the actual code.

Link to comment
Share on other sites

On 1/28/2022 at 11:36 PM, Sithdarth said:

Any recommendations for guides to messing with the XML files?

 

The modding forum here has some tutorials, and the wiki page on XPath syntax is excellent - very clear, comprehensive, and well-written. Truly a masterpiece*. You only need XPath if you want to make modlets which will load up and modify XML at run-time (leaving the original vanilla files intact). You can hand-edit the XML directly in the /config folder also of course, but maybe keep a copy of the original!

 

A great way to learn how to mod Thing X is to find a mod which already does something to Thing X and then open up the modlet xml file to see how they did it. That's how I got familiar with it. That and asking n00b questions in the modding forum. There is also Guppycur's unofficial modding Discord, which has an XML/XPath channel. Link is in the modding forum.

 

*I wrote it.

Link to comment
Share on other sites

1 hour ago, Boidster said:

 

The modding forum here has some tutorials, and the wiki page on XPath syntax is excellent - very clear, comprehensive, and well-written. Truly a masterpiece*. You only need XPath if you want to make modlets which will load up and modify XML at run-time (leaving the original vanilla files intact). You can hand-edit the XML directly in the /config folder also of course, but maybe keep a copy of the original!

 

A great way to learn how to mod Thing X is to find a mod which already does something to Thing X and then open up the modlet xml file to see how they did it. That's how I got familiar with it. That and asking n00b questions in the modding forum. There is also Guppycur's unofficial modding Discord, which has an XML/XPath channel. Link is in the modding forum.

 

*I wrote it.

Thanks, I'll start looking through these and hopefully learn some things. One thing I've already learned through dnSpy is that the motion sensor has a "shouldIgnoreTarget" private method with this bit of code:

 

if (_target is EntityVehicle)
		{
			Entity attachedMainEntity = (_target as EntityVehicle).AttachedMainEntity;
			if (attachedMainEntity == null)
			{
				return true;
			}
			_target = attachedMainEntity;

 

Which means there is absolutely no way via XML editing to get any entity that inherits from the Vehicle class to trip a motion sensor unless there is a player entity attached (i.e. in the vehicle driving it). So now I'm looking into either overriding this class using harmony so motion sensors can detect unattached vehicles as strangers (possibly limiting it just to vehicle that inherit the bicycle class) or trying to use XML to create a new animal that is basically a chicken with IsEnemyEntity set, that has no real AI attached to it, and has a crafting recipe.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...