JGR's Patch Pack

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
JGR
Tycoon
Tycoon
Posts: 2002
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR » 30 Nov 2019 13:35

phobos2077 wrote:
30 Nov 2019 11:25
If I turn on the "Calculate leg profit relative to source station" option, does the "Percentage of leg profit..." option still apply? Or is it only used for the vanilla calculation?

Thanks.
The percentage of leg profit setting is still used in the same way. After the profit for an intermediary leg is calculated, by either method, it is then multiplied by the percentage setting before allocating it to the vehicle.
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018

User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1171
Joined: 15 Feb 2003 17:32
Location: Villefranche-sur-Saône, France

Re: JGR's Patch Pack

Post by MagicBuzz » 02 Dec 2019 08:45

Hello JGR,

Just one small problem that should have to be fixed in your patch pack :
The /docs folder is almost empty. There is only "multiplayer.md" (in both the ZIP provided in the first page of the topic and in the bundle generated from last git commit in your branch).

Is it possible to get them back in next release ? :D

BTW, thank you very much for your amazing patch pack.

User avatar
JGR
Tycoon
Tycoon
Posts: 2002
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR » 02 Dec 2019 19:29

MagicBuzz wrote:
02 Dec 2019 08:45
Hello JGR,

Just one small problem that should have to be fixed in your patch pack :
The /docs folder is almost empty. There is only "multiplayer.md" (in both the ZIP provided in the first page of the topic and in the bundle generated from last git commit in your branch).

Is it possible to get them back in next release ? :D

BTW, thank you very much for your amazing patch pack.
This is the same as in trunk. As far as I can see the docs/ directory of the bundle output has contained only the multiplayer documentation since May 2012.
Which documentation files are you looking for?
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018

Bernasrebelo11
Engineer
Engineer
Posts: 8
Joined: 24 Nov 2019 12:10

train speed

Post by Bernasrebelo11 » 02 Dec 2019 21:35

Hi!
I use the jgr patch, i would like to know a way to change the speed limit of a train or track (no nutracks!!!) or if there is a patch that i can use with the jgr one, so i can use 2 different train in one track with the same speed. :bow:

User avatar
Redirect Left
Tycoon
Tycoon
Posts: 6604
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: JGR's Patch Pack

Post by Redirect Left » 03 Dec 2019 05:35

You can force a train to use a max speed in the timetabling window, which is on the window where you add the route the train will go.
Image
Worst Behaved IRC Member of 2008, 2009 & 2010 - Go Me!

Bernasrebelo11
Engineer
Engineer
Posts: 8
Joined: 24 Nov 2019 12:10

Re: JGR's Patch Pack

Post by Bernasrebelo11 » 03 Dec 2019 12:28

Redirect Left wrote:
03 Dec 2019 05:35
You can force a train to use a max speed in the timetabling window, which is on the window where you add the route the train will go.
How can you show it bc I'm using the timetable

User avatar
vincentkoevoets
Engineer
Engineer
Posts: 30
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets » 03 Dec 2019 12:37

Bernasrebelo11 wrote:
03 Dec 2019 12:28
Redirect Left wrote:
03 Dec 2019 05:35
You can force a train to use a max speed in the timetabling window, which is on the window where you add the route the train will go.
How can you show it bc I'm using the timetable
There you go. In the timetable screen you select a line between two orders and then you can choose the max speed for that line.
Now that we're talking about it, maybe a good time to ask if JGR would be willing to put the speed signal on the wish list (if there is such a list, of course). Indeed I did ask this before, and I'm just curious if it is still on some post-it somewhere or if I should just let it go.
Screenshot
Screenshot
Schermafbeelding 2019-12-03 om 13.32.47.png (56.95 KiB) Viewed 514 times

Bernasrebelo11
Engineer
Engineer
Posts: 8
Joined: 24 Nov 2019 12:10

Re: JGR's Patch Pack

Post by Bernasrebelo11 » 03 Dec 2019 13:16

vincentkoevoets wrote:
03 Dec 2019 12:37
Bernasrebelo11 wrote:
03 Dec 2019 12:28
Redirect Left wrote:
03 Dec 2019 05:35
You can force a train to use a max speed in the timetabling window, which is on the window where you add the route the train will go.
How can you show it bc I'm using the timetable
There you go. In the timetable screen you select a line between two orders and then you can choose the max speed for that line.
Now that we're talking about it, maybe a good time to ask if JGR would be willing to put the speed signal on the wish list (if there is such a list, of course). Indeed I did ask this before, and I'm just curious if it is still on some post-it somewhere or if I should just let it go.

Schermafbeelding 2019-12-03 om 13.32.47.png
:bow: :bow: :bow: :bow: :bow: :bow:

Bernasrebelo11
Engineer
Engineer
Posts: 8
Joined: 24 Nov 2019 12:10

Re: JGR's Patch Pack

Post by Bernasrebelo11 » 04 Dec 2019 15:35

Hey my game is crashing and I don't know why here's a picture of the error https://imgur.com/a/HSY9MFG
Help :bow:

User avatar
JGR
Tycoon
Tycoon
Posts: 2002
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR » 04 Dec 2019 16:10

Bernasrebelo11 wrote:
04 Dec 2019 15:35
Hey my game is crashing and I don't know why here's a picture of the error https://imgur.com/a/HSY9MFG
Help :bow:
Could you post the crash.log and crash.sav files?
Thanks.
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018

User avatar
JGR
Tycoon
Tycoon
Posts: 2002
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR » 04 Dec 2019 19:30

vincentkoevoets wrote:
03 Dec 2019 12:37
Bernasrebelo11 wrote:
03 Dec 2019 12:28
Redirect Left wrote:
03 Dec 2019 05:35
You can force a train to use a max speed in the timetabling window, which is on the window where you add the route the train will go.
How can you show it bc I'm using the timetable
There you go. In the timetable screen you select a line between two orders and then you can choose the max speed for that line.
Now that we're talking about it, maybe a good time to ask if JGR would be willing to put the speed signal on the wish list (if there is such a list, of course). Indeed I did ask this before, and I'm just curious if it is still on some post-it somewhere or if I should just let it go.

Schermafbeelding 2019-12-03 om 13.32.47.png
I probably wouldn't use the existing speed signal patches. They seem to have various issues and there are already enough types of signal.
Adding speed restrictions to the routing restriction interface would seem the lowest friction way of doing it. This would also allow stuff like different speed limits for pax/freight without any additional effort.

What I am not sure about is how useful this would genuinely be, and would there be issues around things like missing end of speed restriction signals, or UI issues like it being unclear why a train is or isn't running at a restricted speed.
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018

Auge
Route Supervisor
Route Supervisor
Posts: 388
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: JGR's Patch Pack

Post by Auge » 04 Dec 2019 19:51

Hello
JGR wrote:
04 Dec 2019 19:30
Adding speed restrictions to the routing restriction interface would seem the lowest friction way of doing it. This would also allow stuff like different speed limits for pax/freight without any additional effort.
There is a way to restrict the speed of a train on a track section in trunk/master since a few years. Put waypoints at the begin and end of the section, add the waypoints to the timetable and set a speed limit for the section from waypoint to waypoint or from station to another one or for any combination.

Tschö, Auge

User avatar
JGR
Tycoon
Tycoon
Posts: 2002
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR » 04 Dec 2019 20:01

Auge wrote:
04 Dec 2019 19:51
Hello
JGR wrote:
04 Dec 2019 19:30
Adding speed restrictions to the routing restriction interface would seem the lowest friction way of doing it. This would also allow stuff like different speed limits for pax/freight without any additional effort.
There is a way to restrict the speed of a train on a track section in trunk/master since a few years. Put waypoints at the begin and end of the section, add the waypoints to the timetable and set a speed limit for the section from waypoint to waypoint or from station to another one or for any combination.

Tschö, Auge
Yes, that it what is described further up.

To expand what vincentkoevoets is asking, the speed signal patch which was referred to allows the speed restriction to be a property of the track layout, not one of each individual vehicle which may be routed over it.
This is closer to how speed restrictions work outside of OpenTTD.
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018

User avatar
vincentkoevoets
Engineer
Engineer
Posts: 30
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets » 04 Dec 2019 21:03

JGR wrote:
04 Dec 2019 19:30
I probably wouldn't use the existing speed signal patches. They seem to have various issues and there are already enough types of signal.
Adding speed restrictions to the routing restriction interface would seem the lowest friction way of doing it. This would also allow stuff like different speed limits for pax/freight without any additional effort.

What I am not sure about is how useful this would genuinely be, and would there be issues around things like missing end of speed restriction signals, or UI issues like it being unclear why a train is or isn't running at a restricted speed.
Now that would actually be a great solution, as that would give us even more options than the speed signal patch did. Of course I wouldn't know about UI issues and stuff like that, but when using the restrictions the user would of course be responsible for placing signals which would lift the set restrictions again.
Auge wrote:
04 Dec 2019 19:51
Hello

There is a way to restrict the speed of a train on a track section in trunk/master since a few years. Put waypoints at the begin and end of the section, add the waypoints to the timetable and set a speed limit for the section from waypoint to waypoint or from station to another one or for any combination.

Tschö, Auge
This is what I am using now, but it is far from ideal, and also not realistic. Now I know that realism in OpenTTD is a relative concept, and maybe it is because I am a train driver myself in real life, but I don't think it is realistic that a train for example enters a station or a junction at full speed. Also sometimes I want a train to leave a station very slowly in order to give road vehicles a chance to clear a level crossing in time.
In terms of usability it would be way easier to set (and change, in the course of the game) maximum speeds on pieces of track, instead of changing it for all the trains that pass that piece of track separately.
But I understand if this is too difficult to implement, and in that case we'll just have to use waypoints.

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5571
Joined: 27 Nov 2004 15:05
Location: Canada

Re: JGR's Patch Pack

Post by wallyweb » 04 Dec 2019 23:57

Thinking of speed limits ... In real life a speed limit is set at a sign or signal and remains in effect until changed at a following sign or signal. Can this not be implemented using programmable signals?

User avatar
JGR
Tycoon
Tycoon
Posts: 2002
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR » 05 Dec 2019 01:17

vincentkoevoets wrote:
04 Dec 2019 21:03
This is what I am using now, but it is far from ideal, and also not realistic. Now I know that realism in OpenTTD is a relative concept, and maybe it is because I am a train driver myself in real life, but I don't think it is realistic that a train for example enters a station or a junction at full speed.
The key problem is that the lookahead and braking distance is half a tile, and there is no deceleration limit.
Ideally deceleration could be limited to something sensible and braking would occur in advance accordingly, but practically this would require many major changes.

Using the equivalent of speed signals to emulate that might soon get tedious if it needs to be done for every junction, etc.
wallyweb wrote:
04 Dec 2019 23:57
Thinking of speed limits ... In real life a speed limit is set at a sign or signal and remains in effect until changed at a following sign or signal. Can this not be implemented using programmable signals?
It would use routing restrictions instead of programmable signals, but otherwise yes.
Programmable signals is an extremely niche feature.
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5571
Joined: 27 Nov 2004 15:05
Location: Canada

Re: JGR's Patch Pack

Post by wallyweb » 05 Dec 2019 03:54

JGR wrote:
05 Dec 2019 01:17
It would use routing restrictions instead of programmable signals, but otherwise yes.
Programmable signals is an extremely niche feature.
"routing restrictions"!! That's the expression I was looking for! :bow:

User avatar
vincentkoevoets
Engineer
Engineer
Posts: 30
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets » 05 Dec 2019 06:37

JGR wrote:
05 Dec 2019 01:17
vincentkoevoets wrote:
04 Dec 2019 21:03
This is what I am using now, but it is far from ideal, and also not realistic. Now I know that realism in OpenTTD is a relative concept, and maybe it is because I am a train driver myself in real life, but I don't think it is realistic that a train for example enters a station or a junction at full speed.
The key problem is that the lookahead and braking distance is half a tile, and there is no deceleration limit.
Ideally deceleration could be limited to something sensible and braking would occur in advance accordingly, but practically this would require many major changes.

Using the equivalent of speed signals to emulate that might soon get tedious if it needs to be done for every junction, etc.


I can see that, but that was not exactly what I meant. I was not thinking about braking distance and lookahead, I can only imagine the changes that would have to be made to the game, and that would definitely be a bridge too far.

My idea was the same as the speed signal, for example the last signal before entering a station reducing the speed of the train to a set speed. When leaving the station, the exit signal lifts that restriction again, or sets a new restriction.
Another example would be reducing the max speed in a residential area, which is often done in real life.

User avatar
JGR
Tycoon
Tycoon
Posts: 2002
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR » 06 Dec 2019 21:19

vincentkoevoets wrote:
05 Dec 2019 06:37
I can see that, but that was not exactly what I meant. I was not thinking about braking distance and lookahead, I can only imagine the changes that would have to be made to the game, and that would definitely be a bridge too far.

My idea was the same as the speed signal, for example the last signal before entering a station reducing the speed of the train to a set speed. When leaving the station, the exit signal lifts that restriction again, or sets a new restriction.
Another example would be reducing the max speed in a residential area, which is often done in real life.
I've done an initial implementation of speed restrictions through the routing restrictions mechanism. It's on Github if you want to try it out.
You'll need to turn on the "Show advanced routing restriction features" setting.
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018

User avatar
vincentkoevoets
Engineer
Engineer
Posts: 30
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets » 07 Dec 2019 09:08

JGR wrote:
06 Dec 2019 21:19
I've done an initial implementation of speed restrictions through the routing restrictions mechanism. It's on Github if you want to try it out.
You'll need to turn on the "Show advanced routing restriction features" setting.
Wow this works absolutely great! I've done some testing, and it seems to work fine. Together with the options for advanced routing restrictions this is a big step forward from the original speed signal patch. I tried out some more complex restrictions, and all seems to work well (only freight trains, or only passenger trains, or entry from the back of a signal, etc).
Just some observations:
- It even works with regular block signals! Perfect for reducing the speed one signal prior to a path signal.
- I didn't clear out the max speeds in the timetable window (yet, I will for sure when I complete setting all signal speeds :D ), and it seems to work next to one another. The rule seems to be: the lowest speed set (either in timetable or as a restriction) will be the max speed.

Thanks JGR for the great work! Just let me know if there is anything I can do, testing stuff or anything.

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 4 guests