Smoother realistic_acceleration
Moderator: OpenTTD Developers
Smoother realistic_acceleration
Well - since quite many Integrated nightly users and nightly users complained over the "kick-start" "feature" of realistic acceleration, introduced in the latest nightlies, I have created a patch, that omits the "kick-start" for trains and while I was at it, I also corrected the train behaviour on the stations and partly in depots.
The last two things can yet be improved, but looking at the time passage in O/TTD, the current behaviour is quite correct, in my opinion.
Here's the diff/patch (for source r2946+):
The last two things can yet be improved, but looking at the time passage in O/TTD, the current behaviour is quite correct, in my opinion.
Here's the diff/patch (for source r2946+):
- Attachments
-
- real_acceleration_sz_1-1_r2946.patch
- kick the kick-start :)
- (1.39 KiB) Downloaded 677 times
Last edited by SirkoZ on 08 Apr 2006 19:34, edited 1 time in total.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
1.2:
- Attachments
-
- real_acceleration_sz_1-2_r2967.patch
- diff r2967+
- (1.28 KiB) Downloaded 676 times
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
what's the speed for entering depots?
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly

I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
The minimal is 61, like before, but you can suggest a different one. 

NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
- webfreakz.nl
- Director
- Posts: 627
- Joined: 11 Aug 2005 08:22
- Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
- Contact:
the maximum speed of the trainSirkoZ wrote:The minimal is 61, like before, but you can suggest a different one.

but in the patch, if i change this:
Code: Select all
if (_curve_neighbours90[dir][0] == ndir ||
_curve_neighbours90[dir][1] == ndir) {
- max_speed = 61;
Code: Select all
if (_curve_neighbours90[dir][0] == ndir ||
_curve_neighbours90[dir][1] == ndir) {
- max_speed = 120;
i'll compile it.....

# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)

Well - you can try - it's opensource.

NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
- webfreakz.nl
- Director
- Posts: 627
- Joined: 11 Aug 2005 08:22
- Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
- Contact:
and:--------------------Configuration: openttd - Win32 Release--------------------
Compiling...
train_cmd.c
Linking...
openttd.exe - 0 error(s), 0 warning(s)
Code: Select all
max_speed = 164 + (v->cur_speed >> 2);

let's see the effect....
hmm i guess i've to change more pieces of code than this one

when the train enters the depot, the speed drops to about 61/64 and than increases back to 164.
so it goes like: 643km/h --> 64 km/h --> 164 km/h
very strange to see

# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
-
- Route Supervisor
- Posts: 389
- Joined: 04 Feb 2004 23:24
- Contact:

Well - for faster compiling/testing, change to "Debug" in "Configuration Manager" and only use "Release" for final compile (debug versions run ~1/2 slower in "Fast Forward" mode).
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
I think we are all aware of that.}T{Reme [Q_G] wrote:As soon as the train exits the depot... its travelling at near zero speed... that expression pretty much reads max_speed = 164 + (0 / 4)

NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
- webfreakz.nl
- Director
- Posts: 627
- Joined: 11 Aug 2005 08:22
- Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
- Contact:
x >> 2 = x/ 2^2 = x/4 (x >> 3 = x/8...),
reverse: x << 2 = x * 2^2 = x * 4 (x << 4 = x * 16...).
In any case - it's only 0 the first four km/h, so please don't make a big deal out of it.
reverse: x << 2 = x * 2^2 = x * 4 (x << 4 = x * 16...).
In any case - it's only 0 the first four km/h, so please don't make a big deal out of it.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
- webfreakz.nl
- Director
- Posts: 627
- Joined: 11 Aug 2005 08:22
- Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
- Contact:
It's not real division, it's only bit shifting, so there's no problem if the x = 0. It's equal to mul./div. with powers of 2.
And if it's 0, it's still 64+0 according to upper equation.
Look it up in Google, bit+shift.
And if it's 0, it's still 64+0 according to upper equation.
Look it up in Google, bit+shift.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
- webfreakz.nl
- Director
- Posts: 627
- Joined: 11 Aug 2005 08:22
- Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
- Contact:
Ik denk dat ik maar naar de bieb ga en een handbook "C voor dummies" ga halen ofzoYoeri wrote:SirkoZ wrote:x >> 2 = x/ 2^2 = x/4 (x >> 3 = x/8...),
reverse: x << 2 = x * 2^2 = x * 4 (x << 4 = x * 16...).
In any case - it's only 0 the first four km/h, so please don't make a big deal out of it.
would be great to be able to do such thing. does anyone knows a good C tutorial?

translation:
I think I should better go to the library and get a "C for dummies" handbook

I now how to script in PHP/MySQL but C is kinda different.....
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
For C tutorials/handbooks search your local library/internet. 
Well - from what I've heard, C and PHP are quite similar.....in a way - so - who knows C has no problems learning PHP. I don't know about reverse.
BTW - you can also learn quite a lot from the source itself.

Well - from what I've heard, C and PHP are quite similar.....in a way - so - who knows C has no problems learning PHP. I don't know about reverse.

BTW - you can also learn quite a lot from the source itself.

NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
-
- Route Supervisor
- Posts: 389
- Joined: 04 Feb 2004 23:24
- Contact:
Pretty much all you can type in PHP, can be typed in C/C++ too.. that includes bit shifting. (Altho it depends on the internal structure of the Zend engine if this actually happends). Syntax is pretty much the same indeed. Many known C functions behave the same in PHP as they do in C (printf, fopen etc)
Siggy not gonna work unless someone allows javascripting...
- webfreakz.nl
- Director
- Posts: 627
- Joined: 11 Aug 2005 08:22
- Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
- Contact:
Well, C(++) uses that much of declarations:
static void
void
public void
public constant
enum
typedef void
:S
In PHP4 it's just like:
function
class
and that's it:P
Last year at school we had to program Java for our 'computer classes' (don't know what it should be) and had to draw pictures with Java. So we had to call a little class which would perform the actions:
forward(100);
left(90);
forward(100);
left(90);
forward(100);
left(90);
forward(100);
and guess what I drew right here!

static void
void
public void
public constant
enum
typedef void
:S
In PHP4 it's just like:
function
class
and that's it:P
Last year at school we had to program Java for our 'computer classes' (don't know what it should be) and had to draw pictures with Java. So we had to call a little class which would perform the actions:
forward(100);
left(90);
forward(100);
left(90);
forward(100);
left(90);
forward(100);
and guess what I drew right here!

# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
Staircase or a jaggied line? 
In any case - the source pretty much speaks for itself, you just have to listen.

In any case - the source pretty much speaks for itself, you just have to listen.

NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Who is online
Users browsing this forum: No registered users and 2 guests