• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Applying Damping to Physics Particles

For the life of me I cannot figure out a way to apply damping to physics particles in a top-down physics world without gravity? Is it even possible? I've tried physics_particle_set_damping(); ranging from 0 to 100 and the higher the damping, the more likely the particles are to bounce off each other it seems? But it doesn't cause them to slow down as they move regardless of the value.

Code:
physics_particle_set_damping(1);
Result:

Code:
physics_particle_set_damping(10);
Result:


This is the particle creation code:

Create Event
Code:
global.soda_flags = phy_particle_flag_tensile | phy_particle_flag_water | phy_particle_flag_viscous;
physics_particle_set_radius(1);
physics_particle_set_damping(10); // This seems to effect how the particles interact with each other, but does not give them "damping" as I understand it
Step Event
Code:
if (mouse_check_button(mb_left)) {
    var dir = point_direction(mouse_x,mouse_y,x,y);
    repeat(5) {
        var fx = lengthdir_x(5,dir+random_range(-2,2));
        var fy = lengthdir_y(5,dir+random_range(-2,2));
        physics_particle_create(global.soda_flags,mouse_x+irandom_range(-30,30)+fx,mouse_y+irandom_range(-30,30)+fy,fx,fy,make_color_rgb(57,32,27),0.5,-1);
    }
}
I've also tried setting the density and gravity scale of the physics particles, but no combinations of values in any of the functions seems to give them friction.
 
Last edited:
have you tried flagging your particles as viscous, and the such, with phy_particle_flag_viscous? If they are watery, they may not stop like you'd like to in this case. I believe it's watery by default.
Maybe check out physics_particle_set_flags and see if it helps. These physics particles are a pain to setup for me too, I gave up on them a while ago, lol

EDIT: I missed that part in the create event...but why don't you just set it to a single flag?
 
have you tried flagging your particles as viscous, and the such with phy_particle_flag_viscous?
Maybe check out physics_particle_set_flags and see if it helps. These physics particles are a pain to setup for me too, I gave up on them a while ago, lol
Yeah, I am setting the flags in the global.soda_flags variable. I've tried multiple combinations of flags and nothing changes the friction. It's kinda frustrating, I have the liquid physics working great in every way except that they just mindlessly keep moving...
 
Yeah, I am setting the flags in the global.soda_flags variable. I've tried multiple combinations of flags and nothing changes the friction. It's kinda frustrating, I have the liquid physics working great in every way except that they just mindlessly keep moving...
Well, if micro-particles with as big a density as possible, combined with a viscous flag doesn't do it, I'm at loss...
This is catching my attention, tho, I may have a shot at it in a toy project later if I manage to finish all the boring stuff I gotta to today
 
I get the feeling the physics_particle_set_damping(); function might be a little bugged. If damping is meant to be:
Damping is used to reduce the physics simulation velocity of instances over time, much like air resistance in the real world.
As the manual describes, then surely a higher damping would have no impact on particle collisions? Which is weird because, as the gifs show, higher damping = particles reacting more violently to collisions with themselves, rather than acting as though there is more air friction...

EDIT: On top of that, physics_particle_set_damping(); effects the behaviour of non-particle physics objects. Setting it high will make normal physics objects go berserk when it comes to certain collisions. Set it low (or don't set it at all) and nothing goes berserk.
 
Last edited:
Well, I made a small project where you could adjust damping/density/radius and swap flags, and I never was able to make the particles stop. Seems Damping is either bugged or the manual is shady, because a higher value gives off more energy to the particles when they collide.
No combinaison whatsoever will simulate friction on them.
I have a hunch, tho, and it would be fixtures. Maybe make all your floor a big-a** fixture and see if it helps?
This thing: GameMaker Studio 2 Manual (yoyogames.com) (GMS 2.3+)

bitmap.png
 
Last edited:
P

ParodyKnaveBob

Guest
@Slow Fingers: I don't have a dog in the physics world fight, but I thought I'd point out you linked the manual for GMS2 pre-2.3. It's docs. for 1.4.9999, docs2. for beginning GMS2, and manual. for GMS2.3. Don't know what, if anything, that might change for ya. ~shrug~
 
@Slow Fingers: I don't have a dog in the physics world fight, but I thought I'd point out you linked the manual for GMS2 pre-2.3. It's docs. for 1.4.9999, docs2. for beginning GMS2, and manual. for GMS2.3. Don't know what, if anything, that might change for ya. ~shrug~
I hate this downloaded manual thing with unsharable links, damn it... but the point is there, and I doubt those functions have changed (but who knows...)..
All in all, it still doesn't work, tho... šŸ˜‚
Thanks for the heads up, I'll try to edit it with the good version. Didnt know that about the manual. prefix, good to know!
 
Top