Thermomachine Attempt 3#661
Open
Ossa88 wants to merge 1 commit intoPentestSS13:masterfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_atmoscalculation happened.Using this information,
. Shiptests the result of the
target_temp - old_tempwould 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:
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: