Are power sources hard-coded?

I was trying to figure out how vehicular power sources worked by looking at the solars, but they seem to have a tag instead of any specific instructions regarding how they generate power.

I was toying with the idea of adding a radioisotope thermoelectric generator, but I can’t make heads or tails of the JSONs I’ve seen regarding power sources. Is this just beyond simple item modding?

There are plutonium reactors already - you can look into them.

Look under engines.json and generators.json. epower is the important number. Positives generate, negative consumes. Remember, RITG generate very tiny amounts of power (on par with 1/100 a solar panel) and generate waste heat that has to be managed for optimum output.

Plutonium generators use fuel. Technically so does an RTG, but the RTG’s fuel source is sealed into the unit when constructed and would last years, if not decades, depending on how hot it runs.

It’s that simple? You can make a generator just by giving it a positive epower figure?

I feel like such an idiot.
I was also thinking of adding a Stirling Cycle Generator to take waste heat and allow for additional electrical generation.

But man, I feel so duuuumb.

In that case yiu want the RTG flaggable as an engine qnd the stirling cycle as an alternator. I know there is a json flag to limit each part to only work with each other in tandem but i don’t remember. @kevin.granade?

Technically, a Stirling should work with any/all sources of heat. A friend and I even mooted the Cataclysm-like scenario involving using a big rig straight-six as the chassis for the Stirling, and mounting it in a railyard switcher; route the RTG heat to it for passive power generation, and ramp up by burning solid fuel.

I think you’re looking for something like what seatbelts use: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/vehicle.cpp#L1539 i.e. “you can only install X if part Y is present”.
This is unfortunately hard-coded, but should be fairly easy to push out to json, all the examples are just “X must be installed on a Y”, so the dependent part just needs to declare the thing it relies on.

As for the RTG, it should be usable to just set it to produce a typical amount of energy with some assumptions about radiator efficiency and air temperature. I’d want to see how much impact the normal range of atmospheric temperatures would have on power production before bothering with a temperature management addition to the vehicle system. I very much suspect that it’s not going to produce a significant amount of power either way, so there’s no payoff to making the number more accurate.

Irrelevant where an RTG would be concerned since it’s literally a miniature nuclear reactor that uses thermocouple exchangers instead of molten salt reactors to generate steam for conventional turbines.The only temperature that affects the electrical potential is the λdt of the radioisotope used in the generator. I’d wager for something in cataclysm it’s probably going to be strontium-90, rather than the more widely used plutonium-238.

The way I’d handle it would be a flat value based on fuel and allow one of two fuel types. strontium-90 or the already in game plutonium fuel cell, and just triple the power output, while allowing small amounts of strontium-90 to be found in craters. I mean lets face it. If we’re talking an RTG that’s we’re building or hacking together (which IS doable, some kid did it in his basement in Jersey back in the 90s), it isn’t going to be precision engineering to to level that NASA would even glance at it, let alone any of the private space agencies.

As an addendum, one of the primary reasons you don’t see RTGs in terrestrial use much any more is unreliability. Russia used them extensively until most of their units failed, and it’s now one of the number one sources of radioactive material on the black market behind cesium-133 stolen out of medical equipment.

Edit: Really with an RTG: the issue is: “how do we get more thermocouple around this thing before we start to steal heat from other thermocouples”.

Didn’t that guy die of cancer?

I think so. The science project went well, but he became obsessed and built a breeder reactor in his backyard that stated to go critical if I remember right, It made national headlines at the time.

Edit: I mean i have degrees that says I know stuff, and I don’t even think I could build a breeder reactor in my backyard.

Edit 2: Actually yes I could, I’m just not that fucking stupid.

To be clear, I wasn’t proposing hacking together a homemade RTG. That would be absurdly dangerous.

So of course, it’s something that probably ought to be possible, but I was thinking of, primarily, adding a big RTG already as a sealed unit which was destined for space or possibly the deep sea and/or a very remote location, until the cataclysm left it stranded on a truck or a railcar or something. In that case, all you’d need to do is plug and play, and if it was designed for deployment in, say, icy wilderness or the deep sea, it’s possible that it would have a signifiant heat output - intended to keep whatever it was installed in warm, but which you could hook up to a Stirling Cycle Generator for added power output.

Apropos of nothing, in the scenario which my friend and I were mooting but totally freeform our whole crazy idea was basically that a combination of railwaymen and literal rocket scientist/engineers had hacked together this super-monstrosity at a NASA railhead out of rolling stock and whatever satellite/space components they had on hand, thus resulting in a rolling cataclysm home that beats the pants off even Lydia the Fluffy Tentacle Mutant’s Doomtrukk, and really puts the English on the phrase “flex fuel,” what with having a conventional diesel-electric locomotive, solars, an RTG and a Stirling Cycle Generator (which itself made use of waste heat from the diesel-electric, the RTG, and could be directly fueled by the simple expedient of a firebox,) able to provide both electrical and motive power. Sadly, CDDA is not equipped to model such, we were more just thought experimenting.

You know, I’ve never considered RTGs for deep see applications. Mainly because of the tiny power output but you’d have a literal ocean of a heatsink, and certain elements have beta decay that rapidly disperse in salt water so the risk of long term radiation poisoning would be moot. You could drop a unit down the Marianas Trench with a wide band video relay and see what’s going on down there on a few second delay with out having to send James Camron down there.

I guess that was Hogbens guy.

I don’t think an RTG is a nuclear reactor at all. It’s powered by radioactive decay, not nuclear fusion or fission. It’s nuclear, sure, but it’s not a reactor in any sense of the word.

EDIT: While double-checking my information, I ran across this gem on the RTG wiki page:

“In the past, small “plutonium cells” (very small 238Pu-powered RTGs) were used in implanted heart pacemakers to ensure a very long “battery life”.”

That’s kind of terrifying.

Perfectly safe, s’long as nothing ruptures the containment cell!

Actually…

@kevin.granade : would the Atomic Foo (Lamp/Night Light/Coffee Maker) be RTGs charging normal batteries and using normal stuff like small blue LEDs? Or are those maniacs at RivTec actually exposing P-238 to some kind of medium to create cherenkov radiation - which, if you’re seeing it created in atmosphere basically means you should sign your Last Will & Testament.

Nah, it’s magic handwavium technology. If an RTG can do the same thing, we could port it over, but the Atomic (watever) items don’t imply that an in-game RTG should have the same performance.

1 Like

Technically a single isotope suspeded in a salt brine for cooling with an internal thermocouple to handle a dc switch to slide a revoloving lampshade to “turn it off”, then yes, your atomic nightlight could be a reeeeeaaaaaaaally smally rtg that uses it’s own beta decay as the light source.

Edit:Science!

More science fun: 1 gram of strontium-90 would last 9~ years and produce 4 lumens of light in the above setup.

Edit: so slightly dimmer than a candle.