[Patch] Catenary on third rail-type

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
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: [Patch] Catenary on third rail-type

Post by stevenh »

So you'd therefore agree the best method for this would be to have OTTD continue to report "3" for the unifiedmaglev setting and have an the next slot in Action D:Misc. GRF Features (9E) be "Enable catenaries over the SECOND track type (only with electrifiedrailway on)" ?

...then having the next slot taken by "Allow realistic acceleration for maglev/third-track-type" seeing as that OTTD disallows it by default.

Where both of these switches would have no effect in TTDP.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: [Patch] Catenary on third rail-type

Post by DaleStan »

stevenh wrote:So you'd therefore agree the best method for this would be to have OTTD continue to report "3" for the unifiedmaglev setting
No, I do not.
3 will almost certainly break things. GRFs assume that exactly one of var 85 bits 32 and 33 is set (corresponding to values of 1 and 2) when electrifiedrailways is on. Things have worked this way approximately since action 7 was introduced, so this is quite a reasonable assumption. If both bits are set, a GRF may end up changing the sprites for the track type on which its engines do not run, which will be just as bad as setting catenary over the track type on which its engines do not run.
stevenh wrote:and have an the next slot in Action D:Misc. GRF Features (9E) be "Enable catenaries over the SECOND track type (only with electrifiedrailway on)"
Except when electrifiedrailway is off, the second track type is electrified rail. Requiring that grfs specify that electrified rail get catenary would be a misfeature.

The third rail type is whatever unifiedmaglev says the third rail type is. If it's 1, the third rail type uses the monorail track sprites. If it's 2, the third rail type uses the maglev track sprites. If it's 3, electrifiedrailways is off, and no catenary can be displayed, so the point is moot.

The only correct solution I can invent is to pick a valid setting for unifiedmaglev (i.e. either 1 or 2, possibly user-choice), and behave as if unifiedmaglev were on with that setting when loading GRFs (specifically, when assigning track-types to locomotives and wagons) unless the GRF explicitly requests some other behaviour. "Some other behaviour" could be requested in any of several different ways; a var 9E bit is one of them.
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
User avatar
Snail
Tycoon
Tycoon
Posts: 1283
Joined: 28 Apr 2003 18:52
Contact:

Re: [Patch] Catenary on third rail-type

Post by Snail »

Speakinfg about the Swiss set, what it would need would be actually two types of narrow gauge tracks; with and without catenary, at the same time. And steamers and wagons should be allowed to run on both these types.
The French Narrow Gauge Train Set is now released! Get it here
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: [Patch] Catenary on third rail-type

Post by stevenh »

Snail wrote:Speakinfg about the Swiss set, what it would need would be actually two types of narrow gauge tracks; with and without catenary, at the same time. And steamers and wagons should be allowed to run on both these types.
Ask peter1138 about "railtypes" (also see the OTTD wiki)... but this patch and the "railtypes" stuff is still under development and, of course, wont be seen in OTTD 0.6
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: [Patch] Catenary on third rail-type

Post by stevenh »

Right... This has dropped to a one-liner thanks to the infrastructure that Peter1138 has thrown into trunk...
This patch would simply be to tide OTTD over for use with the MiscGrfBit until there is a better answer... :)
Attachments
Catenary.diff
(646 Bytes) Downloaded 297 times
dandan
Route Supervisor
Route Supervisor
Posts: 414
Joined: 17 Feb 2008 23:01

Re: [Patch] Catenary on third rail-type

Post by dandan »

Thanks, Steven. Works great!
User avatar
Toni Babelony
Tycoon
Tycoon
Posts: 1389
Joined: 07 Jul 2006 09:34
Skype: toni_babelony
Location: Sagamihara-shi, Japan
Contact:

Re: [Patch] Catenary on third rail-type

Post by Toni Babelony »

So~... Ready for trunk or not?
Retired JapanSet developer and creator of TIAS.
User avatar
Transporter
Engineer
Engineer
Posts: 70
Joined: 14 Aug 2005 08:55

Re: [Patch] Catenary on third rail-type

Post by Transporter »

Hi,

what is the "Catenary on Third Rail.diff" good for?
It's no grf-file, so i can't integrate catenary to the Shinkansen trains... :-(
Renaming the file ending is not successful, too.

Transporter
Vikthor
Engineer
Engineer
Posts: 69
Joined: 13 Jun 2004 16:57
Location: Prague, Czech republic

Re: [Patch] Catenary on third rail-type

Post by Vikthor »

It's a patch, read sticky in this forum(or rather just "read stickies") to see what to do with a diff file.
dandan
Route Supervisor
Route Supervisor
Posts: 414
Joined: 17 Feb 2008 23:01

Re: [Patch] Catenary on third rail-type

Post by dandan »

Transporter, it means that you have to compile the game yourself. If you happen to use Mac OS, I can send you a binary with the catenary patch included.
User avatar
Transporter
Engineer
Engineer
Posts: 70
Joined: 14 Aug 2005 08:55

Re: [Patch] Catenary on third rail-type

Post by Transporter »

Oh, I'm not programing :?

And I use a PC...
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: [Patch] Catenary on third rail-type

Post by stevenh »

Just so that the Japan Set guys can enjoy this for a while longer... here's the same old patch to allow the use of a TTDPatch flag in OpenTTD.
Although I understand that the 'railtypes' movement is getting somewhere... it'd be nice if this was implemented in the interim as it would, at least, allow functionality that TTDP provides in OTTD.
Attachments
catenaryonthirdrail.diff
(604 Bytes) Downloaded 165 times
User avatar
Toni Babelony
Tycoon
Tycoon
Posts: 1389
Joined: 07 Jul 2006 09:34
Skype: toni_babelony
Location: Sagamihara-shi, Japan
Contact:

Re: [Patch] Catenary on third rail-type

Post by Toni Babelony »

Thanks man! I'll be enjoying this! :)
Retired JapanSet developer and creator of TIAS.
User avatar
SwissFan91
Tycoon
Tycoon
Posts: 2395
Joined: 08 Feb 2009 18:36
Location: Alberta, Canada

Re: [Patch] Catenary on third rail-type

Post by SwissFan91 »

So this isn't/will never be available as a .grf ?
Total Alpine Replacement Set: Industry, Town, Objects
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: [Patch] Catenary on third rail-type

Post by stevenh »

This patch enables a grf 'misc' switch to work in OpenTTD. In other words, the GRF side of things is already coded (and works with TTDP)... the issue is that OTTD disrespects this switch. This patch allows OTTD to use the switch.

This is why I'm slightly disturbed... although there is motion to get this implemented into OTTD properly (with 'railtypes'), it would be nice to have this implemented in the interim to allow cross-compatibility of these switches between TTDP and OTTD.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [Patch] Catenary on third rail-type

Post by Roujin »

Did you discuss this with one of the main OpenTTD devs directly? Maybe they just didn't notice it until now?

oh, just read a bit back and belugas said that you are doing a "good job". So maybe ask him directly if he thinks that something is missing in this patch or whatever else reason is to not put it in ;)
* @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
User avatar
SwissFan91
Tycoon
Tycoon
Posts: 2395
Joined: 08 Feb 2009 18:36
Location: Alberta, Canada

Re: [Patch] Catenary on third rail-type

Post by SwissFan91 »

I sincerely apologise for this shameful bump, but how is this project coming along ?
Total Alpine Replacement Set: Industry, Town, Objects
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: [Patch] Catenary on third rail-type

Post by DaleStan »

As a general rule, no news means that there is no news.
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
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: [Patch] Catenary on third rail-type

Post by stevenh »

This will never be applied to trunk.
"Bigger things" are in the works and this would be seen as duplicated effort.
Unfortunate really, for us who want to see catenary on our Shinkansen :P
User avatar
SwissFan91
Tycoon
Tycoon
Posts: 2395
Joined: 08 Feb 2009 18:36
Location: Alberta, Canada

Re: [Patch] Catenary on third rail-type

Post by SwissFan91 »

And may i suggest... catenary on our Narrow Gauge Swiss rails :?
Total Alpine Replacement Set: Industry, Town, Objects
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 8 guests