From 2d801c64a1d8ce0cf3f4f106d77c47fea33bbd4d Mon Sep 17 00:00:00 2001 From: michi_cc Date: Sun, 7 Nov 2010 13:35:07 +0000 Subject: (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. --- src/roadveh.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/roadveh.h') diff --git a/src/roadveh.h b/src/roadveh.h index 96a86bafa..faaadab35 100644 --- a/src/roadveh.h +++ b/src/roadveh.h @@ -217,11 +217,11 @@ 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 60; + return 6; } /** @@ -244,21 +244,25 @@ 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 / 32; + return this->cur_speed / 2; } /** * 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 { - /* Trams have a slightly greater friction coefficient than trains. The rest of road vehicles have bigger values. */ - return (this->roadtype == ROADTYPE_TRAM) ? 50 : 75; + /* Trams have a slightly greater friction coefficient than trains. + * The rest of road vehicles have bigger values. */ + uint32 coeff = (this->roadtype == ROADTYPE_TRAM) ? 40 : 75; + /* The friction coefficient increases with speed in a way that + * it doubles at 128 km/h, triples at 256 km/h and so on. */ + return coeff * (128 + this->GetCurrentSpeed()) / 128; } /** @@ -276,7 +280,7 @@ protected: // These functions should not be called outside acceleration code. */ FORCEINLINE uint32 GetSlopeSteepness() const { - return 20 * _settings_game.vehicle.roadveh_slope_steepness; // 1% slope * slope steepness + return _settings_game.vehicle.roadveh_slope_steepness; } /** -- cgit v1.2.3-54-g00ecf