[1.0] RedistHeat (Oct 29, v50) Ported to 1.0

Started by Morgloz, July 19, 2016, 02:19:23 PM

Previous topic - Next topic

moonra

Ahh, didn't knew that, thanks.

But... oh oh, it seems something got really messed up. I noticed something weird when instead of corpses my fridge had skeletons. Then I checked the temps and... what the heck.


Edit: Argh, sorry for the bad image quality, it was too big when I posted it, so I edited it to halve the size but imgur compression turned it into that abomination. In case you can't see the important info there, Princess seems to be burning AND freezing at the same time and the temperature reads "NaNC" [Sodium CarboNitrate? What the heck]. I removed one of the doors to make it count as outside and the temperature corrected itself, but as soon as I rebuilt the door I got NaNC again.
Reloading the game showed 0ºC on load but seconds after I got NaNC again. Debug log shows no errors.

Canute

Sorry you encounter the NaNc bug. That happen at the A16 version too. Thats one of the main reason i stoped using it. I am waiting for an complete overhaul of this mod, maybe someone from HCSK dev team made it.
You can search for "NaNC" at this thread and follow the tips, but they didn't realy worked for me.
Only way, you need to load a safe before you start to experiented with the industrial things and didn't encounter the NaNC yet. You should safe anything before you build anything from Redist heat so you have a safe point if that happen.

moonra

Hmm, okay, I'll give that a try, thanks a lot.

Edit: I gave the .dll a try but it just gave me errors on load. Then I gave the "find out where the NaNC is coming from" thing a try and found out it was from the intakes, I deleted those before they "generated the NaNC", that fixed it. Fortunately Spring had started and I didn't really needed the Industrial Heater anymore, I might try making intakes again later.

Morgloz

I updated the mod, and since I finished my exams, I'll be here for anything you need
My mods:
RedistHeat

faltonico

Great way to start the day!
BTW did  you managed to fix the NanC bug?

Morgloz

Quote from: faltonico on July 07, 2017, 08:33:18 AM
Great way to start the day!
BTW did  you managed to fix the NanC bug?

Not yet, since I can't pin down the mod that causes the conflict.
My mods:
RedistHeat

PixelBitZombie

Nice, glad it was officially updated to a17, this will make a lot of people happy!
"When logic and proportion have fallen sloppy dead
And the White Knight is talking backwards
And the Red Queen's off with her head"


lperkins2

Good to see someone who knows the code is back :)
As for the NaN bug, it's probably caused by an invalid division (it might be cause by the target temperature hitting infinite, I don't know in C# how that plays out, but bad division is much more likely). 

Here's a list of where non-constant division happens, some of them I can see are guarded against division by zero, some of them I don't know.  Hope it helps, and I'll keep poking at it as time allows.

Building/Building_TempControl/Building_IndustrialHeater.cs
ControlTemperatureTempChange count is never checked to ensure non-zero.  If it is reading from the net, the connected net nodes count might be 0?

Industrial cooler has a similar spot, as does Multipurpose Cooler's Equalize method.
Building_DuctComp.cs also uses compAir.connectedNet.nodes.Count without checking if it is 0, and room.CellCount, but I assume for the room to exist its cell count must be positive.

That appears to be everywhere that division is used with unchecked variables. 
Where is the temperature data stored?  A check there if it is being asked to store NANC and a messy error message might be a good idea, since it would identify other mods involved in the stack.  Also, an inelegant be effective solution would be to replace requests to store NANC with some default value. 


Riddle78

I seem to be missing something,because I can't get the duct system to make any noteworthy changes to a room's temperature. My setup is as follows;

The Icebox is a room with four Industrial Coolers in it,connected to the Lower Network. Each Industrial Cooler has two exhaust ports set to exhaust into the room,pumping into an adjacent embrasure fortification; Embrasures are walls with firing ports,and as such,they cannot retain heat. The Icebox also contains two Intake Ducts,connected to the Lower Network. The Lower Network is linear; Air flows from the Intake Ducts,into the Industrial Coolers,then from the Industrial Coolers to the rest of the building,which contains a fairly large lab,connected to a hospital and medical freezer. The medical freezer has its own Industrial Coolers. The Industrial Coolers in the Icebox are set to -100 Celsius. The Smart Outlets in the hospital and lab are set to 21 Celsius. The temperature drops from 35 Celsius to 30. Further,if I add more outlets,the temperature goes back up to 35,and sometimes even higher. It's precisely that behaviour that made me put the medical freezer on its own,isolated cooling network; Those are set to -50,and only barely bring the freezer down to -10,which is my preferred freezer temperature.

I don't even have my Hotbox set up because the ductwork behaviour is refusing to cooperate with the logic I'm assuming it runs on; Take in air (Any temperature),cool it down,and send it to an outlet.

Canute

Does the industrial cooler, cool a room or do you want put the cold into the ductsystem ?
Like i mention a few posts before, that currently not working, and i don't think Morgluz fixed that issue yet.
Currently you only can use industrual cooler/heater to work at the room, when they try to put it into the duct system they don't generate any flow.
You need to use the industrial cooler like the standard cooler, build them into the wall, put 1-2 exhaust port right behind, or somewhere outside and connect cooler and port with duct.

Riddle78

So,the Network setting on ductwork-enabled temperature devices doesn't work. Whelp. Time to start over. Again.

PixelBitZombie

#326
Quote from: Canute on July 07, 2017, 03:19:36 PM
Does the industrial cooler, cool a room or do you want put the cold into the ductsystem ?
Like i mention a few posts before, that currently not working, and i don't think Morgluz fixed that issue yet.
Currently you only can use industrual cooler/heater to work at the room, when they try to put it into the duct system they don't generate any flow.
You need to use the industrial cooler like the standard cooler, build them into the wall, put 1-2 exhaust port right behind, or somewhere outside and connect cooler and port with duct.
For the Industrial stuff to work, do something like this. Build a box that can fit however many industrial temp machines you want, this would be easier via dev mode in god mode as far as testing goes. Build the box, build the industrial machines, in your case, coolers. Throw only 1 duct intake in the room. Next set your coolers for network mode, when you switch it to said network you'll see white letters pop up from the machines on screen saying network mode. After this is done then build your lower or upper pipes and add them to said rooms within the walls. Once your pipping is laid out head over and put in the smart duct, maybe 3 in your living quarters as a test room. Regular temp is 70f, once they are built and connected to said pipes you laid out before in the walls they will operate accordingly. Now to cool off the rooms even further you can use either Active vents which insure specific rooms get the air over other rooms or just use vents and each room will adjust the same accordingly. Make sure you use a lot of vents.

Edit: I just realized, you really don't need to use industrial coolers for cooling certain things unless thats how you want to roll. I forgot they had central cooling. Which honestly can probably be used to refrigerate I'd imagine. You could also use central for living quarters and two separate buildings, 1 for freezing and 1 for medical/lab. Set the piping accordingly making sure they don't overlap or use upper/lower to avoid pipe confusion.

Quote from: Riddle78 on July 07, 2017, 03:40:34 PM
So,the Network setting on ductwork-enabled temperature devices doesn't work. Whelp. Time to start over. Again.
Look at my post above in the first line

Quote from: Riddle78 on July 07, 2017, 02:48:03 PM
I seem to be missing something,because I can't get the duct system to make any noteworthy changes to a room's temperature. My setup is as follows;

The Icebox is a room with four Industrial Coolers in it,connected to the Lower Network. Each Industrial Cooler has two exhaust ports set to exhaust into the room,pumping into an adjacent embrasure fortification; Embrasures are walls with firing ports,and as such,they cannot retain heat. The Icebox also contains two Intake Ducts,connected to the Lower Network. The Lower Network is linear; Air flows from the Intake Ducts,into the Industrial Coolers,then from the Industrial Coolers to the rest of the building,which contains a fairly large lab,connected to a hospital and medical freezer. The medical freezer has its own Industrial Coolers. The Industrial Coolers in the Icebox are set to -100 Celsius. The Smart Outlets in the hospital and lab are set to 21 Celsius. The temperature drops from 35 Celsius to 30. Further,if I add more outlets,the temperature goes back up to 35,and sometimes even higher. It's precisely that behaviour that made me put the medical freezer on its own,isolated cooling network; Those are set to -50,and only barely bring the freezer down to -10,which is my preferred freezer temperature.

I don't even have my Hotbox set up because the ductwork behaviour is refusing to cooperate with the logic I'm assuming it runs on; Take in air (Any temperature),cool it down,and send it to an outlet.
So like myself you seem to want to run everything on a large scale network. For certain areas you'll need to either let the industrial coolers be in separate rooms with no ducting, or add various small buildings housing the industrial machine and layout your ductwork accordingly. I'm not a master at this of any sort but I've got the what I thought most of the logic down. I still run into small issues I try to fix in various ways but maybe this post will help you a bit.
"When logic and proportion have fallen sloppy dead
And the White Knight is talking backwards
And the Red Queen's off with her head"


Morgloz

Quote from: lperkins2 on July 07, 2017, 01:46:44 PM
Good to see someone who knows the code is back :)
As for the NaN bug, it's probably caused by an invalid division (it might be cause by the target temperature hitting infinite, I don't know in C# how that plays out, but bad division is much more likely). 

Here's a list of where non-constant division happens, some of them I can see are guarded against division by zero, some of them I don't know.  Hope it helps, and I'll keep poking at it as time allows.

Building/Building_TempControl/Building_IndustrialHeater.cs
ControlTemperatureTempChange count is never checked to ensure non-zero.  If it is reading from the net, the connected net nodes count might be 0?

Industrial cooler has a similar spot, as does Multipurpose Cooler's Equalize method.
Building_DuctComp.cs also uses compAir.connectedNet.nodes.Count without checking if it is 0, and room.CellCount, but I assume for the room to exist its cell count must be positive.

That appears to be everywhere that division is used with unchecked variables. 
Where is the temperature data stored?  A check there if it is being asked to store NANC and a messy error message might be a good idea, since it would identify other mods involved in the stack.  Also, an inelegant be effective solution would be to replace requests to store NANC with some default value.

I found it happens when the CompAir in the heater/cooler is null, but that shouldn't happen and I'm not been able to find out why it does
My mods:
RedistHeat

Morgloz

Quote from: Riddle78 on July 07, 2017, 02:48:03 PM
I seem to be missing something,because I can't get the duct system to make any noteworthy changes to a room's temperature. My setup is as follows;

The Icebox is a room with four Industrial Coolers in it,connected to the Lower Network. Each Industrial Cooler has two exhaust ports set to exhaust into the room,pumping into an adjacent embrasure fortification; Embrasures are walls with firing ports,and as such,they cannot retain heat. The Icebox also contains two Intake Ducts,connected to the Lower Network. The Lower Network is linear; Air flows from the Intake Ducts,into the Industrial Coolers,then from the Industrial Coolers to the rest of the building,which contains a fairly large lab,connected to a hospital and medical freezer. The medical freezer has its own Industrial Coolers. The Industrial Coolers in the Icebox are set to -100 Celsius. The Smart Outlets in the hospital and lab are set to 21 Celsius. The temperature drops from 35 Celsius to 30. Further,if I add more outlets,the temperature goes back up to 35,and sometimes even higher. It's precisely that behaviour that made me put the medical freezer on its own,isolated cooling network; Those are set to -50,and only barely bring the freezer down to -10,which is my preferred freezer temperature.

I don't even have my Hotbox set up because the ductwork behaviour is refusing to cooperate with the logic I'm assuming it runs on; Take in air (Any temperature),cool it down,and send it to an outlet.

The intakes can only support four outlets. In my test world I made a room with  an industrial heater and an industrial cooler. Then I set the heater to heat the room to 51ºC to simulate a heat wave, and the cooler to cool the network. After that I built an intake taking air from that room and connect it to the cooler network. Finally I ran the network to another room and connect it to four outlets, one facing inside the other outside(to test the intake on max force). The network is still capable to cool the room down to -10 easily
My mods:
RedistHeat

Morgloz

Quote from: Canute on July 07, 2017, 03:19:36 PM
Does the industrial cooler, cool a room or do you want put the cold into the ductsystem ?
Like i mention a few posts before, that currently not working, and i don't think Morgluz fixed that issue yet.
Currently you only can use industrual cooler/heater to work at the room, when they try to put it into the duct system they don't generate any flow.
You need to use the industrial cooler like the standard cooler, build them into the wall, put 1-2 exhaust port right behind, or somewhere outside and connect cooler and port with duct.

They don't generate flow, and that is intended. The ideal setup is to put an intake outside, run the network to the cooler, and then run the network to some outlets. The placing and fisical orders are irrelevant, you can have the intake, then the outlets, then the cooler and it will work, as long as they are connected to the same network.
My mods:
RedistHeat