Changeset - r5277:2a38f35676d5
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2006-12-07 14:44:26
peter1138@openttd.org
(svn r7421) -Fix (r2475): Changed "kick off" acceleration resulted in only a small amount of power being applied whilst moving off and then double the power at 1 mph. This resulted in a perceived delay before trains moved. Fix this by applying the full power of the engine (or the kick off, whichever is greater). Essay over.
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -397,13 +397,15 @@ static int GetTrainAcceleration(Vehicle 
 
	} else {
 
		resistance = (area * (drag_coeff / 2) * speed * speed) / 10000;
 
	}
 
	resistance += incl;
 
	resistance *= 4; //[N]
 

	
 
	if (speed > 0) {
 
	/* Due to the mph to m/s conversion below, at speeds below 3 mph the force is
 
	 * actually double the train's power */
 
	if (speed > 2) {
 
		switch (v->u.rail.railtype) {
 
			case RAILTYPE_RAIL:
 
			case RAILTYPE_ELECTRIC:
 
			case RAILTYPE_MONO:
 
				force = power / speed; //[N]
 
				force *= 22;
 
@@ -413,13 +415,13 @@ static int GetTrainAcceleration(Vehicle 
 
			case RAILTYPE_MAGLEV:
 
				force = power / 25;
 
				break;
 
		}
 
	} else {
 
		//"kickoff" acceleration
 
		force = (mass * 8) + resistance;
 
		force = max(power, (mass * 8) + resistance);
 
	}
 

	
 
	if (force <= 0) force = 10000;
 

	
 
	if (v->u.rail.railtype != RAILTYPE_MAGLEV) force = min(force, mass * 10 * 200);
 

	
0 comments (0 inline, 0 general)