News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Implementation of narrow-gauge track

Started by passengerpigeon, August 28, 2019, 12:10:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

passengerpigeon

Dear jamespetts and other developers,
Apologies in advance if what I'm about to suggest has been discussed before; feel free to refer me to the relevant threads. Anyway, has there ever been any consideration given to the idea of scrapping the separate narrow gauge waytype, and implementing different track gauges using prohibitive way constraints? This was an idea that popped into my head today, and the advantages of this method include the possibility of implementing more than two different track gauges - the Northern Irish rail network, Brunel's GWR, Isle of Man railways and the Glasgow Subway come to mind - and allowing narrow-gauge tramways and street-running sections. If running cost balancing is a concern, perhaps the separate narrow gauge waytype could be combined with this approach, with narrow gauge depots building 610, 914 and 1,067mm gauge trains and ordinary train depots building 1,219, 1,435, 1,600 and 2,140mm gauge vehicles, for example. How feasible is what I'm suggesting? Are there any major stumbling blocks, and have you already ruled this idea out?
Thank you,
Passengerpigeon.

Mariculous

Funny thing, I just had the same idea in mind when building my first narrow gauge track a few days ago.
However, i don't think that there should be a countless number gauges in any pakset.

In my opinion it would be a great advantage being able to build narrow gauge tramways and combined gauge tracks, which would become possible when implementing narrow gauge as normal rails with constraints.

Spenk009

The issue with former track gauges and rare gauges is that only very few vehicles are offered with each type. If Brunel's broad gauge disappeared in 1892, pakBritain's accuracy focus means we don't have any vehicles for the gauge from that point on. The decision to amalgate all types of mainline railway vehicles into one uniform gauge is to make the game more accessible for players. While the idea of building in another gauge to avoid takeover by other players and utilize the strengths of each type sounds great, the pak is not set out for this.

Also, how would the constraints work? Would you need to lay sleepers and then track on top in varying gauges/constraints?

Phystam

We pak256-Ex team plan to use such kind of idea for the implementation of different 3 types of gauge which are mainly used in Japan.
However, the number of way_constraint is too few to implement them, because we also plan to implement AC/DC catenary voltage differences.
If the number would be larger, I agree with your opinion!

Matthew

I have also had this thought and if narrow-gauge had not already been implemented in Simutrans, then using way constraints would definitely be the way to go about it. The Pak256.Japan-Ex community have clearly made a good choice. However, we do already have a narrow-gauge functionality that achieves 90% of what you'd want. IMHO there are other possibilities which have a better cost-benefit trade-off, but obviously that is subjective, and the fact that different members of the community have different interests is a good thing.  8)

Quote from: Spenk009 on August 29, 2019, 06:26:02 PM
The issue with former track gauges and rare gauges is that only very few vehicles are offered with each type. If Brunel's broad gauge disappeared in 1892, pak128.Britain's accuracy focus means we don't have any vehicles for the gauge from that point on. The decision to amalgate all types of mainline railway vehicles into one uniform gauge is to make the game more accessible for players. While the idea of building in another gauge to avoid takeover by other players and utilize the strengths of each type sounds great, the pak is not set out for this.

I've never seen a 'manifesto' that sets out the pak128.Britain vision, but you're right that this would be a drawback. If anyone wanted to develop a range of highly plausible locomotives for broad gauge, etc., then they could draw on the large number of locos designed & built in Britain for Irish and imperial/Commonwealth use on other gauges. This pool dries up around the 1950s, but personally I would enjoy seeing other manufacturers' locos in the game too. For example, in the Simutrans world where nationalization never happened, it's entirely plausible that a British transport company with a better loading gauge might have ordered some ICE 1s from Siemens for their high-speed needs.

QuoteAlso, how would the constraints work? Would you need to lay sleepers and then track on top in varying gauges/constraints?

The different types of canals, with different constraints, don't need to build a 'base way', do they? So I think that one wouldn't be needed here, which is a credit to the flexibility of James' code. The different gauges would just be another set of track types available in the railway toolbar.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

ACarlotti

Quote from: Matthew on August 29, 2019, 08:31:11 PM
QuoteAlso, how would the constraints work? Would you need to lay sleepers and then track on top in varying gauges/constraints?

The different types of canals, with different constraints, don't need to build a 'base way', do they? So I think that one wouldn't be needed here, which is a credit to the flexibility of James' code. The different gauges would just be another set of track types available in the railway toolbar.

The difference is that canals only ever have one width/depth, whereas you can build track with extra rails to provide multiple gauges on the same alignment.

Mariculous

#6
ICE1? Well I guess that would need a really much larger loading Gauge than the British loading Gauge.
The ICE1 doesn't even fit into the German loading Gauge so it is not even allowed to operate on all German tracks because.
Maybe it could run at the HS1, apart from channel tunnel rules.
ICE2 would be more likely to work because its restaurant car is not that high.

Back to topic, when there are only two types of gauge, it should not be a problem to create narrow gauge, normal gauge and combined tracks.
If there are more types, imho it would be best to create rails for each single gauge that should be available and creating additional wayobjects for each gauge to allow for combined gauge tracks.

Vladki

IMHO it would be enough to allow narrow gauge to have trams. That would benefit both simutrans standard and extended. Then the pak author would decide what is to be considered "standard" gauge and what "narrow" gauge. Dual-gauge track would be nice but probably much more complicated.

Constraints are imho not really good way to do this, due to their permissive/prohibitive nature, and limited to 8 in number, with most of them already occupied by electrification (permissive) and canals (prohibitive). I'm not sure if we have 8 constraints in total or 8 per waytype.  The problem is also that the track-gauge-contraint would have to be specified everywhere as it is permissive and prohibitive at the same time. Think of it this way - a vehicle with no constraints can use electrified track (permissive), while tube train can use non-constrained tunnel (prohibitive).

Vladki

Quote from: Freahk on August 30, 2019, 01:09:07 PMBack to existing features, I don't understand why a MUST USE constraint would be a bad idea for different gauges at normal track type.
For sure, each train has to requires ("MUST USE"-constraint) exactly one gauge and could additionally require for example electrification.
As long as EVERY rail vehicle and track has it defined it is OK. If some (addon) author omits the constraint, it would create vehicle that can run on any track-gauge, or track that can be used by any vehicle.

Mariculous

You got it to make a quote from the future :P
Just joking, I deleted the post to overhaul it, not expecting that someone would just answer in that moment.

QuoteIf some (addon) author omits the constraint, it would create vehicle that can run on any track-gauge, or track that can be used by any vehicle.
If any (addon) author omits setting the allow_underground parameter to 0, it will also be possible to build it everywhere.
What I want to say is that for sure, if dats are not defined properly, one could create unrealistic content. But that's not something that should be prohibited by the engine.
In fact, this would not even be unrealistic per se as at least Japan and Spain have trains that can switch gauges in operation.

However, one could add a default_constraints[rail] parameter to simuconf or some dat file setting which constraints should be added to any vehicle that does not define any constr

As tram_track is a waytype on it's own, just as track or narrowgauge_track waytypes, I don't think it is possible to add narrowgauge tram tracks without adding such a waytype to the code.
It is hardcode to allow for connecting track to tram_track.

Adding yet another waytype, in this case narrowgauge_tram_track, would not add the flexibility required by pak256-ex nor it would allow for combined gauges and also won't allow adding other rail guided systems not yet being hardcoded into Simutrans-extended such as different maglev systems or the Wuppertaler Schwebebahn.

QuoteEach pakset can have up to eight of each type of way constraint.
So, for Pak128.Britain-Ex, that limit should not be a problem since there are only 4? (third rail, catenary, tram, tube) used yet.
However, when we are already at implementing new code, we should consider increasing the constraint limit as it seems that this limit is too small for pak256-ey'x
Would increasing this limit have a huge impact on memory or why is it limited to 8?
Can't believe it would make a huge difference tbh.

As we already are at implementing new features, here are my thoughts about handling different waytypes and allowing for defined interaction in between them. I will come back to the constraint solution and compare both:


Way subtypes not being hardcoded to the game would be a very strong, standard to extended upward compatible way to allow for different track type interaction.

The track type of what is currently track, tram_track, narrow_gauge_track and consequently even maglev or monorail would be track, because these behave exactly the same apart from some very tiny differences, that means except for tram_track, which can be built on roads, one could implement normal gauge trains as maglev, maglev trains as monorail, monorail as narrow_gauge without any different or just slightly different bahavior, which is given by some coefficients, behavior ingame, as all of these are rail systems.

So we would defne all of these as waytype=track but add a subtype to differ these:
A "normal_gauge" railway track would become waytype=track, subtype=normal_gauge
A narrow_gauge railway track would become waytype=track, subtype=narrow_gauge
A tramway would become waytype=track, subtype=normal_gauge, allow_on_roads=1

To provide Simutrans-standard pakset compatibility in extended, waytype=narrow_gauge_track should be interpreted as an alias for waytype=track, subtype=narrow_gauge, and so on.

Yet, these subtypes are just names. Now they need some semantics:
1. A track is always built with exactly one gauge.
2. Wayobjects can add further track types.
3. Wayobjects, Signals, Stations and anything else that can be placed on a track, can only be placed if the base tracks subtype is listed for that object.
4. Tracks can connect to any other track if there is at least one subtype in common.
5. Tracks that have allow_on_roads set, can be built on roads.
6. Trains that  can use a track if it has at least one subtype in common with the track (multiple subtypes allowed for trains)

An explaination about thes rules:
1. It would be annoying if one always had to build a base type first and a special gauge on top of this. Furthermore, the placed base track has a given graphical width for sleepers and ballast, which makes placing smaller gauges only on top of that weird.
2. This allows for mixed gauge tracks.
3. This prevents for example, placing normal gauge rails on top of narrow gauge sleepers/ballast, which is simply too small for normal gauge rails. Additionaly, it prevents crazy stuff such as narrow gauge rails at maglev tracks.
4. Connecting rails if they can't be used that way doesn't make any sense. The user should be assisted when trying to build this.
5. Should be self-explaining. We need a flexible way to allow tram ways.
6. Some trains in Spain and Japan are capable of changing their gauge in operation. this makes that kind of hybrid gauge vehicles possible.

Back to existing features, I don't understand why a MUST USE constraint would be a bad idea for different gauges at normal track type.
For sure, each train has to requires ("MUST USE"-constraint) exactly one gauge and could additionally require for example electrification.

A narrow_gauge vehicle MUST USE narrow_narrow_gauge, a normal_gauge track MUST USE normal_gauge.
An electric normal_gauge MUST USE normal_gauge and MUST USE electrification.
So if you build a normal_gauge track and equip it with electrification, that train can use it but a MUST USE narrow_gauge and electrification can't use it.
Tube tracks use a MAY USE tube constraint, so an electrified normal_gauge tube tunnel may be used by any normal_gauge tube train, which can optionally be electrified.

Comparing these 3 methods, I currently would prefer the constraint solution for Pak128.Britain-Ex as long as it is possible to increase the constraint limitation without too much work because it is flexible and should not be too much work implementing, however it is still not as flexible as way subtypes, which I would guess to be what pak256 needs.
If this implementation is desired, I would like to assist at modifying the .dat files.

Here is my comaprisation table about these, listing features I have read about here or I had in mind.









use waytypesuse constraintsuse subtypes
Allow narrow gauge tram tracksyesyesyes
Allow mixed gauge tracksnoyesyes
Allow mixed gauge  vehiclesnopartly (just one or all possible)yes
Allow connecting tracks only if they are compatibleyesnoyes
Reduced maintenance of signal, station, catenary,... .datno (same signal needs to be redefined for each waytype)yesyes
Allow further rail based transport systemsnopartlyyes
Expected amount of workmedium (game engine)none to medium (game engine) medium (pakset)high(game engine) medium(pakset)
Allow for Road-Rail vehiclesnonono

Vladki

Pak Britain uses these permissive way constraints: 3rd rail, 4th rail, and 3 different overhead catenary voltages (25 kV AC, 1.5 kV DC and 600 V DC for trams). Pak.CS adds 3kV DC and 15 kV AC for german trains, but doesn't have 4th rail. So in total we are at 7 constraints just for electrification.

Prohibitive constraints are tube tunnel and tram track, and 5 water channel widths

Mariculous

And addditionally Waterway and high clearance under bridges permissive.
So we have 7 permissive and 7 prohibitive in Pak128.Britain-Ex?

Well in that case we would need to increase this limit for gauge constraints.

Vladki

And to add to the list I planned to use prohibitive constraint for rack (cog wheel) railways.

jamespetts

I have realised that I had omitted to respond to this thread when I first read it.

Narrow gauge track is a waytype rather than a set of constraints because waytypes are intended for completely incompatible systems whereas constraints are intended for partly compatible systems. A narrow gauge train can never travel on a standard gauge track and a standard gauge train can never travel on a narrow gauge track, whereas, for example, a train that can fit in a Tube tunnel can also travel on overground track and a diesel or steam powered train can also travel on track that is electrified with any given electrification system. Although dual gauge track was used with broad gauge (which we do not simulate because, unlike the real life Great Western Railway, players will know from the outset that it is doomed to become obsolete), this was never used with narrow gauge railways, and there was never any economic reason to do so with narrow gauge railways.

The reason that only one type of narrow gauge track is used is that there would be no significant economic difference between the slight differences of gauge in narrow gauge track, but it would introduce a huge amount of complexity to simulate all of these different types. Remember, Simutrans-Extended is an economic simulation not a computerised model railway: only things that are economically significant are simulated, and awkward differences between incompatible but economically equivalent things (e.g. the distinction between British Standard and Pullman gangways) are generally collapsed for ease and simplicity. There is only a very limited amount of developer time (and until I am able to get parts to rebuild my computer to something more workable, virtually no developer time), and this must be prioritised on things that have a real impact on the game balance for the foreseeable future.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

Dual gauge tracks exist till today, although in limited scenarios:

- Standard (1435) and Narrow (760 mm) gauge go for 2 km together from Jindřichův Hradec, CZ:
https://cs.wikipedia.org/wiki/%C5%BDelezni%C4%8Dn%C3%AD_tra%C5%A5_Jind%C5%99ich%C5%AFv_Hradec_%E2%80%93_Nov%C3%A1_Byst%C5%99ice#/media/Soubor:Jind%C5%99ich%C5%AFv_Hradec,_Doln%C3%AD_Skr%C3%BDchov,_%C5%BEelezni%C4%8Dn%C3%AD_tra%C5%A5_do_Nov%C3%A9_Byst%C5%99ice-odbo%C4%8Dka.JPG

- Trams in Liberec, CZ have many dual gauge parts (1435 + 1000 mm) - they are planning to rebuild completely to standard gauge

- Rail line Baťovo – Korolevo, UA is dual gauge standard (1435) and russian (1520 mm), to allow direct freight trains from Slovakia to Rumania, 68 km.

So although rare, thay have economical significance.

EDIT: I forgot about manipulation line for Prague underground -although it uses standard gauge - the third rail is too close to the track for normal trains to pass, so they have second track slightly offset to let them use it. So czech third rail would have permissive and prohibitive constraint at the same time...

Mariculous

@Vladki First I thought the same, for example many "Stadtbahn" networks, which is something like a mix of tram and underground, often use normal gauge, while trams in the same area use 1m gauge, sometimes on the same track by dual gauge rails.
The same goe for Shinkansen in Japan.
However, I guess this discussion is just about Pak128.Britain-ex.

Quote[Dual gauge] ...was never used with narrow gauge railways, and there was never any economic reason to do so with narrow gauge railways.
Maybe this is correct for the UK. However, at the discussion about ETCS, I read that things should be possible for the player, if these were technically possible, even if British Rail didn't use it at these years.

As dual gauge tracks would sometimes have a huge economical advantage in some cases, It should be possible to allow for dual gauge tracks.

If developer time is the only problem about this, I could move all the existing narrow gauge vehicles and tracks to constraint based normal gauge system.
The only thing we need for this, which Pak256-ex needs anyways, are more possible constraints and graphics for dual gauge tracks.

jamespetts

If dual gauge tracks are something that is of economic relevance for other paksets, then there are two things that might be done: either someone might alter the code to allow for true multiple waytypes per tile in the same direction, which would involve changing somewhat fundamental parts of the code and would be a great deal of work, and is not something that I am likely to be able to priorities for the foreseeable future, or the maintainers of those other paksets might use constraint sets to simulate the various gauges.

Increasing the number of possible constraints from 8 of each type to 16 of each type should be possible, and, although not trivial, not the most difficult of things. The graphics for dual gauge track would be the responsibility of the pakset maintainers in question.

This is not something worthwhile for the British pakset, but I should be interested to know if there is a strong demand for additional constraint slots (i.e. more than 8 of each type) for the purposes of different paksets.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

I think that dual gauge tracks in former czechoslovakia are more of a curiosity than really economically significant. However if the constraints are 8 for each waytype, then it should be enough. Permissive: 6 different electrification voltages; prohibitive: 4 gauges, rack rail, underground (metro)

Mariculous

Well, I think there are already more constraints required for pak256.
I'd like to quote Phystam
QuoteWe pak256-Ex team plan to use such kind of idea for the implementation of different 3 types of gauge which are mainly used in Japan.
However, the number of way_constraint is too few to implement them, because we also plan to implement AC/DC catenary voltage differences.
If the number would be larger, I agree with your opinion!

jamespetts

Thank you for letting me know - I may have go give some consideration to looking into extending the number of constraints, although doing any substantial work is likely to be difficult until I am able to replace my ageing computer at home.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

Just to make sure - is it 8 permissive and 8 prohibitive constraints for each waytype?

jamespetts

Quote from: Vladki on September 23, 2019, 04:18:23 PM
Just to make sure - is it 8 permissive and 8 prohibitive constraints for each waytype?

It is 8 permissive and 8 prohibitive overall; but I think that you can effectively re-use the same constraints in different waytypes, as the translation texts for them are now split by waytype.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.