elasticity and friction fix

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

elasticity and friction fix

Postby D'Lanor » Fri Jun 11, 2010 3:16 pm

I'm sure everyone has noticed that in writers' ages the avatar bounces off colliders in a strange way, which does not happen in Cyan's ages.

This is caused by a bug in PyPRP which sets the default restitution (elasticity) to -1. FYI Cyan's default for restitution is 0.
As a compensation for this bouncing PyPRP also uses a very high default value for friction of 10. Cyan's friction default is 0.5.

I have conformed both to Cyan's values and I must say that everything feels much more natural in my ages now. :) This fix can be downloaded from my SVN contrib folder here: prp_ObjClasses.py.

Note that this change will affect the physics in your age so if you are going to use it you will have to go through all areas and check if everything still behaves as it should, especially if you have puzzles that depend on physics. Yes, I know it can be a pain to redo your tweaking but believe me: You will like this. ;)


P.S. If you decide to test this, please post feedback here.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: elasticity and friction fix

Postby tachzusamm » Sat Jun 12, 2010 12:34 am

Hey, this is GREAT!

Indeed, I was already wondering what was going wrong when my avatar bounces back from colliders; seemed there were springs or some sort of invisible elastic material. Playing around with different collider types did not help. Now it works much better, and as expected.
As a side effect, some of my stairs work better now. I had some issues with the first step of stairs - it was not possible to walk over the first step without running (yes, I did not use an invisible collider ramp, but triangle mesh bounds - because it looks a bit more natural. The height of one step is 0.6 ft. - about 18cm.). Yesterday I thought about adding a ramp at least for the first step - but today it's no longer necessary. Very nice.

I love it. 8-)

Thanks.
User avatar
tachzusamm
 
Posts: 575
Joined: Thu May 29, 2008 2:03 am
Location: Germany

Re: elasticity and friction fix

Postby diafero » Sat Jun 12, 2010 8:14 am

I always wondered where this bouncing came from... good catch, D'Lanor!
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: elasticity and friction fix

Postby D'Lanor » Sat Jun 12, 2010 10:32 am

I have done some further testing. My age Prad, which has a physics dependent "puzzle", still works great. It does feel different though, so I guess it will be easier for some people and harder for others, but such is life.

One issue I had is that without the bouncing two of my colliders now sometimes cause the avatar to go into fall mode (flailing arms), without actually falling. And if I don't maneuver out of it I eventually link out. It is probably no coincidence that both colliders are complexly shaped objects which I used Triangle Mesh bounds for, and maybe should have given separate colliders with Convex Hull bounds the way Cyan does. That is the only downside I have discovered so far.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: elasticity and friction fix

Postby Aloys » Sat Jun 12, 2010 3:14 pm

What is really mind boggling is that no one noticed it before, this bug has been here for, what, nearly 5 years?
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: elasticity and friction fix

Postby Paradox » Sat Jun 12, 2010 3:23 pm

I know there was some discussion about friction when we rewrote part of the plugin just before the fork. Something about friction not being disabled properly, so we used a really high value as a default. In retrospect it sounds like we were missing a flag of some sort.

I haven't tried your fix specifically, but PyPRP2-dev used 0 for both values and I was able to walk around my test Age with no problems. I fully support a merge of this to trunk (along with your waveset GeoState fixes... why haven't those been merged yet?)
Paradox
 
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: elasticity and friction fix

Postby Aloys » Sat Jun 12, 2010 7:02 pm

Paradox wrote:I know there was some discussion about friction when we rewrote part of the plugin just before the fork. Something about friction not being disabled properly, so we used a really high value as a default. In retrospect it sounds like we were missing a flag of some sort.

Indeed, that does ring a bell. The first Ages were totally made of ice, and I do remember a discussion of that style were you went with an eye-balled value that just seemed to work.
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: elasticity and friction fix

Postby D'Lanor » Sat Jun 19, 2010 9:28 am

Paradox wrote:I haven't tried your fix specifically, but PyPRP2-dev used 0 for both values and I was able to walk around my test Age with no problems. I fully support a merge of this to trunk (along with your waveset GeoState fixes... why haven't those been merged yet?)

Yes, you'll be able to walk with friction 0 but when you do a run/jump you will start sliding. In fact only floors need friction but I don't think there is any way for PyPRP to tell if the collider is a floor or a wall.

Feel free to merge them then. :) btw, the other files in my contrib folder can be merged safely as well. They are well tested and non-breaking additions to the quickscripts and wizards.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am


Return to Building

Who is online

Users browsing this forum: No registered users and 1 guest

cron