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

tlpwka
Engineer
Engineer
Posts: 16
Joined: 09 Feb 2015 17:12

Re: JGR's Patch Pack

Post by tlpwka »

Greate patch pack, using it from v 0.5.0, many thanks!
I saw, question about Terminus Airports patch was already asked. Any news about possible integration into patchpack?
Kind regards.
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: JGR's Patch Pack

Post by HackaLittleBit »

JGR wrote: I've looked at the chunnel patch(es) before and I'm not all that keen on the idea of merging it. Bugs and odd corner cases seemed to a persistent issue.
Nobody reported a bug after the last release.
I can't find any, so please report.
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

tlpwka wrote:Greate patch pack, using it from v 0.5.0, many thanks!
I saw, question about Terminus Airports patch was already asked. Any news about possible integration into patchpack?
Kind regards.
HackaLittleBit wrote:
JGR wrote: I've looked at the chunnel patch(es) before and I'm not all that keen on the idea of merging it. Bugs and odd corner cases seemed to a persistent issue.
Nobody reported a bug after the last release.
I can't find any, so please report.
I will take another look at these two when I get some time, not making any guarantees though.
Ex TTDPatch Coder
Patch Pack, Github
birdy890
Engineer
Engineer
Posts: 4
Joined: 04 Apr 2013 00:22

Re: JGR's Patch Pack

Post by birdy890 »

Not sure if this has been posted before, but thought since I have documentation, might as well post it.
[+] Spoiler
Image

I've not gotten the templates to work yet, everytime I decide it may be useful and try to use it, my game crashed.
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

Thanks for reporting this. Can you post the crash log please?
Ex TTDPatch Coder
Patch Pack, Github
BW89
Engineer
Engineer
Posts: 105
Joined: 10 May 2015 11:42

Re: JGR's Patch Pack

Post by BW89 »

Since 13.2 i can't place houses ingame! Why? I need this feature!
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

BW89 wrote:Since 13.2 i can't place houses ingame! Why? I need this feature!
It was removed because it caused desyncs in multiplayer, even when it wasn't being used.
Ex TTDPatch Coder
Patch Pack, Github
archy
Engineer
Engineer
Posts: 42
Joined: 03 Aug 2012 20:55

Re: JGR's Patch Pack

Post by archy »

The latest version from the git repo (jgrpp branch) fails to compile with GCC 6.1.1 on 64bit Arch Linux:
[+] Spoiler

Code: Select all

[SRC] Compiling dedicated.cpp
[SRC] Compiling departures.cpp
[SRC] Compiling departures_gui.cpp
In file included from /home/[...]/OpenTTD-patches/src/crashlog.cpp:42:0:
/home/[...]/OpenTTD-patches/src/safeguards.h:28:19: error: ‘std::SAFEGUARD_DO_NOT_USE_THIS_METHOD’ has not been declared
 #define calloc    SAFEGUARD_DO_NOT_USE_THIS_METHOD
                   ^
/home/[...]/OpenTTD-patches/src/safeguards.h:25:19: error: ‘std::SAFEGUARD_DO_NOT_USE_THIS_METHOD’ has not been declared
 #define malloc    SAFEGUARD_DO_NOT_USE_THIS_METHOD
                   ^
/home/[...]/OpenTTD-patches/src/safeguards.h:31:19: error: ‘std::SAFEGUARD_DO_NOT_USE_THIS_METHOD’ has not been declared
 #define realloc   SAFEGUARD_DO_NOT_USE_THIS_METHOD
                   ^
[SRC] Compiling depot.cpp
[SRC] Compiling depot_cmd.cpp
Makefile:234: recipe for target 'crashlog.o' failed
make[1]: *** [crashlog.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/[...]/OpenTTD-patches/objs/release'
Makefile:57: recipe for target 'all' failed
make: *** [all] Error 1
EDIT: Added distro/compiler details.
Last edited by archy on 19 May 2016 18:16, edited 1 time in total.
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

archy wrote:The latest version from the git repo fails to compile on Linux:
[+] Spoiler

Code: Select all

[SRC] Compiling dedicated.cpp
[SRC] Compiling departures.cpp
[SRC] Compiling departures_gui.cpp
In file included from /home/[...]/OpenTTD-patches/src/crashlog.cpp:42:0:
/home/[...]/OpenTTD-patches/src/safeguards.h:28:19: error: ‘std::SAFEGUARD_DO_NOT_USE_THIS_METHOD’ has not been declared
 #define calloc    SAFEGUARD_DO_NOT_USE_THIS_METHOD
                   ^
/home/[...]/OpenTTD-patches/src/safeguards.h:25:19: error: ‘std::SAFEGUARD_DO_NOT_USE_THIS_METHOD’ has not been declared
 #define malloc    SAFEGUARD_DO_NOT_USE_THIS_METHOD
                   ^
/home/[...]/OpenTTD-patches/src/safeguards.h:31:19: error: ‘std::SAFEGUARD_DO_NOT_USE_THIS_METHOD’ has not been declared
 #define realloc   SAFEGUARD_DO_NOT_USE_THIS_METHOD
                   ^
[SRC] Compiling depot.cpp
[SRC] Compiling depot_cmd.cpp
Makefile:234: recipe for target 'crashlog.o' failed
make[1]: *** [crashlog.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/[...]/OpenTTD-patches/objs/release'
Makefile:57: recipe for target 'all' failed
make: *** [all] Error 1
Which distro, compiler and configure flags are you using out of curiosity? As best I can tell trunk OpenTTD will not compile either if you get that error.
Can you try the "crashlog_header_compile_fix_tmp" branch on github and let me know if that fixes it?
Thanks for reporting this.
Ex TTDPatch Coder
Patch Pack, Github
archy
Engineer
Engineer
Posts: 42
Joined: 03 Aug 2012 20:55

Re: JGR's Patch Pack

Post by archy »

With that branch, crashlog.o seems to compile fine and the compilation process gets quite a bit farther, but then fails for newgrf.o with a different error:
[+] Spoiler

Code: Select all

[...]
[SRC] Compiling network/network_udp.cpp
[SRC] Compiling newgrf.cpp
[SRC] Compiling newgrf_airport.cpp
[SRC] Compiling newgrf_airporttiles.cpp
/home/[...]/OpenTTD-patches/src/newgrf.cpp: In function ‘ChangeInfoResult TownHouseChangeInfo(uint, int, int, ByteReader*)’:
/home/[...]/OpenTTD-patches/src/newgrf.cpp:2409:47: error: call of overloaded ‘abs(int8&)’ is ambiguous
     housespec->cargo_acceptance[2] = abs(goods); // but we do need positive value here
                                               ^
In file included from /usr/include/c++/6.1.1/cstdlib:75:0,
                 from /home/[...]/OpenTTD-patches/src/stdafx.h:86,
                 from /home/[...]/OpenTTD-patches/src/newgrf.cpp:12:
/usr/include/stdlib.h:774:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /home/[...]/OpenTTD-patches/src/core/overflowsafe_type.hpp:15:0,
                 from /home/[...]/OpenTTD-patches/src/economy_type.h:15,
                 from /home/[...]/OpenTTD-patches/src/engine_type.h:15,
                 from /home/[...]/OpenTTD-patches/src/engine_func.h:15,
                 from /home/[...]/OpenTTD-patches/src/newgrf.cpp:18:
/home/[...]/OpenTTD-patches/src/core/math_func.hpp:83:17: note: candidate: T abs(T) [with T = signed char]
 static inline T abs(const T a)
                 ^~~
In file included from /usr/include/c++/6.1.1/math.h:36:0,
                 from /home/[...]/OpenTTD-patches/src/viewport_type.h:18,
                 from /home/[...]/OpenTTD-patches/src/town.h:15,
                 from /home/[...]/OpenTTD-patches/src/newgrf.cpp:21:
/usr/include/c++/6.1.1/cmath:103:5: note: candidate: constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::abs(_Tp) [with _Tp = signed char; typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type = double]
     abs(_Tp __x)
     ^~~
/usr/include/c++/6.1.1/cmath:95:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/6.1.1/cmath:91:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/6.1.1/cmath:85:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
In file included from /home/[...]/OpenTTD-patches/src/stdafx.h:86:0,
                 from /home/[...]/OpenTTD-patches/src/newgrf.cpp:12:
/usr/include/c++/6.1.1/cstdlib:185:3: note: candidate: __int128 std::abs(__int128)
   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
   ^~~
/usr/include/c++/6.1.1/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/6.1.1/cstdlib:172:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
[SRC] Compiling newgrf_canal.cpp
[SRC] Compiling newgrf_cargo.cpp
Makefile:234: recipe for target 'newgrf.o' failed
make[1]: *** [newgrf.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/[...]/OpenTTD-patches/objs/release'
Makefile:57: recipe for target 'all' failed                                                                                                                          
make: *** [all] Error 1
The configure and make command used:
[+] Spoiler

Code: Select all

./configure \
    --prefix-dir=/usr \
    --binary-name=openttd \
    --binary-dir=bin \
    --data-dir=share/openttd \
    --install-dir=/tmp/package-build/openttd \
    --doc-dir=share/doc/openttd \
    --menu-name="OpenTTD" \
    --personal-dir=.openttd

make
PS: You were right, the original "SAFEGUARD_DO_NOT_USE_THIS_METHOD" error for crashlog.o happens with the latest official OpenTTD from SVN trunk, too.
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

I've added another commit which should fix that issue.
Ex TTDPatch Coder
Patch Pack, Github
archy
Engineer
Engineer
Posts: 42
Joined: 03 Aug 2012 20:55

Re: JGR's Patch Pack

Post by archy »

It still fails at the same spot, although the error message slightly changed:
[+] Spoiler

Code: Select all

[...]
[SRC] Compiling newgrf.cpp
[SRC] Compiling newgrf_airport.cpp
[SRC] Compiling newgrf_airporttiles.cpp
[SRC] Compiling newgrf_canal.cpp
/home/[...]/OpenTTD-patches/src/newgrf.cpp: In function ‘ChangeInfoResult TownHouseChangeInfo(uint, int, int, ByteReader*)’:
/home/[...]/OpenTTD-patches/src/newgrf.cpp:2409:52: error: call of overloaded ‘abs(int8&)’ is ambiguous
     housespec->cargo_acceptance[2] = abs<int>(goods); // but we do need positive value here
                                                    ^
In file included from /home/[...]/OpenTTD-patches/src/core/overflowsafe_type.hpp:15:0,
                 from /home/[...]/OpenTTD-patches/src/economy_type.h:15,
                 from /home/[...]/OpenTTD-patches/src/engine_type.h:15,
                 from /home/[...]/OpenTTD-patches/src/engine_func.h:15,
                 from /home/[...]/OpenTTD-patches/src/newgrf.cpp:18:
/home/[...]/OpenTTD-patches/src/core/math_func.hpp:83:17: note: candidate: T abs(T) [with T = int]
 static inline T abs(const T a)
                 ^~~
In file included from /usr/include/c++/6.1.1/math.h:36:0,
                 from /home/[...]/OpenTTD-patches/src/viewport_type.h:18,
                 from /home/[...]/OpenTTD-patches/src/town.h:15,
                 from /home/[...]/OpenTTD-patches/src/newgrf.cpp:21:
/usr/include/c++/6.1.1/cmath:103:5: note: candidate: constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::abs(_Tp) [with _Tp = int; typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type = double]
     abs(_Tp __x)
     ^~~
[SRC] Compiling newgrf_cargo.cpp
[SRC] Compiling newgrf_config.cpp
[SRC] Compiling newgrf_commons.cpp
Makefile:234: recipe for target 'newgrf.o' failed
make[1]: *** [newgrf.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/[...]/OpenTTD-patches/objs/release'
Makefile:57: recipe for target 'all' failed
make: *** [all] Error 1
==> ERROR: A failure occurred in build().
    Aborting...
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

Edit:
This is a measurement tool patch bug, which should be straightforward to fix.
I'll upload a fix shortly.
Last edited by JGR on 20 May 2016 15:52, edited 1 time in total.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
STD
Tycoon
Tycoon
Posts: 1810
Joined: 02 Jul 2012 14:53
Location: Russia, Samara

Re: JGR's Patch Pack

Post by STD »

Hi, JGR. Thank you for patchpack. I really like to play it. You please add the patch calculate the rating at the stations as in spring patchpack. Personally, I like this patch. Convenient :) .
Calculation or rating on the station (spring patch pack).png
Calculation or rating on the station (spring patch pack).png (13.15 KiB) Viewed 2669 times
[OpenTTD] STD screenshots
----------------------------------------------------------------------------------------------------------------------------------
[OpenTTD] STD saved games - My finished scenarios and saves from the game
My Youtube channel - OpenTTD | Wiki xUSSR set (RU) | Wiki xUSSR set (EN) | Download the latest version of the xUSSR set
TT Screenshot of the Month - the page editor | Screenshot Of The Month Contest Winner: August 2017
archy
Engineer
Engineer
Posts: 42
Joined: 03 Aug 2012 20:55

Re: JGR's Patch Pack

Post by archy »

@JGR

I've investigated the issue a bit further:

1) I found the following document, which confirms that these are indeed intentional changes to GCC 6, and that we'll have to adapt to them: Porting to GCC 6

2) I found that Linux distros are already applying a patch on their end, to make the official OpenTTD compile with GCC 6: openttd-1.5.3-gcc6.patch
I've confirmed that this patch makes both the 1.6.0 release and trunk compile just fine.

3) However, when applied to your OpenTTD-patches (jgrpp branch), it only fixes the "SAFEGUARD_DO_NOT_USE_THIS_METHOD" error. The "call of overloaded ‘abs(int8&)’ is ambiguous" error still shows up. Since it doesn't show up with trunk, there must be something your patch pack could do differently to avoid the error as well, right?
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

archy wrote:@JGR

I've investigated the issue a bit further:

1) I found the following document, which confirms that these are indeed intentional changes to GCC 6, and that we'll have to adapt to them: Porting to GCC 6

2) I found that Linux distros are already applying a patch on their end, to make the official OpenTTD compile with GCC 6: openttd-1.5.3-gcc6.patch
I've confirmed that this patch makes both the 1.6.0 release and trunk compile just fine.

3) However, when applied to your OpenTTD-patches (jgrpp branch), it only fixes the "SAFEGUARD_DO_NOT_USE_THIS_METHOD" error. The "call of overloaded ‘abs(int8&)’ is ambiguous" error still shows up. Since it doesn't show up with trunk, there must be something your patch pack could do differently to avoid the error as well, right?
I've pushed an update to the jgrpp branch on github including the previous fix for the SAFEGUARD_DO_NOT_USE_THIS_METHOD issue, and another fix for the abs issue.
The abs problem was introduced by the measurement tool patch, as it added a math.h include to a header, which I've now moved. I previously thought that that bug was also in trunk which threw me off for a while.
STD wrote:Hi, JGR. Thank you for patchpack. I really like to play it. You please add the patch calculate the rating at the stations as in spring patchpack. Personally, I like this patch. Convenient :) .
I'm not really convinced about the need for this patch. This sort of thing should go in the cheats menu rather than in the settings.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: JGR's Patch Pack

Post by Pyoro »

Isn't it also a parameter in FIRS? Maybe make a little GRF with that feature. Shouldn't be too difficult to c&p the code.
archy
Engineer
Engineer
Posts: 42
Joined: 03 Aug 2012 20:55

Re: JGR's Patch Pack

Post by archy »

JGR wrote:I've pushed an update to the jgrpp branch on github including the previous fix for the SAFEGUARD_DO_NOT_USE_THIS_METHOD issue, and another fix for the abs issue.
It works, thanks!
User avatar
Mizari
Traffic Manager
Traffic Manager
Posts: 136
Joined: 22 Apr 2012 14:21

Re: JGR's Patch Pack

Post by Mizari »

Pyoro wrote:Isn't it also a parameter in FIRS? Maybe make a little GRF with that feature. Shouldn't be too difficult to c&p the code.
It's removed in the latest FIRS. The default ratings is terrible.
nihues
Engineer
Engineer
Posts: 85
Joined: 13 Jan 2015 10:26

Re: JGR's Patch Pack

Post by nihues »

I would like a setting like daylength but only for stations ratings, like 2x, 4x+ more slow decay of ratings. Or this or play with DL on.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 20 guests