Restitution 0 still bounces

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Restitution 0 still bounces

Post by Refpeuk »

Hi all,

I saw something on the forums from a while ago that mentioned this issue, but there was never a decisive answer for fixing it.

I'm working on a platformer ATM. Since I'm simply using the physics engine for forces and collision detection for most of the entities in my game I don't want any bounce to occur, so I set the restitution for both objects (in this case the player and a wall) to 0, yet when the player hits it at any kind of speed there's still some bounce, making my wallsliding animation look kind of strange, and making walljump a bit weird too.

I can send you the code if you want it, but it's a fairly large project considering the small question I have, and most of it is irrelevant to the simple question: is there a way to ensure absolutely no bounce occurs?

Thanks
It was the best of times, it was the worst of times . . .
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: Restitution 0 still bounces

Post by Kingdaro »

is it possible to set a negative value or will that just screw everything up?
User avatar
The Burrito
Party member
Posts: 153
Joined: Mon Sep 21, 2009 12:14 am
Contact:

Re: Restitution 0 still bounces

Post by The Burrito »

I assume you're using 0.7.1, in 0.8.0 restitution and friction seem to behave much more naturally. I don't think negative values will work. 0.8.0 is still a bit buggy but it might be worth upgrading or waiting if it's a key part of your game.

One kind of sloppy solution in the mean time would be to perform some check and 0 or reduce the player's horizontal velocity when they hit a wall, I assume you already have some way of knowing when this happens since you have a wall slide animation, so you can probably just throw it in with whatever triggers that.
User avatar
Ruirize
Prole
Posts: 20
Joined: Tue Dec 13, 2011 9:02 pm
Location: England
Contact:

Re: Restitution 0 still bounces

Post by Ruirize »

The Burrito wrote:I assume you're using 0.7.1, in 0.8.0 restitution and friction seem to behave much more naturally. I don't think negative values will work. 0.8.0 is still a bit buggy but it might be worth upgrading or waiting if it's a key part of your game.

One kind of sloppy solution in the mean time would be to perform some check and 0 or reduce the player's horizontal velocity when they hit a wall, I assume you already have some way of knowing when this happens since you have a wall slide animation, so you can probably just throw it in with whatever triggers that.
Not sloppy at all; The player hits a wall, therefore they should stop :)
User avatar
The Burrito
Party member
Posts: 153
Joined: Mon Sep 21, 2009 12:14 am
Contact:

Re: Restitution 0 still bounces

Post by The Burrito »

Ruirize wrote:Not sloppy at all; The player hits a wall, therefore they should stop
I just mean every time you manually set velocities you introduce an opportunity for the physics to break, so you want to do it as little as possible.
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Re: Restitution 0 still bounces

Post by Refpeuk »

Thanks for your reply. I could use your suggestion of triggering a cancel-x-velocity function, but as you already said; it's a bit of a hackjob solution.

Where could I download 0.8?
It was the best of times, it was the worst of times . . .
User avatar
The Burrito
Party member
Posts: 153
Joined: Mon Sep 21, 2009 12:14 am
Contact:

Re: Restitution 0 still bounces

Post by The Burrito »

Refpeuk wrote:Where could I download 0.8?
Since it's still in development you'll probably have to compile it yourself.

I use the PPA ( https://launchpad.net/~bartbes/+archive/love-unstable ) when developing under Linux and MSVC 2010 to compile under windows (you'll have to grab the source from bitbucket and the msvc2010 sdk from https://love2d.org/sdk/)

If there are non physics related components you can work on, 0.8.0 will be released officially sometime soon. At which point somebody (possibly me) will probably right up some details on how to upgrade your game (physics has changed a lot).
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Re: Restitution 0 still bounces

Post by Refpeuk »

I develop on Windows, but bitbucket only has 0.7.2 . . . are there any other repositories?

And when you say 0.8 will be officially released soon what sort of time frame are we looking at? (a week or two, or several months . . .)
It was the best of times, it was the worst of times . . .
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Restitution 0 still bounces

Post by slime »

Definitely less than several months, there are only a few more bugs left to fix.

You can find the Windows nightly builds of 0.8.0 at the bottom of the page here. Be sure to download 'default' rather than 'minor'.
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Re: Restitution 0 still bounces

Post by Refpeuk »

Awesome, thanks! Is there anywhere I can learn about how to upgrade my game in the meantime? I'd like to do that before I work on it too much more or it'll just become a bigger job.
It was the best of times, it was the worst of times . . .
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 199 guests