Re: Calculation of acceleration
Reply #3 –
this code should calculate the number of tiles a convoi can drive on full-speed in one game month, to give you an impression about the involved scaling of quantities:
tiles_per_month = (kmh_to_speed(max_kmh) * ticks_per_tag) >> (8+12); // 12: fahre_basis, 8: 2^8 steps per tile
- kmh_to_speed - just a transformation: (((speed) << 10) / 80)
- max_kmh - max speed in kmh
- ticks_per_tag - ticks per month, configurable in *.tab, default 18
- << and >> are shift operations: a<<b = a * 2^b, a>>b = a/ 2^b
here is the most relevant part of the code for you:
/* deacceleration due to friction */
deccel = ( ( (akt_speed*weight)>>6 )*(akt_speed>>2) ) / 25 + (weight*64)
/* resulting acceleration */
accel = (sum_gear_und_leistung - deccel) / weight
- akt_speed ... current speed
- sum_gear_und_leistung ... sum over all vehicles in convoi of their gear multiplied by their power
- weight ... weight of the convoi
So I guess, ****uming no friction would give
min_number_of_tiles_til_top_speed = ( kmh_to_speed(max_kmh) )^2 / ( 2* (sum_gear_und_leistung/weight -64) *2^20 )
which would yield a lower bound on the needed tiles