Adjusting Vehicle Speeds
Moderator: OpenTTD Developers
Adjusting Vehicle Speeds
OK so with TTDPatch i was able to use Rudge's TTDAlter to adjust most things about the game. Is there something similar to this for OTTD?
ta
ta
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
In easier words, DaleStan said that there are no programs that can edit vehicle stats in way similar to TTDAlter one. You can modify vehicles by creating NewGRF files that could alter or overwrite specs or modify directly the Source 

I ride the sky, I rule the night
Till I am free, with sword and sorcery.
The gods look down, hear battle sound.
I carry on, until the fight is won
Till I am free, with sword and sorcery.
The gods look down, hear battle sound.
I carry on, until the fight is won
-
- Transport Coordinator
- Posts: 283
- Joined: 08 May 2004 07:48
- Location: Alkmaar, The Netherlands
where can you change the code to do that? i found the place where i can alter the vehicle speed, but not where the curve/slope slow is located...Miranda wrote:I modified the source and Rebuilt it so trains are always max speed no matter if they come to a hill bridge depot or anything. I only did it to trains cus I dont care for busses etc, not sure if im allowed to post my game here though
Beer equals power
-
- Transport Coordinator
- Posts: 283
- Joined: 08 May 2004 07:48
- Location: Alkmaar, The Netherlands
I know that here is explained how to compile the source. If you have the source, and some knowledge of programming, it should be doable. However, I have no knowledge of it, and am proud to have found a way to adjust trainspeeds 

Beer equals power
- Campmaster
- Engineer
- Posts: 24
- Joined: 24 Feb 2005 11:59
I don't have a compiler at hands now but in train_cmd.c you can find the function UpdateTrainSpeed:Grolsch wrote:where can you change the code to do that? i found the place where i can alter the vehicle speed, but not where the curve/slope slow is located...Miranda wrote:I modified the source and Rebuilt it so trains are always max speed no matter if they come to a hill bridge depot or anything. I only did it to trains cus I dont care for busses etc, not sure if im allowed to post my game here though
Replace
Code: Select all
v->cur_speed = spd = clamp(v->cur_speed + ((int)spd >> 8), 0, tempmax);
Code: Select all
v->cur_speed = spd = tempmax;

As I have no compiler at hands I can't test if it actually will work but I'm quite sure of it. Personally I'd prefer to change some lines above the quoted one from "accel * 2" to "accel * 200" which means your trains will reach full speed 100 times faster which is almost like instant full speed but you can still see them accelerate if you watch them ingame. (I think instant full speed looks more unrealistic then the 100 times faster acceleration).
PS: Trainspeeds are located in table\engines.h
Look for "const RailVehicleInfo const RailVehicleInfo orig_rail_vehicle_info". The struct is well documented - you should be able to find the max-speed-column.
thanks
thats a relief.
Oh one more question;
At the bottom of this page, theres an example of an action 0 line for a train engine. The value given for the speed property is 'C0 00', this is supposed to represent 192, but i cant see how. The other bytes seem to follow some sort of conversion like str -> hex or whatever, but i cant see how that got that as a value. Kind of stuffs me up if i want to go about changing the speed and i dont even know what value i should be using

Oh one more question;
At the bottom of this page, theres an example of an action 0 line for a train engine. The value given for the speed property is 'C0 00', this is supposed to represent 192, but i cant see how. The other bytes seem to follow some sort of conversion like str -> hex or whatever, but i cant see how that got that as a value. Kind of stuffs me up if i want to go about changing the speed and i dont even know what value i should be using

The largest value that fits in the given width.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Power, weight, coef. of TE, and coef. of air drag.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
hmm, if the <Num-info> element is greater than 1, do i then go to list the vehicles in the <ID> element one after the other? i.e.
Or is it done like counting fron one to the next inside 2 given values. i.e
Where <Num-info> is 11, and there are 11 vehicles from 59 to 63.
Code: Select all
4 * 10 00 00 01 04 59 5A 5B 5C 16 00
Code: Select all
4 * 8 00 00 01 11 59 63 16 00
No. Only the first vehicle's ID. The other vehicles (if any) are the ones with the next sequential ID(s).Smit_h_y wrote:hmm, if the <Num-info> element is greater than 1, do i then go to list the vehicles in the <ID> element one after the other?
No, there aren't. There are 0B. There are 11 from 59 to 69.Smit_h_y wrote:there are 11 vehicles from 59 to 63.
Don't mix your bases.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Who is online
Users browsing this forum: No registered users and 6 guests