Alright...this is the first complex thing I've done with redstone. Until now, the most remarkable thing I've done is a six-switch combination lock...
Anyways, I was watching the Yogscast play the Minecraft Left 4 Dead mod and thought to myself: "This is nothing like L4D, but wouldn't it be cool if someone made something that was, and it was done in vanilla Minecraft."
And so this was born:
That mess of redstone and cloth is a mob Spawning AI that mimics the random zombie spawning AI in the Left 4 Dead games. It will pick one of three spawn points in a room (the massive stone brick building) and spawn mobs from it for a while. Then, it will reset its self and pick another spawn point, which will then repeat the process.
How it works:
The heart of the AI is this randomizer (built on the white cloth)
Basically, it uses 1-clocks to burn out three redstone torches. Because redstone torches come back on at a random time after being burnt out, the outcome of the machine will be completely random. The first torch to come back on will power its corresponding output, and a system of RS NOR latches prevents the other two torches from powering their outputs when they come back on.
After a random output is chosen, the signal will flow to an extreme delay circuit, shown below (built on blue cloth):
The circuit consists of two small loops of repeaters hooked up to an AND gate. However, one loop is delayed slightly longer than the other, so the signal flow won't line up for a while after you power them (about a minute in this case). When the delay circuit is powered by the random output, the AND gate's output turns on, because its two inputs no longer line up. It stays on for a minute, until the repeater loops line up again. When it turns off, it switches an RS NOR latch, which resets the whole delay circuit.
Next comes the zombie spawning system. The output of the AND gate is hooked up to an inverter, which is then hooked up to a 7-clock. This 7 clock connected to a dispenser (which holds the zombie eggs) and a piston that is delayed to activate after the dispenser drops a zombie.
The 7-clock and the dispenser are on the roof of whatever room this whole setup is in. When there is no signal coming from the AND gate, the 7-clock is being powered, deactivating it. However, for the minute it is activated, the 7-clock will turn on and spawn 28 zombies into the room (a lot, I know, but this was intended to be a co-op thing). They get spawned on the roof, and then the piston pulls the floor out from under them, dropping them into the room.
Finally, I needed a way to make the entire system reset on its own. This is what I came up with:
A redstone signal will only pass through this simple machine if the signal is switched from on to off to on again, because of the delay added by that repeater. This allows me to send the signal at the end of all 3 delay circuits back to the original randomizer.
This is only for one room. Imagine when I start building entire L4D maps with these things. I pray that someone updates MCEdit for the week 7 snapshot so I can just copy-paste this machine a few times, but if not...
My little brother and I tried the room I built. It works like a charm!
Quite a leap from combination locks, there :wink.gif: This looks pretty nice! Can the zombies spawn in multiple ports at once, or did you make the signals block each other so that only one can be powered at once?
Fancy that, I'm actually in the middle of totally recreating a level from Left4Dead2, with the mob spawning AI included! This looks similar to the idea I came up with, but right now I only have the redstone for the final section of the level completed. It's one of the 'bring 10 gas cans to the generator' level, so it required a bit different AI than this. For some reason I decided to start with the last section and work backwards! Anyways this looks very nice, maybe I'll even come back here and ask if you want to help wire my map once the last two areas are complete :biggrin.gif:
EDIT: I've also found that minecarts falling through spider webs make for much less laggy and much more space efficient timers than a bunch of repeaters stacked in a row.
Quite a leap from combination locks, there :wink.gif: This looks pretty nice! Can the zombies spawn in multiple ports at once, or did you make the signals block each other so that only one can be powered at once?
They're only supposed to spawn from one, but I've found a glitch where, if the first 1-clock comes back on just before the middle one, they both will spawn zombies. I'm not sure why but I'm not going to try to fix it because it makes it more exciting.
EDIT: I've also found that minecarts falling through spider webs make for much less laggy and much more space efficient timers than a bunch of repeaters stacked in a row.
Anyways, I was watching the Yogscast play the Minecraft Left 4 Dead mod and thought to myself: "This is nothing like L4D, but wouldn't it be cool if someone made something that was, and it was done in vanilla Minecraft."
And so this was born:
That mess of redstone and cloth is a mob Spawning AI that mimics the random zombie spawning AI in the Left 4 Dead games. It will pick one of three spawn points in a room (the massive stone brick building) and spawn mobs from it for a while. Then, it will reset its self and pick another spawn point, which will then repeat the process.
How it works:
The heart of the AI is this randomizer (built on the white cloth)
Basically, it uses 1-clocks to burn out three redstone torches. Because redstone torches come back on at a random time after being burnt out, the outcome of the machine will be completely random. The first torch to come back on will power its corresponding output, and a system of RS NOR latches prevents the other two torches from powering their outputs when they come back on.
After a random output is chosen, the signal will flow to an extreme delay circuit, shown below (built on blue cloth):
The circuit consists of two small loops of repeaters hooked up to an AND gate. However, one loop is delayed slightly longer than the other, so the signal flow won't line up for a while after you power them (about a minute in this case). When the delay circuit is powered by the random output, the AND gate's output turns on, because its two inputs no longer line up. It stays on for a minute, until the repeater loops line up again. When it turns off, it switches an RS NOR latch, which resets the whole delay circuit.
Next comes the zombie spawning system. The output of the AND gate is hooked up to an inverter, which is then hooked up to a 7-clock. This 7 clock connected to a dispenser (which holds the zombie eggs) and a piston that is delayed to activate after the dispenser drops a zombie.
The 7-clock and the dispenser are on the roof of whatever room this whole setup is in. When there is no signal coming from the AND gate, the 7-clock is being powered, deactivating it. However, for the minute it is activated, the 7-clock will turn on and spawn 28 zombies into the room (a lot, I know, but this was intended to be a co-op thing). They get spawned on the roof, and then the piston pulls the floor out from under them, dropping them into the room.
Finally, I needed a way to make the entire system reset on its own. This is what I came up with:
A redstone signal will only pass through this simple machine if the signal is switched from on to off to on again, because of the delay added by that repeater. This allows me to send the signal at the end of all 3 delay circuits back to the original randomizer.
This is only for one room. Imagine when I start building entire L4D maps with these things. I pray that someone updates MCEdit for the week 7 snapshot so I can just copy-paste this machine a few times, but if not...
My little brother and I tried the room I built. It works like a charm!
http://www.youtube.com/user/StephennJF
Not sure exactly. Probably around 5 hours. The longest part was figuring out how to build each individual mechanism.
EDIT: I've also found that minecarts falling through spider webs make for much less laggy and much more space efficient timers than a bunch of repeaters stacked in a row.
They're only supposed to spawn from one, but I've found a glitch where, if the first 1-clock comes back on just before the middle one, they both will spawn zombies. I'm not sure why but I'm not going to try to fix it because it makes it more exciting.
Cool! I'll have to try that.
Sure, but could you recommend a free screen capture program for Mac?
Sorry..but I'm going to keep this to myself until I make an adventure map using it. Unfortunately, I'm having a few issues implementing it