Suggestion for Bridges

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
SimYouLater
Chief Executive
Chief Executive
Posts: 668
Joined: 03 Apr 2016 20:19

Suggestion for Bridges

Post by SimYouLater » 01 Nov 2019 21:31

I have no experience in making patches and I don't expect anyone to take up this idea just because I propose it. That being said...

Is it possible to have more than 19 13 bridges by separating bridges by the NewGRF that provides the bridges?
Last edited by SimYouLater on 02 Nov 2019 00:11, edited 2 times in total.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.

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

Re: Suggestion for Bridges

Post by Eddi » 01 Nov 2019 22:33

SimYouLater wrote:
01 Nov 2019 21:31
Is it possible to have more than 19 bridges
No.
You might not exactly be interested in Ferion, but if you are, have fun :)

SimYouLater
Chief Executive
Chief Executive
Posts: 668
Joined: 03 Apr 2016 20:19

Re: Suggestion for Bridges

Post by SimYouLater » 02 Nov 2019 00:09

Eddi wrote:
01 Nov 2019 22:33
SimYouLater wrote:
01 Nov 2019 21:31
Is it possible to have more than 19 13 bridges
No.
Why not? What's preventing a patch from allowing multiple instances of bridges, defined by whichever NewGRF the bridges are from?
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5559
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Suggestion for Bridges

Post by wallyweb » 02 Nov 2019 06:54

SimYouLater wrote:
02 Nov 2019 00:09
Why not? What's preventing a patch from allowing multiple instances of bridges, defined by whichever NewGRF the bridges are from?
Each bridge in a set has a unique ID between 0x00 and 0x0C inclusive.
A patch to extend that number is possible. JGR and cirdan gave us three extra bridge IDs: 0x0D, 0x0E and 0x0F.
16 is hard set in OpenTTD's code and that set of 16 is not repeatable.
To complicate the situation, each of those 16 IDs has four types: RAIL, ROAD, MONOrail and MAGLev. so in reality one could say there are 48 bridges to a set.
It is possible for each of those 16 IDs to have its own NewGRF, but depending upon the placement of that GRF in your GRF load sequence, it will either overwrite or be overwritten by any other bridge set using the same ID.
So now the question becomes: Is it possible to patch the code to allow multiple bridge sets such that one set won't overwrite all or part of another set?
The short answer would be yes. It is, after all, only code, but the task would be fraught with peril. The code for bridges touches upon so many other features of the game that it would probably require a complete rewrite of OpenTTD's code and that's the simplistic "no" answer to your question.

I do stand to be corrected on this.

SimYouLater
Chief Executive
Chief Executive
Posts: 668
Joined: 03 Apr 2016 20:19

Re: Suggestion for Bridges

Post by SimYouLater » 02 Nov 2019 06:59

wallyweb wrote:
02 Nov 2019 06:54
SimYouLater wrote:
02 Nov 2019 00:09
Why not? What's preventing a patch from allowing multiple instances of bridges, defined by whichever NewGRF the bridges are from?
Each bridge in a set has a unique ID between 0x00 and 0x0C inclusive.
A patch to extend that number is possible. JGR and cirdan gave us three extra bridge IDs: 0x0D, 0x0E and 0x0F.
16 is hard set in OpenTTD's code and that set of 16 is not repeatable.
To complicate the situation, each of those 16 IDs has four types: RAIL, ROAD, MONOrail and MAGLev. so in reality one could say there are 48 bridges to a set.
It is possible for each of those 16 IDs to have its own NewGRF, but depending upon the placement of that GRF in your GRF load sequence, it will either overwrite or be overwritten by any other bridge set using the same ID.
So now the question becomes: Is it possible to patch the code to allow multiple bridge sets such that one set won't overwrite all or part of another set?
The short answer would be yes. It is, after all, only code, but the task would be fraught with peril. The code for bridges touches upon so many other features of the game that it would probably require a complete rewrite of OpenTTD's code and that's the simplistic "no" answer to your question.

I do stand to be corrected on this.
Ah. Okay, that makes sense and it's too bad that's the case. Is it possible to add more types that appear only with railtype and roadtype NewGRFs?
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5559
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Suggestion for Bridges

Post by wallyweb » 02 Nov 2019 07:47

SimYouLater wrote:
02 Nov 2019 06:59
Ah. Okay, that makes sense and it's too bad that's the case. Is it possible to add more types that appear only with railtype and roadtype NewGRFs?
In a manner, that happens now. railtypes and roadtypes define bridge surfaces that are applied as overlays to a bridge deck as long as the bridge is built from within a railtype/roadtype's GUI. The limitation is that the superstucture of a bridge is not addressable from within a railtype/roadtype's code.

You might want to refer to this page of my tutorial (W.I.P.)

User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3082
Joined: 24 Apr 2007 09:37
Location: Straya

Re: Suggestion for Bridges

Post by Emperor Jake » 11 Nov 2019 22:18

wallyweb wrote:
02 Nov 2019 06:54
A patch to extend that number is possible. JGR and cirdan gave us three extra bridge IDs: 0x0D, 0x0E and 0x0F.
Are there any other bridge GRFs that make use of these extra IDs? Just found out about your bridge set but it would also be possible to create an extension for TBRS or something.
--Stuff I made (or helped make)--
ImageImageImageImage

--My Award-Winning Screenshots and Videos--

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5559
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Suggestion for Bridges

Post by wallyweb » 11 Nov 2019 23:48

Emperor Jake wrote:
11 Nov 2019 22:18
Are there any other bridge GRFs that make use of these extra IDs?
Not that I am aware of.
Just found out about your bridge set but it would also be possible to create an extension for TBRS or something.
One could have a standalone set of one, two or three extra bridges. It would work alongside any bridge set.
At the moment my set replaces three bridges and adds one.
It will grow eventually.

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests