Existing objects bridges and tunnels as stations

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
TopTechDreamer
Engineer
Engineer
Posts: 48
Joined: 22 Feb 2012 12:21
Location: Ukraine
Contact:

Existing objects bridges and tunnels as stations

Post by TopTechDreamer » 26 Apr 2019 14:12

[ Edited 20190616 23:59 : This TASK is SUCCESSFULLY IMPLEMENTED (AS PROTOTYPE) :!: - to DOWNLOAD .exe file, .sav and source files
[ Edited 20190904 21:30 : Now player can control tunnel-stations and bridge-stations via existing User Interface (UI) :
description of UI and files to download (executable files for MS Windows and for Android + full set of source-code files) are in p. 3.1 in the topic IMPLEMENTED some suggestions - Independence day of Ukraine 20190824 release ( viewtopic.php?f=32&t=85845 ). ]

[ Attachments renewed 20190619 12:50 from (version) ..20190616 to (version) ..20190618 because bug "D" is fixed. ]
openttd 1.9.1 + Existing objects tunnels and bridges as stations OK++ 20190618.exe.zip
openttd 1.9.1 + Existing objects tunnels and bridges as stations OK++ 20190618 save, src.zip
and for IMPORTANT DESCRIPTION of RESULTS - look at 9th post (16 Jun 2019 23:01) in this topic - viewtopic.php?p=1222935#p1222935 ]


There is no need to do some catastrophic changes to current OpenTTD code to make possible to build stations on bridges and in tunnels.
How?
Just consider existing objects as both: bridge and station (or tunnel and station).
How?
.. 1. Let consider both ends (entrances) to bridge (or tunnel) as tiles of station that define coverage area (look at the attached pictures). [Edited 20190503: Actually, these 2 tiles are station tiles only.]
If this two tiles are too far one from another, so system will disable to build such station because of parameter 'Maximum station spread', else player can build it.
.. 2. Platform length is length of whole that bridge (or tunnel), including both of its ends (entrances).
.. 3. There is no need to make some new graphics for such bridge-stations (tunnel-station) - just use existing graphics for bridge (or tunnel). Maybe add some small label attached to one or both ends (entrances) of bridge (tunnel). It can be standard (existing) label of station. This means station graphics is completely invisible, except of its label (if it isn't joined with other station tiles). Or it can be implemented as additional types of bridges (with the same characteristics as the same bridges but with some different graphics, f.e. with platform on the bridge).

I think this suggestion is easy to implement in existing OpenTTD code because no new objects needed - just use existing objects ( <20% of work ).

And when this will be implemented, it will fulfill almost all needs ( >80% of result ) of players, who wants (so strong) to have stations on bridges and in tunnels ( viewtopic.php?p=745470#p745470 , viewtopic.php?f=32&t=40606&hilit=station+bridge+tunnel , viewtopic.php?f=32&t=45680&hilit=station+bridge+tunnel ).

So, that's why it is so natural.

OpenTTD Developers, please, I ask you with very much hope: please, give us this feature! People are waiting for it so much time! It will be incredible progress for OpenTTD 3D-world!

Image

Image
Attachments
bridge as a station.png
(563.44 KiB) Not downloaded yet
tunnel as a station.png
(831.48 KiB) Not downloaded yet
Last edited by TopTechDreamer on 04 Sep 2019 21:28, edited 5 times in total.

User avatar
Redirect Left
Tycoon
Tycoon
Posts: 6580
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Existing objects bridges and tunnels as stations

Post by Redirect Left » 26 Apr 2019 15:36

This would be a really neat feature, and would replicate real life stations (ie: London Blackfriars is built upon a bridge in central London, over the River Thames).

I suspect this is going to be a lot of code though, rather than the on the surface "just flag it as a station".
Image
Worst Behaved IRC Member of 2008, 2009 & 2010 - Go Me!

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9291
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Existing objects bridges and tunnels as stations

Post by planetmaker » 26 Apr 2019 15:59

The main issue is: anything between tunnel entrances and bridge heads does not exist on the map. It's just an illusion, a wormhole for trains. An illusion which would need to become reality. So indeed there's much more to it than "just allow other graphics" or "attach a label". It completely breaks with the existing concepts, both how it is currently done from the player side as well as internally in the code of how stations are built.

That doesn't mean it's not possible. But it is definitely not just adding a flag "this is a station" and it's all done and set.

TopTechDreamer
Engineer
Engineer
Posts: 48
Joined: 22 Feb 2012 12:21
Location: Ukraine
Contact:

Re: Existing objects bridges and tunnels as stations

Post by TopTechDreamer » 26 Apr 2019 18:26

planetmaker wrote:The main issue is: anything between tunnel entrances and bridge heads does not exist on the map. ... as well as internally in the code of how stations are built.

That doesn't mean it's not possible. But it is definitely not just adding a flag "this is a station" and it's all done and set.

Yes, of course, it is.
But all the objects required are presented. So, it looks like a possibility to get wanted results by changing procedures only without changing objects.
Nothing exists between bridge entrances (and tunnel entrances), but transport runs through bridges (and tunnels) and even stops in these objects (f.e. when it breaks down).
I don't know how code defines platform length for every case of station layout but...
it seems the hardest task here is #2: to bind (to join, to link, to connect) bridge length (or tunnel length) with platform length.

User avatar
Redirect Left
Tycoon
Tycoon
Posts: 6580
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Existing objects bridges and tunnels as stations

Post by Redirect Left » 26 Apr 2019 21:06

I asasume if the entrances are essentailly wormholes. it knows where the start and end points of that wormhole are, to work out what needs to be 'station' between them in a straight line (given bridges & tunnels can't be built diagonally, like stations anyway)
Image
Worst Behaved IRC Member of 2008, 2009 & 2010 - Go Me!

User avatar
jfs
Director
Director
Posts: 578
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Existing objects bridges and tunnels as stations

Post by jfs » 27 Apr 2019 06:33

Part of the problem would also be that the station has (almost) no physical tile presence. Several parts of the code will currently scan the map looking for tiles of Station type, but if stations can suddenly be on tiles with "nothing" on them that changes a lot of core assumptions.

TopTechDreamer
Engineer
Engineer
Posts: 48
Joined: 22 Feb 2012 12:21
Location: Ukraine
Contact:

Re: Existing objects bridges and tunnels as stations

Post by TopTechDreamer » 27 Apr 2019 13:24

Bridges (and tunnels) have 2 'real' tiles - the entrances, that take place on the map,
and 'imaginary' part - between that 2 'real' tiles.

Suggestion is: we can do the same way with a station:
.. 1. 'Real' tiles of station are 'real' tiles of bridge - its entrances. Actually these 2 tiles are station tiles only. And they define station properties, f.e. its coverage area and so on.
.. 2. Exception is - this bridge-station (or tunnel-station) platform length parameter: it includes both 'real' and 'imaginary' parts of the bridge (tunnel).

Again: only 2 tiles are 'real' station tiles (the bridge|tunnel entrances), so the main problem is restriction of platform length parameter.

TopTechDreamer
Engineer
Engineer
Posts: 48
Joined: 22 Feb 2012 12:21
Location: Ukraine
Contact:

Re: Existing objects bridges and tunnels as stations

Post by TopTechDreamer » 08 May 2019 00:37

Search in source code of OpenTTD shows that it is built so smart that it is possible to understand the code and to find how to implement "Existing objects bridges and tunnels as stations" feature (viewtopic.php?p=1221065#p1221065) :
Let's think about this topic. Trains interact with stations. It means that point 1 above is necessary, i.e.

1. we need to associate (to bind, to link) bridge entrances (bridge ramps or tunnel ends) with some our station.
To do this we need to know StationID, because this property defines the station in the list of all stations. So can we attach this StationID index to any tile with bridge (or tunnel) entrance? - YES WE CAN! - Look at some source-files:
/* Because all objects are linked with map: with each tile on the map is linked some object. */
map_type.h contains:

Code: Select all

struct Tile {
	byte   type;        ///< The type (bits 4..7), bridges (2..3), rainforest/desert (0..1)
	byte   height;      ///< The height of the northern corner.
	uint16 m2;          ///< Primarily used for indices to towns, industries and stations
	byte   m1;          ///< Primarily used for ownership information
	byte   m3;          ///< General purpose
	byte   m4;          ///< General purpose
	byte   m5;          ///< General purpose
}; 

In the existing code Tile->type can not be a station and a bridge (or a tunnel) at the same time - look inside tile_type.h :

Code: Select all

/**
 * The different types of tiles.
 *
 * Each tile belongs to one type, according whatever is build on it.
 *
 * @note A railway with a crossing street is marked as MP_ROAD.
 */
enum TileType {
	MP_CLEAR,               ///< A tile without any structures, i.e. grass, rocks, farm fields etc.
	MP_RAILWAY,             ///< A railway
	MP_ROAD,                ///< A tile with road (or tram tracks)
	MP_HOUSE,               ///< A house by a town
	MP_TREES,               ///< Tile got trees
	MP_STATION,             ///< A tile of a station
	MP_WATER,               ///< Water tile
	MP_VOID,                ///< Invisible tiles at the SW and SE border
	MP_INDUSTRY,            ///< Part of an industry
	MP_TUNNELBRIDGE,        ///< Tunnel entry/exit and bridge heads
	MP_OBJECT,              ///< Contains objects such as transmitters and owned land
}; 

This means
/* (for any TileIndex t) IsTileType(t, MP_STATION) && IsTileType(t, MP_TUNNELBRIDGE) == false */

But where is StationID here? - docs\landscape.html explains details:
docs landscape.html and landscape_grid.html .zip
(10.28 KiB) Downloaded 16 times

5. Station tiles:
...
m2: index into the array of stations /* Exactly this contains StationID if ( Tile->type == MP_STATION ). */
...
9. Tunnel / bridge:
...
/* No m2 at all! */
...
docs\landscape_grid.html explains further:
The variable (uint16) Tile->m2 is not used if ( Tile->type == MP_TUNNELBRIDGE ) !!! This means that we have this possibility to attach some StationID value TO ANY Tile that contains ends (entrances) of bridge or tunnel !!!

Then we can modify function from station_map.h , for example:

Code: Select all

static inline StationID GetStationIndex(TileIndex t)
{
	assert(IsTileType(t, MP_STATION) || IsTileType(t, MP_TUNNELBRIDGE));       // <-- changed
	return (StationID)_m[t].m2;
}
And so on: we can consider ( Tile->type == MP_TUNNELBRIDGE ) as IsTileType(t, MP_STATION) everywhere, where GetStationIndex(TileIndex t) > 0. (I.e. StationID == 0 means "no station here" == bridge or tunnel without any station inside.)

Code: Select all

	if ( IsTileType(t, MP_STATION) || ( IsTileType(t, MP_TUNNELBRIDGE) && (StationID)_m[t].m2 > 0 ) );
It (above) was an answer to point 1 from this topic. These possibilities allow us to solve "economical" aspect of train-station interaction (vehicle-station interaction), because "economical" interaction works through the StationID.


//********************************************************************************************//
2. This point 2 is "physical" aspect of train-station interaction.
There are several functions (in the existing code) that describe this "physical" aspect, for example:
in train_cmd.cpp are

Code: Select all

int GetTrainStopLocation(StationID station_id, TileIndex tile, const Train *v, int *station_ahead, int *station_length)

and

Code: Select all

int Train::GetCurrentMaxSpeed() const

These two use some other functions from other source code files, for example:

Code: Select all

/* virtual */ uint Station::GetPlatformLength(TileIndex tile) const

and

Code: Select all

/* virtual */ uint Station::GetPlatformLength(TileIndex tile, DiagDirection dir) const

from station.cpp.
Because in the function GetTrainStopLocation(...) are defined values of variables *station_length and *station_ahead by using GetPlatformLength(...):

Code: Select all

int GetTrainStopLocation(StationID station_id, TileIndex tile, const Train *v, int *station_ahead, int *station_length)
{
	const Station *st = Station::Get(station_id);
	*station_ahead  = st->GetPlatformLength(tile, DirToDiagDir(v->direction)) * TILE_SIZE;
	*station_length = st->GetPlatformLength(tile) * TILE_SIZE;
...

Here we need DiagDirection dir, but we already have it: A) as DirToDiagDir(v->direction) and B) as GetTunnelBridgeDirection(tile) and so on, because there are also:

Code: Select all

static inline bool IsBridgeAbove(TileIndex t)
{
	return GB(_m[t].type, 2, 2) != 0;
}

and

Code: Select all

static inline Axis GetBridgeAxis(TileIndex t)
{
	assert(IsBridgeAbove(t));
	return (Axis)(GB(_m[t].type, 2, 2) - 1);
}

and

Code: Select all

TileIndex GetNorthernBridgeEnd(TileIndex t);
TileIndex GetSouthernBridgeEnd(TileIndex t);
TileIndex GetOtherBridgeEnd(TileIndex t);
from bridge_map.h and bridge_map.cpp .
For tunnels we need to know z-coordinate and we can get it from train data: v->z_pos as well as v->direction. So we have not only x- and y-coordinates of tile (under the bridge or above the [several] tunnels), but also z-coordinate (and even heading direction) of train (inside the tunnel or bridge), that allow us to know, wich exactly tunnel has that train inside.
From vehicle_base.h :

Code: Select all

/** %Vehicle data structure. */
struct Vehicle : VehiclePool::PoolItem<&_vehicle_pool>, BaseVehicle, BaseConsist {
...
public:
...
	int32 x_pos;                        ///< x coordinate.
	int32 y_pos;                        ///< y coordinate.
	int32 z_pos;                        ///< z coordinate.
	DirectionByte direction;            ///< facing
...

This means we can define values of variables *station_length and *station_ahead and also values of all other "physical" parameters for any train inside any tunnel-station or bridge-station.

It (above) was an answer to point 2 from this topic. These possibilities allow us to solve "physical" aspect of train-station interaction (including the speed of loading/unloading).

//********************************************************************************************//
3. User interface needs to get one or two buttons like "Convert bridge (or tunnel) to a bridge-station (or a tunnel-station)".
And graphics needs to have sprites of bridge ramps and of tunnel entrances with symbol "S" written on them - to differ them (with stations inside) from traditional bridge and tunnel entrances (without stations inside).

TopTechDreamer
Engineer
Engineer
Posts: 48
Joined: 22 Feb 2012 12:21
Location: Ukraine
Contact:

Re: Existing objects bridges and tunnels as stations

Post by TopTechDreamer » 16 Jun 2019 23:01

Today is the holiday of the Trinity in the Orthodox tradition. And we have a gift:
+1 (3rd) coordinate, that is, the output (the exit) of stations from 2 to 3-dimensional space. This is +1 (3rd) degree of freedom.
This is 3D-revolution of stations!

Freedom is our religion!

This "patch" [ Attachment renewed 20190619 12:50 from ..20190616 to ..20190618 because bug "D" is fixed. ] is compiled for Windows 32 bit (must work with WinXP_SP3 32 bit, Win8.1 32 bit, Win10 64 bit) and it continues series of "patches" (+ this), that have to allow players to build stations in 3D space: to use (existing OpenTTD objects) bridges or tunnels as parts of (railway-) stations platforms or even - as the whole platform (this version)!

This allow players to build 2 or more railway platforms one above (or under) another and to place many stations platforms inside towns, cities, mountains, river- or lake-sides, forests or other zones with high deficit of place.

To use this .exe file, copy it to the same folder as the "openttd.exe" of stable version 1.9.1 and run it.

Several testing .sav files are inside the 2nd attachment (below) - in folder "save".

This is PROTOTYPE :!: :
( I'm sorry, but... not yet: )
... A) - Here is no changes in UI (and in Advanced Settings too). So, to convert tunnel or bridge to make them a platform of the station, player have to build a directly adjacent station platform tile as continue of this tunnel or bridge (or to build them as continue of an already built platform tile) - just like it is shown on pictures in the topic Allow existing tunnels and bridges to increase "platform length" parameter for directly adjacent station tiles. AND ( :!: ) after that at least 1 train have to arrive to this combined platform with order to go there and to stop there (OT_GOTO_STATION) ! Directly adjacent (to a platform tile) tunnel or bridge object gets the same StationID (as that platform tile) when train begins to slow down (to brake) approaching this "complex" platform, that is, when OpenTTD.exe program calls function

Code: Select all

/* virtual */ uint Station::GetPlatformLength(TileIndex tile, DiagDirection dir) const
from station.cpp.
After the first such interaction this and the next trains can use this tunnel or bridge as the whole platform even without directly adjacent station platform tiles.
... B) - But tunnel-platform or bridge-platform can (yet) only supply ( :!: ) cargo (and passengers too), but doesn't accept them. So, to create the acceptance coverage area (and facility to this station to interact with any trains) player have to build at least 1 tile with usual station platform tile anywhere (for example there, where player want to have this coverage area for acceptance) - Such usual platform tile may simulate an entrance to the underground tunnel-platform (or to the bridge-platform).
... C) - Please, don't use simply "Go to <station>" (or "Go via <station|waypoint>) orders, because this may lead to appearance of "Implicit" orders. ( :!: ) Tests show (test9 in "save" folder) that the "Implicit" orders may cause some critical ERRORS (with this "patch", which cause the immediately program termination. Just use "Go non-stop to <station>" or "Go non-stop via <station|waypoint>" orders. [ Edited 20190619 13:10 : Implicit orders cause critical ERROR with program termination NOT ALWAYS, but, it seems, only in certain specific situations: when player push the button "skip" or button "d" on keyboard (when corresponding "Train<#> (Orders)" window is opened) AND this command of player must switch orders from "Implicit" to "hand-made" or vice versa - from "hand-made" order to "Implicit". But the same situation doesn't cause the same ERROR in the 1.9.1 stable version of openttd.exe. It is probably, that the additional condition to appearance of this ERROR is, that one of the stations, engaged in this situation, have to be not usual platforms, but a new tunnel-platform or bridge-platform. So, if player don't try to skip (to switch) orders (especially, the "Implicit" orders), then this ERROR doesn't have to appear. ]
... D) [ Edited 20190619 13:00 : This "bug" is fixed in the "patch" of version "...20190618.exe" (1st attachment - above). Fixed by the next modification in source code in file station_cmd.cpp :

Code: Select all

static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
{
...
//  for Existing objects tunnels and bridges as stations
			// if (x == stop) {
			if (x >= stop) { x = stop; 
...
}
] - Please, don't use orders with stop position in the middle of the platform - label: [middle] - please, use the [far end] or [near end] instead, because in some cases train may to miss the stop point, then it will run further but still have a not completed order. [ Edited 20190617 22:22 : This affects only the bridge-platforms and tunnel-platforms, but doesn't affect platforms with usual station platform tiles at the far end of the platform (that is, this doesn't affect the "complex" = combined platforms too (with adjacent station tiles at the far end of platform) - it affects only platforms with entrance to tunnel or bridge at the far end of the platform). ]
... E) Here is some inaccuracy with the path (track) reservation of "complex" platforms [ Edited 20190617 22:53 : This affects only platforms with rails under (any) bridge above, if such tile is inside a "complex" platform, but not at the end of the platform ], so, it causes some inaccuracy in functioning of path signals and may lead to infinity-long-"Waiting for free path" train stop situations, when train is blocking path to itself, when finished loading, stay on such platform and try to go out. Here can help to change order stop location, for example, not [near end] but [far end].

CHANGELOG:
... F) All modified source code files are collected in the next attachment - in folder "scr". All corresponding changes there are marked with comments "Existing objects bridges and tunnels as stations": [ Attachment renewed 20190619 12:50 ] Some functions in the modified source code are not optimized - this is just first results of searches and experiments to achieve the main purpose: to have tunnel-platforms and bridge-platforms (tunnel-stations and bridge-stations) anyhow! Especially "brutal" changes ( :lol: ) are in the function VehicleEnterTile(..) [ Edited 20190617 22:22 : ]

Code: Select all

/**
 * Call the tile callback function for a vehicle entering a tile
 * @param v    Vehicle entering the tile
 * @param tile Tile entered
 * @param x    X position
 * @param y    Y position
 * @return Some meta-data over the to be entered tile.
 * @see VehicleEnterTileStatus to see what the bits in the return value mean.
 */
VehicleEnterTileStatus VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y)
{
// Begin for Existing objects tunnels and bridges as stations
	// return _tile_type_procs[GetTileType(tile)]->vehicle_enter_tile_proc(v, tile, x, y);
	if (IsTileType(tile, MP_TUNNELBRIDGE) && (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL)) {
//		return _tile_type_procs[MP_STATION]->vehicle_enter_tile_proc(v, tile, x, y) | _tile_type_procs[MP_TUNNELBRIDGE]->vehicle_enter_tile_proc(v, tile, x, y);
		VehicleEnterTileStatus rr1 = _tile_type_procs[MP_TUNNELBRIDGE]->vehicle_enter_tile_proc(v, tile, x, y);
		VehicleEnterTileStatus rr2 = _tile_type_procs[MP_STATION]->vehicle_enter_tile_proc(v, tile, x, y);
		return rr1 | rr2;
	}
// End   for Existing objects tunnels and bridges as stations
	return _tile_type_procs[GetTileType(tile)]->vehicle_enter_tile_proc(v, tile, x, y);
}
from vehicle.cpp . This "brutality" is easy to avoid (and eliminate) - by replacing it to the function VehicleEnter_TunnelBridge from tunnelbridge_cmd.cpp, but... I just can not wait anymore and need to inform all the OpenTTD fans about this wonderful news and to place here this "patch" compiled into .exe file to let everyone player, who wants this possibilities, to get this! Because I think and believe, this is true gift to the today's Trinity holiday! :)

Let's be happy together! :)
Give thanks to God.

OpenTTD Developers, please, add this new possibilities (as new Advanced Settings) to the main (stable) OpenTTD releases of new versions (as soon as this will be stable enough). Thank you.
Last edited by TopTechDreamer on 19 Jun 2019 13:36, edited 2 times in total.

User avatar
kamnet
Moderator
Moderator
Posts: 6814
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Existing objects bridges and tunnels as stations

Post by kamnet » 17 Jun 2019 08:11

TopTechDreamer wrote:
16 Jun 2019 23:01
OpenTTD Developers, please, add this new possibilities (as new Advanced Settings) to the main (stable) OpenTTD releases of new versions (as soon as this will be stable enough). Thank you.
You should submit a proper patch through the GitHub repository and then make a proper request for review via GitHub. While there are some members of the development team who are here on the forums, not all of them are, nor do they typically respond to patch requests here in the forums.

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9291
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Existing objects bridges and tunnels as stations

Post by planetmaker » 17 Jun 2019 10:21

Issue C sounds like a show-stopper and issues D and E as critical omissions / regressions to me.

User avatar
odisseus
Engineer
Engineer
Posts: 45
Joined: 01 Nov 2017 21:19

Re: Existing objects bridges and tunnels as stations

Post by odisseus » 17 Jun 2019 20:44

planetmaker wrote:
17 Jun 2019 10:21
Issue C sounds like a show-stopper
I think implicit orders for trains should be disabled anyway. Is there any good use for them at all?

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9291
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Existing objects bridges and tunnels as stations

Post by planetmaker » 18 Jun 2019 07:29

odisseus wrote:
17 Jun 2019 20:44
planetmaker wrote:
17 Jun 2019 10:21
Issue C sounds like a show-stopper
I think implicit orders for trains should be disabled anyway. Is there any good use for them at all?
There are basically two different orders you can give:

goto stationA
goto non-stop stationA

The "goto non-stop" order is obvious IMHO and does exactly that: have the train go to stationA without stopping anywhere in between.

The "goto" order is a bit less obvious: The train will stop at any station on the way. The implicit orders show you where the train stops even when you did not explicitly tell it to stop there. They are automatically adjusted each round and are just for information purposes without impacting any train routing. This is useful for stop-trains where you only have to give the two end stations as orders - and it will stop anywhere in between and you don't have to klick on each of the 20+ stations in between of your long-distance PAX line. In essence: they are only information for you with no game-play effect. If you want the train to not stop in between: give it explicit non-stop orders.

Eddi
Tycoon
Tycoon
Posts: 7414
Joined: 17 Jan 2007 00:14

Re: Existing objects bridges and tunnels as stations

Post by Eddi » 18 Jun 2019 11:57

planetmaker wrote:
18 Jun 2019 07:29
they are only information for you with no game-play effect.
That is not entirely true. CargoDIst relies on that information.
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9291
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Existing objects bridges and tunnels as stations

Post by planetmaker » 18 Jun 2019 12:47

Eddi wrote:
18 Jun 2019 11:57
planetmaker wrote:
18 Jun 2019 07:29
they are only information for you with no game-play effect.
That is not entirely true. CargoDIst relies on that information.
Aye, that's true, I forgot about that. But as its purpose is to distribute cargo to the serviced stations, that totally makes sense :) Otherwise we'd wonder why none of the intermediate stations received nor provided any cargo when cargodist is enabled.

TopTechDreamer
Engineer
Engineer
Posts: 48
Joined: 22 Feb 2012 12:21
Location: Ukraine
Contact:

Re: Existing objects bridges and tunnels as stations

Post by TopTechDreamer » 19 Jun 2019 14:30

In post viewtopic.php?p=1222935#p1222935
attachments renewed 20190619 12:50 from (version) ..20190616 to (version) ..20190618 because bug "D" is fixed:
openttd 1.9.1 + Existing objects tunnels and bridges as stations OK++ 20190618.exe.zip
openttd 1.9.1 + Existing objects tunnels and bridges as stations OK++ 20190618 save, src.zip

... D) [ Edited 20190619 13:00 : This "bug" is fixed in the "patch" of version "...20190618.exe" (1st attachment - above). Fixed by the next modification in source code in file station_cmd.cpp :

Code: Select all

static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
{
...
//  for Existing objects tunnels and bridges as stations
			// if (x == stop) {
			if (x >= stop) { x = stop; 
...
} 
]
Earlier was:
- Please, don't use orders with stop position in the middle of the platform - label: [middle] - please, use the [far end] or [near end] instead, because in some cases train may to miss the stop point, then it will run further but still have a not completed order. [ Edited 20190617 22:22 : This affects only the bridge-platforms and tunnel-platforms, but doesn't affect platforms with usual station platform tiles at the far end of the platform (that is, this doesn't affect the "complex" = combined platforms too (with adjacent station tiles at the far end of platform) - it affects only platforms with entrance to tunnel or bridge at the far end of the platform). ]

And:
... C) - Please, don't use simply "Go to <station>" (or "Go via <station|waypoint>) orders, because this may lead to appearance of "Implicit" orders. ( :!: ) Tests show (test9 in "save" folder) that the "Implicit" orders may cause some critical ERRORS (with this "patch", which cause the immediately program termination. Just use "Go non-stop to <station>" or "Go non-stop via <station|waypoint>" orders.
[ Edited 20190619 13:10 : Implicit orders cause critical ERROR with program termination NOT ALWAYS, but, it seems, only in certain specific situations: when player push the button "skip" or button "d" on keyboard (when corresponding "Train<#> (Orders)" window is opened) AND this command of player must switch orders from "Implicit" to "hand-made" or vice versa - from "hand-made" order to "Implicit". But the same situation doesn't cause the same ERROR in the 1.9.1 stable version of openttd.exe. It is probably, that the additional condition to appearance of this ERROR is, that one of the stations, engaged in this situation, have to be not usual platform, but a new tunnel-platform or bridge-platform. So, if player don't try to skip (to switch) orders (especially, the "Implicit" orders), then this ERROR doesn't have to appear. ]

TopTechDreamer
Engineer
Engineer
Posts: 48
Joined: 22 Feb 2012 12:21
Location: Ukraine
Contact:

Re: Existing objects bridges and tunnels as stations

Post by TopTechDreamer » 04 Sep 2019 21:11

Now player can control tunnel-stations and bridge-stations via existing User Interface (UI) :
description and files to download (executable files for MS Windows and for Android + full set of source-code files) are in the topic IMPLEMENTED some suggestions - Independence day of Ukraine 20190824 release ( viewtopic.php?f=32&t=85845 ).

Post Reply

Return to “OpenTTD Suggestions”

Who is online

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