Game Development Community

Higher friction of a player?

by Galun · in General Discussion · 07/11/2007 (4:00 pm) · 8 replies

Hello,

How can I influence the friction of a player? In the demos the player slides down small hills which he could climb to a certain point. I would like to have a higher friction setting so that the player just stops if he cannot climb any higher.
I found hints in this forum that there is a friction variable in the datablock but for me it looks like it has no effect (or at least not te desired).

#1
07/11/2007 (4:05 pm)
That friction variable should do something. What was its value before and after you played around with it?
#2
07/12/2007 (10:53 am)
I think I'm doing something wrong. I tried both "friction" in the datablock as well as a global variable "$friction".

As far as I read here it can take values between 0 and 1 so I tried both 0.2 and 1.0 but could not see any difference.
#3
07/12/2007 (11:42 am)
You're probably going to need to get the engine code to change it to what you want somehow. If one is the highest, then that's it. Why do you want the player stopping right away for?
#4
07/12/2007 (12:16 pm)
In the demo the player feels like a vehicle or a man on very slippy shoes.
If I try to run up a hill and reach a point where maximum angle is exceeded the player stops which is fine. But immediatly it starts to slide down the hill which is unrealistic for a human being. It should just stop because we tend to hold the balance instead of running backwards if we encounter a hill to be too steep. (Atleast if it happened to you that you've fallen backwards doing so ... :) )
A similar effect is visible when you run on a ramp from one of the sides i.e. not running straight up a hill but approach it from one of the sides. You will slide down the hill until the acceleration from the gravity is taken by the friction. That means you will typically stop at a place where the terrain is flat. This is unrealistic as well. A human being would stop earlier as he actively breaks by using his balance or at least be able to control his run down from the hill in a certain range.

My hope is that I can simulate a bit of our equilibrium sense with a higher friction so that the player movements feel more natural. Currently it acts artificial like a dead object.
#5
07/12/2007 (2:22 pm)
Engine code is only $100 for Torque 1.4 or $150 for Torque 1.5. Check the product listings, read about them, and decide what you like best. The engine code is the only way you can experience higher friction than allowed.
#6
07/12/2007 (2:31 pm)
I'm not sure that engine code will help anything here.
the only physically meaningful range for a coefficient of friction is 0 to 1.
yeah - looking at the engine code, it seems to me that variable friction is only implemented for:
* dead players (debris)
* items
* projectiles
* rigid bodies
* vehicles
so even if you had the engine code you'd have to actually implement the entire feature, not just tweak the ranges.

at least, that's how it looks to me. someone else may have another take.
being able to control how much a person slides down a hill would definitely be nice.
#7
07/12/2007 (2:58 pm)
I have the engine code of 1.5 and currently work through the "3D programming all in one". My hope was it could be set somewhere using torque script but what you tell me sounds more like a resource. Gimme some time, maybe I can code something when I have a better overview - at the end of the book possibly.
Or maybe someone reads this who had the same problem and found a solution.
#8
08/03/2007 (12:52 pm)
Increasing the mass (and jumpforce) of the Player can really help with this.