The Machine Editor and Electrical Systems

So I’ve been combing through the vehicle code (it’s just as much of a mess as when I last saw it,) and I’m pretty impressed with how far things have come there. Months and months back, I made a suggestion; I think it’s time we start thinking about the implications of it. I’m talking about an expansion to the vehicle editor, to make it into more of a general purpose machine editor. What could we do with this? Well, anything really. But first I want to discuss expansions to the electrical system.

First of all, something like this is completely possible to build in cata (engine, alternator, car battery, wooden frame). Someone recently added in jumper cables which can transfer power between vehicles, and that system can be expanded for laying down wires between electrical appliances. The biggest obstacle I see right now is the inconsistencies in the system; right now, “machinery” is pretty evenly divided between the constructions menu and vehicles (see: minifridges and stoves that can only be attached to a car). It would be nice to bring to life the preexisting appliances in cata (fridges and stoves in houses) and merge that with the current construction and vehicle editing systems.

tl;dr What electrical systems would you guys like to see in the game, and how do you think the constructions and vehicle editor menus could be consolidated?

Let’s back up just a bit to the implications for a power grid.
The way things are currently coded, only vehicles can participate in a power grid.
As such there are two ways forward.

  1. make everything that consumes or produces power a vehicle.
  2. extend power generation and consumption to non-vehicles.

Since terrain and furniture has no state attached to it, I’m favoring 1 as being much less disruptive to all the code.

To support that, we can make uncraftable vehicles that get spawned when you interact with an eligible machine, so e.g. a refrigerator would show up as a vehicle made of a frame and a refrigerator component that works like the vehicle-mounted refrigerator, but probably larger and using more power.

We can easily modify the vehicle menu to shunt interactins to a simplified appliance menu since the full vehicle interaction menu doesn’t make sense, also disassembly would get you refrigerator components, not vehicle parts.
In fact the only vehicle-like interaction you might have with a refrigerator is attaching jumper wires to it. It might just act like a regular container otherwise.

Discrete appliances like generators and worklights would get the same treatment, under the hood they’re a vehicle, but the interface they present to the player is just an appliance they can wire up as either a source or sink of power.

As to the menu unification, I’m not sure what you’re getting at, if things are treated as discrete objects, it doesn’t make much sense to use the vehicle menu at all, so it would be unchanged. That aside, are there more complex machines you see a need to create that aren’t vehicles? I can’t think of any, but I’m ready to be corrected.

[quote=“Kevin Granade, post:2, topic:7829”]Let’s back up just a bit to the implications for a power grid.
The way things are currently coded, only vehicles can participate in a power grid.
As such there are two ways forward.

  1. make everything that consumes or produces power a vehicle.
  2. extend power generation and consumption to non-vehicles.

Since terrain and furniture has no state attached to it, I’m favoring 1 as being much less disruptive to all the code.[/quote]
Yeah, I realize the implications of turning appliances into vehicles in game terms. I’ve tinkered with the vehicle code quite a bit and I know how much of a headache it would be to implement some of this stuff.

The problem here is that we’ve put all of our eggs into the vehicle basket. We have a minifridge, welding rig, forge (?!), kitchen unit, chemistry lab, various lights and auto guns. All of them only work when attached to a car. Meanwhile, things like fridges and stoves in houses are just inert terrain items that you use like a shelf. The question, then, is where to draw the line. There are 2 options if I wanted to build, say, a generator.

A.) Open the vehicle menu and mount a fuel tank, engine, alternator and battery on a frame. This fits right in with the existing vehicle code with no modification, all you need is a way to connect it to appliances like ovens, floodlights, etc.
B.) You create a “generator” furniture item and build it in the construction menu. This is easier to understand for the player.

Either way, unless we want to turn every single static appliance into a vehicle with a bunch of unnecessary car-related variables, it would be best to do what you suggested: create a temporary, invisible vehicle that functions alongside the terrain object. However, it seems like it would be less trouble if we just added a new tag to furniture items like “POWERED”, which would allow them to be turned on and off. Then all you would need is a signed power value, indicating how much power it would drain or supply when switched on. From there on we could add in support for furniture that emits light when powered (upright floodlight), is usable as a cooking tool when powered (electrical oven), and more.

I probably worded that badly. I meant something more along the lines of making a clear division between what each menu would handle, because a lot of things that would have been handled by the construction menu have been shoved into the rather bloated vehicle menu lately. Like I said before, there are plenty of things that could be represented either as a modular vehicle object or a discrete terrain feature.

Vehicles don’t have to be involved in this at all if we just make some furniture capable of using electricity. But the framework is there, and much of it relies on the current vehicle system. So it’s a choice.

I like this idea. Since jumper cables have been added, I’ve been wanting proper electric cabling.

As for the “generator” idea, what about a construction requiring those basic vehicle components that builds a basic vehicle with that set up?

Now that I think about it, electric cables are going to be very difficult to show to the player. How would they be represented? A line along the path of the cable would probably be too obstructive, not to mention a headache to code in. I guess it could be invisible normally but the player could open an alternate view to see what devices are connected? I’m kind of stumped here.

how about making “houses” being considered “wired” and what the player does is “simply” hack in a generator into the houses pre-existing electrical system.
something along the lines of a construction menu option to build a “hookup” spot and then the player will have to build a vehicle with a battery placed in that spot.
code-wise it would follow along the logic of each house having an invisible tiny internal battery and when a spot is designated (and perhaps activated to make it easier) it will act as a jumper cable and suck the battery in the designated spot. heck even simpler build a thingy that requires you to hook up jumper cables to it to power the house.

if its not too complicated to code maybe consider walls as being wired and anything within, lets say, 4 blocks is plugged in. walls will be considered powered if they are connected to a battery\generator or touching another wall which is powered. this will help with player-build houses