Distant-join-stations (in trunk)

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

PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: Distant-join-stations (rev11917)

Post by PhilSophus »

I just updated the patch to current trunk (r11917).

If I find the time this weekend I might have a look at open issues, i.e. passing station ID instead of the list index (there are indeed enough bits if one reorders a bit), code style, enums, comments. But I can not promise that I'll find the time.

EDIT: Removed old version of patch
Last edited by PhilSophus on 19 Jan 2008 23:47, edited 1 time in total.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: Distant-join-stations (rev9840)

Post by PhilSophus »

Sorry, for double-posting.

I reordered the bits for CmdBuildRailroadStation, and changed the patch so that it always passes the station ID to join in p2 bits 16-31 or INVALID_STATION if no station should be joined. These bits were free for other station types, so no need to distinguish between them anymore.

While I were at it, I found a bug in the patch: When a dock is build the tile passed to PlaceDocks_Dock is not always the one with the lowest coordinate but always the land tile (which might be a different tile). This resulted in the wrong tiles being checked and building a separate station instead of showing the selection window in some cases.

I fixed that by evaluating _thd.pos instead of just taking tile, however I am not sure, why docks are treated differently. For example building railroad with dragging works as expected when using the passed tile.

Please check, if the patch is working for you in both singleplayer and multiplayer.

EDIT: Adapted to current trunk
Attachments
distant_join_stations_r11985.patch
(23.68 KiB) Downloaded 221 times
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Distant-join-stations (rev11985)

Post by Trond »

This needs and update now :) Please...
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Distant-join-stations (rev11985)

Post by MJS »

In what sense does it need an update? Has it stopped compiling against trunk? Otherwise, the main thing we can wish for here is that it might be included in trunk... I'm especially curious whether the developments on the station list ID have taken away what appeared to be the major blocker for inclusion.
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Distant-join-stations (rev11985)

Post by Trond »

I couldnt compile it against trunk earlier today, and that makes me believe it wount go into trunk eather ;) And I definately want this one in trunk!

Using the update from Gonozal, this is what BOTTD says:

Code: Select all

patching file `src/airport_gui.cpp'
patching file `src/command_type.h'
patching file `src/dock_gui.cpp'
patching file `src/lang/english.txt'
Hunk #1 succeeded at 1662 (offset 10 lines).
patching file `src/rail_gui.cpp'
Hunk #2 succeeded at 673 (offset 18 lines).
patching file `src/road_gui.cpp'
Hunk #1 succeeded at 203 (offset -1 lines).
Hunk #2 succeeded at 523 (offset 2 lines).
patching file `src/station_cmd.cpp'
Hunk #1 succeeded at 887 (offset -1 lines).
Hunk #3 succeeded at 918 (offset -1 lines).
Hunk #5 succeeded at 1010 (offset -1 lines).
Hunk #7 succeeded at 1333 (offset -1 lines).
Hunk #9 succeeded at 1395 (offset -1 lines).
Hunk #11 succeeded at 1722 (offset -1 lines).
Hunk #13 succeeded at 2030 (offset -1 lines).
patching file `src/station_gui.cpp'
Hunk #1 FAILED at 24.
Hunk #2 succeeded at 1047 (offset 50 lines).
1 out of 2 hunks FAILED -- saving rejects to src/station_gui.cpp.rej
patching file `src/station_gui.h'
patching file `src/variables.h'
patching file `src/viewport.cpp'
Hunk #1 succeeded at 2319 (offset 11 lines).
patching file `src/viewport_type.h'
patching file `src/window_type.h'
Hunk #1 FAILED at 90.
1 out of 1 hunk FAILED -- saving rejects to src/window_type.h.rej
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Distant-join-stations (rev12558)

Post by Frostregen »

Here is the patch updated to r12558.
(and nothing else. based on PhilSophus' distant_join_stations_r11985.patch)
Last edited by Frostregen on 04 Apr 2008 09:05, edited 2 times in total.
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Distant-join-stations (rev12558)

Post by Trond »

You're on a roll today, thanks a load!!
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
User avatar
leno4
Traffic Manager
Traffic Manager
Posts: 247
Joined: 10 Mar 2008 02:45
Location: Australia

Re: Distant-join-stations (rev12558)

Post by leno4 »

Very nice thanks 8)
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Distant-join-stations (rev12558)

Post by Trond »

Oh noes, it broke again... probably due to the changes done in r12570... Dare I ask for another update...
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Distant-join-stations (rev12558)

Post by Frostregen »

-
Attachments
distant_join_stations_r12580.diff
(23.98 KiB) Downloaded 174 times
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Distant-join-stations (rev12580)

Post by Trond »

Thanks again :bow:
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Distant-join-stations (rev12580)

Post by Trond »

Sorry to be at it again, but trying to build this again r12647 doesnt work :( All the changes in the trunk lately makes it really hard to be addicted to some patches ;)

I hope you can find the time to update it again (to latest trunk), and I surely hope the devs will accept this one to trunk soon...
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Distant-join-stations (rev12580)

Post by MJS »

Also because, and I hope it won't help to emphasize that, this is a feature that has been in TTDPatch for quite a while, and it would enhance compatibility between the two strands from a user perspective.
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Distant-join-stations (rev12580)

Post by Trond »

Managed to update this myself (!) so here it is for latest trunk at the moment, and I'm still hoping this one will find it's way into trunk...
Attachments
distant_join_stations_r12684.patch
(24.22 KiB) Downloaded 238 times
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Distant-join-stations (rev12580)

Post by MJS »

Good work, Trond!
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Distant-join-stations (rev12684)

Post by Ammler »

Why don't you get a station list if you like to build a station next to an other one?

Greets
Ammler
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Distant-join-stations (rev12684)

Post by Trond »

Not sure I understood your question correctly Ammler, but if I did, try pressing CTRL while building a station.
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Distant-join-stations (rev12684)

Post by Ammler »

Trond wrote:Not sure I understood your question correctly Ammler, but if I did, try pressing CTRL while building a station.
Then, it will apear a new station, instead of the list with all available stations in the spread area. (Seems, like it doesn't overwrite adjacent station patch.)

Thanks
Ammler
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: Distant-join-stations (rev12684)

Post by PhilSophus »

Ammler wrote:Then, it will apear a new station, instead of the list with all available stations in the spread area. (Seems, like it doesn't overwrite adjacent station patch.)
If you build an adjacent station (including diagonal IIRC) the meaning of CTRL is reversed: Without pressing CTRL the existing station is joined, without CTRL a separate station is built. I guess this is intended.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Distant-join-stations (rev12684)

Post by Trond »

Build 2 stations
Clipboard01.png
Clipboard01.png (11.74 KiB) Viewed 4675 times
Build another one while pressing control and you get a third one.
Clipboard02.png
Clipboard02.png (15.39 KiB) Viewed 4677 times
Build another one, inbetween the two, without control and you get a message you cannot do that. I think thats how it's supposed to be...
Clipboard03.png
Clipboard03.png (15.36 KiB) Viewed 4677 times
Ammler: You want to pop up a message asking you wich of the two stations you wanne join?

EDIT: Now I think I get it, if you wanne build a station on the tile next to an existing station and hold control, it just builds a new station and dont ask you if you wanne join to an existing station? Imho thats how it should be? I can't say I ever needed to do that? ?(
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests