New map features

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

aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: New map features

Post by aantono »

I'm using zlib version 1.2.8 installed via homebrew (pkg mgr for OSX)

After making the 'template' changes you suggested, the compiling FINALLY succeeded, and I was able to build a Mac bundle.

BTW, here is what my final/working ./configure looks like:

Code: Select all

./configure --enable-static  LDFLAGS="-stdlib=libc++ -std=c++11 -Wno-narrowing" CFLAGS="-stdlib=libc++ -std=c++11 -Wno-narrowing" CC=/usr/bin/clang++ CXX=/usr/bin/clang++
So I'm attaching it to this post for people to try out.

I'm also attaching a patch.diff of all the changes I had to make to get the thing to compile. Hopefully you won't mind applying them to the code, so I can continue to provide OSX builds in the future.
Attachments
bundle.zip
Built for OSX Yosemite from hash - gb3ef7105M
(6.42 MiB) Downloaded 30 times
patch.diff
(5.73 KiB) Downloaded 43 times
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

Glad it worked!
aantono wrote:I'm also attaching a patch.diff of all the changes I had to make to get the thing to compile. Hopefully you won't mind applying them to the code, so I can continue to provide OSX builds in the future.
Thank you. However, I cannot blindly apply your patch to the source tree; what fixes your build may very well break somebody else's. But I will look into each change in detail and decide how to deal with it (for instance, I will likely fix some of your casts in a different way).
aantono wrote:I'm using zlib version 1.2.8 installed via homebrew (pkg mgr for OSX)
Can you post your /usr/include/zlib.h and /usr/include/zconf.h files (preferably tarred or zipped)?
aantono wrote:After making the 'template' changes you suggested, the compiling FINALLY succeeded, and I was able to build a Mac bundle.
According to a bug report in the clang mailing list, my code may be at fault here. I am using a construction that is not completely correct but works under GCC and MSVC. GCC also accepts the correct syntax, but I will try it with MSVC before making the change (you never know when doing things right may get MSVC out of whack).
aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: New map features

Post by aantono »

Here are the headers...
Attachments
headers.zip
zlib.h and zconf.h headers
(25.73 KiB) Downloaded 28 times
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

Thank you. So there is something about your zlib installation: you said that you installed zlib 1.2.8, but those headers are from zlib 1.2.5, which lacks ZLIB_CONST support. This likely means that your system came with 1.2.5 in the usual place (/usr) and you installed 1.2.8 somewhere else (/usr/local, perhaps?). Now the question is which one your compilation setup picks up, and my bet is on the preinstalled library, given that you had to use a const_cast. You should try to find out where your zlib 1.2.8 installation is and point the configure script to it.
aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: New map features

Post by aantono »

That is a good question.

The output of ./configure only shows that

Code: Select all

checking zlib... found
, but does not indicate the actual version or the location.

I'll try to reconfigure with

Code: Select all

CPPFLAGS="-I/usr/local/opt/zlib/include"
to see if that works.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: New map features

Post by Eddi »

try the file "config.log", it may contain additional details, e.g.

Code: Select all

detecting zlib
  trying /usr/include/zlib.h... found
checking zlib... found
aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: New map features

Post by aantono »

Yep, that's where it is reading it.

And for some reason adding

Code: Select all

CPPFLAGS="-I/usr/local/opt/zlib/include"
didn't make it use the new location of zlib either :(
Any suggestions on what is the right switch to tell ./configure to use zlib from a different location?
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: New map features

Post by Eddi »

something like "--with-zlib=location", but don't take my word for it

also, "CPPFLAGS" is probably not a thing. "CFLAGS" or "CXXFLAGS", plus "LDFLAGS"
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

aantono wrote:Any suggestions on what is the right switch to tell ./configure to use zlib from a different location?
There is none, actually.

You can say

Code: Select all

--with-zlib=/path/to/your/zlib
but this will just check that a file by the name provided exists, and ignore it otherwise (try "--with-zlib=/bin/cat" and you will get exactly the same generated makefiles). It only makes a difference if you are doing a static build (not recommended), in which case the argument selects the location of the static libz.a. But there is no way whatsoever to point the configure script to an alternate directory for the include files, which is precisely what you need to get rid of your compilation error.

Some day I will autotoolise the package and stop all this madness.
User avatar
te_lanus
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 19 Jul 2012 18:04
Location: The Elizabeth Arkham Asylum for the Criminally Insane

Re: New map features

Post by te_lanus »

Bug report ahead

This morning I tried to construct a "path" signal in front of a depot, and it crashed. :(

The thing that triggered the error is that there was a train entering the depot at the time. Tested with 1.5.0-RC1 and doesn't happen in main trunk. Tested it few times, and everytime it happened

Crash reason:
Exception: E1212012
Location: 7C812AEB
Message: Assertion failed at line 2730 of C:/MinGW/msys/1.0/home/Adminguy/fttd/src/train_cmd.cpp: v->trackdir != TRACKDIR_DEPOT
Attachments
crash.log.txt
(16.47 KiB) Downloaded 31 times
crash.png
(326.07 KiB) Downloaded 7 times
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

Another update.
  • Fixed a crash when a road vehicle reached a dead end through a one-way road (reported by romazoon).
  • Fixed several slope- and bridge-related bugs in the road pathfinder.
  • Minor code changes to make compilation easier with clang in c++11 mode.
aantono:
From the diff you sent me, you should no longer need to patch gfx.cpp, map/tileset.h, misc_gui.cpp or table/newgrf_debug_data.h; the other changes are still required. Please let me know if there is anything else broken.
te_lanus wrote:Bug report ahead
Thanks for your report; I will look into it.


EDIT: I have (hopefully) fixed the serious bug I found yesterday. The game still suffers from the bug reported by te_lanus, which I have already identified. As a workaround until I fix it, try not to modify rail track or signals near a train that is partially in a depot.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:Another update.
...
EDIT: I have (hopefully) fixed the serious bug I found yesterday. The game still suffers from the bug reported by te_lanus, which I have already identified. As a workaround until I fix it, try not to modify rail track or signals near a train that is partially in a depot.
and the Windows binary (unguaranteed):
Attachments
OpenTTD-g7255c8fe-Win32.7z
(5.43 MiB) Downloaded 34 times
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

And here is the Ubuntu version as usual a bit l8er, because
i thought there will be another update of the source :D
Replaced with a newer version, thanks Cirdan :)
Attachments
openttd-custom-ga7336630-UNIX.tar.xz
Version: ga7336630
Ubuntu 14.04 64bit
(4.62 MiB) Downloaded 27 times
Last edited by TrueSatan on 12 Jan 2015 21:00, edited 1 time in total.
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

TrueSatan wrote:i thought there will be another update of the source :D
And there is, now. The crash when modifying signals near a train that is partially in a depot, reported by te_lanus, should be gone, and there are several cherry-picks from openttd, but no other user-visible changes since last update.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

As u can see Cirdan i am as fast as an Vacuum Tube :D
Already compiled the newest version.

Thanks and hope to see more.

btw ever thought about 45° tunnels and bridges?
I don't need those Roller Coaster style, but sometimes 45°
like the tracks would be nice.
User avatar
romazoon
Tycoon
Tycoon
Posts: 1291
Joined: 20 Jun 2010 23:16

Re: New map features

Post by romazoon »

Thanks for the fixes :)

+1 for diagonal tunnels...but i want diagonal bridge too then :P

personnaly, more on the path of bridgehead, i was wondering if it s technically possible to have a road crossing rail or vice versa on the bridgehead tile ? and if that's a feature you planned/or wish to add ?
and what about starting a new bridge from the bridgehead tile ? or even station tiles on it ? technically doable with your implementation of CBH or am i just a dreamer ? ;)
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

TrueSatan wrote:btw ever thought about 45° tunnels and bridges?
I don't need those Roller Coaster style, but sometimes 45°
like the tracks would be nice.
Yes, it would be nice, but also a nightmare code-wise. I guess tunnels would be slightly easier, because they essentially do not exist anywhere in the code (just a couple of endpoints and vehicles simply drive through the mountain otherwise), but bridges do have some state. Overall, too many assumptions in the code would break, and it would take a lot of work to change them.
romazoon wrote:personnaly, more on the path of bridgehead, i was wondering if it s technically possible to have a road crossing rail or vice versa on the bridgehead tile ? and if that's a feature you planned/or wish to add ?
Hmm, never thought about it. It is technically possible, of course (as in Turing-computable); the question is how much code we would have to write. :-) I will think about it.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

To bad ga7336630 crashes on my savegame like mad after a few days ingame.
and even worse this time i forget to copy the older version. hope i have the xz somewhere around lol

added the crashlos, since you don't like my savegames from this computer i dunno if you can read
something useful.
it crashes march 8th.

going back now to an earlier version.
Edit : Found g7255c8fe and savegame works there

cheers
Attachments
ga7336630-crash.tar.xz
(4.45 MiB) Downloaded 24 times
Last edited by TrueSatan on 12 Jan 2015 21:42, edited 1 time in total.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

cirdan wrote:
TrueSatan wrote:btw ever thought about 45° tunnels and bridges?
I don't need those Roller Coaster style, but sometimes 45°
like the tracks would be nice.
Yes, it would be nice, but also a nightmare code-wise. I guess tunnels would be slightly easier, because they essentially do not exist anywhere in the code (just a couple of endpoints and vehicles simply drive through the mountain otherwise), but bridges do have some state. Overall, too many assumptions in the code would break, and it would take a lot of work to change them.
Oh tunnels would be a start and nice to have, guess it would be easier graphic wise as well.
So if you ever have time you could maybe try something out then :)

thanks and hope to get the new bug fixed soon.
User avatar
romazoon
Tycoon
Tycoon
Posts: 1291
Joined: 20 Jun 2010 23:16

Re: New map features

Post by romazoon »

thanks for the reply ;)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 39 guests