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 (

) 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.