Electricity for buildings a la vehicles

You can more or less build non vehicle stuff with the vehicle system though. I remember this really clever person had drilled a hole in his wall, replaced it with vehicle walls, put solar panels outside and then inside the house put lights and other stuff. Awesome idea in my opinion! It would be great to have more parts to do things of this kind.

[quote=“BeerBeer, post:18, topic:12540”]I’m looking for a way to build custom buildings using the vehicle format.

While I didn’t think about dragging furniture or, say shopping carts, there are ways around it. At least you probably wouldn’t be forced to build vehicle floors but maintain construction floors. And you CAN drag objects on them. Only walls would have to be “vehicle”. But admittedly only walls would conduct electricity then. That may or may not be an issue. It would still allow traditional (sane) housing designs, in which electrical devices are close to walls.[/quote]

Vehicle code is said to be “terrible”, though, and the devs are quite opposed to expanding it…

[quote=“Profugo Barbatus, post:19, topic:12540”]

No! You got it all wrong! I’m not looking to convert every single building into the vehicle format! Christ! I’m looking for a way to build custom buildings using the vehicle format.

And that’s not what you were just saying though…

I just think it's a small crime that we have all those abandoned homes and little means to... turn them into appropriate homes. And it's been like that for so long.

Which implies you want houses to be working with this new system you want. I’m starting to get confused about what you want to achieve here. If you want buildings to behave as vehicles, we’d need to convert them over into vehicles. If you want the ability to build a vehicle and treat it like a house… There’s nothing stopping you.[/quote]
I think I may have gotten my thoughts mixed. Sorry. I can’t remember my thought process exactly. But I think I thought something about not doing it all manually, but rather writing a program that would convert the buildings. I didn’t get around expressing that thought though… There is a problematic number of building types but I don’t think there’s very many essential construction tiles: wall, door, window. Everything after that is extra. Although roofing…?

But anyway. Even a “concrete block” vehicle part, using identical graphics as the standard concrete wall, would let electricity in seamlessly. So: Break a wall tile, install frame, install “conductive concrete block” or whatever, and then install frame + RV kitchen unit next to it. And there’s your stove. No one knows the concrete wall block behind it conducts electricity to the outside solar panel array.

But would there be any issue with “wireless electricity”? Such as a special power source that would automatically link only with certain compatible devices within limited range.

Why not just use jumper cables?

[quote=“Zireael, post:22, topic:12540”][quote=“BeerBeer, post:18, topic:12540”]I’m looking for a way to build custom buildings using the vehicle format.

While I didn’t think about dragging furniture or, say shopping carts, there are ways around it. At least you probably wouldn’t be forced to build vehicle floors but maintain construction floors. And you CAN drag objects on them. Only walls would have to be “vehicle”. But admittedly only walls would conduct electricity then. That may or may not be an issue. It would still allow traditional (sane) housing designs, in which electrical devices are close to walls.[/quote]

Vehicle code is said to be “terrible”, though, and the devs are quite opposed to expanding it…[/quote]

Only part of that is true, the code is terrible but there is ongoing work to fix the worst aspects of it

If you want to fully build your base you can also just build an immobile vehicle and put everything on top of it.

[quote=“Coolthulhu, post:4, topic:12540”]Inventing a robust algorithm that will allow draining energy and supplying energy to unloaded map sections in a way that doesn’t break regardless of which sections are loaded and which sections aren’t.
Nothing a non-programmer can be expected to do, so posting ideas won’t help here.[/quote]

I do like to think on such problems, even after an 14-hour work day (so could be very wrong somewhere - if so feel free to point it out (and smash my hopes :stuck_out_tongue: ))

Anyway, the only sensible way i can think of doing it is to:

  1. Create a new entity consisting of “loads”, “generators” and “storage”, maybe also a power_loss_factor depending on the distance between “generators” -> “storage” -> “loads”.

  2. Now, when something that should be a part of such an entity is loaded (eg. an appliance furn), the game will do a quick check or all connected terrain and furn that can host wiring. Naturally house ters and furns can do that, but roads etc cannot. We’d need some rules on that, sure.
    This check will create that entity i mentioned in (1), as we will now know all its elements.

  3. The known entities can only change on a few well known occasions: ter change, furn change. Just before one of these happens, we need to (a) find any entities that can interact with the ter or furn and (b) determine if these entities cease to exist, split into new ones, or combine into new ones.

  4. With this system, jumper cables can be handled as an added combination of load/generator/storage, so this is no biggie.

  5. We need to track all loaded entities and their power status just like we do for vehicles now, and save all entities as needed.

  6. Profit. :slight_smile:

I’m not sure if will be a major performance hog, but i don’t see why it would be. I mean, we do need CPU to do the whole entity identification and reassessment thing, and we do need memory for keeping all the entities, but this is not a huge amount of calculations or data. Or is it?

Also, would the large amount of times a ter_id or furn_id changes in the code be an effective barrier? One would have to take into account most of these, so he’d have to make changes in the codebase in quite a lot of places, correct?

Anyway, thats all i can think of right now.
Off to bed.

That’s the part which won’t work.
As I said, it can’t be checked reliably without forcing loading of out-of-bubble sections.

That’s the part which won’t work.
As I said, it can’t be checked reliably without forcing loading of out-of-bubble sections.[/quote]

Umm but why? Can’t we load as many tiles as needed by following adjacent tiles until the whole entity is found? (by force-loading those needed out-of-bubble tiles)

The whole entity can change during processing, also outside the bubble, meaning a cache with it can’t be expected to stay consistent without rigorous checks.
Loading it by crawling at the tiles would be slow for big maps, especially without a cache. And a good cache requires bounds to be known beforehand.
Entities created this way could be arbitrarily big, possibly big enough to strain memory.

Overall it’s deep into “not worth it”. Expect it to never happen.

OHHhhh. Indeed. A 50-meter “jumper cable”. Just needs a new name. Just… “long power cable”? But could the jumper cable mechanic work with a single power source and multiple recipient devices?

This is a 50m spool of electrical cabling, meeting the industry standards for household electricity and appliances. Plug this to your generator and the other end to the appliance, and enjoy the luxury of electricity at your home again. It’s like the cataclysm never happened!"

I forget how it’s done, but IRL if you lose all power, (blackout) you still have the interior wiring. Now It’s been a few years since I’ve even seen it done, so I might be a bit sketchy on the details, but:
you can just

  1. hook your generator into the wall socket (make sure it can support the amount of power you will be pushing)

  2. turn off breaker for circuit you will be running (don’t want to power the neighborhood… again sketchy on the details… in about this area.)

  3. turn on the generator pushing the power “backwards” into the socket (copper doesn’t care) and into any appliances/ lights running on that circuit. (generator’s are built to know how much power is being attempted drawn)

  4. enjoy having refrigerators not rotting goods until power comes back, and any lights on that circuit(probably not)

In game however, buildings have no pre-existing wiring to determine what is powered where. Closest you could probably get is to have a Circuit Panel wall tile somewhere in the building, accessible only on one side like a window, and have a series of commands available to those character that pass a electronics skill check.

The Circuit panel would essentially be a ‘controlls’ for vehicles but for houses, except instead of controlling anything it just decides whether this building even needs any special look or not (toggle) Once you have ‘Disconnected from exterior grid’ (toggle on for look at building) you would turn on/off rooms use and plug in a generator of choice, using jumper cables or other similar device to turn the walls of that building into wiring,

And then you run into all the normal problems. But at least with this approach all unused buildings are ignored, and you can leave the building unloaded when not there… or something.

well. Its the simplest approach I can think of, and still not really doable.

I’ve been using the debug menu to remove walls in a place I want to set up, I construct wiring (wiring from the Blazemod, made invisible) and then debug the walls back. It works well as long as you only put it in walls and don’t cross doorways or windows. I had made it so I could just deconstruct, build the wiring and reconstruct the walls but then I could deconstruct my way into places I shouldn’t be going.

I tried making a mod with a place that would spawn with wiring already in it but when the place spawned it would trigger the “vehicle crash” code and destroy the walls and the ‘electrical system’.

So maybe just make a vehicle part flag that can be constructed in walls?

(Note: sorry about the wall of text, it’s a bit of a brain dump.)

I know several of the active developers are irritated at this point by the repeated attention to this topic, but this is going to keep coming up again, and again, and again: until something is done about it.
Yes there are technical limitations, yes, most suggestions don’t acknowledge those existing. I do not think they are insurmountable though: the implementation only needs to be right. (concessions to technical limitations made.)

I believe the best (possibly only reasonable to implement) way to go about doing this is to plan an on-load differential calculation, and not attempt any out-of-bubble calculation (too many things can happen, it’ll never be perfect till the whole map is in bubble).

important!: don’t run dead or deactivated circuits, power generation or supply needs to be the trigger for processing.
Possible: artificial hard cap on number of items/tiles per circuit. most games have a spawn cap, or other artificial limits, it’s a good safeguard.

ok, differential processing. The idea here is to compress any circuit into states & timestamps on unload, then use an algorithm based on circuit layout, to determine what happened while you were gone. (~song~)

suppose you have a circuit with a diesel generator, a fridge, and a battery. you leave for say, 2 days. (bubble time)(~can’t touch this~)
generator has fuel to run the fridge for 1 day, and overflow power to max out the battery at .7 days. battery runs fridge for .5 days
when you return, the game checks the circuit, empties the fuel and battery, then ages food at 1.5days chilled and 0.5days unchilled

say you come back in .7 days, the battery is topped off, the fridge is chilled, and the generator is at 0.3days of diesel fuel.

as for map generation, and the load of JSON changes… add a new wall type to construction menu: “unpowered wall”? that functions identically to current walls, and add wires to the old construction menu wall.
on std wall generation, a new, seperately tracked item is created. doesn’t matter what it’s called, really. essentially functions like vehicle circuitry.
does nothing on it’s own, but is destroyed when the construction that adds it on that tile is destroyed.
generators as a construction would need to be added, then fridge/oven rework.(basically reskin the vehicle item traits?)
vehicle item integration would be important, but not necessary to begin the process,
the appeal being that groundwork can be laid invisibly, then functionality added when that’s ready.

the only issue is what to do with multi map-tile circuits. that has multiple options, and requires some knowledge of map code behaviour to figure out properly.
lots of planning would be needed, yes it’d be work… but it would be possible, and not require a full JSON rewrite, or merging construction and vehicle code. it also wouldn’t introduce excessive processing requirement, none at all when unloaded, just a bit on load and then what a normal vehicle takes when loaded.

1 Like

^ this is what currently happens with food. Probably best idea for building electricity too, except… still to much hassle to be worth it, which just leaves us here bellyaching to ourselves, because we’re assholes like that, and waht everything to be perfect, and demand the devs work to death until perfection is achieved, whichever comes first. Followed by more work from/for devs.

1 Like

Yeah, it’d be a lot of work, but not too much compared to many of the other things that are being tossed around recently.
I think the biggest thing is creating the logic for the calculations, which is gruntwork people who are more inexperienced can begin work on.
solar can probably borrow from the funnel formula, and is probably the hardest item to figure.
making a new field that is added to/removed from by constructions, but is handled seperately… I don’t know, but it could pull significantly from vehicles.
I’d be interested in trying to figure out some basics here if a dev or two said it seemed… feasible, as opposed to a straight up “no-never”.
I’m getting a handle on self-compiling, but I need to figure out github properly to really add anything productive in that sense.

[quote=“Cat09, post:36, topic:12540”]solar can probably borrow from the funnel formula, and is probably the hardest item to figure.
making a new field that is added to/removed from by constructions, but is handled seperately… I don’t know, but it could pull significantly from vehicles.
I’d be interested in trying to figure out some basics here if a dev or two said it seemed… feasible, as opposed to a straight up “no-never”.[/quote]

Solars are trivial, the code is already written for vehicles.
It’s not the individual components that are a problem, it’s the connections and reality bubble.

Look, I’m telling you as someone experienced with DDA code: it’s way harder than you think to extend the code that way once you consider all the cases you need to consider.
And even if you actually made it work, you would still need to make it work in reasonable time. And this would be twice (if not more) as hard as just making it work.

It would be easier and more functional to just make each appliance a 1 part vehicle and reusing jumper cable code for connections.

would that work for say, future lab equipment, or powering something at a hospital? (medical centrifuge comes to mind) there is the possiblity of some fun expansion in those areas.
what are you thinking when you say “reuse jumper cable code”? that seems like it could work well, handwaving connectivity as a jumper cable when near a (house)wall?

isn’t there a big generator in labs? it’d be an aweaome endeavor to get that working, connect the right things up, and open a portal or do !Science!
none of that good stuff is really possible right now, due to constructions and furniture being dead items.

PS:would it be possible to cable up a ceiling light? 1-tile invisible vehicle in the middle of the room. feels hacky.

No, I mean actually having to grab a cable and explicitly connecting two items. No way to do it just with walls unless going for hacks such as limiting connections to one submap and thus making the system not work for mansions.

Another way it could be done is only making houses process power like a vehicle if they have some sort of generator plugged in. Otherwise they’re just a regular map house.