[In-progress] Base mod! generators

The “appliance” concept is intended to address the idea of powered walls. For various reasons dealing with the way we load maps into memory, powered walls are going to need to be vehicles under the hood, just skinned through a different ‘examine’ layer.

Unfortunately, it’s not something I hugely care about, so while I’m willing to help someone else do it, I’m not motivated to do the work myself.

And you’re welcome! Thank you for the appreciation and kind words.

3 Likes

Understood. This game is very complex with what it lets you do already. Plus, time.

But you got to admit, that would be cool.

If I am getting the image you have for this right, it would be like a layer. Kind of like the layers in the old Sim City titles where you look into plumbing, grid, etc but using the existing vehicle interface. "e"xamined from the character’s viewpoint, though.

Good luck.

Makes me wish I was a coder sometimes. Then I’d get into rabbit holes and my family would never see me :slight_smile:

1 Like

I’ve noticed terrain witch should have more code well the counter part code, hmm what’s the issue with it being difficult, wouldn’t appliance be like menus with the menu activating, if no ones up for implementing base building electricity I’ll consider it but rn I’ve got to much mod work, family life and building todo. atm I have relaxed deadlines now for mods witch I know ill beat, GMC first.

But this wouldn’t do anything without other code, this should happen to keep the features ball rolling. The generators would have appliance maybe turn on but without normal electricity. well, there should be some sort of electricity or why do fridges work Constant? blocker? or code that makes it magically work?

I’d like to at least be able to have menus or at least something telling you have disconnected/unplugged the appliance/plug

Why would you rather base building in-vehicle JSON? I don’t see a generator as a vehicle, but I know there are large two-wheeled and four-wheeled towed generators. I think we may be getting mixed up on this? I mean a standard small 5 - 25 generator I think 25 is a lot, i think if you end up using Vehicle building menu it will need extended and i think it would be simpler to just add a new variation because later down the line you will want a separate menu all together things might get confusing if it’s in the same menu because of the amount of different things you can build

solution 1
Make the game lose electricity after x amount of days

Solution 2
Get rid of electricity being a thing entirely (not code-wise) to make base building be of a thing that players want to do

Or there no point in using generators/other base power because you can literally take a fridge out a building that’s powered and move it where ever and it will work. this shouldn’t be a thing. but to apply base building menu this to every building and house might take some work witch if you use vehicle build menu for this it will be weird as well.

actually, i think the base building should work independently of any menus like how construction works but would require menus of its own when using as I have mentioned before.

I have no idea how you got “it still needs an alternator” from my previous postings and I’m not even sure what noun “it” is replacing in that sentence.

Good luck with whatever out-of-tree, mod-only thing you’re trying to attempt.

1 Like

I’ll edit and post tomorrow

Expanding on previous answer a bit more:

The solution I’d like see looks like this:

  • There would be JSON for multiple vehicle parts that are generator versions of the current engines, so “v2 gasoline generator” or “large gas turbine generator”. They would probably lighter than the current engines (no implicit transmission) but occupy the same location in a vehicle and consume the same amount of fuel when operating.
  • There would be a new bunch of code for dealing with these, but the short version is that generators act like engines EXCEPT you can install multiple generators without instruction, generators don’t contribute to the motive power of the vehicle, and generators don’t count as extra engines for multiple engine motive power penalties.
  • There would be a bunch of new code for “appliances”. Internally to the code, appliances would be vehicles (though usually without wheels) but you’d interact with them as though they were items, mostly.
  • Your stand-alone generator (SAG) would be represented in JSON as a wheelless vehicle (or appliance) with a special frame, a small combustion engine, a car or motorcycle alternator, and a 2L fuel tank. You’d interact with the SAG as an item via some special commands, so there would be an action to refill the tank, an action to connect the generator to other appliances, etc. Notably, you’d use the craft menu (and not the vehicle interaction menu) to craft a new SAG or build a recharging station from a SAG and a recharging station, and you wouldn’t be able to remove parts from the SAG like you can with a vehicle, but only disassemble it like any other item. You could store a SAG in large container like a duffel bag (well, maybe, depending on the size). But the code would treat it as a vehicle, so the existing code to handle fuel consumption and power production would work just fine.

Now, this version of appliances is, as I’ve said a lot of work and I’m not going to do it. But I’m also not going to do the work to add a generator item that consumes fuel and generates electrical power when it’s on the active item list. The difference is I’m going to help someone else implement the appliance idea, and I’m going to work against anyone trying to implement the active item version.

Now I am reasonably sure that you don’t understand all of what I just said, which isn’t a problem except that it makes it difficult for you to make convincing arguments for your version of the solution to the problem. I can try to help you understand this stuff, if you’d like, but it means understanding elements of how CDDA is written in C++ and I don’t know if you want to do that.

Powered walls wouldn’t be a “layer” and you wouldn’t look at them through the existing vehicle interface. That’s exactly backwards of what we want.

Powered walls would be a vehicle (without wheels, obviously) internally to the code, and would be loaded as a vehicle and processed as a vehicle. However, when you examined them, instead of getting the vehicle interaction menu, you’d get the same sort of data you’d get from examining a piece of terrain or furniture.

There’s some complicated details on the implementation, but that’s the big take-away. Powered walls will be vehicles, but you won’t interact with them as they though they were vehicles at all.

1 Like

Hey, stupid question. Wouldn’t it make sense, long term, to convert buildings into static vehicles all together? That would allow ‘armoring’ walls, built in turrets, things like that. And it would solve the generator question above while opening up other options.

1 Like

No. Currently, buildings have an extremely lightweight footprint in terms of memory and processor time; vehicles have an extremely heavyweight footprint in the same terms.

There was an extensive discussion between 4 senior devs on this topic last night on the discord server, see https://discordapp.com/channels/598523535169945603/598535887801810944/768213398541565952 and on and on for the next 6 hours.

Basically, what we expect to have happen at some point:

  • some of the vehicle code will get migrated to be usable by other entities
  • it will be possible to convert some furniture (mostly electrical appliances) into an appliance class which uses the vehicle power generation/usage code; most electrical appliances will stay furniture to minimize performance concerns but the player will have the option of making the furniture they care about into appliances.
  • most buildings will remain a collection of terrain and furniture, but again the player will have the option to take over a specific building and turn into to a facility, which again uses the vehicle power generation and usage code.

So ideally, your home base is going to be a fully powered facility with solar panels, a combustion powered generator, overhead lights, and floor lamps and machine tools as appliances. The mansion that you raid, loot, and leave will remain a collection of furniture and terrain, and the mansions’ floor lamps that you never use will remain furniture. Very light weight for performance concerns for the stuff you don’t care about, heavyweight memory and performance concerns for the stuff you do care about.

4 Likes

I actually caught some of that discussion. Fascinating.

Though I think some people were getting hung up on wording as to what is considered what in the way the game thinks.

Which you have corrected in this post.

But it brings up some more questions and possibe scenarios.

In an old sci fi disaster novel from the 80s, one of the characters was a manager of an electrical plant. Being a powerful and respected community figure and having heads up on the coming destruction of civilization, he called all his workers and their families to live at the power plant.

When the protaganists finally met him, they were shocked! Clean clothing, lights, all the trappings of civilization at this facility!

Of course, way the story ended up is that the survivor village that the main character was in formed an alliance with the Plant Manager and his people and agreed to share labor to repair the power lines and run power in exchange for aid in military protection and trade in farms that were coming online. Which, I’ll admit is a bit of a stretch for what yall have in mind and would be far, far end game which isn’t fleshed out nor really the focus.

But it brings the point. We already have bases like the Free Merchants that have power and some “furniture” appliances. Would those appliances be made into appliances out of the box for some things like established faction bases? Or would it be abstract like the lighted areas in some labs?

I mean, I’m sure the Free merchants would not mind you using the washer and dryer as long as you bring (or buy) your own detergent.

1 Like

The Free Merchants are going to charge you to use their washer and dryer if they let you use it; they understand the concepts of depreciation and maintenance costs. They’re capitalists and free marketeers; they have some minimal charity (the Lobby Beggars) but the Refugee Ranch shows that they’re mostly on the “work or starve” plan.

So Kevin has already said that power plants are out of scope for the intended direction of the game, and I’ve said I don’t anticipate facilitys to be larger than about 120x120 map squares (which is 5x5 overmap tiles, that’s a lot of space!).

As long as the player doesn’t have to worry about the power issues, static appliances in other people’s bases are likely to remain furniture. Especially in the case of the Free Merchants, where the dozens of NPCs are already making it one of our most processor heavy areas.

1 Like

I’ll admit that I’ve only gotten into cdda in the last 2 months but I I have checked out videos about it prior to.

While I do admit that building small stationary vehicles in your base to represent a power grid is required by game mechanics and understand that, would it be possible to make some kind of construction / vehicle tile that could connect z levels which would defeat the entire argument by allowing people to just set up miniature vehicles on the roof containing solar panels connected by these tiles to the main floor where the sentry guns and appliances would draw power from?

Like I said prior to, I am new and not sure if this is possible but thought I’d put the idea out there because it would most likely be easier than making buildings their own entities.

1 Like

You should look into jumper cables and heavy duty cables.

Also, I fully intend to make it so vehicles can have multiple z-levels themselves[1]; people have been asking for double-decker busses since forever and it’s something I want so we can have proper hot-air balloons and a better helicopter experience. It’s just something that I didn’t get done before the 0.F feature freeze.

[1] by which I mean components in the same x,y co-ordinates but different z co-ordinates; vehicles already can spawn z-levels thanks to ramps but they can’t stack.

2 Likes

Thanks for responding, I understand that making every building into its own entity would be a pain and if we simply reworked the current vehicle system ATM with a smaller tiny frame that somebody could barely see/ stack with walls for inside work/said multi z level connections for power I could see the conversation dying immediately.

But I know this might sound like a stupid question but I’m assuming when you said double decker buses you’re only talking about everything above ground level, because I was also getting at putting connections through basements?

When I add support for stacked z-levels within a vehicle, there will be options to both build up and build down.

In addition, you would obviously be able to start building a vehicle in a basement and then build up to whatever z-level you prefered.

2 Likes

Thank you for clarifying/ responding. Made sure to tell my friends about this game and they were quite interested after watching Seth’s review on YouTube.

Be safe and all that

1 Like

there is a portable generator thats a vehicle but in my head these arent vehicles and this is what i mean

there completely different these are vehicle generators generator

I’ll read everything. And post another comment few things I need to mention

Even at that you can use a massive generators with tows as well

I’ve noticed terrain witch should have more code well the counter part code, hmm what’s the issue with it being difficult, wouldn’t appliance be like menus with the menu activating, if no ones up for implementing base building electricity I’ll consider it but rn I’ve got to much mod work, family life and building todo. atm I have relaxed deadlines now for mods witch I know ill beat, GMC first.

But this wouldn’t do anything without other code, this should happen to keep the features ball rolling. The generators would have appliance maybe turn on but without normal electricity. well, there should be some sort of electricity or why do fridges work Constant? blocker? or code that makes it magically work?

I’d like to at least be able to have menus or at least something telling you have disconnected/unplugged the appliance/plug

Why would you rather base building in-vehicle JSON ? I don’t see a generator as a vehicle, but I know there are large two-wheeled and four-wheeled towed generators. I think we may be getting mixed up on this? I mean a standard small 5 - 25 generator I think 25 is a lot, i think if you end up using Vehicle building menu it will need extended and i think it would be simpler to just add a new variation because later down the line you will want a separate menu all together things might get confusing if it’s in the same menu because of the amount of different things you can build

solution 1
Make the game lose electricity after x amount of days

Solution 2
Get rid of electricity being a thing entirely (not code-wise) to make base building be of a thing that players want to do

Or there no point in using generators/other base power because you can literally take a fridge out a building that’s powered and move it where ever and it will work. this shouldn’t be a thing. but to apply base building menu this to every building and house might take some work witch if you use vehicle build menu for this it will be weird as well.

actually, i think the base building should work independently of any menus like how construction works but would require menus of its own when using as I have mentioned before.

only reason i said it still needs an alternator is that something you referenced
and you are thinking the wrong generators this is what i mean

  • there is only one generator that is a vehicle portable_generator i can’t find v2 gasoline generator or large gas turbine generator the JSON regex cant find it
  • If devs are working on a solution for this ill wait to add my generators as tools that would need to be placed

I understand what you have said, I have made c++ code for my windows before with help from korggent, i am up for the task but it could be tedious and might be frustrating getting someone else to do this

this is how i visioned it, dependent on the appliance dependant on the menu. Witch the appliance code would need to be like "appliance": "generator", for example to execute that menu should allow for modded appliances as well, id still like construction to be in the construction menu though even for powered walls