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
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: JGR's Patch Pack

Post by Gwyd »

I'm not very experienced in the code side of things for OpenTTD, but could a patch pack have a specific GRF in-built in some way that a NewGRF can detect like any other NewGRF. Based on this, the NewGRF could activate or deactivate certain features
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: JGR's Patch Pack

Post by Eddi »

that doesn't seem any more helpful than putting a random number in the code and calling that a "version"
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: JGR's Patch Pack

Post by michael blunck »

JGR wrote: Defining some sort of structured versioned feature test mechanism via action 14/CSTM as suggested in the documentation sounds quite doable.
Twiddling variable 8D/9D as a success indicator is a bit more problematic as it doesn't compose very well.
I'm open to thoughts/suggestions on all this.
What is var A1 being set for your patch(es)?

regards
Michael
Image
User avatar
Xaxa
Engineer
Engineer
Posts: 42
Joined: 18 Sep 2008 15:03
Location: Zaanstad, The Netherlands
Contact:

Re: JGR's Patch Pack

Post by Xaxa »

Oh boy! Bridges on top of train stations, yes! Great step forward for the flexible network I require. Thank you for the implementation!

Ultimately, will there be
Stations on top of stations? (Like stations on top of bridges?)
Stations in tunnels?

Inspirational stations:
[+] Spoiler
Amsterdam Sloterdijk (one of two flying X-stations in the Netherlands):
Image

The other one would be Duivendrecht which is like a really neat cross looking at it from an earial angle.
[+] Spoiler
Triple layered Antwerpen Centraal. The top layers are both terminal. The lower layer for (amongst others) high speeds trains is roro.
Image
I would also love a feature that makes longer platforms have A and B sides, that if a three tile train enters a seven tile platform, the three tiles (or four) on the other side are still usable. It would be an issue if both trains wanted to cross, but if you can program it properly and only have two final destination trains on each side (or have one terminal and one continuous train that departs later) it should be good. Of course the programming is up to the player's discretion. I can make a three tile - gap/waypoint/signal - three tile station instead, but that would disallow seven tile trains to use the entire platform in one go if you catch my drift.
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: JGR's Patch Pack

Post by Eddi »

ok, quick thought here:
  1. each patchpack chooses a 4-letter ID (we have plenty of those going around already) to represent itself (master could get "OTTD" or something)
  2. the version number reported to NewGRFs will then be uncomparable between patchpacks, and ech pactchpack has the responsibility to provide an incremental version. (something here needs to change in openttd master anyway, since there is no automatic incremental revision number anymore)
major drawback here is that a NewGRF checking for feature availability must know every patchpack

another approach could be an Action6/7/9/D variable thatgets a parameter XXYY and acts like "is there feature X property Y in this version?" that might be extended to other stuff like new callbacks, but might not wrk for all types of spec changes
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: JGR's Patch Pack

Post by michael blunck »

Isn´t that too complicated? We don´t have querying of features now. We only have revision numbers, and a newGRF has to know what revision supports a certain feature.

So, e.g. JGRPatch could choose a value for 9D (IIRC, NMF already has this), and use existing var A1 for revisioning.

Or is that too simple?

regards
Michael
Image
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: JGR's Patch Pack

Post by Eddi »

well, if the future of development goes into the direction that several long-term patchpacks live side-by-side, it is to expected that newgrf features will be introduced at different times, possibly also in different order.

there is probably no simple solution here. there is some coordination effort needed at some place, and i'm not sure how that really works out
User avatar
JGR
Tycoon
Tycoon
Posts: 2559
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

I'm inclined to adopt a versioning system which sort of looks like the one I'm currently using for savegames.
Broadly speaking this is the unaltered trunk version numbers + a list of named features with an associated integer version number.
This is to the avoid the numerous issues in nearly all preceding patchpacks where savegame versioning was ham-fistedly forced into a linear model, such that backwards and forwards compatibility didn't really work very well, if at all.

For the same reasons, I'm not keen on trying to redefine the trunk linear version numbers or platform number, as this just creates compatibility headaches with GRFs versioned against trunk and when I come to merge future trunk changes.

My current thought is to use action 14 CSTM to encode something to the effect of:
Set bit N (where N >= 4) of variable 8D iff the feature identified by STRING exists and has a version number >= MIN_VERSION.
Bits of variable 8D can then be tested in the usual way, and will be 0 on implementations which don't have the feature or know about feature tests.

I will look to write up a proper proposal at a later time.
Ex TTDPatch Coder
Patch Pack, Github
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: JGR's Patch Pack

Post by michael blunck »

JGR wrote: My current thought is to use action 14 CSTM to encode something to the effect of:
Set bit N (where N >= 4) of variable 8D iff the feature identified by STRING exists and has a version number >= MIN_VERSION.
Bits of variable 8D can then be tested in the usual way, and will be 0 on implementations which don't have the feature or know about feature tests.
Var 8D? You mean 9D?

Code: Select all

8D	B	TTD version, 0=DOS, 1=Windows
9D	D	TTD Platform, 0=TTDPatch, 1=OpenTTD
regards
Michael
Image
User avatar
JGR
Tycoon
Tycoon
Posts: 2559
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

michael blunck wrote:
JGR wrote: My current thought is to use action 14 CSTM to encode something to the effect of:
Set bit N (where N >= 4) of variable 8D iff the feature identified by STRING exists and has a version number >= MIN_VERSION.
Bits of variable 8D can then be tested in the usual way, and will be 0 on implementations which don't have the feature or know about feature tests.
Var 8D? You mean 9D?

Code: Select all

8D	B	TTD version, 0=DOS, 1=Windows
9D	D	TTD Platform, 0=TTDPatch, 1=OpenTTD
regards
Michael
Either of them would be fine really, I suppose 9D is better as it's advertised as being wider.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3427
Joined: 24 Apr 2007 09:37
Skype: Discord: Emperor Jake #4106
Location: Not Actually Japan
Contact:

Re: JGR's Patch Pack

Post by Emperor Jake »

Custom bridgeheads for rail are awesome, but naturally we managed to get carried away and break it again :P

The game crashes when placing or removing signals on bridges with custom bridgeheads in a certain way. To reproduce it, open the netsave (which should already be in the right location) and click on the tile shown using the remove signal tool.
crash.png
crash.png (69.51 KiB) Viewed 2479 times
I can PM you any missing GRFs if needed. Version is 0.26.0 Win x64.

UPDATE: It seems signals on custom bridgeheads is completely broken, when I did manage to remove the top signal, the train got stuck at the other signal even though it was green, probably because the game can't handle a signal that's also on an intersection.
Attachments
netsave.sav
(1.71 MiB) Downloaded 35 times
crash.dmp.zip
(328.61 KiB) Downloaded 32 times
User avatar
JGR
Tycoon
Tycoon
Posts: 2559
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

Emperor Jake wrote:UPDATE: It seems signals on custom bridgeheads is completely broken, when I did manage to remove the top signal, the train got stuck at the other signal even though it was green, probably because the game can't handle a signal that's also on an intersection.
Signals are not permitted on junction tiles.
I thought that all ways of constructing that were disallowed but I must have missed something, I'll look into it.
Many thanks for the bug report.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3427
Joined: 24 Apr 2007 09:37
Skype: Discord: Emperor Jake #4106
Location: Not Actually Japan
Contact:

Re: JGR's Patch Pack

Post by Emperor Jake »

Thanks for the quick response.

Another related minor issue: train wagons on custom bridges are out of alignment for some reason:
Attachments
alignment.PNG
alignment.PNG (46.24 KiB) Viewed 2430 times
User avatar
JGR
Tycoon
Tycoon
Posts: 2559
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

JGR wrote:
Emperor Jake wrote:UPDATE: It seems signals on custom bridgeheads is completely broken, when I did manage to remove the top signal, the train got stuck at the other signal even though it was green, probably because the game can't handle a signal that's also on an intersection.
Signals are not permitted on junction tiles.
I thought that all ways of constructing that were disallowed but I must have missed something, I'll look into it.
Many thanks for the bug report.
This is now fixed.
Any bridges which came to exist with both signals and junction tiles should be removed carefully, things like signal updating, etc. most likely will not work properly, and the game may crash in some circumstances.
Emperor Jake wrote:Thanks for the quick response.

Another related minor issue: train wagons on custom bridges are out of alignment for some reason:
Edit: Fixed now.
Thanks again for the bug report.
Last edited by JGR on 05 Aug 2018 09:54, edited 1 time in total.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: JGR's Patch Pack

Post by le_harv »

Ever since I have upgraded from 25.2 to 26.0 I can't seem to place waypoints properly on a particular axis. I am using the windows binary you share.

Using the attached save as a test, in 25.2 no problem but when loaded in 26.0 I get an error saying, no suitable railway track found but only on the NW to SE axis.
WP Test.sav
(35.61 KiB) Downloaded 33 times
EDIT - To add my thanks too. The custom bridgeheads for both rail and road are a gamechanger addition.
User avatar
JGR
Tycoon
Tycoon
Posts: 2559
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

le_harv wrote:Ever since I have upgraded from 25.2 to 26.0 I can't seem to place waypoints properly on a particular axis. I am using the windows binary you share.

Using the attached save as a test, in 25.2 no problem but when loaded in 26.0 I get an error saying, no suitable railway track found but only on the NW to SE axis.

WP Test.sav

EDIT - To add my thanks too. The custom bridgeheads for both rail and road are a gamechanger addition.
The waypoint issue is reported and fixed already, I'll do another release soonish with this in.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
JGR
Tycoon
Tycoon
Posts: 2559
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

eshield wrote:Hello, JGR.

I've noticed few issues with 0.26.0win:
1. Entire game is lagging and stutters on mouse move. 0.25.2 does not have such issue. Re-tested 3 times on 3 diff PC (not VM). Video: https://drive.google.com/file/d/11KJbPy ... xl4YT/view
I can't reproduce this on Linux which means that I'm unlikely to be able to debug/resolve it.
Using Wine produced some odd performance behaviour but the cause was not obvious and I wasn't able to debug anything in that environment.
eshield wrote:2. Fails to load a save game provided by me in this post.
I've attached a fixed savegame:
U-TIC Organization, Oct 7th, 2121 - fixed.sav
(1.35 MiB) Downloaded 37 times
Ex TTDPatch Coder
Patch Pack, Github
eshield
Engineer
Engineer
Posts: 32
Joined: 24 Feb 2009 12:41
Contact:

Re: JGR's Patch Pack

Post by eshield »

JGR wrote: I can't reproduce this on Linux which means that I'm unlikely to be able to debug/resolve it.
Using Wine produced some odd performance behaviour but the cause was not obvious and I wasn't able to debug anything in that environment.
Thanks for an attempt!
JGR wrote:I've attached a fixed savegame: U-TIC Organization, Oct 7th, 2121 - fixed.sav
:bow:
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall open unto you.
User avatar
SquireJames
Tycoon
Tycoon
Posts: 1863
Joined: 07 Aug 2004 11:56
Skype: squirejames5
Location: Stoke-on-Trent
Contact:

Re: JGR's Patch Pack

Post by SquireJames »

Hey there, No biggy if this can't be fixed or I did something impossible, but decided to upgrade from jgrpp-0.25.2-MINGW-win64 to jgrpp-0.26.0-MINGW-win64. My save game now crashes when trying to load. Attached is the log and dmp file. If you need a save file I can upload it to.

As I said, trundling along quite happily with 0.25.2 so, I'll revert to that for now.
Attachments
JGR026Crash.rar
(255.86 KiB) Downloaded 51 times
Image
User avatar
JGR
Tycoon
Tycoon
Posts: 2559
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

SquireJames wrote:Hey there, No biggy if this can't be fixed or I did something impossible, but decided to upgrade from jgrpp-0.25.2-MINGW-win64 to jgrpp-0.26.0-MINGW-win64. My save game now crashes when trying to load. Attached is the log and dmp file. If you need a save file I can upload it to.

As I said, trundling along quite happily with 0.25.2 so, I'll revert to that for now.
This looks like one of the issues that has been reported and fixed already, so it should load in the next release.
Thanks for the report though.
Ex TTDPatch Coder
Patch Pack, Github
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 43 guests