It's all in your head, Part 17

The only place you'll ever hear the truth
User avatar
Chris
Introversion Staff
Introversion Staff
Posts: 1172
Joined: Sat Nov 25, 2000 7:28 pm
Location: Cambridge, UK
Contact:

It's all in your head, Part 17

Postby Chris » Tue May 26, 2009 4:27 pm

I started working on some new security systems for the test building and quickly ran into problems, prompting a slight rethink of the Electrical Systems part of the project. I designed the system to support complex multi-part systems – specifically an Elevator system, which is made up of many components duplicated on every floor, with some quite complex controlling logic written in Lua script. But an Elevator system is about as complex as it gets, and many systems in a building are much simpler. In fact, the Sliding Doors are a much more sensible example – an entirely self-contained system, made up of a handful of sensors, motors, and maybe a control chip of some kind. In my previous design I was supporting complex stuff like elevators at the expense of making simple stuff like Sliding Doors _much_ more complex than they needed to be. Fundamentally, a sliding door doesn’t need anything as complex as a Lua script to drive its logic.

In fact, you can build a sliding door with quite a simple circuit layout.

Image

The way it works is quite simple. The two motion sensors have a Circuit Pin, which carries a value. A value of 1 means “yes”, and a value of 0 means “no”. When the motion sensors detect movement in their zone, they set their pin to 1, and when there is no movement they set their pins to 0. Similarly, the Actuators are controlled by a Circuit Pin – set it to 1 to make the actuators open, and set it to 0 to make them close. The actuators are the cogs that drive the doors to open and close. So by wiring the motion sensors into an OR gate (so either motion sensor can trigger both doors simultaneously), then wiring the OR gate into the actuators, you have a basic “Motion Activated Sliding Door” circuit.

However there is a small problem – as soon as both motion sensors are off, the 0 value from them is passed to the Actuators, and the doors close. Typically you’d expect sliding doors to stay open for several seconds, even if no further movement is detected – otherwise you’re likely to close the doors on people who are still walking through. So by adding a “Low Delay” Circuit Component to the system, we can fix that problem. A Low Delay component allows a value of 1 through immediately, but a value of 0 is delayed by (say) 5 seconds. Adding this component to the circuit causes the doors to open immediately on detection of movement, then once no further movement is detected they will close after a 5 second delay.

Image

I designed this entirely in paint shop pro (the images here are the actual designs I was playing with – paint packages are excellent for rapid prototyping). Once I had an obviously working design, I decided to try to make some other circuits using the same basic components, plus a few others. The more circuits I designed, the more convinced I became that this would be perfect for most of the simple systems in a building.

Image
Image

I’ve seen a similar system before, in ‘WireMod’ : a mod for ‘Garry’s Mod’ which is itself a Mod of the source engine. They use a similar system of pins and wires to send zeros and ones around, and manage to control some fairly complex systems using it. I think Eskil has been working on something similar in his game Love as well, using simple signals and connections to model complex systems. I think a system like this would suit Subversion very well.

Here are some pics of the new Circuit system working in the sandbox building. The first shows the sliding door arrangement, the second shows a test set of laser trip wires connected to a security light. The Laser emitters are on the left of the picture, and the laser Sensors are on the right, along with the logic gates and the security light. I used some nice Bezier curves to show the circuit wires, and the colours indicate their state: green for 1, red for 0.

Image
Image

This new method of building systems has the advantage that it’s conceptually very simple, and also easier to work with as a developer. Using the previous system, even something simple (eg a laser trip wire) would have required a control computer chip with a Lua script to run the logic. Using this new system, circuit tampering becomes a very valid way to progress – every one of these circuits can be bypassed or broken with careful cutting of the right wire, or setting a pin to a 1 or 0 at the right moment. Furthermore, this could lead to an awesome crafting system for the game. Want your guys to set explosives with a 30 second timer? No problem, you can build the circuit yourself. Want your guys to bypass a four digit Keypad Lock? No problem, you can build a device that rapidly enters every single 4 digit code until the door opens. Or maybe you are securing something valuable in a locked room, and you want to build a custom security system, with moving laser tripwires, pressure sensors under the floor, motion sensors in the roof, temperature sensors, cameras, the whole thing, all wired into a control panel in a different room, with automatically locking doors to capture intruders. Not everyone is going to want to take on projects like this, but some will, and this system will make it possible. And bypassing such a system would be a ton of fun.

I haven't removed the Lua script integration - I think its still going to be required for more complex systems. Ultimately any complex system is going to have a control computer, which connects to all the components, and runs Lua logic to make it all work. But you shouldn't need it for simple stuff like this. And with just a few general case components (logic gates, timers and counters, sensors, actuators, emitters) we should be able to build almost anything.

Image

When your guys open the safe on the 25th floor and find this time bomb inside, and the timer is ticking down from 30 seconds, that’s how long you have before the whole thing explodes in your face. Do you cut the red wire, or the blue wire? Cutting the right wire will stop the timer and disarm the bomb, cutting the wrong wire will set it off. With the system described above, this would become a genuine choice based on the actual operation of the components used to build the bomb. A little bit of rapid research will tell you this particular type of detonator is activated by sending a 1 signal to the 2nd pin. So you cut the 2nd wire, stop the timer, and complete the mission.

Or if you’re feeling lazy or you aren’t interested in all this electrical engineering nonsense, you could just pick up the bomb and throw it out the window. We have the physics for that now too.

I have no idea how many government red-flags I’ve accumulated writing this blog entry and drawing these diagrams, but it’s got to be a few. If we get black flagged and one day “disappear” in some unmarked vans, you’ll know what’s happened.
Last edited by Chris on Tue May 26, 2009 4:50 pm, edited 2 times in total.
martin
level5
level5
Posts: 3210
Joined: Fri Nov 19, 2004 8:37 pm

Postby martin » Tue May 26, 2009 4:36 pm

I wondered how long it would be before the wiremod comparison came up ;)

This is developing to be a fascinating looking game!
GENERATION 22:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
User avatar
NeoThermic
Introversion Staff
Introversion Staff
Posts: 6256
Joined: Sat Mar 02, 2002 10:55 am
Location: ::1
Contact:

Re: It's all in your head, Part 17

Postby NeoThermic » Tue May 26, 2009 4:51 pm

Chris wrote:I have no idea how many government red-flags I’ve accumulated writing this blog entry and drawing these diagrams, but it’s got to be a few. If we get black flagged and one day “disappear” in some unmarked vans, you’ll know what’s happened.


All I wanted was a nice easy journey home from work today. If I disappear tonight, I blame this blog! ;)

NeoThermic
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Tue May 26, 2009 5:17 pm

Please, please, persistent multiplayer world with that. I'd spend day in, day out building devious bombs and hiding them, leaving clues in messages to well respected players. Or mount them on IR sensor controlled, people seeking minicars. Tehehe.

We'd need more interesting detonators, though. With only the kind that detonates when some signal goes to one, you'll always just have to find the detonator and cut that wire.
User avatar
KingAl
level5
level5
Posts: 4138
Joined: Sun Sep 10, 2006 7:42 am

Postby KingAl » Tue May 26, 2009 5:18 pm

Silly question: why the two sensors? Wouldn't it be more flexible to be able to set the sensor zone, or something? Or is it a line-of-sight implementation?
EDIT: This answers my question, methinks!

I love your solution though, it's beautifully simple and still powerful. (This isn't fanboy blather, honest, I had a big fat smile across my face while I was reading the blog :P)

jelco: I believe the system before was pretty much the same, in terms of hardcoded components, the control chip simply controlled the relationship between them -- and, I guess, ideally, the available components model all the simple interactions that are possible and then you don't need to mod in new components, you just create complex systems of them controlled by a Lua-scripted chip. Which is not to say the possibility of Lua scripted components wouldn't be welcome...
Gentlemen, you can't fight in here: this is the War Room!
Ultimate Uplink Guide
Latest Patch
User avatar
KingAl
level5
level5
Posts: 4138
Joined: Sun Sep 10, 2006 7:42 am

Postby KingAl » Tue May 26, 2009 5:41 pm

I was assuming that a chip could be intergrated into the same system to serve any logic roles, rather than requiring the entire system to be simplified down to a everything-to-chip basis. But I can see what you're getting at... creating Lua scripted objects which perform predictable, new actions relating their connected components could still be useful; making scripted objects black boxes every time isn't really ideal if a puzzle is involved.
Gentlemen, you can't fight in here: this is the War Room!

Ultimate Uplink Guide

Latest Patch
Rkiver
level5
level5
Posts: 6405
Joined: Tue Oct 01, 2002 10:39 am
Location: Dublin, Ireland

Postby Rkiver » Tue May 26, 2009 5:54 pm

Subversion: The ultimate sandbox.

That's the first thing that's come to my mind after reading that. More and more I am looking forward this.
Uplink help: Read the FAQ
User avatar
Ace Rimmer
level5
level5
Posts: 10803
Joined: Thu Dec 07, 2006 9:46 pm
Location: The Multiverse

Postby Ace Rimmer » Tue May 26, 2009 7:42 pm

Chris wrote:Or if you’re feeling lazy or you aren’t interested in all this electrical engineering nonsense, you could just pick up the bomb and throw it out the window. We have the physics for that now too.

Hmm, with 30 seconds, how about throwing it down the stairs? Or, into an adjacent office. Now that bum has a mess to clean up as well. Unless his car is just outside the window (down at the street level of course).

That's what I'd do, cause I'm lazy, but don't like the obvious solutions (out the window).

Edit: This also begs the question, cut the wire and be able to reconnect it for later use? Recycling is fun.
Smoke me a kipper, I'll be back for breakfast...
Plankhead
level0
Posts: 2
Joined: Sat Oct 07, 2006 9:36 pm

Postby Plankhead » Tue May 26, 2009 10:37 pm

So "your guys" will be breaking into "the safe on the 25th floor" to "complete the mission"?

Aha! Uplink was inspired by hacker movies, Darwinia by Tron, Defcon by Wargames, and Subversion by heist movies. Okay, we know what the game's about now.
Orange Soda
level2
level2
Posts: 95
Joined: Sun Nov 25, 2007 9:16 am

Postby Orange Soda » Tue May 26, 2009 10:49 pm

I had so much fun building stuff in wiremod. Combine wiremod with procedurally generated cities... This project just became a lot more interesting.
VHASE
level0
Posts: 1
Joined: Tue May 26, 2009 11:43 pm

Postby VHASE » Wed May 27, 2009 12:10 am

Awesome
It's so geeky...love it. Can't wait to play with these circuits. So many possibilities.

I hope simulation stuff also takes place outside of buildings.
User avatar
darthkiwi
level1
level1
Posts: 16
Joined: Sat Jan 05, 2008 12:51 pm
Location: On the brink of insanity.

Postby darthkiwi » Wed May 27, 2009 12:39 am

Using this new system, circuit tampering becomes a very valid way to progress – every one of these circuits can be bypassed or broken with careful cutting of the right wire, or setting a pin to a 1 or 0 at the right moment. Furthermore, this could lead to an awesome crafting system for the game. Want your guys to set explosives with a 30 second timer? No problem, you can build the circuit yourself. Want your guys to bypass a four digit Keypad Lock? No problem, you can build a device that rapidly enters every single 4 digit code until the door opens. Or maybe you are securing something valuable in a locked room, and you want to build a custom security system, with moving laser tripwires, pressure sensors under the floor, motion sensors in the roof, temperature sensors, cameras, the whole thing, all wired into a control panel in a different room, with automatically locking doors to capture intruders. Not everyone is going to want to take on projects like this, but some will, and this system will make it possible. And bypassing such a system would be a ton of fun.


:shock:

I want this game so much I would sell one of my eyes for it.
Cthulhu fhtagn.
dopeghoti
level0
Posts: 2
Joined: Wed May 27, 2009 2:09 am

Wow, flashback

Postby dopeghoti » Wed May 27, 2009 2:15 am

I can't be the only one that was reminded of Robot Odyssey when reading this, can I? Back when I was still cutting my teeth with this whole 'computer' thing, I lost many an hour to that game.

If I just nailed any nostalgia nerves, there's a genius out there that ported the entire game to Java, and released it as freeware, with some improvements.
SmackleFunky
level1
level1
Posts: 11
Joined: Wed Jul 09, 2008 6:23 am

Postby SmackleFunky » Wed May 27, 2009 2:30 am

So... A 3d immersive world with gravity, digital logic, motors, physics and Lua scripting.

In other words - Garry's Mod (with WireMod)...with retro graphics?
User avatar
Wasgood
level5
level5
Posts: 1082
Joined: Sat Sep 02, 2006 11:44 am

Postby Wasgood » Wed May 27, 2009 2:31 am

Yay explosives.

Return to “Introversion Blog”

Who is online

Users browsing this forum: No registered users and 10 guests