TeamPorcupine / ProjectPorcupine

Project Porcupine: A Base-Building Game...in Space!
GNU General Public License v3.0
484 stars 279 forks source link

Brownouts #1236

Open kd7uiy opened 8 years ago

kd7uiy commented 8 years ago

I was just playing with the latest version of the game, and I had a brownout, where I had some power, but not enough to power everything. Nothing worked at all. It would be nice if we had a system whereby some things had power, but not everything. I'm not sure quite how we should make this work, but I would like to have a way to do this. What do you guys think?

buggy213 commented 8 years ago

A good way to go about this would be a priority system where certain unneeded subsystems would be the first to power down in case of power loss, followed by the more important stuff (life support, etc.)

jaselito commented 8 years ago

Yeah, definitely a priority system. And also a way to handle what to do when having several items of the same type (i.e. same priority) but not enough power for all of them (I guess randomly select a few of them to be powered? Or let the user decide on custom priorities?)

buggy213 commented 8 years ago

IMO, custom priorities would be a bit of a pain to have to micromanage

jaselito commented 8 years ago

I mean, everything should have a standard priority but maybe give the user an option to override it.

vogonistic commented 8 years ago

Maybe some machines should work at a reduced rate based on what they can get and some would just fail to operate at all, but still consuming the power. Later in the game you can build a connector that turns off the machine in case of a brownout.

TomMalbran commented 8 years ago

Once we have implemented wires and such another option is to give power based on proximity to the source. You start with the closest and end with the ones further away, and skipping the ones that aren't being used.

jaselito commented 8 years ago

Is that realistic, though? I mean, appreciable power losses over a cabled network happen over distances of kilometers... And if you have superconducting cables, they shouldn't even happen at all.

TomMalbran commented 8 years ago

I really don't know. If it makes no sense, then running at a reduced rate would work fine too. And things that can't, could just shut off.

Geoffrotism commented 8 years ago

well in real life some things still work on low power, like light bulbs, while others will cease to function if the power supplied is not enough. do we want to go into such depth? I am an engineer (amateur coder) and could implement actual calculations on some varying degree if you all would like.

kd7uiy commented 8 years ago

I like that idea. Some things work, but at a lowered capacity, while others stop working entirely. Hmmm...

dusho commented 8 years ago

Ye, I would like to see actual wattage of things of things as well.. Regarding brownouts, would it make sense to have flag for furniture of how essential it is when hooked in power grid? Something like with Low and High. So say light bulbs and furnace are flagged as Low, but oxygen generator is marked as High. And when there is power shortage, first things that will be taken out to balance power will be Low prio ones (bulbs out, furnace not working) and High prio ones still working..

Geoffrotism commented 8 years ago

I am currently working on adding cables into the game. Questions:

Do we want cables to have a max amount of power that can be run through it? Do we want cables to produce heat? Can power be transferred vertically (up and down floors of the ship)?

jaselito commented 8 years ago

I would say yes to all. There can be different types of cables based on different wattage so they have to be upgraded as demand grows. Also, heat production and dissipation is an important problem in space engineering, so it would be natural to include that. And I don't see why you wouldn't want to be able to transfer power between different floors.

That said, I think this should work on top of the utilities implementation (#1224) that @koosemose is writing, so maybe hold it until that has been merged.