Author Topic: Long Convoy Patch  (Read 5918 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH

Long Convoy Patch
« on: April 28, 2017, 09:20:35 AM »
This patch is originally made by @Lus1531 ‏ and I introduce this on this forum with his permission.
This extends the limit of convoy length from 4 (cars) or 24 (trains) to 8 (cars) or 64 (trains).
Now we can enjoy American style very long freight trains ;)

Offline Leartin

Re: Long Convoy Patch
« Reply #1 on: April 28, 2017, 12:49:54 PM »
Are there any negative side effects?

I like it, especially the change for cars. The four-car-limit only considered trucks, not motorcades. Now I only have to pixel a capitol to produce presidents every four years, which can be transported in an 8-car-convoy to the white house...

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Long Convoy Patch
« Reply #2 on: April 28, 2017, 12:58:07 PM »
Is there anywhere in the world a 8 car freight road train? Australia never uses more than three trailers, and I though this was the pratical limit (due to overtaking and curves etc.).

And the only negative side effect is the missing scroll bar in the depot window for the extra cars.

Offline THLeaderH

Re: Long Convoy Patch
« Reply #3 on: April 28, 2017, 02:07:24 PM »
Quote
And the only negative side effect is the missing scroll bar in the depot window for the extra cars.
Please run this patch and you'll find the scroll bar for the extra cars!

Offline Leartin

Re: Long Convoy Patch
« Reply #4 on: April 28, 2017, 02:21:32 PM »
Is there anywhere in the world a 8 car freight road train? Australia never uses more than three trailers, and I though this was the pratical limit (due to overtaking and curves etc.).

No, but there are convoys longer than 4 cars, nobody said they need to be connected. p192c already uses something like that - you cannot use a bus to transport prisoners by itself, it always requires a normal police car in front as protection. This could be expanded for hazardous materials. Say, you have a nuclear power plant and deliver uranium or something to it. It would make sense to have the truck that actually carrys the stuff be accompanied by some containment unit, just in case. However, if you had two trucks transporting uranium, one containment unit might still be enough. And of course, virtually every special transportation has a pilot car.
Sure, these monsters would rarely be overtaken and cause traffic issues - but that's what they do in real life too, don't they?

Offline DrSuperGood

Re: Long Convoy Patch
« Reply #5 on: April 28, 2017, 02:52:38 PM »
So instead of having 12 km long stations we will need 24 long stations... I think the 24 unit length limit on trains was there for practical reasons, not so much that it was technically challenging to extend.

Experimental (extended) changed theirs ages ago however this resulted in the stupid situation on the server where players were running 60 tile long trains across the map, limited only by the limits experimental used. If this makes it into standard I will just be running 24 tile long subways with 24 tile long feeder trains instead of 12 tile long, the definition of inflation.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #6 on: April 28, 2017, 03:26:52 PM »
I find this just weirds up the scale in Simutrans even more. Train stations easily dwarf industries and even some towns as it is. But each player sees Simutrans differently.

No, but there are convoys longer than 4 cars, nobody said they need to be connected.

That is the unfortunate side effect of a bad name in Simutrans. Simutrans "convoys" are meant to be connected vehicles, not literal convoys. We just haven't found a good (and short) name to describe that concept across road, rail, water and air transportation.

Offline Leartin

Re: Long Convoy Patch
« Reply #7 on: April 28, 2017, 03:44:39 PM »
That is the unfortunate side effect of a bad name in Simutrans. Simutrans "convoys" are meant to be connected vehicles, not literal convoys. We just haven't found a good (and short) name to describe that concept across road, rail, water and air transportation.
Is that so? How so? I mean, if I wanted you to implement actual convoys as unconnected vehicles, how would you do it, and how would it be different in gameplay from what we already have? Because all I can see is the same as we have now, but without shared power. But power only really matters with trains, since for cars, the really barrier is the max_speed per vehicle - which would still apply.

Offline pumuckl999

Re: Long Convoy Patch
« Reply #8 on: April 28, 2017, 04:26:11 PM »
Not only cars using the depot....;)

http://www.reitsportnews.at/de/archiv/3694-reitsportnews--pferdesport--reitsport--weltweit--1-klick-weltrekord-im-oman-linnicher-trainierte-koenigliche-prunkkutsche-mit-40-araber-pferde

More possibilities are never bad.

Create for fun a 200m carnival procession for example... If it placed in the tram menu, the trucks and busses can override the procession. But we don´t play GTA.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #9 on: April 28, 2017, 06:13:43 PM »
Is that so? How so?

pak64 displays everything the game was meant to do, because Simutrans and pak64 was once a single thing. A feature would not originally have been implemented unless it could be used. convoi_t was used to combine the individual vehicles that make up a train, and also to represent truck and trailed for road vehicles. Whether tugboats was part of the initial design is unknown to me, but in any case, boats and airplanes would also be use convoi_t to simplify programming.

I mean, if I wanted you to implement actual convoys as unconnected vehicles, how would you do it

I wouldn't, because it is not part of the gameplay. Vehicles are also effectively tokens, not realistic depictions of actual traffic because: 1) a bus would not take a whole day to do complete a circuit around a few city blocks 2) trains are unrealistically short. If trains had a realistic number of cars, they would have spanned half the map, at least with the map sizes when Simutrans was made. Not to mention how many times you could have them loop around themselves.

Note the first paragraph of my previous post. In particular the last sentence. I would like to see long trains snake their way through the landscape, but then everything would have to scale up with it. Maps would have to be tens of thousands of tiles along both sides. Big cities would need to have millions of buildings, when maps probably don't have a million buildings in total now. Gradients should be realistic, as should turns. They should be smooth, not these jagged steps we have now. Anything in between this and the simplistic, symbolic landscape we have now would be an ugly uncanny valley for me.

Offline Leartin

Re: Long Convoy Patch
« Reply #10 on: April 28, 2017, 08:24:24 PM »
pak64 displays everything the game was meant to do, because Simutrans and pak64 was once a single thing. A feature would not originally have been implemented unless it could be used. convoi_t was used to combine the individual vehicles that make up a train, and also to represent truck and trailed for road vehicles. Whether tugboats was part of the initial design is unknown to me, but in any case, boats and airplanes would also be use convoi_t to simplify programming.

In pak64, take a look at the materials wholesale factory. You'll see that the factory uses frontimage to display a vehicle over a static background. Was that what frontimage was designed to do? Clearly not - afaik frontimages are way older than animation, which would give us a first clue. They also only work on ground level of a building, which makes thems rather awkward to use in some cases. So there is something displayed in pak64 which the game was not even meant to do, but - as a happy little accident - works anyway. So pak 64 displays something the game was not even meant to do.
The game allows for non-rectangular buildings. Might be it was an accidental functionality at first, but at least with map rotations it was intentionally designed to work again, even if 0.0 is not occupied. I have not seen such buildings in pak 64. So pak64 does not display something the game was meant to do.
Add these two, and your first arguement becomes invalid. Plus, it really doesn't matter if something was 'intended' or not, as long as it works.

I wouldn't, because it is not part of the gameplay. Vehicles are also effectively tokens, not realistic depictions of actual traffic because: 1) a bus would not take a whole day to do complete a circuit around a few city blocks 2) trains are unrealistically short. If trains had a realistic number of cars, they would have spanned half the map, at least with the map sizes when Simutrans was made. Not to mention how many times you could have them loop around themselves.

But don't you see an issue here? I want to have convoys. There is something called convoys in the game, and it allows me to get what I want reasonably well. But you come along and take my toy away, saying that's not how to use it, but don't give me an alternative. I really don't care why you don't want convoys in the game, composing them adds as much gameplay as composing trains, and they are not less realistic as far as tokens go than trains are. So yeah, I say convoys are exactly what you would use if you want to have convoys, just like frontimages are what you use for animations, intended or not.

Note the first paragraph of my previous post. In particular the last sentence. I would like to see long trains snake their way through the landscape, but then everything would have to scale up with it. Maps would have to be tens of thousands of tiles along both sides. Big cities would need to have millions of buildings, when maps probably don't have a million buildings in total now. Gradients should be realistic, as should turns. They should be smooth, not these jagged steps we have now. Anything in between this and the simplistic, symbolic landscape we have now would be an ugly uncanny valley for me.

For you. I'm fine with that, really, but don't try to impose that view on others. This whole Simutrans-Scale-Business is completely subjective, and also different from pakset to pakset. I'm pretty sure cities of the same number of tiles and inhabitants can look like big cities or small countryside villages, all depending on which pakset you use. And there are people who make a giant map of one city while others play a map of all of europe, everyone has preferences, and by raising a limit nothing is lost.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #11 on: April 28, 2017, 08:31:55 PM »
I did not try to impose my views on others any more than you or anyone else did. For the most part, I was trying to explain the misuse of the word convoy in Simutrans.

Offline Sarlock

Re: Long Convoy Patch
« Reply #12 on: April 28, 2017, 09:08:07 PM »
Wonderful!  Having long trains snake through the landscape is a wonderful thing... that's what real trains are to the North American child in me, not these short passenger things ;)  Though, is 64 long enough?  Most freight trains around here are 100+ cars long.  There's that whole scale vs. reality thing again.

Is this something that could/should be set within the settings so that it can be controlled by the user/pakset/online game admin?
Current projects: Pak128 Trees, blender graphics

Offline Junna

Re: Long Convoy Patch
« Reply #13 on: April 28, 2017, 09:49:11 PM »
Experimental (extended) changed theirs ages ago however this resulted in the stupid situation on the server where players were running 60 tile long trains across the map, limited only by the limits experimental used. If this makes it into standard I will just be running 24 tile long subways with 24 tile long feeder trains instead of 12 tile long, the definition of inflation.

What's stupid about it-- nonsense. Anyway, the ex limit is still there. Not sure what it is but it's like 64 or 70 vehicles (depending on the length of vehicles, like 30 tiles). You're just being silly here.

Offline THLeaderH

Re: Long Convoy Patch
« Reply #14 on: April 29, 2017, 01:16:43 AM »
Some of you insists that the current restriction of convoy's length should be kept mainly because the scaling issue. However, I have to tell you the fact that some Japanese players love very long trains with this patch and that they strongly desire the integration to the standard. Thus, the limit of convoy's length has to be set in simuconf.tab. The current restriction are imposed as the default setting but advanced players can change this and enjoy very long trains. This enables JUST extending the possibility of simutrans!

Offline Yona-TYT

Re: Long Convoy Patch
« Reply #15 on: April 29, 2017, 02:02:50 AM »

I think someone already mentioned it, but I think it would be good to implement an automatic restriction depending on the size of the map, to prevent the scale from lose sense in small maps.

Offline sheldon_cooper

Re: Long Convoy Patch
« Reply #16 on: April 29, 2017, 02:21:04 AM »
I think it's interesting, I'm doing trailers to dock, the limit is three (the truck and three more trailers) plus this patch will stay opsional, help with transportation, transporting more products, and live up to the Simutrans name. :D
Is there anywhere in the world a 8 car freight road train? Australia never uses more than three trailers, and I though this was the pratical limit (due to overtaking and curves etc.).

And the only negative side effect is the missing scroll bar in the depot window for the extra cars.

The maximum I know four, and is usually tank and only walks on highways to avoid complications in the cities... :)
« Last Edit: April 29, 2017, 02:38:51 AM by sheldon_cooper »

Offline Vladki

Re: Long Convoy Patch
« Reply #17 on: April 29, 2017, 08:44:35 AM »
I also welcome this patch. Some pak authors of pak.128.cs worked around this limit by putting waggon twins in pakset. So if this patch is accepted, these duplicates could be removed and depots would less cluttered.




Offline Isaac.Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3440
  • Total likes: 331
  • Helpful: 91
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Long Convoy Patch
« Reply #18 on: April 29, 2017, 12:34:28 PM »
Well...


About one minute in, the "Centipede" with 6 trailers:

I remember seeing a documentary from at least a decade ago (possibly from the 90s) where some company was actually using something like 12-14 trailers. I remember - there were two of them, because the documentary made a big deal about catching footage of them passing (going opposite directions). I think they were mining trailers, but they might have been fluids. I'm nearly certain they were white and green. They were also not full-length trailers - but still, it was something like 10-12-14. I don't remember the precise number.

Offline gauthier

Re: Long Convoy Patch
« Reply #19 on: April 30, 2017, 07:43:49 AM »
This patch is great for some articulated trains which have small vehicles, like the Z50000 addon for pak128. Then, it's up to the player to play Simutrans as he likes, with or without long convoys. As long as it does not break balancing of the game and ends up to an exploit, removing a limit like this is nice. Thanks !

Offline Junna

Re: Long Convoy Patch
« Reply #20 on: April 30, 2017, 09:02:58 AM »
I think someone already mentioned it, but I think it would be good to implement an automatic restriction depending on the size of the map, to prevent the scale from lose sense in small maps.

Why? If you don't want to use it, you don't need to. If you think it looks awful, then you also don't need use the feature.

The length in Extended needs to be increased to at least 100 vehicles.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2594
  • Total likes: 290
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: Long Convoy Patch
« Reply #21 on: April 30, 2017, 03:37:49 PM »
Why not just let the limit be a uint8 (up to 255), with default to current settings, but if the pakset or the user wish to change it this can be done with parameters in simuconf.tab?

(...) the limit of convoy's length has to be set in simuconf.tab. The current restriction are imposed as the default setting but advanced players can change this and enjoy very long trains.

Offline Yona-TYT

Re: Long Convoy Patch
« Reply #22 on: April 30, 2017, 05:22:52 PM »
Why? If you don't want to use it, you don't need to. If you think it looks awful, then you also don't need use the feature.

The length in Extended needs to be increased to at least 100 vehicles.

Why not just let the limit be a uint8 (up to 255), with default to current settings, but if the pakset or the user wish to change it this can be done with parameters in simuconf.tab?


Many novice players (including me) do not know or just do not like to configure parameters in a file, that's why I like the idea of an automatic configuration (depending on the size of the map), this could be the default value.  8)



Well...


About one minute in, the "Centipede" with 6 trailers:

I remember seeing a documentary from at least a decade ago (possibly from the 90s) where some company was actually using something like 12-14 trailers. I remember - there were two of them, because the documentary made a big deal about catching footage of them passing (going opposite directions). I think they were mining trailers, but they might have been fluids. I'm nearly certain they were white and green. They were also not full-length trailers - but still, it was something like 10-12-14. I don't remember the precise number.

It is obvious that these trucks can not pass through a curba, in case of some future implementation, it is necessary to restrict the passage of vehicles (more than three trailers) in the curbs.  :P

 

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #23 on: April 30, 2017, 08:23:10 PM »
In the end, the only objective argument for or against this is whether or not the length limits for consists is increased, is whether or not this affects the performance of the game in a particular way. And perhaps whether or not it can be exploited for creating grief in multiplayer games, but have no experience with multiplayer games.

Many novice players (including me) do not know or just do not like to configure parameters in a file, that's why I like the idea of an automatic configuration (depending on the size of the map), this could be the default value.

Would that really be intuitive to the player? Would they understand the correlation? And if economics is taken into consideration, one might suddenly find that trains can't be profitable at all, since they can't be built as long as the pak set author intends.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Long Convoy Patch
« Reply #24 on: May 01, 2017, 02:28:42 AM »
I do not think that allowing more trailers is such a big issue. pak64 did not allow any extra trailer (I hope), and thus the issue ill not arise. Programmatically, very long road convoys will mess up traffic lights and also the (old) overtaking code did not really check for convoy length.

Apart from that it is really up to the user.

(BTW: Animations (old coal mine) are as old as foreground images (passenger station), since the first version releae (0.78) or so had both of them. Not that I was in charge of it, and neither they were called like this, since they had a completely different packing system.)

Offline THLeaderH

Re: Long Convoy Patch
« Reply #25 on: May 03, 2017, 08:37:51 AM »
Now you can set the length limit of convoi in simuconf.tab! Write parameters in simuconf.tab like
Code: [Select]
max_rail_convoi_length = 128
max_road_convoi_length = 32
max_ship_convoi_length = 32
max_air_convoi_length = 32
and you can enjoy very long trains. These parameters are stored as uint16, so the limit of the parameters are 65535. If these parameters are not written, the default values are applied, which are
  • max_rail_convoi_length = 24
  • max_road_convoi_length = 4
  • max_ship_convoi_length = 4
  • max_air_convoi_length = 1

I don't know what happens on multiple air vehicles but it's all up to players. I set a limitation for beginners and give a possibility to advanced players. Also, overtaking would not work correctly on super long road trains, but that should be discussed as another topic, since IT'S ALL UP TO PLAYERS whether they change the length limitation of convoy. At least, this patch does not make any memory errors.

Offline Leartin

Re: Long Convoy Patch
« Reply #26 on: May 03, 2017, 09:01:18 AM »
Must be really strong coupling to carry 60.000 wagons  :o

Would it be possible to define seperate lengths for different types of track, such that narrowgauge, monorail and maglev could be longer or shorter than normal track?

Offline Flemmbrav

Re: Long Convoy Patch
« Reply #27 on: May 03, 2017, 02:00:30 PM »
You can just put locos in between, don't worry :P

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #28 on: May 03, 2017, 03:46:24 PM »
You can just put locos in between, don't worry :P

But you don't have to, so the super strong couplings must exists whether you need them or not. (Furthermore, most locomotives in pak64 don't allow a vehicle before them, and most of those that do can only have the same kind of locomotive in front, but now I'm perhaps getting too serious.)

Offline THLeaderH

Re: Long Convoy Patch
« Reply #29 on: May 04, 2017, 01:47:26 PM »
So I'm waiting for the code review...

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2594
  • Total likes: 290
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: Long Convoy Patch
« Reply #30 on: May 05, 2017, 01:37:03 AM »
I would lower to uint8 as it's already almost impossible to exist a 200 vehicles long trains. Maximum I've seen in real life was ~190. And it's just absurd for the other transports. And 255 vehicles in a convoy is already asking for troubles, more it's almost suicidal. Tests are needed to see if bugs would not blow the game.

There's some dirt in the patch that needs to be removed before commit:
Code: [Select]
line_selector.set_max_size(scr_size(DEPOT_FRAME_WIDTH - D_MARGIN_RIGHT - D_MARGIN_LEFT - selector_x, LINESPACE * 13 + 2 + 16));
 
  /*
- * [CONVOI]
- */
+ * [CONVOI]
+ */
  convoi.set_grid(scr_coord(grid.x - grid_dx, grid.y));
  convoi.set_placement(scr_coord(placement.x - placement_dx, placement.y));

Offline THLeaderH

Re: Long Convoy Patch
« Reply #31 on: May 13, 2017, 01:02:45 PM »
Quote
There's some dirt in the patch that needs to be removed before commit:
Thank you. These dirt should be removed before commit.

Quote
I would lower to uint8 as it's already almost impossible to exist a 200 vehicles long trains. Maximum I've seen in real life was ~190. And it's just absurd for the other transports. And 255 vehicles in a convoy is already asking for troubles, more it's almost suicidal. Tests are needed to see if bugs would not blow the game.
Some players would make the super long convoy with the vehicles whose length is very short. In this case, the number of vehicles in a convoy can exceed uint8's maximum. But I'd like to lower the limit of length to uint8 because we're not sure whether it brings us to a fatal result.

So this patch needs
  • removing the dirt.
  • lowering the length limit of convoy to uint8.
but these are easy to fix and I'll be very glad when the great dev team commits this patch with these fixing.

Is there anything to be solved?

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16089
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Long Convoy Patch
« Reply #32 on: May 13, 2017, 03:31:12 PM »
Experimental (extended) changed theirs ages ago however this resulted in the stupid situation on the server where players were running 60 tile long trains across the map, limited only by the limits experimental used. If this makes it into standard I will just be running 24 tile long subways with 24 tile long feeder trains instead of 12 tile long, the definition of inflation.

The limit to the sensible length of trains in Extended are economic, just as in reality. An arbitrary limit imposed because the economic limits are not simulated properly is not good game design.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #33 on: May 13, 2017, 03:53:12 PM »
Real train lengths are limited by the amount of cargo per time slot (you need enough to cover the cost of the locomotive, fuel and crew, but you can't wait forever), and the length of passing loops where applicable. However, time has little meaning in Simutrans (you can wait forever, at least until fixed cost is introduced), and extending passing loops require virtually no effort. The limits to train lengths in Simutrans are therefore unrealistic, whether put in by the developers or the pak makers. Because ultimately, there must be some limit, since computers don't handle infinity well.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16089
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Long Convoy Patch
« Reply #34 on: May 13, 2017, 03:58:55 PM »
Real train lengths are limited by the amount of cargo per time slot (you need enough to cover the cost of the locomotive, fuel and crew, but you can't wait forever), and the length of passing loops where applicable. However, time has little meaning in Simutrans (you can wait forever, at least until fixed cost is introduced), and extending passing loops require virtually no effort. The limits to train lengths in Simutrans are therefore unrealistic, whether put in by the developers or the pak makers. Because ultimately, there must be some limit, since computers don't handle infinity well.

The code limits should generally be beyond the economic limits so that the practical limitations faced by players are the economic limits: Standard is different, of course, but Extended has a fixed costs feature (has this not been implemented in Standard?) and goods will take the quickest route to their destination, meaning that players with a low frequency service might find themselves out competed by players with a higher frequency service. Introducing maximum journey times for some sorts of goods (in place of the speed bonus) is also under consideration in Extended.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #35 on: May 13, 2017, 05:55:07 PM »
The code limits should generally be beyond the economic limits so that the practical limitations faced by players are the economic limits

The question is how high that would be. A developer has to make a trade-off between computer resources and capability. 640K memory limits and 260 character path limits have gotten lot of hate, but if MS-DOS had been written with higher limits back in its youth, it might have been so bloated that the IBM PC segment never made its breakthrough. And originally, these limits were considered well padded.

I'll leave it to those with experience profiling Simutrans to decide whether Simutrans can bear the burden of having trains with 28-1, 216-1 or 232-1 vehicles.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16089
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Long Convoy Patch
« Reply #36 on: May 13, 2017, 07:10:41 PM »
The expanded limits in Extended have not caused any noticeable performance issues: the length of convoys has by itself very little impact on performance.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline DrSuperGood

Re: Long Convoy Patch
« Reply #37 on: May 13, 2017, 08:36:11 PM »
Quote
the length of convoys has by itself very little impact on performance.
That is a bold claim to make. I would imagine them having potentially some performance impact as a result of caching once the data for a single convoy exceeds a certain volume.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16089
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Long Convoy Patch
« Reply #38 on: May 13, 2017, 09:52:47 PM »
There is a difference between no impact at all and no significant impact.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline THLeaderH

Re: Long Convoy Patch
« Reply #39 on: May 14, 2017, 12:45:16 PM »
In a convoy, Each vehicles are held as pointers. Only small size of memory is allocated when convoy is created, and the size of array expands only when additional memory is required. Therefore, expanding the limit itself does not affect the performance.
If you want to insist that this patch should cause any severe performance issue, please test and prove it by yourself.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Long Convoy Patch
« Reply #40 on: May 14, 2017, 01:42:03 PM »
The only negative impact (on CPU load) very long convoys would make are due to the length of the convoys itself, i.e. by bloxking signals and crossings for long amount of times. Since a convoy at a crossing needs to check often quite some track ahead each time, this could slightly increase CPU load. On the other hand, the amount of cargo and passengers is limited by the map. Hence running fewer longer convois would actually generate less CPU load for route finding and so one.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #41 on: May 14, 2017, 03:06:09 PM »
The only negative impact (on CPU load) very long convoys would make are due to the length of the convoys itself

In that case, those who do not play with long trains, will not suffer from the ability to do so. (Unless the pak set author is in on it, and starts enforcing long trains through balancing.)

Offline THLeaderH

Re: Long Convoy Patch
« Reply #42 on: May 14, 2017, 11:27:25 PM »
In that case, those who do not play with long trains, will not suffer from the ability to do so. (Unless the pak set author is in on it, and starts enforcing long trains through balancing.)
That's absolutely true  :)

Offline River

Re: Long Convoy Patch
« Reply #43 on: May 19, 2017, 02:14:01 PM »
I think longer car convoys are an intrestring option. But i would like to see a penalty for using them just any where. options like fixed monthly cost or extra toll when going through cities, slow down with many turns(i donno if this already exists with cars)? this will not make them the default way to go and have some diversity in what vehicles you use.

For the record there is a legal limit of 1 trailer in the Netherlands. having a hard limit could be seen as a law :)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #44 on: May 19, 2017, 03:25:03 PM »
For the record there is a legal limit of 1 trailer in the Netherlands. having a hard limit could be seen as a law :)

I was almost certain that there was some EU law dictating otherwise, since I've seen trucks with two trailers recently in Norway. And I'm not sure whether articulated buses legally count as one or more vehicles, but they certainly would in Simutrans. And people aren't necessarily writing about trailers either, but actual convoys (not Simutrans convois), which sort of unjustifies any strict legal or technical limitations.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Long Convoy Patch
« Reply #45 on: May 22, 2017, 12:28:26 AM »
The legal limit are usually rather length and number of axis. Hence a short two axis generator may be added to a trailer truck. Otherwise, (in Germany) there are still law from the time, when there were longer convoys using a (steam) tractor to tow like a house, and several trailes. Even now one can see farm tractors pulling two wagons frequently. But then their speed is limited to 25 km/h so they are not counted a trucks (in the highway code).

Nevertheless, since it satisies demand, hat patch should go in.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Long Convoy Patch
« Reply #46 on: May 22, 2017, 06:13:48 AM »
The legal limit are usually rather length and number of axis.

The two-trailered truck I think I saw, which I believe it was a semi-trailer with another trailer behind it, was in a region of Norway bordering the EU (Sweden) that has a special regulation for cross-border compatibility. As far as I know, that regulation is all about length and weight. (The regulation was also motivated by a major downsizing of Norwegian paper production, which mean that the lesser forms of timber is increasingly exported to Sweden. Cheap long-distance hauling means bigger volumes per driver and engine. This also motivated more use of railroads.)

There are also those tiny, tourist-carrying road trains that actually try to look like trains. They usually have three trailers or more. Maybe they are being forced out by big double-decker hop-on-hop-off tourist buses, though.

Offline THLeaderH

Re: Long Convoy Patch
« Reply #47 on: May 31, 2017, 09:18:39 AM »
I made some fixes needed for the integration.
  • Dirt in code which was suggested here were removed.
  • A comment in Japanese was translated into English so that it will not cause a encoding trouble.
  • The length of convoy is stored in uint8.

The length limit of convoy is set in simuconf.tab. Write parameters in simuconf.tab like
Code: [Select]
max_rail_convoi_length = 128
max_road_convoi_length = 32
max_ship_convoi_length = 32
max_air_convoi_length = 32

Now these parameters are stored as uint8. So the limit of these parameters are 255. If these parameters are not written, the default values are applied, which are
  • max_rail_convoi_length = 24
  • max_road_convoi_length = 4
  • max_ship_convoi_length = 4
  • max_air_convoi_length = 1

Offline THLeaderH

Re: Long Convoy Patch
« Reply #48 on: June 01, 2017, 03:09:03 PM »
Is there any question about this patch?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Long Convoy Patch
« Reply #49 on: June 06, 2017, 12:28:40 AM »
No, only me very busy. But I have a look at it today.

EDIT
Some work I have to do (respective already done):
* remove the crollbar until it is needed
* Use proper high with larger themes
* put to config window
* save values so all player have the same settings on networkgames

Ok, done, incorporated.
« Last Edit: June 06, 2017, 02:05:33 AM by prissi »

Offline THLeaderH

Re: Long Convoy Patch
« Reply #50 on: June 06, 2017, 12:13:34 PM »
Thank you very much ;D
Many Japanese players are pleased with this integration!
https://togetter.com/li/1117649

Offline Antarctica

Re: Long Convoy Patch
« Reply #51 on: June 11, 2017, 09:17:52 AM »
My first test with maximum allowed just failed in the June 6 nightly. Seems to be an issue of int8 instead of uint8.

I started Pak 128 German, allowed for 240 vehicles, and then I tried to make a long convoi of BR 480. At 128, it failed:

Quote
FATAL ERROR: array_tpl<T>::[] - index out of bounds: -128 not in 0..129, T=P9vehicle_t

And then there's a off-by-1 glitch: Right now, if you need 255 vehicles, you have to patch in Simuconf.tab, because 254 is the maximum possible in the Settings UI.

Offline Vladki

Re: Long Convoy Patch
« Reply #52 on: June 11, 2017, 10:41:49 AM »
Hi, what are the exact option names for max lenght of tramways, narrow-gauge, maglev and monorail?

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2594
  • Total likes: 290
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: Long Convoy Patch
« Reply #53 on: June 11, 2017, 09:28:14 PM »
And then there's a off-by-1 glitch: Right now, if you need 255 vehicles, you have to patch in Simuconf.tab, because 254 is the maximum possible in the Settings UI.
Easily fixed.

My first test with maximum allowed just failed in the June 6 nightly. Seems to be an issue of int8 instead of uint8.
The patch only created the variables but the function that calculated the convoi length was using signed int char to iterate over the cars.

Try r8245

Hi, what are the exact option names for max lenght of tramways, narrow-gauge, maglev and monorail?
Code: [Select]
max_rail_convoi_length = 128
max_road_convoi_length = 32
max_ship_convoi_length = 32
max_air_convoi_length = 32

Offline Vladki

Re: Long Convoy Patch
« Reply #54 on: June 12, 2017, 06:25:57 AM »
I have found those four. So which of them applies to the remaining modes of transport?




Offline Leartin

Re: Long Convoy Patch
« Reply #55 on: June 12, 2017, 09:13:14 AM »
I have found those four. So which of them applies to the remaining modes of transport?

I asked to implement them, but did not get an answer, so it should be the rail_convoy_lenght that applies to all rail-bound vehicles - track, narrowgauge, maglev, tram, monorail.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Long Convoy Patch
« Reply #56 on: June 13, 2017, 12:44:18 AM »
Yes, since all these are derived from the rail subtype, the same constrains apply.