(svn r21106) -Change: Tuned realistic acceleration to be a bit more realistic in order to make acceleration "slower", which highlights the differences between vehicle types more.

This commit is contained in:
michi_cc
2010-11-07 13:35:07 +00:00
parent 1ee62de0a3
commit 2d801c64a1
4 changed files with 40 additions and 33 deletions

View File

@@ -438,11 +438,12 @@ protected: // These functions should not be called outside acceleration code.
/**
* Gets the area used for calculating air drag.
* @return Area of the engine.
* @return Area of the engine in m^2.
*/
FORCEINLINE byte GetAirDragArea() const
{
return 120;
/* Air drag is higher in tunnels due to the limited cross-section. */
return (this->track == TRACK_BIT_WORMHOLE && this->vehstatus & VS_HIDDEN) ? 28 : 14;
}
/**
@@ -465,20 +466,24 @@ protected: // These functions should not be called outside acceleration code.
/**
* Calculates the current speed of this vehicle.
* @return Current speed in mph.
* @return Current speed in km/h-ish.
*/
FORCEINLINE uint16 GetCurrentSpeed() const
{
return this->cur_speed * 10 / 16;
return this->cur_speed;
}
/**
* Returns the rolling friction coefficient of this vehicle.
* @return Rolling friction coefficient in [1e-3].
* @return Rolling friction coefficient in [1e-4].
*/
FORCEINLINE uint32 GetRollingFriction() const
{
return 35;
/* Rolling friction for steel on steel is between 0.1% and 0.2%,
* but we use a higher value here to get better game-play results.
* The friction coefficient increases with speed in a way that
* it doubles at 512 km/h, triples at 1024 km/h and so on. */
return 30 * (512 + this->GetCurrentSpeed()) / 512;
}
/**
@@ -496,7 +501,7 @@ protected: // These functions should not be called outside acceleration code.
*/
FORCEINLINE uint32 GetSlopeSteepness() const
{
return 20 * _settings_game.vehicle.train_slope_steepness; // 1% slope * slope steepness
return _settings_game.vehicle.train_slope_steepness;
}
/**