Skip to content

Make pressure tolerance sliders logarithmic#6913

Open
RyuDanuer wants to merge 3 commits intoRevolutionary-Games:masterfrom
RyuDanuer:fix-5963-pressure-slider-ranges
Open

Make pressure tolerance sliders logarithmic#6913
RyuDanuer wants to merge 3 commits intoRevolutionary-Games:masterfrom
RyuDanuer:fix-5963-pressure-slider-ranges

Conversation

@RyuDanuer
Copy link
Copy Markdown
Contributor

Brief Description of What This PR Does

This makes the pressure minimum and pressure range controls use logarithmic slider positions while still storing the real pressure values in pascals. The surface pressure range was squeezed into a tiny part of the old linear slider, so this should make those values way less annoying to adjust tbh.

I also made the pressure range display use the same log scale, so the slider grabber and the displayed range stay visually lined up.

I tested this on my machine with:

  • dotnet run --project Scripts -- check files rewrite --include src/microbe_stage/editor/TolerancesEditorSubComponent.cs --include src/microbe_stage/editor/ToleranceRangeDisplay.cs --include src/microbe_stage/editor/TolerancesEditorSubComponent.tscn --no-rebuild
  • dotnet run --project Scripts -- check inspectcode --include src/microbe_stage/editor/TolerancesEditorSubComponent.cs --include src/microbe_stage/editor/ToleranceRangeDisplay.cs --no-rebuild
  • dotnet build Thrive.sln --no-restore
  • dotnet test test\code_tests\ThriveTest.csproj --no-build

Related Issues

Closes #5963

Progress Checklist

Note: before starting this checklist the PR should be marked as non-draft.

  • PR author has checked that this PR works as intended and doesn't
    break existing features:
    https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
    (this is important as to not waste the time of Thrive team
    members reviewing this PR)
  • Initial code review passed (this and further items should not be checked by the PR author)
  • Functionality is confirmed working by another person (see above checklist link)
  • Final code review is passed and code conforms to the
    styleguide.

Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.

@Patryk26g
Copy link
Copy Markdown
Contributor

Patryk26g commented Apr 22, 2026

This would be nice addition, but now:

  1. Changing tolerance using keyboard/controller takes too long
  2. There are cases that it is impossible to perfectly adapt in high pressures:
Screenshot_20260422_142512 Screenshot_20260422_142525 These values are 1 tick apart

So I think the solution might be to make the flexibility be also logarithmic value depended on the pressure tolerance?

@Accidental-Explorer
Copy link
Copy Markdown
Contributor

If I get this correctly, it is purely on the visualisation, correct? (apart from the created bug with the perfect adaptation)

I see you made the Flexibility slider logarithmic also, but I actually don't see the need in doing that. In fact, it creates some confusing behaviour with the MP costs not being linear as you move the slider.

@hhyyrylainen
Copy link
Copy Markdown
Member

I see you made the Flexibility slider logarithmic also, but I actually don't see the need in doing that. In fact, it creates some confusing behaviour with the MP costs not being linear as you move the slider.

Good point. The original idea about the logarithmic slider was that it wouldn't apply to the tolerance range slider as well. Sorry if this wasn't communicated clearly in the issue description.

@Accidental-Explorer
Copy link
Copy Markdown
Contributor

I think there's a balance/design argument for having the flexibility slider apply logarithmically based on the current minimum pressure. Because there's just a greater difference in pressure between patches at greater depth, so the same amount of flexibility does much less (as I think this PR's UI does demonstrate clearly).

But that would be a mechanical change, not a UI change.

@RyuDanuer
Copy link
Copy Markdown
Contributor Author

Adjusted in 6d23643. I kept the minimum pressure slider logarithmic, restored the pressure tolerance/flexibility slider to linear values, and made the minimum pressure step a bit coarser so keyboard/controller input is less painful.

Tested on my machine with dotnet build Thrive.sln and dotnet run --project Scripts -- check files.

@Patryk26g
Copy link
Copy Markdown
Contributor

The keyboroard speed is now better but I have 2 comments:

  • by "testing" we usually mean gameplay testing, no just calling "dotnet run --project Scripts -- check files" with each PR. Every PR needs to have a gameplay testing done by its author
  • the issue I showed above with the two screenshots is still present. The other idea I have for it to be fixed is to maybe make the flexibility be in % instead of Pa. But that's just a proposal, there was no discussion about it before

@hhyyrylainen
Copy link
Copy Markdown
Member

I'll hold off on looking at the code in this PR until the gameplay testing is done.

@RyuDanuer
Copy link
Copy Markdown
Contributor Author

RyuDanuer commented Apr 23, 2026

Tested this on my pc in the microbe editor tolerances tab. The pressure slider opens and adjusts correctly in-game.

Tbh I didn't change the high-pressure perfect adaptation / percentage flexibility part here, as that seems like a separate mechanics/design change from what this PR originally touched.

Updated screenshots from the gameplay check without the tutorial overlay:

pressure slider open

pressure slider adjusted

@Accidental-Explorer
Copy link
Copy Markdown
Contributor

Tbh I didn't change the high-pressure perfect adaptation / percentage flexibility part here, as that seems like a separate mechanics/design change from what this PR originally touched.

Regardless, it's possible in current master to get the perfect adaptation bonus for pressure tolerance, even at high pressure. So if this PR breaks that, it would need to be fixed within the same PR.

I will agree with you that changing the flexibility system to something percentage based instead of a fixed number goes beyond the required scope of what is supposed to be just a UI change.

@Patryk26g
Copy link
Copy Markdown
Contributor

Updated screenshots from the gameplay check without the tutorial overlay

you need to reduce flexibility to minimum. ypu can check on master hownit works like. you'll see green text for perfect adaptation

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

Labels

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Valid ranges for the pressure sliders on the surface are very small

4 participants