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: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

ino wrote: 13 Nov 2019 19:18 A question. I just load up OpenTTD in quite a while (I think >6 months), and update my local installation of the patch pack to cbdd9f84d8d8a181c25a9f88c908468285f1417d. I loaded up some of my old save game, and somehow a number of train are showing as 0HP, which result in a train too heavy message being shown. The savegame is already in JGRPP format so I don't know if it's vanilla problem or not. It happen in multiple save file -- the attached file doesn't have any newgrf either.

Am I missing some new options, or is it a bug, or am I missing something?
Looks like a bug, stopping and starting the vehicles fixes the HP/TE values, I will investigate shortly.

Edit: Fixed, see most recent commit.
Last edited by JGR on 13 Nov 2019 20:28, edited 1 time in total.
Ex TTDPatch Coder
Patch Pack, Github
phobos2077
Engineer
Engineer
Posts: 25
Joined: 13 Nov 2019 16:17

Re: JGR's Patch Pack

Post by phobos2077 »

JGR wrote: 13 Nov 2019 19:11 Each button is there for a reason but of course no single user will want to use all of them.
I'd expect the vast majority of users to either not use timetables, or to just turn on timetable automation/etc and never have to look at the timetable window again.
Yeah, I got that. What I mean is ideally you'd want to select which set of features do you want via settings and then only see the buttons you want to use in the UI. But you're right, once I've switched to automatic timetable, I never want to go back there. It just "works". Damn, setting up road vehicle routes was never this painless in TTD for me. Awesome job.
JGR wrote: 13 Nov 2019 19:11 No NewGRF author has ever asked about a way of reading the current day length, and therefore there is no such mechanism.
If a NewGRF author ever seriously wanted to implemented such behaviour it could be added easily enough.
In that case I'd ask for a simpler NewGRF - one that just allows you to control production rates manually, just like BaseCost? That'll solve the problem of half-empty routes with base industries.

Btw, why there is no day length increments in, say, 20%/25% of the original length? Instead the smallest change you can make is two-fold speed reduction.

PS: Playing from an non-patchpack save for several hours now. No issues so far! Definitely don't want to return back to vanilla. This feels as a massive improvement. I think I'd settle on a day length of 2 for a good balance.
ino
Traffic Manager
Traffic Manager
Posts: 152
Joined: 09 Apr 2017 14:58

Re: JGR's Patch Pack

Post by ino »

JGR wrote: 13 Nov 2019 19:27 Looks like a bug, stopping and starting the vehicles fixes the HP/TE values, I will investigate shortly.

Edit: Fixed, see most recent commit.
Confirmed fixed, thank you,
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5656
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: JGR's Patch Pack

Post by andythenorth »

phobos2077 wrote: 13 Nov 2019 20:02 In that case I'd ask for a simpler NewGRF - one that just allows you to control production rates manually, just like BaseCost? That'll solve the problem of half-empty routes with base industries
Just use the production cheat? :)
User avatar
vincentkoevoets
Engineer
Engineer
Posts: 48
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets »

vincentkoevoets wrote: 13 Nov 2019 11:44 Hey there JGR, I'm back at it again.. :roll:
Trying to compile on Windows this time, I get the following error:

Code: Select all

make[1]: Map '/home/Koevoets/openttd-patches/objs/lang' wordt binnengegaan
[LANG] Compiling core/alloc_func.cpp
[LANG] Compiling string.cpp
[LANG] Compiling strgen/strgen_base.cpp
[LANG] Compiling strgen/strgen.cpp
[LANG] Compiling getoptdata.cpp
[LANG] Compiling and Linking strgen.exe
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: strgen_base.o:strgen_base.cpp:(.text+0x28e): undefined reference to `__memcpy_chk'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:67: strgen.exe] Fout 1
make[1]: Map '/home/Koevoets/openttd-patches/objs/lang' wordt verlaten
make: *** [Makefile:57: all] Fout 1
Yes I know you compiled it already, but I enjoy the process myself. Can you help me with this one?
Thanks!
Nevermind this, turns out updating my Msys2 installation borked things up. A lot of research later I've got it working again, long story that does not belong in this place. But a word of advice would be: be careful with updating Msys/MinGW installations because it might mess things up.
phobos2077
Engineer
Engineer
Posts: 25
Joined: 13 Nov 2019 16:17

Re: JGR's Patch Pack

Post by phobos2077 »

andythenorth wrote: 15 Nov 2019 10:36 Just use the production cheat? :)
Very funny. When you start the game with base industries, they got certain default range of production rates balanced for a decent start. With day patch enabled (especially with large setting like 5 or higher), these default rates become very low, so your start is much slower and less fun. What I'd like to have is to just have some option (a NewGRF or a built-in option) to just scale the industry production rates across the board w/o resorting to manually cheating every industry values (which breaks the flow for me and is very tedious to do for every factory or house).
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5656
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: JGR's Patch Pack

Post by andythenorth »

phobos2077 wrote: 15 Nov 2019 21:54What I'd like to have is to just have some option (a NewGRF or a built-in option)
Newgrf will probably work then. It won't be very hard for you to make one.
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

Ragin1_ wrote: 08 Nov 2019 03:27 Not sure if this has been mentioned before but the template train replacement window is massive when you use 2x gfx and font size

https://gyazo.com/2b7805db7ecc4780294f5ea75d2b0ed3

https://gyazo.com/f24a24368a5d863a52fdcc9a55549aa7

I think it might be something to do with the 2x font size as it doesnt have the same issue in jokers patch pack which is missing it

https://gyazo.com/631cc701a2bcf8a2b22d00df16cefc51

https://gyazo.com/33912c23139283dcb702e61574c7d79d

I saw something about resizing the template based train replacement window in the patch notes for 0.32.1 but upgrading to 0.32.2 didnt do anything
This should be fixed now, it'll be in the next release.
Ex TTDPatch Coder
Patch Pack, Github
AkipTsaqif
Engineer
Engineer
Posts: 21
Joined: 28 Apr 2016 11:11

Re: JGR's Patch Pack

Post by AkipTsaqif »

Hi. Just a question from me.

Does this mean that the Dutch Station Addition Set by Quast65 not so compatible with bridge over platform patch? The graphic looks a little glitchy, especially when I put the platform on the left/right bottom side of the track.
[+] Spoiler
Image
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

AkipTsaqif wrote: 18 Nov 2019 05:05 Hi. Just a question from me.

Does this mean that the Dutch Station Addition Set by Quast65 not so compatible with bridge over platform patch? The graphic looks a little glitchy, especially when I put the platform on the left/right bottom side of the track.
[+] Spoiler
Image
Other than Wallyweb's modification of ISR, I don't believe any station set supports this feature, as most of these station sets have not been updated in several years.

The glitches in Dutch Stations occurs because the roof on the stations is as the same height as the bridge. To work around this you'll need to make the bridge higher.
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: 18 Nov 2019 06:56
AkipTsaqif wrote: 18 Nov 2019 05:05 Hi. Just a question from me.

Does this mean that the Dutch Station Addition Set by Quast65 not so compatible with bridge over platform patch? The graphic looks a little glitchy, especially when I put the platform on the left/right bottom side of the track.
[+] Spoiler
Image
Other than Wallyweb's modification of ISR, I don't believe any station set supports this feature, as most of these station sets have not been updated in several years.

The glitches in Dutch Stations occurs because the roof on the stations is as the same height as the bridge. To work around this you'll need to make the bridge higher.
Quast65 is aware of the bridges-over-stations feature, but I don't know if he implemented it. There are two versions of the feature. Cirdan did the original for his New Map Features. JGR took it to new levels. In JGR's version, where the bridge glitches with the roof of the station tile, it would have thrown a "can't build bridge here" error message and as kamnet noted, you would have to build the bridge at least one level higher. Part of my ISR mod was testing each station tile for its height.
A work around for you would be to use a flat (no roof) station tile where the bridge crosses.
AkipTsaqif
Engineer
Engineer
Posts: 21
Joined: 28 Apr 2016 11:11

Re: JGR's Patch Pack

Post by AkipTsaqif »

wallyweb wrote: 18 Nov 2019 09:01 Quast65 is aware of the bridges-over-stations feature, but I don't know if he implemented it. There are two versions of the feature. Cirdan did the original for his New Map Features. JGR took it to new levels. In JGR's version, where the bridge glitches with the roof of the station tile, it would have thrown a "can't build bridge here" error message and as kamnet noted, you would have to build the bridge at least one level higher. Part of my ISR mod was testing each station tile for its height.
A work around for you would be to use a flat (no roof) station tile where the bridge crosses.
Still the same tough:
[+] Spoiler
Image

Building one level higher fixes that but there is still some little glitch with the roof:
[+] Spoiler
Image
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: JGR's Patch Pack

Post by wallyweb »

AkipTsaqif wrote: 18 Nov 2019 14:32 Building one level higher fixes that but there is still some little glitch with the roof:
Then the roof must be higher than expected. Build the bridge one more level higher.
User avatar
Quast65
Tycoon
Tycoon
Posts: 2654
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: JGR's Patch Pack

Post by Quast65 »

wallyweb wrote: 18 Nov 2019 14:52
AkipTsaqif wrote: 18 Nov 2019 14:32 Building one level higher fixes that but there is still some little glitch with the roof:
Then the roof must be higher than expected. Build the bridge one more level higher.
The issue is caused by my wrong use of Building Boxes (press CTRL+B ingame to see them) when I started out coding a long time ago.
Wasnt such a huge issue when bridges could not be built over stations, now it can be…
So, I am aware of the issue. Will it be fixed? To be honest, not in the foreseeable future, its a lot of boring code-repair.
The GRF's are GPL though, so you are very welcome to fix it.
Or to make a little GRF with just a couple of platforms using the graphics from this set (like Wally suggested, the ones without anything on them) that have correct Building Boxes, especially for under bridges.
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

Quast65 wrote: 18 Nov 2019 15:12
wallyweb wrote: 18 Nov 2019 14:52
AkipTsaqif wrote: 18 Nov 2019 14:32 Building one level higher fixes that but there is still some little glitch with the roof:
Then the roof must be higher than expected. Build the bridge one more level higher.
The issue is caused by my wrong use of Building Boxes (press CTRL+B ingame to see them) when I started out coding a long time ago.
Wasnt such a huge issue when bridges could not be built over stations, now it can be…
So, I am aware of the issue. Will it be fixed? To be honest, not in the foreseeable future, its a lot of boring code-repair.
The GRF's are GPL though, so you are very welcome to fix it.
Or to make a little GRF with just a couple of platforms using the graphics from this set (like Wally suggested, the ones without anything on them) that have correct Building Boxes, especially for under bridges.
By default building bridges over GRF stations which don't define the required clearance is not allowed, exactly because it isn't possible to work out the required vertical clearance and bridge pillar restrictions, and there is a lot of scope for graphical glitches.
There is an override setting to allow it anyway, in which case it is really up to the user to make sure the bridge is high enough and pillars are not in inappropriate places.
The default stations and any GRFs which correctly set the clearance and bridge pillar restrictions should render correctly and not require the override setting.

For reference the default stations have a minimum clearance of 2 and 5 for the unroofed and roofed versions respectively, and prohibit pillars as necessary.

If using a bridge GRF which doesn't explicitly set the pillar flags (i.e. all of them), the bridge pillars are set reasonably conservatively.
Ex TTDPatch Coder
Patch Pack, Github
dasy2k1
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 20 Sep 2006 23:43
Location: UK
Contact:

Re: JGR's Patch Pack

Post by dasy2k1 »

Anyone else struggling to compile the current repo?

Im struggling with GFX_layout which is crashing the compiler

Not sure if this is the patch pack or trunk to be honest

Code: Select all

[SRC] Compiling gfx_layout.cpp
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp: In member function ‘virtual std::unique_ptr<const ParagraphLayouter::Line> FallbackParagraphLayout::NextLine(int)’:
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:513:10: error: cannot bind ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>’ lvalue to ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>&&’
   return l;
          ^
In file included from /usr/include/c++/4.9/memory:81:0,
                 from /home/dasy2k1/games/OpenTTD/src/stdafx.h:87,
                 from /home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:10:
/usr/include/c++/4.9/bits/unique_ptr.h:220:2: note: initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = FallbackParagraphLayout::FallbackLine; _Ep = std::default_delete<FallbackParagraphLayout::FallbackLine>; <template-parameter-2-3> = void; _Tp = const ParagraphLayouter::Line; _Dp = std::default_delete<const ParagraphLayouter::Line>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:563:13: error: cannot bind ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>’ lvalue to ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>&&’
      return l;
             ^
In file included from /usr/include/c++/4.9/memory:81:0,
                 from /home/dasy2k1/games/OpenTTD/src/stdafx.h:87,
                 from /home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:10:
/usr/include/c++/4.9/bits/unique_ptr.h:220:2: note: initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = FallbackParagraphLayout::FallbackLine; _Ep = std::default_delete<FallbackParagraphLayout::FallbackLine>; <template-parameter-2-3> = void; _Tp = const ParagraphLayouter::Line; _Dp = std::default_delete<const ParagraphLayouter::Line>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:590:9: error: cannot bind ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>’ lvalue to ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>&&’
  return l;
         ^
In file included from /usr/include/c++/4.9/memory:81:0,
                 from /home/dasy2k1/games/OpenTTD/src/stdafx.h:87,
                 from /home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:10:
/usr/include/c++/4.9/bits/unique_ptr.h:220:2: note: initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = FallbackParagraphLayout::FallbackLine; _Ep = std::default_delete<FallbackParagraphLayout::FallbackLine>; <template-parameter-2-3> = void; _Tp = const ParagraphLayouter::Line; _Dp = std::default_delete<const ParagraphLayouter::Line>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:591:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Makefile:234: recipe for target 'gfx_layout.o' failed
make[1]: *** [gfx_layout.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/mnt/shared/games/OpenTTD/objs/release'
Makefile:54: recipe for target 'all' failed
make: *** [all] Error 1
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

dasy2k1 wrote: 25 Nov 2019 21:55 Anyone else struggling to compile the current repo?

Im struggling with GFX_layout which is crashing the compiler

Not sure if this is the patch pack or trunk to be honest

Code: Select all

[SRC] Compiling gfx_layout.cpp
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp: In member function ‘virtual std::unique_ptr<const ParagraphLayouter::Line> FallbackParagraphLayout::NextLine(int)’:
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:513:10: error: cannot bind ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>’ lvalue to ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>&&’
   return l;
          ^
In file included from /usr/include/c++/4.9/memory:81:0,
                 from /home/dasy2k1/games/OpenTTD/src/stdafx.h:87,
                 from /home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:10:
/usr/include/c++/4.9/bits/unique_ptr.h:220:2: note: initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = FallbackParagraphLayout::FallbackLine; _Ep = std::default_delete<FallbackParagraphLayout::FallbackLine>; <template-parameter-2-3> = void; _Tp = const ParagraphLayouter::Line; _Dp = std::default_delete<const ParagraphLayouter::Line>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:563:13: error: cannot bind ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>’ lvalue to ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>&&’
      return l;
             ^
In file included from /usr/include/c++/4.9/memory:81:0,
                 from /home/dasy2k1/games/OpenTTD/src/stdafx.h:87,
                 from /home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:10:
/usr/include/c++/4.9/bits/unique_ptr.h:220:2: note: initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = FallbackParagraphLayout::FallbackLine; _Ep = std::default_delete<FallbackParagraphLayout::FallbackLine>; <template-parameter-2-3> = void; _Tp = const ParagraphLayouter::Line; _Dp = std::default_delete<const ParagraphLayouter::Line>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:590:9: error: cannot bind ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>’ lvalue to ‘std::unique_ptr<FallbackParagraphLayout::FallbackLine>&&’
  return l;
         ^
In file included from /usr/include/c++/4.9/memory:81:0,
                 from /home/dasy2k1/games/OpenTTD/src/stdafx.h:87,
                 from /home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:10:
/usr/include/c++/4.9/bits/unique_ptr.h:220:2: note: initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = FallbackParagraphLayout::FallbackLine; _Ep = std::default_delete<FallbackParagraphLayout::FallbackLine>; <template-parameter-2-3> = void; _Tp = const ParagraphLayouter::Line; _Dp = std::default_delete<const ParagraphLayouter::Line>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
/home/dasy2k1/games/OpenTTD/src/gfx_layout.cpp:591:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Makefile:234: recipe for target 'gfx_layout.o' failed
make[1]: *** [gfx_layout.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/mnt/shared/games/OpenTTD/objs/release'
Makefile:54: recipe for target 'all' failed
make: *** [all] Error 1
Looks like this recent change in trunk: https://github.com/OpenTTD/OpenTTD/comm ... 3e0ad8182f
I'll see what I can do.

Edit: If you

Code: Select all

git revert 150884a9
does that make the problem go away?
Ex TTDPatch Coder
Patch Pack, Github
maxiecool2
Engineer
Engineer
Posts: 31
Joined: 28 Feb 2013 00:20

Re: JGR's Patch Pack

Post by maxiecool2 »

how do i add patched to the patchpack?
its just 2 patches from spring i want to add
wait for cargo and industry filter
i find that picking upcargo waiting at stations doesnt alter its production, in a stations set in series where the last station has wait for full cargo
the industry filter is more beneficial to my arthritic wrists, i dont have to constantly scroll the industry lists for new industry groups im currently working on
thanks mat
dasy2k1
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 20 Sep 2006 23:43
Location: UK
Contact:

Re: JGR's Patch Pack

Post by dasy2k1 »

fixed the compilation errors, was my stupidly out of date version of gcc
phobos2077
Engineer
Engineer
Posts: 25
Joined: 13 Nov 2019 16:17

Re: JGR's Patch Pack

Post by phobos2077 »

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.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 14 guests