Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hijack vehicles (the code that is) to make furniture/terrain power grids #28289

Closed
I-am-Erk opened this issue Feb 20, 2019 · 16 comments
Closed
Labels
Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. (P3 - Medium) Medium (normal) priority <Suggestion / Discussion> Talk it out before implementing

Comments

@I-am-Erk
Copy link
Member

Is your feature request related to a problem? Please describe.
We have the code to make power grids, plumbing, gas lines, etc - in vehicles.
Although we can build power grids for cars, we can't build them for our bases. This leads to a couple weird things:

  1. People make their bases using the vehicle code, which is a solution, but not a very elegant one,
  2. Furniture elements that we'd like to have don't get implemented because they wouldn't fit in vehicles, like full sized fridges and freezers, and
  3. Furniture elements that shouldn't be readily installed in vehicles are made, because there's no other way to get them - the forge being a key example.
    Allowing furniture and terrain to do the work of vehicles is also a major step in making stationary bases better. Being able to have a row of 500 liter fridges and freezers is already a pretty good argument for having a home base! So is being able to plug in some kind of weaponry to your central grid.

Describe the solution you'd like
"pseudovehicle" furniture and terrain, that leverages the vehicle code to allow transmission of power and liquids through that terrain to other furniture and terrain that needs power.

Existing walls would need to have versions with copper pipes and wires in the recipe (ideally pvc pipe would also be added as an option), and perhaps an option to upgrade them with it. Eventually this would necessitate a big revisit of existing maps to add wiring to the walls as well. For now, t_wall could just have a chance to yield these items at random and that would give us a start.

Describe alternatives you've considered
I had this clever algorithm worked out where we could do power transmission with a whole new code system and Kevin was like "why dude there's already a system for it".

Additional context
This is just a code infrastructure thing for the most part. Here are some ongoing projects that would be good to do once this was in place:

  • We'd still need to work out how to plug appliances into an outlet. I suspect it'd be a lot like a UPS charging station, you put it on the tile and voila.
  • Once plug-in appliances exist, it would be good to remove some of the battery powered ones that don't make a lot of sense, or at least make battery powered versions a mod of the outlet-powered kind
  • We'd have to modify existing furniture like fridges to be able to connect to the power grid, and add furniture versions of a lot of power creating terrain and things.
  • There should be a third furniture dismantling option besides "dismantle" and "bash": "disconnect" creates an item version of furniture that can then be loaded into a vehicle and moved.
@I-am-Erk I-am-Erk added <Suggestion / Discussion> Talk it out before implementing Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. labels Feb 20, 2019
@Zireael07
Copy link
Contributor

This has certainly been suggested multiple times in the past (and therefore there exists at least one duplicate). It was shot down due to the complexity of vehicle code involved.

I seem to recall a refactor of vehicle code recently though, maybe the situation improved?

@I-am-Erk
Copy link
Member Author

Neither Kevin nor mlangsdorf seemed to think that this would be particularly difficult

@Photoloss
Copy link
Contributor

Furniture elements that shouldn't be readily installed in vehicles are made, because there's no other way to get them - the forge being a key example.

I can't speak for the forge but full-size freezers and lockers should exist for vehicles, after all container trucks, tankers and freezer trucks are a thing. They would have to come with hefty penalties in aerodynamics and curve handling though due to the increased height.

We'd still need to work out how to plug appliances into an outlet. I suspect it'd be a lot like a UPS charging station, you put it on the tile and voila.

Either that or jumper cables, I'm not sure whether the jury-rigged charm would outweigh the tedium of having to actually plug things in and manage cables though.

@I-am-Erk
Copy link
Member Author

I think managing cables is the sort of micromanagement we could really live without...

Full sized freezers and lockers, or even forges in the back of vehicles, should be possible - but those sort of 'fills the whole back of the truck' things aren't really well simulated yet.

@Photoloss
Copy link
Contributor

Full sized freezers and lockers, or even forges in the back of vehicles, should be possible - but those sort of 'fills the whole back of the truck' things aren't really well simulated yet.

I was thinking of a single-tile container, either a full-size locker or an abstraction of a shipping container which is assumed to be plated on the sides. The main point is not the size of the footprint but the height of the container where trunks assume sedan-style construction (2 trunk tile "Car" 320l, Ford Mondeo 530l) and cargo carriers are meant to simulate the fairly low (I've seen <50cm) wall height of pickup trucks or trailers.

@kevingranade
Copy link
Member

Brief outline of how it works:
Add a vehicle flag "APPLIANCE".
Add code to vehicle interaction menu to bail out when the APPLIANCE flag is present and possibly redirect to an iexamine.
Add construction recipes that spawn an appropriate appliance-like vehicle (e.g. refrigerator, generator, lamp) and apply the APPLIANCE flag.

@Hyperseeker
Copy link
Contributor

Existing walls would need to have versions with copper pipes and wires in the recipe (ideally pvc pipe would also be added as an option), and perhaps an option to upgrade them with it.

Could wires be a piece of non-blocking floor furniture or attached to the wall from the outside (but not part of it)?

@kevingranade
Copy link
Member

This issue has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/add-functionality-for-the-stuff-in-lmoe-shelters/23260/4

@linonetwo
Copy link
Contributor

So will there be a Rimworld style power system?

@S0ZDATEL
Copy link

Oh, I would love to be able to come to closest power plant, fix it and power the whole city.

@I-am-Erk
Copy link
Member Author

That's a long way from what we're talking about here

@ParaplegicRacehorse
Copy link

I just want to run a heavy-cable from the solar cell on my starting evac shelter to power an oven and fridge/freezer, coffee maker, etc. Or have pre-existing wall-outlet power which is run from solar panel + inverter (new item!), or generator.

As things currently exist (0.E-2), I have to knock out a large section of wall and construct an adjoining "vehicle" with RV galley, FOODCO, mini-fridge, mini-freezer, solar panel, storage battery(/ies), etc.

I'm okay with this waiting for 0.G as I think it will require some fairly extensive testing in Experimental and I want to play, soon, in a Stable with nested containers.

@I-am-Erk
Copy link
Member Author

I-am-Erk commented Aug 9, 2020

It's a thing we all really really want, it will happen at some point. It's just been slowed a little while F has been barreling along quickly.

@ParaplegicRacehorse
Copy link

Great! So, question: With the move to JSON-ing all-the-things over the last few releases, is it better/easier to retrofit existing buildings with a (unpowered) power grid, or will it still require editing the pieces used to construct the building?

@kevingranade
Copy link
Member

Nothing about the code that made re-using the vehicle code for this the right approach has changed.

@ParaplegicRacehorse
Copy link

Ok. That's good because I can't program myself out of a sci-fi garbage compactor, especially if I also have to deal with a tentacle monster, but I can read+write JSON at almost A2 proficiency. (CEFR is used to measure code language proficiency, too, right?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. (P3 - Medium) Medium (normal) priority <Suggestion / Discussion> Talk it out before implementing
Projects
None yet
Development

No branches or pull requests

8 participants