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

Flagellum scaling #5491

Merged
merged 26 commits into from
Sep 24, 2024
Merged

Flagellum scaling #5491

merged 26 commits into from
Sep 24, 2024

Conversation

CI09
Copy link
Contributor

@CI09 CI09 commented Sep 12, 2024

Brief Description of What This PR Does

Lets you scale flagellum (shorter/ less ATP usage, less force, longer - vice versa)

Related Issues

closes #4107

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.

@CI09 CI09 added the review label Sep 12, 2024
@CI09 CI09 requested review from a team September 12, 2024 18:19
@hhyyrylainen hhyyrylainen added this to the Release 0.7.1 milestone Sep 12, 2024
@hhyyrylainen
Copy link
Member

This needs text for this feature (removing the placeholders so that the translation system will see the new strings).

@CI09
Copy link
Contributor Author

CI09 commented Sep 12, 2024

There is still a serious ATP balance display bug / balance which I'm not sure right now how to fix. (With short flagellum)

@hhyyrylainen
Copy link
Member

ATP balance calculation code where flagellum movement cost is taken into account needs to be updated, if you haven't done that already. The code is in the ProcessSystem file probably.

@CI09
Copy link
Contributor Author

CI09 commented Sep 13, 2024

Seems for some reason when very short flagellum doesn't have enough mass to push, editor shows ATP consumption as negative and I don't know why.

@hhyyrylainen
Copy link
Member

Could it be that the math actually works out for it to be negative force / energy cost at certain length?

@CI09
Copy link
Contributor Author

CI09 commented Sep 13, 2024

Ah I used wrong constant, my bad

Copy link
Member

@hhyyrylainen hhyyrylainen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a few technical issues. Besides those I guess this doesn't have any major roadblocks if no one wants to comment about the balance of this feature.

src/microbe_stage/editor/upgrades/FlagellumUpgradeGUI.tscn Outdated Show resolved Hide resolved
src/microbe_stage/PlacedOrganelle.cs Outdated Show resolved Hide resolved
src/microbe_stage/editor/upgrades/FlagellumUpgradeGUI.tscn Outdated Show resolved Hide resolved
@CI09
Copy link
Contributor Author

CI09 commented Sep 16, 2024

There is weird bug where when upgrade popup shows up stuff in it don't fit and you need to scroll but it's generally in usable state

@hhyyrylainen
Copy link
Member

Is the minimum size set big enough for it? Also if the explanation text doesn't have x-axis minimum width (and word wrap enabled), that would be good to do. And might help with godot messing up the size calculation and showing the scroll bar.

@CI09
Copy link
Contributor Author

CI09 commented Sep 16, 2024

I tried setting minimum size but it kinda looked like didn't do anything

@hhyyrylainen
Copy link
Member

The minimum size should be bigger than what the controls naturally want, then it starts affecting things and might fix the scrollbar issue if the natural size has a slight bug where it sometimes calculates the space as slightly too small and adds a scrollbar.

Copy link
Member

@hhyyrylainen hhyyrylainen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the new bug that was discovered fixed? I just reviewed the source code again and only 2 of the files I had previous unsolved comments on seem ones with any problems left.

@CI09
Copy link
Contributor Author

CI09 commented Sep 17, 2024

I must worry you that I don't really know how to fix that problem. I tried changing custom minimum size, enable expand mode but neither worked.

@CI09
Copy link
Contributor Author

CI09 commented Sep 17, 2024

I can make it at least fit within for now (scroll remains still though)
image

@hhyyrylainen
Copy link
Member

Okay, so you need help with making the GUI work correctly?

@CI09
Copy link
Contributor Author

CI09 commented Sep 17, 2024

Actually it looks acceptable now. Not perfect (slider doesn't fill out entire horizontal space) but good.

Copy link
Member

@hhyyrylainen hhyyrylainen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see the problem with the scrollbar or wrong horizontal spacing.

What I did immediately notice that default flagellum length is not the same as before:

2024-09-18_11 01 59 5976

I need to ask that the numbers are rebalanced so that the default flagellum length is the same as before this PR.

@hhyyrylainen
Copy link
Member

Was the default length changed? This was force pushed again so I can't easily check the changes, and GitHub only shows that en.po file was changed since I last marked the file as viewed.

@@ -2301,6 +2301,14 @@ private void UpdateAlreadyPlacedVisuals()
organelleModel.Visible = !MicrobePreviewMode;

UpdateOrganellePlaceHolderScene(organelleModel, modelInfo, Hex.GetRenderPriority(organelle.Position));

if (organelle.Upgrades?.CustomUpgradeData is FlagellumUpgrades flagellumUpgrades)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed this is in the wrong place, I'll fix this.

Copy link
Member

@hhyyrylainen hhyyrylainen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reduced the extremes of the scaling as I though that that really made it obvious that it was just a model being stretched on a single axis for the graphics. I also fixed that one wrong place where the scale calculation was for the editor. So now I think this is good to go. I opened a follow up issue, though: #5536

@hhyyrylainen hhyyrylainen merged commit 7436424 into master Sep 24, 2024
4 checks passed
@hhyyrylainen hhyyrylainen deleted the flagellum_remodel branch September 24, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add flagellum upgrade to increase thrust force (speed) along with ATP usage
2 participants