Ever since Brickadia first became available with Alpha 4, you've all been building a lot of things. And that's grand! We've seen forts, TDM arenas, challenges, film studios, and so much more. We've even seen a fair few vehicles, and a bit of machinery. Right now in Brickadia, you can make a creation that imitates anything at all. In appearance. Not in function.
You have some special bricks, and special components, but those just have rigid, unchangeable behavior. How can we improve this?
Let's talk about some new, upcoming features!
I'll be the first to admit it; Brickadia really does a shoddy job at doors. We're just not catering to door fans right now. Breaking into the door market is not going to be easy - we’ve already upset the powerful video game door lobby with our joke blog post earlier this year. Wrapperup has since fled his home, and all attempts to persuade him to reveal his whereabouts have been met with typical paranoid outbursts - "You're working for the door people, aren't you?!" I understand his plight, of course - I myself have fled to Guinea, where I continue to live as a rat.
To make a proper door, which opens and closes, we'll look at not just a new brick, but a new component - the Door component. You can click on a door to open and close it.
We also need to know about the Switch. You can click on a switch to turn it off and on. On its own, of course, it doesn't do anything useful.
It might seem like we've just added two new components that have limited functionality, but these are the building blocks of what we'll introduce next; wires.
With the addition of wires, every component in the game now has wire ports. Wire ports come in two flavors; Wire inputs are places we can route data into a brick component, allowing us to control that component - and wire outputs are places we can get data out.
Interacting with wires will be done through a new tool called the Wire Tool, though that will be the subject of later posts. Like hidden bricks, you can only see wires when you have a building tool in your hand. Otherwise, they're out of your way.
Connecting Doors and Switches
For the sake of this example, a door has only one wire input - whether it should be open. Thus, if we send an "on" value down the wire, the door will open, and if we send an "off" one, the door will close.
The switch is the exact opposite case in terms of what wire ports it has. It has one wire output - whether the switch is turned on. Do you see where this is going?
If we wire a switch to the door, like this, you can now use the switch to open and close the door.
So far, this might seem a bit simple. But this is just the beginning.
Can wires be used to turn your lights on and off, too? Can they disable and enable pickups? Can they switch your radio off and on?
Yes. They can.
Remember what I said? With the addition of wires, every component in the game now has wire ports.
Let's wire this button up to something! What about the pickup's enabled property?
Excellent! Now we can switch the pickup on only when the button is pressed! This means that that bow can only be picked up with teamwork - one person needs to stand where the pickup is, and another must press the button.
What else can we do? Can we adjust the pickup's size, so that when the switch is flipped, our pickup gets huge?
Well, hold on there. Different wire ports will give and take different kinds of values. Some might take an "on"/"off", some might need a number. Obviously, these couldn't be wired together.
Or could they?
If you wire a switch to something that doesn't take a "on"/"off" signal, the wire system will just convert it in a way that lets you choose two possible values. Here, we've said we want the light's intensity to be 30lm when the switch is on, and 0lm (basically off) when the light is off.
You can do this with everything. For example, the size of a pickup, the volume of a radio, or even multiple of those things, at the same time:
There are all kinds of inputs we can use to control things. Here are just three, two of which you've seen:
- Buttons will emit an "on" signal for a set amount of time when pressed.
- Switches emit an "on" signal if switched on, and an "off" signal if switched off.
- Dials let us emit a whole range of values. Turning a dial makes the number it sends go up. Valves, sliders and other inputs of this type work similarly.
Of course, there’s still more we can do here. So let's add something new again; something that will open even more new possibilities.
Let's say, for the sake of another example, that you have a door you want to be opened by switches. More specifically, by two switches. You now have a problem.
Obviously, you can't wire two switches to the same door. If one switch is on and the other one is off, there's no knowing what should happen. And so, what are you to do instead?
Just use the AND gate.
Gates are placed with the brick tool. They will occupy a custom tab, and will be hidden from view by default. The AND gate's specific behavior is that it'll always output an off signal, unless both things wired to it are outputting an on signal. In real terms, this means your door will only be open if both switches are on.
There are all sorts of logic gates planned, but I won’t introduce them all for now. Instead, let me show you some use cases.
More to come
While we're still early in the progress of this work, this blog post is an important indicator of the shape of things to come. Wires can be used to do a lot of cool stuff.
However; what if we want to go further? What if we want to store data in bricks? What if we want to script custom brick components of our own, with their own properties and wire ports, rather than wiring together the existing ones? What if we want to create entire custom gamemodes?
Next time, we'll be talking about our visual scripting system called Behaviors. Stay tuned.
Build credits: Myself, Refticus, DessertSauce, SeventhSandwich, Demi, SeaChameleon, Wrapperup