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

Small blocks don't bounce and look odd #67

Closed
KatieWoe opened this issue Jul 6, 2021 · 10 comments
Closed

Small blocks don't bounce and look odd #67

KatieWoe opened this issue Jul 6, 2021 · 10 comments
Assignees
Labels
type:bug Something isn't working

Comments

@KatieWoe
Copy link
Contributor

KatieWoe commented Jul 6, 2021

Test device
Dell
Operating System
Win 10
Browser
Firefox
Problem description
For phetsims/qa#663. May be connected to #37 and/or #33.
When you drag a large block with a small density to the bottom of the pool and let go, it shoots up and bounces a bit. This looks alright and seems to behave fine. However, if the block is a smaller size with the same density, they move up and stop more abruptly, and it looks a bit odd.

Visuals
nobounceoddlook
nobounce

Troubleshooting information:

!!!!! DO NOT EDIT !!!!!
Name: ‪Density‬
URL: https://phet-dev.colorado.edu/html/density/1.0.0-dev.16/phet/density_all_phet.html
Version: 1.0.0-dev.16 2021-06-22 15:36:28 UTC
Features missing: touch
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Language: en-US
Window: 1280x675
Pixel Ratio: 1.5/1
WebGL: WebGL 1.0
GLSL: WebGL GLSL ES 1.0
Vendor: Mozilla (Mozilla)
Vertex: attribs: 16 varying: 30 uniform: 4096
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32)
Max viewport: 32767x32767
OES_texture_float: true
Dependencies JSON: {}

@KatieWoe KatieWoe added the type:bug Something isn't working label Jul 6, 2021
@DianaTavares
Copy link

you are right, it looks very strange. I am playing with the prototype version of the website and it has a better behavior respected to this. I think that probably was some modification related to #37 and/or #33. @jonathanolson, can you review it?

jonathanolson added a commit to phetsims/density-buoyancy-common that referenced this issue Jul 27, 2021
@jonathanolson
Copy link
Contributor

I've added three query parameters above:

  // Controls the proportional amount of overall result viscosity forces applied
  viscosityMultiplier: {
    type: 'number',
    defaultValue: 1
  },

  // A mix between 0: Full viscosity is applied when any part of a mass is in the liquid, 1: The viscosity effect is
  // multiplied times the proportion of the mass submerged (lowering viscosity when partially submerged).
  viscositySubmergedRatio: {
    type: 'number',
    defaultValue: 0
  },

  // Viscosity for masses larger than this will be reduced to the force for this viscosity (somewhat of a hacK)
  viscosityMassCutoff: {
    type: 'number',
    defaultValue: 2
  }

I demoed effectively viscosityMultiplier=2&viscositySubmergedRatio=0.8. @DianaTavares what query parameter combinations seem to work best for you?

@DianaTavares
Copy link

I already play with the parameters and the one that I like most how to generate the bouncing was viscosityMassCutoff. I use the value of 0.5 like it is in this link and I like the behavior for small and big blocks with low density in water:
density1

@DianaTavares
Copy link

DianaTavares commented Jul 28, 2021

by slack @jonathanolson commented that it used to be the previous value before it was changed based on one of the issues #37. Reviewing the comments in that issue @arouinfar and I agree that the behavior was acceptable, and we can use viscosityMassCutoff as 0.5. But this opens a problem with the common code between Density and Buoyancy because the behavior of low dense blocks in fluids with high density has issues. Like is shown in the gif, the less dense block starts to bounce by itself:
Buoyancy

@jonathanolson suggests finding a solution that fits both sims. And some of the options are:

  1. Have different viscosity values for dense fluids in buoyancy
  2. Limit the density that the blocks can have. If we restrict the block mass to 0.5 kg as the minimum value, the block in the exploring screen have a good behavior (it doesn't bounce by itself):
    image

the problem is that not only the explore screen allows objects with super small density. The empty bottle gets lost in the Applications screen with the denser fluid if we push it inside the fluid and then drop it. The bottle just jumps outside the pool and not come back (at least in the time that took me to write this issue, that mean minutes):

image

My suggestion is to add in this situation a "return object" pop op screen probably, because we are not going to find a value that works for all the cases, with a sim ta allow so extreme values.

@DianaTavares
Copy link

During the last design meeting, it was discussed the idea to limit the max velocity that a block can get when it goes out of the water, making that denser blocks go faster to the equilibrium. @jonathanolson is going to play with that option.

@jonathanolson
Copy link
Contributor

I limited the max velocity to 5. @DianaTavares can you try it out?

@DianaTavares
Copy link

It works perfectly for Density! I think that the behavior for the Explore screen in Buoyancy is very good, but in the bottle screen still jumping the bottle for a long time.

Bottel

I think that this behavior is acceptable and we can go with these values. I just want to present it today in the design meeting for second voices.

@DianaTavares
Copy link

In the design meeting, we agree that this behavior is good!
Use viscosityMassCutoff as 0.5 to allow small blocks to bounce, and limited the max velocity to 5 to make less dense blocks to stabilize faster.

jonathanolson added a commit to phetsims/density-buoyancy-common that referenced this issue Aug 7, 2021
@jonathanolson
Copy link
Contributor

Implemented the cutoff, can you verify things look good?

@DianaTavares
Copy link

it is looking perfect, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants