Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Train-side length override for stop positions #1085

Open
hotdamndel opened this issue Nov 7, 2024 · 8 comments
Open

[Suggestion] Train-side length override for stop positions #1085

hotdamndel opened this issue Nov 7, 2024 · 8 comments

Comments

@hotdamndel
Copy link

There are routes where multiple stop positions depending on car amount are required. However, there are cases where trains having a smaller number of longer cars have to stop at a position not matching their car count (good example is New York subway and 75ft cars where 8-car trains have to stop at 10-car signs).
Best solution I can think of is an override value specified on the train side that will only affect stop positions (anything else like dummy cars is detrimental to physics, sound, performance etc) - train is still simulated as 8 cars (NY example) but stops where a train formed with an override count (10 in this example) would.

@ginga81
Copy link
Contributor

ginga81 commented Nov 7, 2024

I apologize if that's not what you mean.
The Tohoku Shinkansen has a variety of carriages and numbers of cars.
There are 6, 7, 8, 10, 12, 16 and 17 cars.
Each train has a mark and number at its stopping position, and the mark for that number of cars is lit up as an animated object.
The route data is common and is done in this way, so it behaves the same as the various real trains.

,;base-stop(others:ALL)		16/17 cars	 or others
12.5					
	.Stop (0;$Sub(1000);$Sub(1000);0)				,;共通
	.FreeObj 0; 120; -2.8; 4.5; 0				,;共通
14.5					
	.Tr 2				
-2.5					
	.Stop (0;$Sub(1000);$Sub(1000);7)				,;Z=Series E6: 7 cars
-0.5					
	.Tr 2				
;Z There was a discrepancy between the stopping position and the object placement, so it was fixed.
-6					
	.FreeObj 0; 124; -2.8; 4.5; 0				,;Z
-7.5					
	.Stop (0;$Sub(1000);$Sub(1000);6)				,;秋 山: Series E3: 6 cars
-5.5					
	.Tr 2				
;秋 There was a discrepancy between the stopping position and the object placement, so it was fixed.				
-8.5					
	.FreeObj 0; 127; -2.8; 4.5; 0				,;秋
;山 There was a discrepancy between the stopping position and the object placement, so it was fixed.				
-4					
	.FreeObj 0; 126; -2.8; 4.5; 0				,;山
					
;There was a discrepancy between the stopping position and the object placement, so it was fixed.					
-138.25					
	.FreeObj 0; 122; -2.8; 4.5; 0				,;810 Series-E2-1000 、E4、 ALFA-X E2-0 8/10 cars
-139.87					
	.FreeObj 0; 121; -2.8; 4.5; 0				,;U Series-E5
					
-134.75					
	.Stop (0;$Sub(1000);$Sub(1000);8)				,;8
	.Stop (0;$Sub(1000);$Sub(1000);10)				,;10
-132.75					
	.Tr 2				
-31.35					
	.FreeObj 0; 125; -2.8; 4.5; 0				,;12 Series-E7 12 cars
-27.85					
	.Stop (0;$Sub(1000);$Sub(1000);12)				,;12
-25.85					
	.Tr 2				

Screenshot from 2024-11-07 20-12-35
Screenshot from 2024-11-07 20-12-58

@hotdamndel
Copy link
Author

That's close enough. But I mean specific cases, like if cars are longer (or shorter) for certain trains so that smaller number of cars should stop where bigger would. Think of E331, it has more cars in BVE terms (more separate car bodies) but it stopped where 10 regular cars (E233 or 205) would.

@ginga81
Copy link
Contributor

ginga81 commented Nov 7, 2024

I see.
Luckily, The Tohoku Shinkansen is not have real 14 cars formation.
In the above case, cars 8 and 10 are in the same position, so if we want to set 14 cars of E331,

-134.75					
	.Stop (0;$Sub(1000);$Sub(1000);8)				,;8
	.Stop (0;$Sub(1000);$Sub(1000);10)				,;10
	.Stop (0;$Sub(1000);$Sub(1000);14)				,;14

how about doing it like this?
I remember that there was an old issue where we could only sort in ascending or descending order.
Someone asked for it to be fixed, and I remember that now it's possible.

@hotdamndel
Copy link
Author

it's still problematic when there are 8-car trains, 10-car trains and longer 8-car trains that stop where 10 cars normally do run on the same line, this is the scenario that I meant originally and that can't be solved currently.

@ginga81
Copy link
Contributor

ginga81 commented Nov 7, 2024

So for example, on a platform with a base of 20m/car

Type 1: 8-car formation. Length 160m: 20m/car
Type 2: 8-car formation. Length 200m: 25m/car
Type 3: 10-car formation. Length 200m: 20m/car

And, we want to make this like...

Type 1 a stopping position for 8 cars
Types 2 and 3 a stopping position for 10 cars

But since it can only judge by "8", it stops at the 8.
Is this correct my understand?
If so, I think that's right since right now we can only judge by numbers.

@leezer3
Copy link
Owner

leezer3 commented Nov 7, 2024

I can't see a good solution to this one.

Anything you add is going to need specific route / train combination mappings.
This is definitely a flaw with the current BVE design, but I'm not sure there's really a good answer at the minute.

What it feels like is that it wants an extension of the XML station format somehow.
https://openbve-project.net/documentation_hugo/en/routes/xml/stationxml.html

If we assume that our default station is thus:

  
<?xml version="1.0" encoding="utf-8"?>
<openBVE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Station>
		<Name>Dockyard</Name>
		<ArrivalTime>12.3130</ArrivalTime>
		<DepartureTime>12.3150</DepartureTime>
		<Doors>Left</Doors>
		<ForcedRedSignal>False</ForcedRedSignal>
		<PassengerRatio>10</PassengerRatio>
	</Station>
</openBVE> 

We could then add an alternative per-train station definition something like this:

<?xml version="1.0" encoding="utf-8"?>
<openBVE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Station>
		<Name>Dockyard</Name>
		<ArrivalTime>12.3130</ArrivalTime>
		<DepartureTime>12.3150</DepartureTime>
		<Doors>Left</Doors>
		<ForcedRedSignal>False</ForcedRedSignal>
		<PassengerRatio>10</PassengerRatio>
	</Station>
	<Station Train="HST4_OpenBVE">
		<Name>Dockyard</Name>
		<ArrivalTime>P</ArrivalTime>
	</Station>
</openBVE> 

Basically though, I don't see much difference here to just adding different routefiles. It'd be marginally more convienient, but in order for a feature to gain traction, it needs something new and shiny.

@ginga81
Copy link
Contributor

ginga81 commented Nov 8, 2024

Thank you for the idea.
I also agree with defining it in XML.
Just one thing, this time, even though the number of cars is the same and the lengths of the cars are different, the .stop command only recognizes it as define 8 cars, so even though we actually want to stop at stop position 10, it stops at stop position 8.
So even though there are 8 cars, we want to make it the same as stop 10, but because stop is used at 8, setting 8 twice is invalid.
So I think what we're trying to do is make it possible to choose more than two types of stop even with 8 cars.
So I don't think it's "P".
If we define the stations by their names in XML, I thought it would be better to assign the distance of each train's stop distance to the station name. For example,

Type 1: 8-car formation. Length 160m: 20m/car
Type 2: 8-car formation. Length 200m: 25m/car
Type 3: 10-car formation. Length 200m: 20m/car

<Station Train="8Cars_Type1">
	<StopPosition>
		<Name>Departure Station</Name>
		<Distance>160</Distance>
	</StopPosition>
	<StopPosition>
		<Name>Middle Station</Name>
		<Distance>2160</Distance>
	</StopPosition>
	<StopPosition>
		<Name>Final Station</Name>
		<Distance>4160</Distance>
	</StopPosition>
</Station>
<Station Train="8Cars_Type2">
	<StopPosition>
		<Name>Departure Station</Name>
		<Distance>200</Distance>
	</StopPosition>
	<StopPosition>
		<Name>Middle Station</Name>
		<Distance>2200</Distance>
	</StopPosition>
	<StopPosition>
		<Name>Final Station</Name>
		<Distance>4200</Distance>
	</StopPosition>
</Station>
<Station Train="10Cars">
	<StopPosition>
		<Name>Departure Station</Name>
		<Distance>200</Distance>
	</StopPosition>
	<StopPosition>
		<Name>Middle Station</Name>
		<Distance>2200</Distance>
	</StopPosition>
	<StopPosition>
		<Name>Final Station</Name>
		<Distance>4200</Distance>
	</StopPosition>
</Station>

@hotdamndel
Copy link
Author

hotdamndel commented Nov 8, 2024

Not a great idea since it attaches stop positions to train names on route side. I thought of something in train's xml like:

<?xml version="1.0" encoding="shift_jis"?>
<openBVE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Train>
		<ConvertorVersion>1.9.2.2</ConvertorVersion>
		<DriverCar>0</DriverCar>
		<Car>03-830.xml</Car>
		<Car>03-730.xml</Car>
		<Car>03-630.xml</Car>
		<Car>03-530.xml</Car>
		<Car>03-430.xml</Car>
		<Car>03-330.xml</Car>
		<Car>03-230.xml</Car>
		<Car>03-130.xml</Car>
		<Plugin>Files\ats.dll</Plugin>
		<HeadlightStates>2</HeadlightStates>
		<Description>aaa</Description>
		<CarCountOverride>10</CarCountOverride>
	</Train>
</openBVE>

Basically, it's a 8-car train, but stop positions treat it as 10 cars because of CarCountOverride.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants