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
SciFurz
Traffic Manager
Traffic Manager
Posts: 154
Joined: 13 Oct 2018 16:33
Contact:

Re: JGR's Patch Pack

Post by SciFurz »

In case it hasn't come up before, timetable times are limited to 65535 ticks or 885 days, which limits things on high daylength factor.
Higher times filled in automatically in the table aren't correct.
Tinkering in the code in between writing mostly naughty stuff.
See http://scifurz.wordpress.com/
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

SkullKrixzz wrote:this is the file i assume you are referring to...
The small_size font size value is too large for the text to fit in the box.
At present there isn't a mechanism to increase the size of the box when using very large font sizes.
SciFurz wrote:Played around with vanilla OpenTTD a couple of years ago but stumbled across your version thanks to the great port on Android from Peyla and now find myself rather addicted to the simulator (I don't really play it as the game). It's a shame daylength can't be used higher than 125 but at least it reduces tile size to about 18km for trains (quick test) and the huge stations don't take up most of the map.
If I remember correctly, increasing it any higher than this would start to cause awkward problems with numeric overflow. Various fields would have to be made wider.
SciFurz wrote:While experimenting in it with the more advanced options I jotted down a few questions and maybe some of the more specific ones can get a quick yes or no answer.

Is it possible to get a restricted signal option to set the maximum speed for trains?
For example, slowing them down before a busy station to avoid constant stop and go of each train in the traffic jam.
This isn't possible at present. Other than aesthetics, I'm not sure that it would help all that much with reducing congestion.
The interactions between timetabling, order-defined speed limits and any restricted signal based speed limits could be a bit problematic/complex.
SciFurz wrote:Set high or low priority on aquiring a slot?
To give trains from one direction or express cargos priority over others.
I would instead suggest that you use more than one slot, and use the slot occupancy conditional.
The way that the pathfinder and reservations/slot operations work doesn't lend itself very well to prioritisation in that sense.
SciFurz wrote:At setting the dispatch schedules, display ticks as an option?
Setting by day means all trains start at the same time, and the hour/minute option has no relation to the actual game date. At least with real or virtual ticks I can set dispatch times at specific moments of the day.
I can look into this at some point, unless @ino fancies a go.
SciFurz wrote:And speaking of dispatch, setting wait time at waypoints?
I can set it on stations but when I build a parking yard with a multi track one tile platform they're set to loading/unloading until it's time to leave. I don't want to risk accidental loading if the yard's close enough to industry or city if I miss setting the order to no load/unload. Besides, a waypoint looks better.
As mentioned above, this was implemented in 0.27.0.
I'm not quite sure I understand what problem you're trying to solve here though.
SciFurz wrote:And this thought just came up, instead of a waypoint, could it be a restricted signal? One that will stop blocking between certain times (ticks of the day).
This feature has crossed my mind before but I've never been able to think of a setup where it would actually be useful. What would you do with such a signal, that couldn't be achieved with ordinary signal logic?
SciFurz wrote:Another thing that came to mind while experimenting with timetables;

An option to set full load with a timeout, to have a train wait and load for a set time but the ability to leave early when it reaches full load of all or any cargo within the time limit.
Something like Load until timeout (leave at full load all cargo)/Load until timeout (leave at full load any cargo).
This to ensure a steady delivery while not wasting time on trains that are fully loaded.
I can see that this could be useful, on the other hand it could play havoc with timetable lateness and automation/auto-separation if those are enabled.
SciFurz wrote:In case it hasn't come up before, timetable times are limited to 65535 ticks or 885 days, which limits things on high daylength factor.
Higher times filled in automatically in the table aren't correct.
Yes timetables use 16 bit storage in memory and in savegames at present.
I may look into the feasibility of bumping this in due course though.
Edit: This has been done now.
SciFurz wrote:Thanks for all your great work and making this game interesting. Now I can create the model railroad that I wished for as a kid. ;-)
Thanks, it's much appreciated :)
Last edited by JGR on 23 Oct 2018 02:18, edited 1 time in total.
Ex TTDPatch Coder
Patch Pack, Github
yellyFish
Engineer
Engineer
Posts: 8
Joined: 04 Oct 2018 20:22

Re: JGR's Patch Pack

Post by yellyFish »

JGR wrote:
yellyFish wrote:Hi. I have been trying to play in a server that uses your patch version 0.27.0. But everytime the map gets loaded the game gets super slow, my CPU usage goes to 100% and the only clue i get about this is using debug mode. i get this error spammed in console.

Code: Select all

dbg: [grf] Unhandled vehicle variable 0x61, type 0x0
I have digged in the code trying to find the newgrf responsible or if it is something with the patch or openttd itself but i can't seem to find it.
I'll attach the server savefile so you can test if it happens to you too and if you have any clue on what is causing this.

UPDATE: i found the newgrf responsible for the errors. now i am asking the creator what he knows. It was 2cc Trains In NML version 3.0-alpha2.
It may be an issue of the CPU requirements to play the game at full speed.
On my machine your savegame once loaded runs at about 0.7 of normal speed, and uses 100% of one of my CPU cores.
This is mostly due to the large number of trains in the game.
You can see these sorts of stats in the "Show frame rate" window, in the question mark menu.
I don't think that the GRF error is that important, though the GRF author may be able to better answer you on that one.
If load a a savegame from the servers it runs almost the same, 0.7x and 100% CPU, BUT it doesn't lag. It works fine. Now if i try to connect to the server the game crawls as it tries to load and then i get a desync because i got too long to sync.

So i wanted to know if you know how could i determine if it's a problem on my side and my computer's CPU is just too underpowered or maybe there is a problem with the game/server.

The only clue i have is that it starts to happen when the server gets older, i.e more trains, stations, etc.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: JGR's Patch Pack

Post by Eddi »

yellyFish wrote:So i wanted to know if you know how could i determine if it's a problem on my side and my computer's CPU is just too underpowered or maybe there is a problem with the game/server.
this is most likely an issue with your CPU speed, but for further investigation we need more information from you, like a screenshot of the framerate window. that way we can narrow down what area of the game is slow
yellyFish
Engineer
Engineer
Posts: 8
Joined: 04 Oct 2018 20:22

Re: JGR's Patch Pack

Post by yellyFish »

Eddi wrote:
yellyFish wrote:So i wanted to know if you know how could i determine if it's a problem on my side and my computer's CPU is just too underpowered or maybe there is a problem with the game/server.
this is most likely an issue with your CPU speed, but for further investigation we need more information from you, like a screenshot of the framerate window. that way we can narrow down what area of the game is slow
Okay. i could join the server as spectator and the game was paused because it there where no players . Of course it worked smoothly and that is the first pic. Then when i joined my company it slowed down. That's the second one.
Attachments
paused.png
paused
(674.33 KiB) Not downloaded yet
unpaused.png
unpaused/running normal speed/slow for me
(415.04 KiB) Not downloaded yet
ino
Traffic Manager
Traffic Manager
Posts: 152
Joined: 09 Apr 2017 14:58

Re: JGR's Patch Pack

Post by ino »

JGR wrote:
SciFurz wrote:At setting the dispatch schedules, display ticks as an option?
Setting by day means all trains start at the same time, and the hour/minute option has no relation to the actual game date. At least with real or virtual ticks I can set dispatch times at specific moments of the day.
I can look into this at some point, unless @ino fancies a go.
Bit busy at the moment, but it should be trivial to do.

On the other hand, I do not really see any usecases for this though. 74 tick per day go by so fast. My passenger trains is normally scheduled to stop for at least 80-240 ticks (240 ticks per minute here)
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Re: JGR's Patch Pack

Post by OzTrans »

My Wishlist ...

Property 12 for Railtypes (Station (and Depot) graphics)
Could that property be extended to bridges as well ? Currently any Railtype will only ever use the rail bridge (slot 1); monorail and maglev bridges are simply ignored. However, I have different looking bridges for standard gauge, highspeed and narrow gauge rail (NG is implemented in the monorail slot and HS in the maglev slot). It would be nice to be able to use all 3 rail bridge slots. BTW, this has nothing to do with the rail pieces, defined in rail types.

Property 14 for bridges (Menu Icons)
Having different looking bridges for rail, road, narrow gauge and highspeed rail; it would be nice to also have different looking menu icons. Could property 14 be extended to 'B n*D' for menu icon list; e.g.

Code: Select all

1 icon  - all slots would use it (as we have it today)
2 icons - first for rail, monorail and maglev, second for road
3 icons - first for rail, second for road, third for monorail and maglev
4 icons - each slot has its own

Property 1B for stations (Minimum bridge height)
Nice feature, but more often than not we should also have the same property for bridges, some of them look outright ugly even if enough clearance has been given; thus we can disable some bridges from being built across stations or been given additional clearance. Just try to build a viaduct across a ground level station, on the other hand a wide span bridge should just be fine. Also, what about objects ?[quote=JGR]Settings to allow placing stations and all NewGRF objects under bridges. (added in v0.26.0)[/quote]What is the property ID for objects, if there is one ?

Feature 0E New Signals
Are there any plans to include New Signals from the TTDPatch days ?

Station menu list
Currently any 'not yet available' or 'no longer available' station or station tile is somewhat poorly greyed out. Would it be possible to not show these at all ? Also, any station description is only shown when clicked on. It is quite laborious to click on all tiles to find the right one to build. It would be nice to have an option in 'Settings' to display the build-able stations in list form compared having them tiled (just like in the good old TTDPatch days).

Snow in Temperate
It would be nice to also have snow and the variable snowline in temperate climate games. Any chance ?

A little buglet ...
In Settings: Interface/General/Show Tooltips should that not have a decimal point or read 'milliseconds'.

Vehicle Purchase List
I also have a small issue with the vehicle purchase list ...
RV Purchase List 2.png
RV Purchase List 2.png (26.02 KiB) Viewed 3018 times
What have I missed ? In OpenTTD v1.8 I can filter among the cargo types (just ignore those undefined strings); in JGR v0.27 I only get passengers and mail with the same GRFs loaded. Without any GRFs loaded the list is fine.

And a question ...
How many cargo types can we have beyond the first 32 ? OpenTTD gives a fatal GRF error with more than 32 !

That would be all for the moment; thank you for all the good work, keep it up, it is being highly appreciated.
MichalSoldat
Engineer
Engineer
Posts: 10
Joined: 21 Oct 2018 21:47

Re: JGR's Patch Pack

Post by MichalSoldat »

Hello guys !
I've been observing this topic for very long time and i have to say i really admire job you are doing. Finally decided to join community.

Here are some usefull features requests:
1. Marged depots ( would be great to marge adjacent depots to be seen as one)
2. Programmable signals ( changing "last visited station" to "last order")
3. Programmable signals ( pass red signal ) abbility to pass red signal when some conditions are met.

And finally i found bug with using "through load" feature:
If you use timetable for example, through load time 60 ticks, every time the train moves to load new wagons ticks resets again to 60. I think it shoud be set to whole through load to 60. So that would be more transparent. Now it ruins my whole timetable.

Hope i've presented everything clear, greetings. :wink:
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: JGR's Patch Pack

Post by wallyweb »

OzTrans wrote:
JGR wrote:Settings to allow placing stations and all NewGRF objects under bridges. (added in v0.26.0)
What is the property ID for objects, if there is one ?
Is this what you are looking for?

Code: Select all

Object Action 0:
property 10, Bit 11: Allow bridge over the object taking the building height into account.
property 16 (Building Height): The property is also used to determine how high a bridge must be if it is allowed by the bit in property 10.
@JGR - Is there some duplication in your patch code?
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

yellyFish wrote:Okay. i could join the server as spectator and the game was paused because it there where no players . Of course it worked smoothly and that is the first pic. Then when i joined my company it slowed down. That's the second one.
This looks to me like a plausible amount of slow-down due to having a large game with many vehicles.
What sort of machine are you running this on, with what sort of CPU?
OzTrans wrote:My Wishlist ...

Property 12 for Railtypes (Station (and Depot) graphics)
Could that property be extended to bridges as well ? Currently any Railtype will only ever use the rail bridge (slot 1); monorail and maglev bridges are simply ignored. However, I have different looking bridges for standard gauge, highspeed and narrow gauge rail (NG is implemented in the monorail slot and HS in the maglev slot). It would be nice to be able to use all 3 rail bridge slots. BTW, this has nothing to do with the rail pieces, defined in rail types.

Property 14 for bridges (Menu Icons)
Having different looking bridges for rail, road, narrow gauge and highspeed rail; it would be nice to also have different looking menu icons. Could property 14 be extended to 'B n*D' for menu icon list; e.g.

Code: Select all

1 icon  - all slots would use it (as we have it today)
2 icons - first for rail, monorail and maglev, second for road
3 icons - first for rail, second for road, third for monorail and maglev
4 icons - each slot has its own
I don't really see the rationale of hard-coding anything to the 3 original TTD railtypes, when OpenTTD can support up to 64 rail types.
I am somewhat reluctant to add NewGRF features unless there's an imminent demand for it.
I think that these sots of things would probably be better pitched at trunk.
OzTrans wrote:Property 1B for stations (Minimum bridge height)
Nice feature, but more often than not we should also have the same property for bridges, some of them look outright ugly even if enough clearance has been given; thus we can disable some bridges from being built across stations or been given additional clearance. Just try to build a viaduct across a ground level station, on the other hand a wide span bridge should just be fine.
That seems reasonable enough, however it is likely to need another property ID or some such. Adding this in the same way as the existing one would re-open the issue of out-of-trunk property ID allocations, trunk/non-trunk compatibility and the associated grumbling, which I'm not all that keen to do. Coming up with something more robust/defensive may take a while as my time is limited.
OzTrans wrote:Also, what about objects ?
JGR wrote:Settings to allow placing stations and all NewGRF objects under bridges. (added in v0.26.0)
What is the property ID for objects, if there is one ?
This is in the trunk spec, it's not a feature which I added, see here.
OzTrans wrote:Feature 0E New Signals
Are there any plans to include New Signals from the TTDPatch days ?
No. I have no plans to do that again.
OzTrans wrote:Station menu list
Currently any 'not yet available' or 'no longer available' station or station tile is somewhat poorly greyed out. Would it be possible to not show these at all ? Also, any station description is only shown when clicked on. It is quite laborious to click on all tiles to find the right one to build. It would be nice to have an option in 'Settings' to display the build-able stations in list form compared having them tiled (just like in the good old TTDPatch days).

Snow in Temperate
It would be nice to also have snow and the variable snowline in temperate climate games. Any chance ?
Re-designing the station menu UI would be a big job, and I am not really a UX-designer sort of person, I would rather leave that to someone else to do.
For snow I'd suggest just using sub-arctic instead.
OzTrans wrote:A little buglet ...
In Settings: Interface/General/Show Tooltips should that not have a decimal point or read 'milliseconds'.
Looks fine here, which language are you using?
OzTrans wrote:Vehicle Purchase List
I also have a small issue with the vehicle purchase list ...
RV Purchase List 2.png
What have I missed ? In OpenTTD v1.8 I can filter among the cargo types (just ignore those undefined strings); in JGR v0.27 I only get passengers and mail with the same GRFs loaded. Without any GRFs loaded the list is fine.
The "undefined string" lines suggest that something is wrong with the GRF which is defining the cargoes, you should check that first.
OzTrans wrote:And a question ...
How many cargo types can we have beyond the first 32 ? OpenTTD gives a fatal GRF error with more than 32 !
My patchpack does not differ from trunk in this area, in that the total number of cargoes in a game is 64. It would probably be best to refer to the documentation as I am only familiar with a fairly narrow subset of the spec.
MichalSoldat wrote:Hello guys !
I've been observing this topic for very long time and i have to say i really admire job you are doing. Finally decided to join community.

Here are some usefull features requests:
1. Marged depots ( would be great to marge adjacent depots to be seen as one)
2. Programmable signals ( changing "last visited station" to "last order")
3. Programmable signals ( pass red signal ) abbility to pass red signal when some conditions are met.

And finally i found bug with using "through load" feature:
If you use timetable for example, through load time 60 ticks, every time the train moves to load new wagons ticks resets again to 60. I think it shoud be set to whole through load to 60. So that would be more transparent. Now it ruins my whole timetable.

Hope i've presented everything clear, greetings. :wink:
1. This seems reasonable but it is likely to be quite non-trivial to implement right, perhaps in the fullness of time I can take a look into it.
2. This is named this way as trains remember the last station they stopped at, but don't remember other things like waypoints and via orders.
3. I don't think that this would be advisable. Red signals should never be passed without manual intervention.

I will take a look at the through load timetabling issue shortly.
wallyweb wrote:@JGR - Is there some duplication in your patch code?
Not sure I understand your question here?
Last edited by JGR on 25 Oct 2018 23:04, edited 1 time in total.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Re: JGR's Patch Pack

Post by OzTrans »

wallyweb wrote:Is this what you are looking for?
Yes, that's it, must have missed it; thank you.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: JGR's Patch Pack

Post by wallyweb »

JGR wrote:
wallyweb wrote:@JGR - Is there some duplication in your patch code?
Not sure I understand your question here?
Settings to allow placing stations and all NewGRF objects under bridges. (added in v0.26.0)
seemed to infer that property 1B applied equally to NewGRF objects as well as stations.
As you and I have just noted, objects have their own implementation apart from stations property 1B, hence OzTrans question.
OzTrans wrote:
wallyweb wrote:Is this what you are looking for?
Yes, that's it, must have missed it; thank you.
You are welcome. Glad I could be of assistance.
By the way, I adapted mart3p's ISR. It's available here.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Re: JGR's Patch Pack

Post by OzTrans »

OzTrans wrote:In Settings: Interface/General/Show Tooltips should that not have a decimal point or read 'milliseconds'.
JGR wrote:Looks fine here, which language are you using?
English (Australian) - It is also the case in OpenTTD v1.8 (see below). German is ok too; haven't checked any other languages though.
ShowToolTips A.png
ShowToolTips A.png (2.26 KiB) Viewed 2791 times
OzTrans wrote:How many cargo types can we have beyond the first 32 ...
JGR wrote:My patchpack does not differ from trunk in this area ...
Well, it does, because I have no problems using cargo IDs beyond the first 32 in your patchpack. OpenTTD v1.8 only has 32 according to anything I could find; even NFORenum thinks so (see below). The error is also evident in NMF (latest incarnation).
OpenTTD v1.8
OpenTTD v1.8
Fatal Error A.png (1.65 KiB) Viewed 2791 times

Code: Select all

//!!Error (141): ID 21 out of valid range (00..1F).
  230 * 16	 00 0B 01 0A 18 08 18 19 1A 1B 1C 1D 1E 1F 20 21
OpenTTD Changelog wrote:0.6.0-beta1 (2007-11-18)
- Feature: Increase cargo types from 12 to 32 and enable newcargo flag in NewGRF loader (r9638)
The only reference I could find regarding the number of cargo types.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: JGR's Patch Pack

Post by Eddi »

OzTrans wrote:Well, it does, because I have no problems using cargo IDs beyond the first 32 in your patchpack. OpenTTD v1.8 only has 32 according to anything I could find;
1.8 is not trunk
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: JGR's Patch Pack

Post by wallyweb »

Eddi wrote:
OzTrans wrote:Well, it does, because I have no problems using cargo IDs beyond the first 32 in your patchpack. OpenTTD v1.8 only has 32 according to anything I could find;
1.8 is not trunk
I've always been confused by this.
Download stable wrote:Latest release in stable is 1.8.0, released on 2018-04-01 13:07 UTC.
Download nightly wrote:Latest release in trunk is r28004, released on 2018-04-06 18:02 UTC.
So the nightlies are trunk?
I'll have to mind my references. 8)
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

wallyweb wrote:
Eddi wrote:
OzTrans wrote:Well, it does, because I have no problems using cargo IDs beyond the first 32 in your patchpack. OpenTTD v1.8 only has 32 according to anything I could find;
1.8 is not trunk
I've always been confused by this.
Download stable wrote:Latest release in stable is 1.8.0, released on 2018-04-01 13:07 UTC.
Download nightly wrote:Latest release in trunk is r28004, released on 2018-04-06 18:02 UTC.
So the nightlies are trunk?
I'll have to mind my references. 8)
To further confuse you: since the move to github, there's no longer "trunk", it is now "master". 8) :lol:
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: JGR's Patch Pack

Post by wallyweb »

kamnet wrote:To further confuse you: since the move to github, there's no longer "trunk", it is now "master". 8) :lol:
Argh!!! Anybody need some head hair? I seem to have pulled a bunch out. :?
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

Trunk (i.e. git master) was last updated as detailed below:

Code: Select all

commit 50efaa2372cafe430f79ecc3361cb2450715417c (HEAD -> master, origin/master)
Author:     Niels Martin Hansen <nielsm@indvikleren.dk>
AuthorDate: Sat Oct 27 08:17:40 2018 +0200
Commit:     Niels Martin Hansen <nielsm@indvikleren.dk>
CommitDate: Sat Oct 27 10:30:24 2018 +0200

    Fix e00908f: Visual C++ 2015 compile error
    
    Microsoft Visual C++ 2015 Update 3 (and possibly other versions) consider a struct member undefined in a
    static_assert in the struct body. Moving the static_assert to a member function solves the issue.
It includes 64 cargoes, etc.
Ex TTDPatch Coder
Patch Pack, Github
MichalSoldat
Engineer
Engineer
Posts: 10
Joined: 21 Oct 2018 21:47

Re: JGR's Patch Pack

Post by MichalSoldat »

Another Question: Is it possible to set higher numer than 255 for "effect of distance on demands"?
I've tried to do this in openttd.cfg in line "demand_distance" but after saving file and running the game the number which set resets again to 255.

Thanks for help.
Attachments
Przechwytywanie.PNG
Przechwytywanie.PNG (3.72 KiB) Viewed 2689 times
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Re: JGR's Patch Pack

Post by OzTrans »

Eddi wrote:
OzTrans wrote:Well, it does, because I have no problems using cargo IDs beyond the first 32 in your patchpack. OpenTTD v1.8 only has 32 according to anything I could find;
1.8 is not trunk
Well, we shall wait until 'trunk-master' finds its way into a 'stable'. In the mean time I'll concentrate on JGR v0.27.

BTW, where can I find a Win32 executable of the latest 'trunk-master' ?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 44 guests