summaryrefslogtreecommitdiff
path: root/src/roadveh.h
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2010-11-07 13:35:07 +0000
committermichi_cc <michi_cc@openttd.org>2010-11-07 13:35:07 +0000
commit2d801c64a1d8ce0cf3f4f106d77c47fea33bbd4d (patch)
tree45839f8afb161f979b4131255f3c132ade2b1f8f /src/roadveh.h
parent1ee62de0a338f07b2b843bedc00621f8bb1bfea3 (diff)
downloadopenttd-2d801c64a1d8ce0cf3f4f106d77c47fea33bbd4d.tar.xz
(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.
Diffstat (limited to 'src/roadveh.h')
-rw-r--r--src/roadveh.h20
1 files changed, 12 insertions, 8 deletions
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;
}
/**