Heat vent visual bug

Gage Meawasige shared this bug 39 days ago
Investigating

I found that the heat vent block has an interesting bug. If there is a power deficit (Demanding more power than available), the louvers can spin the wrong way (sometimes for multiple revolutions) and the color is also changed. This only seems to apply if there is either a solar panel or wind turbine on the grid. The solar panel and wind turbine must be turned on and producing.


Build a simple grid with 3 batteries, heat vent and either a wind turbine or solar panel (they must be able to produce).

Set 2/3 batteries to recharge.

I set the vent to 2% power dependency. Just the best value to see the color and not have the vents close.


You should see that the vent changes color and that the vent louvers rotate backwards. In my testing, setting the minimal color to {R:255, G:60, B:0} and the maximal color to {R:255, G:100, B:0} will have the vent produce a magenta color. If you change the color while in this bugged state, the color change is not linear. For example if you slide the green slider up slowly (Brightening the color) there are points where the color gets dark again multiple times through the 0-255 range.


Theory:

The error probably comes from the power usage calculation when a solar panel or wind turbine are involved. I believe that the color and vent position are being derived from an unintentional negative number. This results in the backwards louver motion, and would result in a integer wrap around on the color values which would probably be unsigned bytes (0-255). The problem value is likely multiplied with the color values at some point. This would explain why the colors seem to reset at multiple set points. It's interesting to note that the precise value a color will "reset" depends on the count of renewable sources. In my example above, setting the "G" minimal value from anywhere from 60-184 the magenta color will get lighter, at 185 it will snap back to a darker tone. If you add another turbine (I only tested with a turbine with equal outputs) it will snap again at 189 instead. This leads me to believe that the bugged value is where the renewable power is added up and compared to the total power demand because the color change is not related to total deficit but instead by the count of renewable sources.

Other notes:

-When not in the bugged state, setting the power dependency to 0% has the louvers closed. I'm not sure if that is intentional. It would make more sense if they were always open.

-When in the bugged state, changing the power dependency between 1% and 2% gives a huge color change. I think this may be another instance of an integer wrap around.


- This condition also survives reloads and restarts.


Other information: I'm on an Intel i7 9700K with a 3070 just in case its anything platform related.

Leave a Comment
 
Attach a file