YAPP - Yet Another PBS Patch (now 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

Post Reply
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

YAPP - Yet Another PBS Patch (now in trunk!)

Post by Michi_cc »

Seeing the recent activity with new PBS patches, I could finally be arsed to finish mine. I am now presenting you YAPP (Yet Another PBS Patch)!

Features:
  • Works with NPF and YAPF.
  • Implements a signal system similar to the one Tekky described (without real bi-di tracks).
  • Is fully backwards compatible, normal and PBS signals can be used in parallel.
  • Can colour the reserved paths.
  • No known bugs 8) (well, unknown bugs on the other hand...)
Instructions:
Apply the patch and compile.

You can now additionally build two kinds of PBS signals: signals that can be passed from behind and signals that disallow passing just like the regular signals. The passable signals use the old PBS signal graphics, the one-way signals the old PBS pre-signal graphics.

These new signals work a bit different than the standard OpenTTD signals. A PBS signal works more like in reality: it is by default red and will switch only to green if an aproching train can get to a safe waiting position behind the signal. Safe waiting positions are depots, tiles in front of a signal and end of line. The back of a PBS signal is not a safe waiting position and will be passed through.
If you don't like it that signals can be passed from behind, use one-way pbs signals instead. Most times this should not be neccessary as passing a signal from behind is penalized by the pathfinder.

Patch options:
There are now two patch options under 'Construction': 'Signal type to build by default' should be pretty self-explanatory. You can switch between normal, pbs and one-way pbs signals. The second option is 'Cycle through signal types', it controls which signal types are cycled through by ctrl-click. Options are cycle only the regular signals, only the pbs signals or all signals. You can always change these settings in game. Note that both settings aren't synchronised in any way.


I've attached a screenshot of a through station. Note the placement of the signals around the platforms and at the station exits. To prevent traffic jams, you should now place the exit signals a train length after the last switch so a waiting train won't block the tracks for entering trains.
Sample trough station.
Sample trough station.
Chonston Transport, 18th Mar 1950.png (34.95 KiB) Viewed 46595 times
Technical details:
To get highlighted PBS paths, turn the patch setting on the 'Interface' tab on.

Mixing normal and PBS signals will work, but might lead to stuck trains.
Reversing a train may also yield a stuck train. Force proceed will unstuck any train, but beware that this can lead to a train crash, so be careful!

OpenTTD will use NPF or YAPF to find a path through a PBS signal even if you have turned both off in the patches window. But this is only for PBS signals, non-PBS blocks will still use the old pathfinder. As this might lead to less-than-optimal paths, using the old pathfinder is not recommended.

If you don't like the result of the pathfinder, you can tweak the patches npf_rail_pbs_cross_penalty, npf_rail_pbs_signal_back_penalty, yapf.rail_pbs_cross_penalty and yapf.rail_pbs_signal_back_penalty.

Current news and a SVN-compatible patch that works with BuildOTTD can be found in the latest release post.

If you search for older versions of this patch, please look at http://www.icosahedron.de/openttd/yapp/.

Further information is available on the OpenTTD wiki.

-- Michael Lutz
Attachments
yapp_r13840_v9.patch
git diff, apply with patch -p1
(208.88 KiB) Downloaded 876 times
git_branch_r13840_v9.patch
Output of git format-patch -k, to be used with git am -k. Contains the full commit history of this patch, broken into smaller pieces.
(260.84 KiB) Downloaded 646 times
Last edited by Michi_cc on 26 Jul 2008 20:59, edited 30 times in total.
-- Michael Lutz
User avatar
AntBUK
Transport Coordinator
Transport Coordinator
Posts: 319
Joined: 02 May 2007 12:29
Location: Sheffield, England
Contact:

Re: YAPP - Yet Another PBS Patch

Post by AntBUK »

BuildOTTD doesn't like the patch format, and we don't have r15052 yet; the nightly is r12050 and SVN is r12053.

Edit: typos ftw :P
Last edited by AntBUK on 04 Feb 2008 17:12, edited 1 time in total.
Rasing Awareness: Aspergers Syndrome 1 (NAS UK)2 (BBC)3 (YaleDDC)


Something is driving you insane... It is me.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: YAPP - Yet Another PBS Patch

Post by belugas »

I have not yet tried it, but i can cmpliment you at least
a) for the effort
b) for the almost perfect compliance to the code style
c) for quite a good presentation :)
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: YAPP - Yet Another PBS Patch

Post by Rubidium »

AntBUK wrote:BuildOTTD doesn't like the patch format...
Flame BuildOTTD about not liking the patch format because the patch it uses actually supports this patch format.

Now about the patch, some warnings (and errors) as emitted by gcc 4.3 (don't have time to properly at the exact warnings/errors though):
/home/rubidium/openttd/clean/src/npf.cpp: In function ‘uint NPFReservedTrackCost(AyStarNode*)’:
/home/rubidium/openttd/clean/src/npf.cpp:230: warning: suggest parentheses around && within ||
/home/rubidium/openttd/clean/src/signal.cpp: In function ‘SigSegState UpdateSignalsInBuffer(Owner)’:
/home/rubidium/openttd/clean/src/signal.cpp:543: warning: suggest parentheses around && within ||
/home/rubidium/openttd/clean/src/yapf/yapf_node_rail.hpp: In member function ‘bool CYapfRailNodeT<Tkey_>::IterateTiles(const Vehicle*, Tbase&, bool (Tbase::*)(TileIndex, Trackdir)) const’:
/home/rubidium/openttd/clean/src/yapf/yapf_node_rail.hpp:184: error: there are no arguments to ‘GetTile’ that depend on a template parameter, so a declaration of ‘GetTile’ must be available
/home/rubidium/openttd/clean/src/yapf/yapf_node_rail.hpp:184: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/rubidium/openttd/clean/src/yapf/yapf_node_rail.hpp:185: error: there are no arguments to ‘GetTrackdir’ that depend on a template parameter, so a declaration of ‘GetTrackdir’ must be available
/home/rubidium/openttd/clean/src/yapf/yapf_node_rail.hpp: In member function ‘bool CYapfRailNodeT<Tkey_>::IterateTiles(const Vehicle*, Tbase&, bool (Tbase::*)(TileIndex, Trackdir)) const’:
/home/rubidium/openttd/clean/src/yapf/yapf_node_rail.hpp:184: error: there are no arguments to ‘GetTile’ that depend on a template parameter, so a declaration of ‘GetTile’ must be available
/home/rubidium/openttd/clean/src/yapf/yapf_node_rail.hpp:184: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/rubidium/openttd/clean/src/yapf/yapf_node_rail.hpp:185: error: there are no arguments to ‘GetTrackdir’ that depend on a template parameter, so a declaration of ‘GetTrackdir’ must be available
In file included from /home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:9:
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp: In member function ‘int CYapfCostRailT<Types>::ReservationCost(typename Types::NodeList::Titem&, TileIndex&, Trackdir, int)’:
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:137: error: there are no arguments to ‘GetReservedTrackbits’ that depend on a template parameter, so a declaration of ‘GetReservedTrackbits’ must be available
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp: In member function ‘void CYapfFollowRailT<Types>::FindSignalOnNode(const Vehicle*, typename Types::NodeList::Titem*)’:
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:231: error: expected primary-expression before ‘,’ token
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:231: error: expected primary-expression before ‘>’ token
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp: In member function ‘void CYapfFollowRailT<Types>::TryReserveTrack(const Vehicle*)’:
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:274: error: expected primary-expression before ‘,’ token
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:274: error: expected primary-expression before ‘>’ token
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:279: error: expected primary-expression before ‘,’ token
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:279: error: expected primary-expression before ‘>’ token
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp: In member function ‘void CYapfFollowRailT<Types>::FindSignalOnNode(const Vehicle*, typename Types::NodeList::Titem*) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’:
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:200: instantiated from ‘Trackdir CYapfFollowRailT<Types>::ChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:137: instantiated from ‘static Trackdir CYapfFollowRailT<Types>::stChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:360: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:231: warning: left-hand operand of comma has no effect
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:231: error: could not convert ‘node->CYapfRailNodeT::IterateTiles [with Tbase = Tbase, Tfollower = Tfollower, Tkey_ = CYapfNodeKeyTrackDir]’ to ‘bool’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:231: error: in argument to unary !
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp: In member function ‘void CYapfFollowRailT<Types>::TryReserveTrack(const Vehicle*) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’:
/home/rubidium/openttd/clean/src/
[SRC] Compiling yapf/yapf_road.cpp
yapf/yapf_rail.cpp:206: instantiated from ‘Trackdir CYapfFollowRailT<Types>::ChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:137: instantiated from ‘static Trackdir CYapfFollowRailT<Types>::stChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:360: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:274: warning: left-hand operand of comma has no effect
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:206: instantiated from ‘Trackdir CYapfFollowRailT<Types>::ChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:137: instantiated from ‘static Trackdir CYapfFollowRailT<Types>::stChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:360: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:279: warning: left-hand operand of comma has no effect
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp: In member function ‘void CYapfFollowRailT<Types>::FindSignalOnNode(const Vehicle*, typename Types::NodeList::Titem*) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’:
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:200: instantiated from ‘Trackdir CYapfFollowRailT<Types>::ChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:137: instantiated from ‘static Trackdir CYapfFollowRailT<Types>::stChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:364: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:231: warning: left-hand operand of comma has no effect
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:231: error: could not convert ‘node->CYapfRailNodeT::IterateTiles [with Tbase = Tbase, Tfollower = Tfollower, Tkey_ = CYapfNodeKeyTrackDir]’ to ‘bool’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:231: error: in argument to unary !
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp: In member function ‘void CYapfFollowRailT<Types>::TryReserveTrack(const Vehicle*) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’:
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:206: instantiated from ‘Trackdir CYapfFollowRailT<Types>::ChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:137: instantiated from ‘static Trackdir CYapfFollowRailT<Types>::stChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:364: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:274: warning: left-hand operand of comma has no effect
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:206: instantiated from ‘Trackdir CYapfFollowRailT<Types>::ChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:137: instantiated from ‘static Trackdir CYapfFollowRailT<Types>::stChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:364: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:279: warning: left-hand operand of comma has no effect
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp: In member function ‘int CYapfCostRailT<Types>::SignalCost(typename Types::NodeList::Titem&, TileIndex, Trackdir) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’:
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:360: instantiated from ‘bool CYapfCostRailT<Types>::PfCalcCost(typename Types::NodeList::Titem&, const typename Types::TrackFollower*) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:216: instantiated from ‘void CYapfBaseT<Types>::AddNewNode(typename Types::NodeList::Titem&, const typename Types::TrackFollower&) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:200: instantiated from ‘void CYapfBaseT<Types>::AddMultipleNodes(typename Types::NodeList::Titem*, const typename Types::TrackFollower&) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:126: instantiated from ‘void CYapfFollowRailT<Types>::PfFollowNode(typename Types::NodeList::Titem&) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:127: instantiated from ‘bool CYapfBaseT<Types>::FindPath(const Vehicle*) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:168: instantiated from ‘Trackdir CYapfFollowRailT<Types>::ChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:137: instantiated from ‘static Trackdir CYapfFollowRailT<Types>::stChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:360: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_PBS’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_NOENTRY’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_LAST’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp: In member function ‘int CYapfCostRailT<Types>::SignalCost(typename Types::NodeList::Titem&, TileIndex, Trackdir) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’:
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:360: instantiated from ‘bool CYapfCostRailT<Types>::PfCalcCost(typename Types::NodeList::Titem&, const typename Types::TrackFollower*) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:216: instantiated from ‘void CYapfBaseT<Types>::AddNewNode(typename Types::NodeList::Titem&, const typename Types::TrackFollower&) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:200: instantiated from ‘void CYapfBaseT<Types>::AddMultipleNodes(typename Types::NodeList::Titem*, const typename Types::TrackFollower&) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:126: instantiated from ‘void CYapfFollowRailT<Types>::PfFollowNode(typename Types::NodeList::Titem&) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:127: instantiated from ‘bool CYapfBaseT<Types>::FindPath(const Vehicle*) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:168: instantiated from ‘Trackdir CYapfFollowRailT<Types>::ChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:137: instantiated from ‘static Trackdir CYapfFollowRailT<Types>::stChooseRailTrack(Vehicle*, TileIndex, DiagDirection, TrackBits, bool*, bool) [with Types = CYapfRail_TypesT<CYapfRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationTileOrStationRailT, CYapfFollowRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:364: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_PBS’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_NOENTRY’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_LAST’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp: In member function ‘int CYapfCostRailT<Types>::SignalCost(typename Types::NodeList::Titem&, TileIndex, Trackdir) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’:
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:360: instantiated from ‘bool CYapfCostRailT<Types>::PfCalcCost(typename Types::NodeList::Titem&, const typename Types::TrackFollower*) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:216: instantiated from ‘void CYapfBaseT<Types>::AddNewNode(typename Types::NodeList::Titem&, const typename Types::TrackFollower&) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:200: instantiated from ‘void CYapfBaseT<Types>::AddMultipleNodes(typename Types::NodeList::Titem*, const typename Types::TrackFollower&) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:43: instantiated from ‘void CYapfFollowAnyDepotRailT<Types>::PfFollowNode(typename Types::NodeList::Titem&) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:127: instantiated from ‘bool CYapfBaseT<Types>::FindPath(const Vehicle*) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:76: instantiated from ‘bool CYapfFollowAnyDepotRailT<Types>::FindNearestDepotTwoWay(Vehicle*, TileIndex, Trackdir, TileIndex, Trackdir, int, int, TileIndex*, bool*) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:52: instantiated from ‘static bool CYapfFollowAnyDepotRailT<Types>::stFindNearestDepotTwoWay(Vehicle*, TileIndex, Trackdir, TileIndex, Trackdir, int, int, TileIndex*, bool*) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail1, CFollowTrackT<TRANSPORT_BEGIN, true>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:413: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_PBS’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_NOENTRY’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_LAST’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp: In member function ‘int CYapfCostRailT<Types>::SignalCost(typename Types::NodeList::Titem&, TileIndex, Trackdir) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’:
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:360: instantiated from ‘bool CYapfCostRailT<Types>::PfCalcCost(typename Types::NodeList::Titem&, const typename Types::TrackFollower*) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:216: instantiated from ‘void CYapfBaseT<Types>::AddNewNode(typename Types::NodeList::Titem&, const typename Types::TrackFollower&) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:200: instantiated from ‘void CYapfBaseT<Types>::AddMultipleNodes(typename Types::NodeList::Titem*, const typename Types::TrackFollower&) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:43: instantiated from ‘void CYapfFollowAnyDepotRailT<Types>::PfFollowNode(typename Types::NodeList::Titem&) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_base.hpp:127: instantiated from ‘bool CYapfBaseT<Types>::FindPath(const Vehicle*) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:76: instantiated from ‘bool CYapfFollowAnyDepotRailT<Types>::FindNearestDepotTwoWay(Vehicle*, TileIndex, Trackdir, TileIndex, Trackdir, int, int, TileIndex*, bool*) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:52: instantiated from ‘static bool CYapfFollowAnyDepotRailT<Types>::stFindNearestDepotTwoWay(Vehicle*, TileIndex, Trackdir, TileIndex, Trackdir, int, int, TileIndex*, bool*) [with Types = CYapfRail_TypesT<CYapfAnyDepotRail2, CFollowTrackT<TRANSPORT_BEGIN, false>, CNodeList_HashTableT<CYapfRailNodeT<CYapfNodeKeyTrackDir>, 12, 16>, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT>]’
/home/rubidium/openttd/clean/src/yapf/yapf_rail.cpp:417: instantiated from here
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_PBS’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_NOENTRY’ not handled in switch
/home/rubidium/openttd/clean/src/yapf/yapf_costrail.hpp:195: warning: enumeration value ‘SIGTYPE_LAST’ not handled in switch
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: YAPP - Yet Another PBS Patch

Post by Roujin »

AntBUK wrote:BuildOTTD doesn't like the patch format, and we don't have r15052 yet; the nightly is r12050 and SVN is r12023.
Why should svn have a lower revision number than the nightly? That's far from making sense... because every evening the newest revision is taken from svn and compiled into the nightly.

as of now, newest revision is 15052, committed yesterday at 9:23 PM
Revision: 12052
Author: maedhros
Date: 21:23:59, Sonntag, 3. Februar 2008
[...]
---
@topic: I have applied your patch and am currently compiling. And for those who can't deal with this kind of patch I've made a diff that can be read by BuildOTTD so they can test too. No changes made.

Writing again after I've compiled and tested.
Attachments
yapp_r12052.diff
same patch, different format. and right number this time.
(112.52 KiB) Downloaded 822 times
Last edited by Roujin on 04 Feb 2008 08:04, edited 1 time in total.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: YAPP - Yet Another PBS Patch

Post by DaleStan »

Roujin wrote:as of now, newest revision is 15052,
Revision: 12052
You wouldn't happen to be dyslexic?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: YAPP - Yet Another PBS Patch

Post by Roujin »

As far as I know, I'm not. I happen to have concentrated on the last numbers too much it seems. Thanks for enlarging it so a nutcase like me gets it aswell. :roll:
edit: thinking about it, it just might be that this combination of numbers is easy to confuse, since the patch author made the same mistake.
edit2: there you have it. I've corrected the number in the file I uploaded. better now? ;)
edit3: NOW i know the real cause:
AntBUK wrote:BuildOTTD doesn't like the patch format, and we don't have r15052 yet; the nightly is r12050 and SVN is r12023.
AntBUK made a different mistake. Because of that, I didn't notice the 5 in the original number. And while correcting him, I just used the wrong number without even doubting its correctness.

but meh, we are going far offtopic now, so...

---
Regarding the patch, I'm also getting some errors
In file included from d:/dev/ottd/wip/trunk/src/yapf/yapf_common.cpp:9:
d:/dev/ottd/wip/trunk/src/yapf/yapf_node_rail.hpp: In member function `bool CYapfRailNodeT<Tkey_>::IterateTiles(const Vehicle*, Tbase&, bool (Tbase::*)(TileIndex, Trackdir)) const':
d:/dev/ottd/wip/trunk/src/yapf/yapf_node_rail.hpp:184: error: there are no arguments to `GetTile' that depend on a template parameter, so a declaration of `GetTile' must be available
d:/dev/ottd/wip/trunk/src/yapf/yapf_node_rail.hpp:184: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
d:/dev/ottd/wip/trunk/src/yapf/yapf_node_rail.hpp:185: error: there are no arguments to `GetTrackdir' that depend on a template parameter, so a declaration of `GetTrackdir' must be available
make[1]: *** [yapf/yapf_common.o] Error 1
make[1]: Leaving directory `/d/dev/ottd/wip/trunk/objs/release'
make: *** [all] Error 2
It aborts after these, but I think I would be getting about the same ones as rubidium else.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAPP - Yet Another PBS Patch

Post by Michi_cc »

Rubidium wrote: Now about the patch, some warnings (and errors) as emitted by gcc 4.3 (don't have time to properly at the exact warnings/errors though):
All fixed, at least for gcc (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125). I hope other gcc versions do like the code as well.

Patch in the first post updated.

-- Michael Lutz
Attachments
yapp_r12052_svn.patch
SVN patch for those with broken software.
(112.92 KiB) Downloaded 567 times
-- Michael Lutz
User avatar
Toni Babelony
Tycoon
Tycoon
Posts: 1389
Joined: 07 Jul 2006 09:34
Skype: toni_babelony
Location: Sagamihara-shi, Japan
Contact:

Re: YAPP - Yet Another PBS Patch

Post by Toni Babelony »

This looks so unbelievably sexy! Too bad I can't compile :| (or would somebody please be so kind to compile a Macintosh OSX version?)
Retired JapanSet developer and creator of TIAS.
User avatar
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: YAPP - Yet Another PBS Patch

Post by AndersI »

Yes, this really looks interesting! Unfortunately, when I compile with BuildOTTD I get an openttd.exe, but it doesn't work. First I get a message "Your 'OPENTTDW.GRF' file is corrupted or missing...", clicking OK gives me "No available language packs..." and clicking OK on that gives me "Assertion failed ... openttd.cpp line 113, Expression: 0" (Edit: which after code inspection seems to be the normal way of exiting after the previous messages - talk about user friendly...).

Running the openttd_org.exe (Yes! I made a backup before starting to patch) from the same folder works.

Does anyone have a working Windows binary somewhere?
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch

Post by Tekky »

Wow, I must say that I am very impressed by this patch! Also, I am happy to see that you have adopted most of my ideas :-)

It would, however, seem more meaningful to me that CTRL-clicking a PBS signal causes the back side of the signal to be impassible. That way, only one signal will have to be placed. In your implementation, one must place two signals in front of an intersection, one normal signal and an additional no-entry signal facing the other direction. I think these two signals should be combined into one signal by changing the behavior of CTRL-clicking a signal so that the back side of the signal is impassible.

By the way, I have found a bug regarding depots. I have produced a savegame in which the error is reproduced. I had the problem that trains leaving a depot still had the order to go to the depot. I had this error several times, at least when I used the "go to depot" order. I didn't ever encounter this error when I used the "service at depot" order, but this may be coincidence. Anyway, when analyzing this bug further, I started encountering train crashes. In the attached savegame, there has been a recent crash in front of the depot. As soon as the crash debris is cleared, the next crash will take place immeditely form one of the trains leaving the depot. In order to reproduce this bug, please load my savegame and hold TAB (in order to advance time fast).

@AndersI: I had no trouble compiling and running the BuildOTTD executable. Did you only copy openttd.exe to your OpenTTD directory or also all the other files?
Attachments
bug.sav
savegame with train crashes
(57.51 KiB) Downloaded 454 times
User avatar
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: YAPP - Yet Another PBS Patch

Post by AndersI »

Tekky: I did it all from scratch:
- downloaded and installed 0.6.0 Beta 3. Verified that the installation works.
- downloaded and installed BuildOTTD 1.0 RC1
- let BuildOTTD download the sources (12052), apply the patch and compile. Resulting openttd.exe copied to working OTTD installation.
- didn't work, as described above.

What 'additional files' were you thinking of? The ones mentioned in the error messages are there, from the original OTTD installation.
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch

Post by Tekky »

@AndersI: BuildOTTD produces a lot more than just openttd.exe. I suggest you try copying all produces files to your OpenTTD directory. If that also doesn't work, you may want to first install the latest nightly and verify that it works before you copy the files produced by BuildOTTD.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: YAPP - Yet Another PBS Patch

Post by Roujin »

Well what can I say - I didn't find any bugs, it worked like expected for me.
Congratulations on that!

However what I was clearly missing was combining the pbs signals with presignals - are you planning to do that in a future version?
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
fjb
Engineer
Engineer
Posts: 86
Joined: 08 Oct 2007 11:20

Re: YAPP - Yet Another PBS Patch

Post by fjb »

Hi,

I'm very impressed. I didn't start a new game but converted the old signals to pbs signals. That all awent without any problem.
But after some game years I had a train crash. A train choses the wrong platform of a dead end station.

Save ist attached:
Attachments
RST, 2. Mär 1975.sav
(427.5 KiB) Downloaded 470 times
Regards
Frank
MarkyParky
Engineer
Engineer
Posts: 89
Joined: 20 Nov 2003 15:20

Re: YAPP - Yet Another PBS Patch

Post by MarkyParky »

First I would like to say Great job.

Second, I would like to report a bug. If you have a terminus station and arriving train have all possibilities blocked, it sometimes chooses ocupied platform. I am attaching a picture with description and savegame.
Attachments
Green train is leaving station correctly.<br />Blue train left station recently and stops at signal correctly.<br />Lightblue and violet trains are in the station, blocking two platforms.<br />All platforms were ocupied for arriving train (platforms to the left are blocked by leaving green train, platform ahead is blocked by leaving blue train), still hi pickes an occupied track ahead.
Green train is leaving station correctly.
Blue train left station recently and stops at signal correctly.
Lightblue and violet trains are in the station, blocking two platforms.
All platforms were ocupied for arriving train (platforms to the left are blocked by leaving green train, platform ahead is blocked by leaving blue train), still hi pickes an occupied track ahead.
wrong.PNG (120.65 KiB) Viewed 55711 times
Wrong.sav
Savegame prior to srash. Train A picks route through Train B.
(29.98 KiB) Downloaded 453 times
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch

Post by Tekky »

Roujin wrote:However what I was clearly missing was combining the pbs signals with presignals - are you planning to do that in a future version?
I see no point in having additional PBS-pre-signals because PBS-signals have similar behavior as pre-signals. As long as you only place signals before and not after junctions (in contrast to traditional OpenTTD signalling), there should be no need for having pre-signals.

Please note that these new PBS-signals behave very differently to TTDPatch-pre-signals and the old PBS system of OpenTTD. In this new signalling system, you are only supposed to place signals where trains are supposed to wait. Since trains are only supposed to wait in front of junctions and never inside a junction, you must place signals only before an intersection/junction and never immidiately afterwards.
Last edited by Tekky on 04 Feb 2008 15:43, edited 3 times in total.
Vikthor
Engineer
Engineer
Posts: 69
Joined: 13 Jun 2004 16:57
Location: Prague, Czech republic

Re: YAPP - Yet Another PBS Patch

Post by Vikthor »

I am uploading the save with bug I reported on IRC, it seems very similar to MarkyParky's one, hope you can get something useful from that.
Attachments
bug1.sav
(29.29 KiB) Downloaded 452 times
User avatar
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: YAPP - Yet Another PBS Patch

Post by AndersI »

Tekky wrote:I suggest you try copying all produces files to your OpenTTD directory
OK, I got it to work after copying the 'Data' and 'Lang' folders too from the BuildOTTD results. Thanks!
(But the error situation could have been handled better by OTTD - a version number for the data and lang files, for example?)

Now I'm off to go PBS-ing in OTTD (PBS has been the major missing thing for me)!

BTW, I agree with you that it should be possible to mark the signals as 'one-way-only', *I* would actually want that as the default behavior when placing a new PBS signal.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAPP - Yet Another PBS Patch

Post by Michi_cc »

AndersI wrote: BTW, I agree with you that it should be possible to mark the signals as 'one-way-only', *I* would actually want that as the default behavior when placing a new PBS signal.
Most of the time this is not neccessary as passing a signal from behind has a rather large penalty in the pathfinder, so in most networks trains will avoid ways through such signals like hell. And if you build a terminus or bi-directional through station, one-way-only signals don't work at all.

I will most likely change the no-entry signal to a one-way-only pbs signal, as it is probably more sensible than just a no-entry signal.

To determine what kind of signal should be build by default, I could introduce another patch setting, but I know that the OpenTTD devs generally frown uppon too much patch settings, so I'm a bit weary about that.

Comments on that issue are appreciated.

-- Michael Lutz
-- Michael Lutz
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 8 guests