New map features
Moderator: OpenTTD Developers
- Toni Babelony
- Tycoon
- Posts: 1389
- Joined: 07 Jul 2006 09:34
- Skype: toni_babelony
- Location: Sagamihara-shi, Japan
- Contact:
Re: New map features
I know this isn't of any practical help, but, if I may, I'd like to express my gratitude and applaud the development of this patch. This is something OpenTTD has missed out on a lot!
Please, do keep up the good work! If this gets into the stable releases (nightlies) of OpenTTD, it will completely change the gaming experience and ways of thought of all players.
Please, do keep up the good work! If this gets into the stable releases (nightlies) of OpenTTD, it will completely change the gaming experience and ways of thought of all players.
Retired JapanSet developer and creator of TIAS.
Re: New map features
It may not be practical help, but it helps anyway, so thank you.
I am beginning to feel quite confident about the patch, not in the sense that it is bug-free--most likely it is not--but with the design choices. Specifically, after the last round of code restructuring, I no longer have any reservations about custom rail bridgeheads and signal handling, which were my main concerns. So, while I am still tweaking the patch sequence, I expect it to remain fairly stable unless bugs show up.
I am beginning to feel quite confident about the patch, not in the sense that it is bug-free--most likely it is not--but with the design choices. Specifically, after the last round of code restructuring, I no longer have any reservations about custom rail bridgeheads and signal handling, which were my main concerns. So, while I am still tweaking the patch sequence, I expect it to remain fairly stable unless bugs show up.
- Attachments
-
- nma-r24070.diff.gz
- Simple diff
- (280.17 KiB) Downloaded 199 times
-
- nma-r24070.patch.gz
- Branch (361 patches)
- (592.32 KiB) Downloaded 184 times
Re: New map features
Rebased against current trunk.
- Attachments
-
- nma-r24262.diff.gz
- Simple diff
- (281.49 KiB) Downloaded 184 times
-
- nma-r24262.patch.gz
- Branch (370 patches)
- (598.19 KiB) Downloaded 185 times
- JacobD88
- Chief Executive
- Posts: 708
- Joined: 16 Aug 2008 17:51
- Location: Long Eaton, Nottinghamshire. UK
- Contact:
Re: New map features
Thank-you for your continued support of this set of patches Cirdan, your work is greatly appreciated
High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: New map features
Just a quick note cirdan
get only 1 compile error in mingw
fixed it with
get only 1 compile error in mingw
Code: Select all
d:/development/ottd/vtile/src/train_cmd.cpp: In function 'void FreeTrainTrackRes
ervation(const Train*)':
d:/development/ottd/vtile/src/train_cmd.cpp:2236:10: error: 'ft' cannot appear i
n a constant-expression
d:/development/ottd/vtile/src/train_cmd.cpp:2236:13: error: '.' cannot appear in
a constant-expression
d:/development/ottd/vtile/src/train_cmd.cpp:2243:10: error: 'ft' cannot appear i
n a constant-expression
d:/development/ottd/vtile/src/train_cmd.cpp:2243:13: error: '.' cannot appear in
a constant-expression
make[1]: *** [train_cmd.o] Error 1
Code: Select all
if (first) {
if (ft.m_flag == ft.TF_BRIDGE) {
if (ft.m_old.InWormhole()) {
assert(IsRailBridgeTile(ft.m_old.wormhole));
} else {
assert(IsRailBridgeTile(ft.m_old.tile));
}
} else if (ft.m_flag == ft.TF_TUNNEL) {
if (ft.m_old.InWormhole()) {
assert(IsTunnelTile(ft.m_old.wormhole));
} else {
assert(IsTunnelTile(ft.m_old.tile));
}
}
break;
}
Re: New map features
How strange... The fix is obviously correct, but I wonder why I do not get that error and you do. What compiler are you using?
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: New map features
Code: Select all
hans@H ~
$ gcc -v
Using built-in specs.
COLLECT_GCC=d:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=d:/mingw/bin/../libexec/gcc/mingw32/4.5.0/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.0/configure --enable-languages=c,c++,ada,fortran,obj
c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo
mp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-r
untime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.0 (GCC)
hans@H ~
$
Re: New map features
Thank you. I can successfully reproduce the error with gcc versions 4.5.0, 4.5.1 and 4.5.2, but not with 4.6.1 or 4.6.3. Therefore, I guess that gcc was stricter in the 4.5 branch than in 4.6. I will include your fix in my patch.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: New map features
zip file with vc++ build log plus small perl file to convert from git to svn (more or less).
disclaimer: use perl file at your own responsibility.
EDIT: Cirdan I did not do clean build so hold on pls.
EDIT2: that build log stands !!
EDIT3: warning
disclaimer: use perl file at your own responsibility.
EDIT: Cirdan I did not do clean build so hold on pls.
EDIT2: that build log stands !!
EDIT3: warning
Code: Select all
d:/development/ottd/vtile/src/elrail.cpp: In function 'void DrawCatenaryRailway(
const TileInfo*)':
d:/development/ottd/vtile/src/elrail.cpp:339:26: warning: 'sprite_halftile' may
be used uninitialized in this function
- Attachments
-
- cbh.zip
- (5.73 KiB) Downloaded 189 times
Re: New map features
What kind of compiler outputs a log in HTML?
Anyway, thanks for your report. This is my analysis of the log.
Anyway, thanks for your report. This is my analysis of the log.
- The error at newgrf_engine:810 looks like a missing cast. C++ is extremely picky about casts, even between simple scalar types, and it seems that your compiler is pickier than mine. I will try to fix it by adding an explicit cast.
- The errors at map_sl.cpp probably mean that your compiler chokes on the constructionwhich GCC accepts. Compound literals are valid C99 code, but using them in C++ may be a GCC extension, so I will switch to an alternative approach.
Code: Select all
_mc[t] = { 0, 0, 0, 0, 0, 0, 0 };
- I am puzzled at the swarm of "performance warnings" regarding rail_map.h:429, in which a scalar value is returned as a boolean. This is valid code (otherwise the message would be an error), and I cannot see how it could impact performance, since it has very well-defined semantics and it is precisely what is wanted.
- The warning about sprite_halftile is harmless. The variable is never used uninitialised, but the compiler is not clever enough to see this.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: New map features
rail_map.h:429
to me *SignalByte is pointer ==> 4bytes, you need bool == byte. so extra instruction.
EDIT: Just a hunch because you declared it as byte, I can't see the instructions.
EDIT2: return (*SignalByte(tile, TrackdirToTrack(trackdir)) & (IsSignalHighBit(trackdir) ? 0x10 : 0x08)) != 0;
_mc[t] = { 0, 0, 0, 0, 0, 0, 0 }; see this
to me *SignalByte is pointer ==> 4bytes, you need bool == byte. so extra instruction.
EDIT: Just a hunch because you declared it as byte, I can't see the instructions.
EDIT2: return (*SignalByte(tile, TrackdirToTrack(trackdir)) & (IsSignalHighBit(trackdir) ? 0x10 : 0x08)) != 0;
_mc[t] = { 0, 0, 0, 0, 0, 0, 0 }; see this
Re: New map features
Here is a new version of the patch, addressing all of the recent concerns.
Exactly. An integer type, when used as a boolean, should behave as true iff nonzero. It may be a matter of coding style, but "performance warning"? The compiler should just generate the same code in either case.HackaLittleBit wrote:rail_map.h:429
EDIT2: return (*SignalByte(tile, TrackdirToTrack(trackdir)) & (IsSignalHighBit(trackdir) ? 0x10 : 0x08)) != 0;
Thanks for the link; I have changed the code not to use a compound literal.HackaLittleBit wrote:_mc[t] = { 0, 0, 0, 0, 0, 0, 0 }; see this
- Attachments
-
- nma-r24329.diff.gz
- Simple diff
- (284.23 KiB) Downloaded 167 times
-
- nma-r24329.patch.gz
- Branch (376 patches)
- (602.71 KiB) Downloaded 165 times
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: New map features
A bug for the weekend.
You did not change line 429 in rail_map.h (!= 0)
Edit1:
Try loading ottdcoop endgames.
192 and 193
will trigger asserts.
Train reverse and will not cross bridge.You did not change line 429 in rail_map.h (!= 0)
Edit1:
Try loading ottdcoop endgames.
192 and 193
will trigger asserts.
- Attachments
-
- 458.png (6.36 KiB) Viewed 6115 times
-
- 459.png (6.48 KiB) Viewed 6115 times
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: New map features
It is difficult to reproduce
so here is savegame.
Edit1:
One more bug. see pic
Just a hunch cirdan.
I need time to familiarize with the code.
But it smells that somewhere you are relying on DIAGDIR
Be careful with that one.
so here is savegame.
Edit1:
One more bug. see pic
Just a hunch cirdan.
I need time to familiarize with the code.
But it smells that somewhere you are relying on DIAGDIR
Be careful with that one.
- Attachments
-
- Spijkenwater Transport, 15th Jan 1953.sav
- (6.82 KiB) Downloaded 163 times
-
- bg2.png (58.65 KiB) Viewed 6058 times
Re: New map features
Thank you for your bug reports.
The bug triggered by the openttdcoop games was quite silly, in fact. It seems that I was being a bit overzealous with my assertions; the code itself was fine, only the assertions were wrong.
With respect to the bug in your last post, I am unable to reproduce it. Is there something specific that I must do?
The bug triggered by the openttdcoop games was quite silly, in fact. It seems that I was being a bit overzealous with my assertions; the code itself was fine, only the assertions were wrong.
With respect to the bug in your last post, I am unable to reproduce it. Is there something specific that I must do?
- Attachments
-
- nma-r24346.diff.gz
- Simple diff
- (286.09 KiB) Downloaded 162 times
-
- nma-r24346.patch.gz
- Branch (379 patches)
- (608.09 KiB) Downloaded 159 times
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: New map features
I installed hg and applied your patch to 100% clean trunk.cirdan wrote:With respect to the bug in your last post, I am unable to reproduce it. Is there something specific that I must do?
It is working now so I can't reproduce that bug anymore.
Sorry for false alarm
About openttdcoop game 192
when loading game tunnel reservation is changed
Don't know if this is intended behaviour but can be reason for crash.
see photo
- Attachments
-
- pa_tr.png (291.26 KiB) Viewed 5854 times
Re: New map features
that looks like intended behaviour to me. if tunnels are now individual tiles with individual reservation state (this is in any case necessary for proper signals on bridges/in tunnels), then there is no reason to keep the tunnel entrance reserved. it only needs making sure that the pathfinder will correctly return a path collision for the next train.HackaLittleBit wrote:when loading game tunnel reservation is changed
Don't know if this is intended behaviour but can be reason for crash.
see photo
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: New map features
This game crashes on 2 of june
cirdan maybe it is not yet a good idea to test on very complex games.
cirdan maybe it is not yet a good idea to test on very complex games.
- Attachments
-
- Groenhalen Transport, 14th Mar 1950.sav
- (10.03 KiB) Downloaded 166 times
Re: New map features
You are a keen observer... That is intended behaviour indeed. In trunk, bridges and tunnels are reserved as a whole, since they effectively behave like one long piece of track. With my patch, however, bridgeheads can have signals, or junctions, or two parallel pieces of track, so each bridgehead must be dealt with separately from the rest of the bridge. Tunnels receive the same treatment because it was easier to change both of them at the same time and because it will make it easier to add signals on tunnelheads.HackaLittleBit wrote:when loading game tunnel reservation is changed
Don't know if this is intended behaviour but can be reason for crash.
see photo
I think that testing complex games is precisely what it is needed. I consider the patch to be mostly finished in what it does, so any kind of testing is appreciated.HackaLittleBit wrote:This game crashes on 2 of june
cirdan maybe it is not yet a good idea to test on very complex games.
I will have a look at your savegame, although I will not be able to until next week.
Re: New map features
Bug squashed. In the end, it was a small oversight on my part. Thanks for the report!
- Attachments
-
- nma-r24358.diff.gz
- Simple diff
- (286.08 KiB) Downloaded 171 times
-
- nma-r24358.patch.gz
- Branch (379 patches)
- (608.17 KiB) Downloaded 172 times
Who is online
Users browsing this forum: No registered users and 38 guests