Custom Bridgeheads

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

User avatar
StopRightThere
Chief Executive
Chief Executive
Posts: 761
Joined: 18 Dec 2005 20:10
Location: United Kingdom

Re: Custom Bridgeheads

Post by StopRightThere »

To those who want custom bridgeheads, I suggest you implement this feature yourself. After all, that's the beauty of this game's code being open! :D
I think it was belugas on this forum who said something like, "If you're not prepared to work for your idea, it doesn't mean very much for you."
Bye Bye OpenBVE :(
Official TT-Hot young ginger Doctor Who assistant FanClub
Formerly known as AdditionalData
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: Custom Bridgeheads

Post by stevenh »

Does anyone want to provide assistance? I restarted this patch around a month ago and got it to a nearly workable state... but it needs work.
I don't have the time right now to document each line I have changed, but if anyone puts there hand up then I'll detail it here.
Screenshot.
Screenshot.
cbh.jpg (47.94 KiB) Viewed 5074 times
Attachments
CustomBridgeHeads-r20915.diff
Against r20915
(31.41 KiB) Downloaded 230 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Custom Bridgeheads

Post by planetmaker »

That's a pleasant surprise. One thing I noted during a brief look: you use partially the wrong comment style:

Code: Select all

/* bla bla full line comments */

int i = 5;  // comment in same line as code

/**
 * Function description for doxygen
 * @param tile TileIndex
 * @return True if the tile is a bridge end
 */
EDIT: Also mind

Code: Select all

src/rail_cmd.cpp: In function ‘CommandCost CmdRemoveSingleRail(TileIndex, DoCommandFlag, uint32, uint32, const char*)’:
src/rail_cmd.cpp:691: warning: unused variable ‘reserved’

src/tunnelbridge_cmd.cpp: In function ‘VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle*, TileIndex, int, int)’:
src/tunnelbridge_cmd.cpp:1588: warning: enumeration value ‘DIAGDIR_END’ not handled in switch
src/tunnelbridge_cmd.cpp:1588: warning: enumeration value ‘INVALID_DIAGDIR’ not handled in switch
Missing:
track lay highlight cursor on the bridge heads, signals on bridge heads

If stations are going to be allowed on bridge heads: it needs a general change such that I can build a station on foundations no matter what the actual track layout of the tile is or the behaviour will become inconsistent.
User avatar
JacobD88
Chief Executive
Chief Executive
Posts: 708
Joined: 16 Aug 2008 17:51
Location: Long Eaton, Nottinghamshire. UK
Contact:

Re: Custom Bridgeheads

Post by JacobD88 »

stevenh wrote:I restarted this patch around a month ago and got it to a nearly workable state... but it needs work...
StevenH, that is fantastic news, especially to have a Dev working on it, many thanks :bow:

I'm downloading to have a look at the patch now :mrgreen:
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: Custom Bridgeheads

Post by stevenh »

planetmaker,
As stated, there was a lot to do and I'd left the GUI and coding style until last. If this deters people from helping then I suppose it's all TMWFTLB.

JacobD88,
Also as stated, I've stalled on this patch as I had other things to carry on with and require help/motivation to continue. I'd also seen another post on re-working the bridge code which, although would help, has not gotten anywhere.

As this stands, the patch will not continue any time soon. Sorry to get everyone's hopes up, but my time is low for development as we speak.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Custom Bridgeheads

Post by planetmaker »

stevenh wrote:As this stands, the patch will not continue any time soon. Sorry to get everyone's hopes up, but my time is low for development as we speak.
Right, I might have mis-interpreted you slightly in the way that you would maintain the current state of the patch till you find time to continue :-) Given that understanding of your posting I gave that feedback :-) Any other person could of course use that as well and have a go.
maquinista
Tycoon
Tycoon
Posts: 1829
Joined: 10 Jul 2006 00:43
Location: Spain

Re: Custom Bridgeheads

Post by maquinista »

Thanks for this patch. :D
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Custom Bridgeheads

Post by belugas »

I'm trying to make this patch more acceptable, although it is already of a really nice quality.
I don't promise, I don't imply, i'm just trying.
I'm not even understanding it all right now...
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
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: Custom Bridgeheads

Post by stevenh »

belugas, that's what my issue was... as soon as I got into the pathfinder I freaked out.

Keep me updated as to your progress and expect my help if you need it :)
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Custom Bridgeheads

Post by Eddi »

you shouldn't have to touch the pathfinder core. only the "follow track" routine.
User avatar
StopRightThere
Chief Executive
Chief Executive
Posts: 761
Joined: 18 Dec 2005 20:10
Location: United Kingdom

Re: Custom Bridgeheads

Post by StopRightThere »

Great stuff guys. :D
Bye Bye OpenBVE :(
Official TT-Hot young ginger Doctor Who assistant FanClub
Formerly known as AdditionalData
ZxBiohazardZx
Tycoon
Tycoon
Posts: 1534
Joined: 14 Mar 2006 12:46
Location: Netherlands

Re: Custom Bridgeheads

Post by ZxBiohazardZx »

Bump:

any progress on patch? the first one worked quite well, just interested on current status and maybe a bump to match trunk revision
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Custom Bridgeheads

Post by planetmaker »

ZxBiohazardZx wrote:Bump:
Please don't necromance old threads without adding any new information. The fact that there are no updates here, is answer enough to your pointless question. As a long-term member of this forum you should know that it's not accepted behaviour and doing repeatedly so may give you a warning.
ZxBiohazardZx
Tycoon
Tycoon
Posts: 1534
Joined: 14 Mar 2006 12:46
Location: Netherlands

Re: Custom Bridgeheads

Post by ZxBiohazardZx »

maybe i didnt phrase it correctly, is that posted .diff the last known patch available, im currently checking if i can make it work on the tip revision and upload it again, but before i do so i preferred to check if there arent other changes on the patch....
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: Custom Bridgeheads

Post by stevenh »

ZxBiohazardZx wrote:...im currently checking if i can make it work on the tip revision and upload it again...
Right, so what errors/message/debug do you have from your current efforts?
I haven't had a chance to get back to this, but I'm willing to help if you make the effort too.



update... I've just tried to get it up-to-trunk; it compiles... but trains wont enter bridges... fail. Will have to look into it again soon.
ZxBiohazardZx
Tycoon
Tycoon
Posts: 1534
Joined: 14 Mar 2006 12:46
Location: Netherlands

Re: Custom Bridgeheads

Post by ZxBiohazardZx »

stevenh wrote:
ZxBiohazardZx wrote:...im currently checking if i can make it work on the tip revision and upload it again...
Right, so what errors/message/debug do you have from your current efforts?
I haven't had a chance to get back to this, but I'm willing to help if you make the effort too.



update... I've just tried to get it up-to-trunk; it compiles... but trains wont enter bridges... fail. Will have to look into it again soon.

hit the same wall, applies fine, compiles fine, doesnt work ingame, as i think the entrance tile (bridgehead) isnt handled properly or maybe its a pathfinder issue?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Custom Bridgeheads

Post by planetmaker »

Some code related to bridge heads / tunnel entrances change around r21136 - r21141
ZxBiohazardZx
Tycoon
Tycoon
Posts: 1534
Joined: 14 Mar 2006 12:46
Location: Netherlands

Re: Custom Bridgeheads

Post by ZxBiohazardZx »

mainly related on tunnelbridge.cpp but there are indeed some changes that added a few lines.

still strange that it didnt give any build errors though
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: Custom Bridgeheads

Post by stevenh »

I had to manipulate the code quite a bit to get it to apply... the change in direction checking upon bridge entering had created a few difficulties...

The direction checking allows the bridge direction + 45 degrees either way to enter the bridge; previously this could only be the exact bridge direction.

I'll try and get back to it eventually.
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: Custom Bridgeheads

Post by HackaLittleBit »

stevenh wrote:The direction checking allows the bridge direction + 45 degrees either way to enter the bridge
Steven I solved the reversing problem.
See second patch in this post
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Bing [Bot] and 19 guests