diff --git a/src/train.h b/src/train.h --- a/src/train.h +++ b/src/train.h @@ -438,11 +438,12 @@ protected: // These functions should not /** * 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 /** * 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 */ FORCEINLINE uint32 GetSlopeSteepness() const { - return 20 * _settings_game.vehicle.train_slope_steepness; // 1% slope * slope steepness + return _settings_game.vehicle.train_slope_steepness; } /**