i need trains.. lots of trains..
Moderator: OpenTTD Developers
i need trains.. lots of trains..
i changed the number of maximum vehicles to 4096 (obviously 2048 is not enough) and now with 2200 vehicles in game some trains are skipping orders (never know wich train).
for example train going from station A to D via B,C and back suddenly skips rest of its orders and is going back to station A without unloading at station D (they usually reach D station and drive straight trough) i think orders of the another train is affecting to orders of the skipping train. These problem trains are using shared orders, though it does not change the situation when i just copy them. Setting pathfinding to new / old does not affect. i'm not sure if some single train (using its own special orders) is doing this.
Has anyone else had this kind of problem before or am i just doing something wrong (except building too many trains)
edit: increasing order_array to 10000 did not solve this problem.
i started a new game (with edited version) and built couple of maglevs and they were skipping orders..
i also loaded the game with 2200 vehicles with non edited openttd and it works exactly the same... except i cant build more vehicles.
I think theres something in the order handling, it was not in "cmd skip orders".
edit2: i started a new game, with game modified only on factory starting production levels, and for a change the trains were skipping orders (maglev-trains), i havent seen a normal train skipping orders, so could it be maglev related?
things that i edited was:
- changed max vehicles to 4096 first, later 3072 and special vehicles to 1024 first, later 768.
- Doubled industry starting production rates (messed it a bit to make factories / sawmills produce valuables)
- Disabled decrease industry production, by making it as a comment.
for example train going from station A to D via B,C and back suddenly skips rest of its orders and is going back to station A without unloading at station D (they usually reach D station and drive straight trough) i think orders of the another train is affecting to orders of the skipping train. These problem trains are using shared orders, though it does not change the situation when i just copy them. Setting pathfinding to new / old does not affect. i'm not sure if some single train (using its own special orders) is doing this.
Has anyone else had this kind of problem before or am i just doing something wrong (except building too many trains)
edit: increasing order_array to 10000 did not solve this problem.
i started a new game (with edited version) and built couple of maglevs and they were skipping orders..
i also loaded the game with 2200 vehicles with non edited openttd and it works exactly the same... except i cant build more vehicles.
I think theres something in the order handling, it was not in "cmd skip orders".
edit2: i started a new game, with game modified only on factory starting production levels, and for a change the trains were skipping orders (maglev-trains), i havent seen a normal train skipping orders, so could it be maglev related?
things that i edited was:
- changed max vehicles to 4096 first, later 3072 and special vehicles to 1024 first, later 768.
- Doubled industry starting production rates (messed it a bit to make factories / sawmills produce valuables)
- Disabled decrease industry production, by making it as a comment.
- Attachments
-
- here is screenshot from the game, featuring two trains (with shared orders) wich just have skipped orders and are heading back to station A.
- ordersnotworking.png (128.55 KiB) Viewed 1247 times
-
- savegame.zip
- savegame. including about 2200 vehicles. meanin that it does not load with non-edited openTTD.
- (154.5 KiB) Downloaded 285 times
it wasnt me..
That's the reason why you can't build that many vehicles in any official release, not even in SVN. You are welcome to fix this issue though and we'll happily apply it to the current SVN. 

"There's a readme that comes with the source. I suggest you read it."
- Korenn
- Korenn
I am looking in to the problem, and as far as I can see, it has NOTHING to do with the changes you made. Even an unchanged 0.3.2.1 game has that effect.. it has to do with the nonstop TTDPatch option. If you had used checkpoints instead of the nonstop TTDPatch option it worked perfectly. Now you use normal stations and non-stop, it is kind of failing..
For your information: I increased the max vehicles to 4096 and started your game without the nonstop TTDPatch and it worked perfectly. I don't see why this can't be changed in SVN (max vehicles to 4096 or something). The only limit is created by the savegame, the << 14, which makes a max of 2^14, which is 16384. You can't increase the amount of vehicles above that number, without altering the savegame routine.
Just my two pennies..
(ps: looking into the problem of nonstop TTDPatch..)
For your information: I increased the max vehicles to 4096 and started your game without the nonstop TTDPatch and it worked perfectly. I don't see why this can't be changed in SVN (max vehicles to 4096 or something). The only limit is created by the savegame, the << 14, which makes a max of 2^14, which is 16384. You can't increase the amount of vehicles above that number, without altering the savegame routine.
Just my two pennies..
(ps: looking into the problem of nonstop TTDPatch..)
Okay, found and solved the problem. Why it happened randomly I don't know, possibly a glitch in the function calls (e.g. if VehicleEnter_Station() is called twice for one train before it moved, such glitches can happen..)
I don't know if this is the place to post some code, but here it goes.
In station_cmd.c, change in VehicleEnter_Station():
to
In train_cmd.c, change in ProcessTrainOrder():
to
This way the problem is gone. Maybe someone wants to optimalize is, or post it to SVN, see what you want to do with it, and good luck!
I don't know if this is the place to post some code, but here it goes.
In station_cmd.c, change in VehicleEnter_Station():
Code: Select all
if (_patches.new_nonstop && (v->next_order & OF_NON_STOP)) {
v->cur_order_index++;
} else if (v->next_order != OT_LEAVESTATION && v->last_station_visited != station_id) {
Code: Select all
if (_patches.new_nonstop && (v->next_order & OF_NON_STOP)) {
// A non-stop station with nonstop TTDPatch enabled should feel like a checkpoint.. so moved to train_cmd.c in ProcessTrainOrder().
// v->cur_order_index++;
} else if (v->next_order != OT_LEAVESTATION && v->last_station_visited != station_id) {
In train_cmd.c, change in ProcessTrainOrder():
Code: Select all
// check if we've reached the checkpoint?
if ((v->next_order & OT_MASK) == OT_GOTO_CHECKPOINT && v->tile == v->dest_tile) {
v->cur_order_index++;
}
// Get the current order
to
Code: Select all
// check if we've reached the checkpoint?
if ((v->next_order & OT_MASK) == OT_GOTO_CHECKPOINT && v->tile == v->dest_tile) {
v->cur_order_index++;
}
// check if we've reached a non-stop station while TTDPatch nonstop is enabled..
if (_patches.new_nonstop && v->subtype == 0 && (v->next_order & OF_NON_STOP) && v->next_order_param == _map2[v->tile]) {
v->cur_order_index++;
}
// Get the current order
This way the problem is gone. Maybe someone wants to optimalize is, or post it to SVN, see what you want to do with it, and good luck!
you can make this game to work. 
but what seems to be the problem?
edit:
you mean loading that savegame?
you need to alter the sourcecode for that and compile it.
theres these lines in vehicle.h in line number 344 and 345
NUM_NORMAL_VEHICLES = 2048,
NUM_SPECIAL_VEHICLES = 512,
change them to (for example):
NUM_NORMAL_VEHICLES = 4096,
NUM_SPECIAL_VEHICLES = 1024,
that should do it.

but what seems to be the problem?
edit:

you need to alter the sourcecode for that and compile it.
theres these lines in vehicle.h in line number 344 and 345
NUM_NORMAL_VEHICLES = 2048,
NUM_SPECIAL_VEHICLES = 512,
change them to (for example):
NUM_NORMAL_VEHICLES = 4096,
NUM_SPECIAL_VEHICLES = 1024,
that should do it.
it wasnt me..
-
- Engineer
- Posts: 36
- Joined: 15 Mar 2004 17:08
Or if you want to do it the easy way just dl a nightlybuilds... the savegame does load with it 
http://openttd.rulez.org/download/nightlybuilds/
BTW the savegame is simply impressive !

http://openttd.rulez.org/download/nightlybuilds/
BTW the savegame is simply impressive !
actually i managed to load that savegame too with non-edited version.. not sure if it works as it should (all vehicles loaded?), but at least there was no way to build more vehicles.
and you also have to change the lines TrueLight mentioned so the trains will work as they should.
maybe i can upload or email fixed .exe if somebody needs it.
and you also have to change the lines TrueLight mentioned so the trains will work as they should.
maybe i can upload or email fixed .exe if somebody needs it.
it wasnt me..
Who is online
Users browsing this forum: Ahrefs [Bot] and 15 guests