Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setting to have overheat cooldown in steps #562

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Desour
Copy link
Contributor

@Desour Desour commented Mar 28, 2021

Problems to be solved:

Currently the cooldown is done in steps of seconds and the time it takes a device to fully cooldown is also in seconds.
Gates however have a delay in server steps (always exactly 2 steps). This makes it nearly impossible to build circuits that can never overheat, in any circumstances.
Also, servers have a much longer server step dtime, which results in inconsistencies and bad defaults (see also #561).

Changes:

  • A new setting cooldown_mode (enum: seconds (default), steps (default)) says whether to use the old or the new method.
  • Two new settings cooldown_time_steps (float, default=125.0) and cooldown_granularity_steps (int) can be used to configure the new mode, they work like their non-_steps counterparts.
  • Rationale for not reusing the old settings: The values for *_steps are typically much higher. If you use an older mesecons version, the cooldown_mode setting is ignored and circuits will overheat. Also it's much more convenient to have separate settings if you want to play around with them. Furthermore, the new settings allow to define suitable defaults.
  • Choice of values:
    125 steps is 2 seconds for a step time of 0.016 seconds. I was not able to measure a lower step time in singleplayer.
    This is a pretty strict value compared to the old settings. But it isn't actually that strict, it allows one heat every 6.25 steps, which is enough for a shortcut NOT gate plus two diode gates for delay.
    The granularity of 20 steps if the same as 0.5 seconds with a dtime of 0.025 seconds.
    For servers the seconds-based cooldown would be ca. every 5 steps. So this value is more performance-friendly to servers.
    I currently don't know exactly if this value is good, but it's probably good enough.

Other changes:

  • Added documentation of settings in settingtypes.txt.
  • Removed arbitrary limits in settingtypes.txt.
  • Check lower bounds for settings in lua.
  • Use float type for overheat_max in settingtypes.txt.

@sfan5
Copy link
Member

sfan5 commented Mar 29, 2021

If the old way is inconsistent shouldn't this just be the default?

@sfan5 sfan5 added the bugfix label Mar 29, 2021
@Desour
Copy link
Contributor Author

Desour commented Mar 29, 2021

Yes sure. I was just scared by the possibility of people complaining about a change.

steps is now the default.

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.

None yet

3 participants