Skidding

FIXME : outdated article. 0.6 was released since then and brings radically different approaches to physics and friction.

The current (0.5) version of SuperTuxKart already supports skidding, but at this stage the friction parameters are not appropriately set to allow karts to really skid (except for the sand texture). To see skidding in action, run the race or beach track, drive on the sand, and turn the wheel/hit the brakes.

The friction used by the physics is computed as the product of the wheel's friction-slip and the friction of the terrain the kart is on, i.e. which *.rgb file the kart is on.

Contents

edit

Friction-slip

Friction-slip is (at the moment) defined in data/stk_config.data (';' starts a comment):

(config
;; STK parameters
;; --------------
;; ...
;; The following files are the defaults for karts
;; ----------------------------------------------
 (kart-defaults
;; ...
   (friction-slip      10000000    )
;;  ...
 )   ;; end kart-defaults
)

All karts will inherit this value (unless a kart model specifies a different value in its *.kart file, which is supported by STK but currently not used).

edit

Terrain specific friction

The terrain specific friction is specified in the data/materials.dat (for 0.4; in current SVN this file is either data/textures/materials.dat, or the materials.dat file for each track in data/tracks/TRACKNAME/materials.dat):

# TextureName              Clamp Trans Alpha Light SphMp Frict Ign Zip Rst Col
"chrome.rgb"                N N    N    0.0    N     Y    0.5   N   N   N   N
"chrome2.rgb"               N N    N    0.0    N     Y    0.5   N   N   N   N
"railing.rgb"               N Y    Y    0.5    Y     N    1.0   N   N   N   N
"wood.rgb"                  N N    N    0.0    Y     N    1.0   N   N   N   N
"concrete.rgb"              N N    N    0.0    Y     N    1.0   N   N   N   Y
"brick.rgb"                 N N    N    0.0    Y     N    1.0   N   N   N   Y
"stonewall.rgb"             N N    N    0.0    Y     N    1.0   N   N   N   N
"stones.rgb"                N N    N    0.0    Y     N    0.2   N   N   N   N
"pebbles.rgb"               N N    N    0.0    Y     N    1.0   N   N   N   N
"floor.rgb"                 N N    N    0.0    Y     N    1.0   N   N   N   N
"sand.rgb"                  N N    N    0.0    Y     N    0.0000001   N   N   N   N

The column marked 'Frict' contains the friction for a specific terrain. The default (e.g. for materials/textures that are not listed in the materials.dat file) is 1.0.

edit

Bringing it all together

The effective friction for the physics is computed by multiplying the friction-slip with the terrain specific friction, e.g.: if the kart is on 'stones.rgb', the friction is computed as 10000000*0.2=2000000.0. If the kart is on 'sand.rgb', the computed friction value is: 10000000*0.0000001=1.0 At this stage we have no experience with what range should be used for friction - the resulting value of 1.0 already gives a rather slippery feeling :) And a friction value of 2000000.0 basically gives no skidding at all.

edit

Skidding Goals

STK does not aim to give a realistic race experience. We'd suggest to distinguish between three or four different friction values:

While I currently put 'ice' in the 'extreme' skidding section, it might actually be better for game play to make 'ice' the same as 'sand', since otherwise some of the tracks (snowtuxpeak) might be too difficult and/or too boring to drive. Depending on how the feel of skidding is, we might end up using only three different values (i.e. products of friction-slip with terrain friction), or perhaps more.

--Hiker 21:25, 24 March 2008 (PDT)

Retrieved from "http://supertuxkart.sourceforge.net/Skidding"

User Tools