Skip to content

Thermomachine Attempt 3#661

Open
Ossa88 wants to merge 1 commit intoPentestSS13:masterfrom
Ossa88:thermomachine-3
Open

Thermomachine Attempt 3#661
Ossa88 wants to merge 1 commit intoPentestSS13:masterfrom
Ossa88:thermomachine-3

Conversation

@Ossa88
Copy link
Copy Markdown
Collaborator

@Ossa88 Ossa88 commented Apr 12, 2026

About The Pull Request

So, the last version of the ThermoMachine fix, while fixing the thing I wanted, was not actually working as intended.

So here is my after actions report:

Both the Shiptest version and My last version of the code:
Saved into memory the return temp of the gas inside the pipe each time process_atmos calculation happened.
Using this information,
. Shiptests the result of the target_temp - old_temp would give us the difference
. Pentest this result was done as an absolute so it was always a positive value
If this difference was GREATER THAN 1 unit of difference, then the info would pass this though an equation to get the new power draw.
. Shiptests was (heat_capacity * the_difference) / 5 + idle
. Pentests was (heat_capacity * the_difference) / 1000 + idle
Ultimately meant that should the rest of Shiptest's code work, their thermo machines were EXPENSIVE to start up.

What was originally wrong:
Well Shiptest's code did all this calculation but it was never actually passed onto the APC for the area that was in charge of this machine. This resulted in while cases where the machine could gain, or lose values upwards to 1.5E18... or like 1,500,000,000,000,000,000.

What I did wrong:
Because I wanted to preserve as much of the old code, both because I was trying to prevent potential merge issues in the future, and because I assumed that this was correct. I did not challenge their code, as such I stupidly assumed that the 1 unit difference was much smaller than 1 unit.

Since the machine does calculate to the hundeths decimal place, I assumed 1 unit was .01 which is technically impossible for the machine to be told. The machine only accepts whole numbers. I figured that the system would catch this and just process at idle.

IN ACTUALITY,
It would never properly pass the power use meaning the machine would act as if it was working at full power. But, simply changing the value to max/min letting the machine actually process between the two states would fix this issue.

So the fix here:

  1. The change must be greater than 1 check has been torn out.
  2. An additional nodes IF check that I had tested before, but was pulled was brought forward just in case.
  3. The old temp check system was just ripped out. Machine will no longer need this information.
  4. Instead it will live calculate each time process_atmos is done.
  • In theory this could be offloaded back into process_atmos proc. Yet, the reason I have not is that the old on/off state change procs, and a few others used to update power. So having them just recalculate power right then should make them not freak out in some way.

Results:

Should work correctly now that it just deals with the actual workload and not some superficial before and after.

Oddities:

It gets down to the fractional power use now.

Why It's Good For The Game

Stops a issue where setting a thermo machine to its target temp at turn off/on caused it to assume full power to continue working.

Changelog

🆑
fix: Fixing this again.... God damn how much I would love to just upgrade the entire codebase to TG's
/:cl:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant