BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Animating pantograph height changes

Go down

Animating pantograph height changes Empty Animating pantograph height changes

Post by Delsin Thu Apr 09, 2020 1:33 am

I'm doing upgrades on an old BVE4 route that has many transitions between tunnel and outside sections and that means overhead catenary changes height in all these places. However, I need to somehow vary pantograph height so it fits under the wire (another alternative is making tunnels disproportionally higher, but that'll make them ridiculously tall, I'm not even talking about other issues) and can't think of a way to do this. The best would be specifying catenary height in the route file in a similar fashion to brightness with a way for .animated files to retrieve it, but there's simply no such command. Any possibility to implement something like this?
Delsin
Delsin

Posts : 283
Join date : 2016-08-20

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by Manuel18 Tue May 05, 2020 9:20 pm

It's possible using a plugin for this. When the train reaches a beacon the pantograph contact zone changes. But you must give a smooth animation.

It might be hard match the animation because openBVE pantographs doesn't work using nodes just like Trainz or Train Simulator series.
Manuel18
Manuel18

Posts : 74
Join date : 2012-10-18
Age : 27
Location : Caracas,Venezuela

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by Delsin Wed May 06, 2020 12:44 am

That's why using a plugin isn't a feasible option. We need wire height specified in the route file in a similar way to brightness, with interpolations between diffeent heights, and a function that returns that value in an .animated file. If the function will be able to return pantograph height at the point n meters from the centre of the car i as it goes along the route, animating that will be easy.
Delsin
Delsin

Posts : 283
Join date : 2016-08-20

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by zbx1425 Wed May 06, 2020 2:41 am

I cannot think of a nice solution other than using a plugin.
The plugin can output the data to a panel variable, and can be used as the ats[i] parameter in animated object.
Specifying data for a plugin is easy. Track.Beacon enables you to send anything you would like to the plugin at a specified location. You can easily specify datas like what is the height going to be and how long should it take to animate.
So a plugin need to be programmed for this purpose. It should be fairly simple to program as the functionality is simple. Or there might have been someone who have done that already.
zbx1425
zbx1425

Posts : 136
Join date : 2017-08-18
Location : China

https://www.zbx1425.cn

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by Delsin Wed May 06, 2020 2:15 pm

This works fine until you need to use a different plugin for a different train and even if you make a separate module for pantographs only, it won't always work with DetailManager. Or the entire thing will just refuse to load like some plugins do and the whole thing falls over.

On the other side, pantographs with varying height are universal enough to be a standard feature, there are lots of routes with overhead power around and almost everywhere catenary gets lower in some places.
Delsin
Delsin

Posts : 283
Join date : 2016-08-20

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by zbx1425 Wed May 06, 2020 2:31 pm

Delsin wrote:This works fine until you need to use a different plugin for a different train and even if you make a separate module for pantographs only, it won't always work with DetailManager. Or the entire thing will just refuse to load like some plugins do and the whole thing falls over.

On the other side, pantographs with varying height are universal enough to be a standard feature, there are lots of routes with overhead power around and almost everywhere catenary gets lower in some places.
The OpenBVE-DetailManager programmed by S520 worked quite smooth for me. And I made a hacky modification to it, which allowed both .NET assemblies and Win32 DLLs to be loaded at the same time. https://zbx1425.tk/nautilus/detailmanager.html
Anyway it is up to Mr.leezer3 to decide whether a new feature should be added or not. I can only suggest some solutions that works without requiring any modification to the current game. The plugin solution does not sound too troublesome, at least to me.
zbx1425
zbx1425

Posts : 136
Join date : 2017-08-18
Location : China

https://www.zbx1425.cn

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by leezer3 Thu May 07, 2020 12:45 pm

This has been asked before I'm sure, and no-one ever got around to doing anything.

Anyways, if doing this, we need to do it properly.

Initial thoughts for a draft pair of commands:
.PowerSupplyStart type; voltage; contactHeight; ampsAvailable

.PowerSupplyEnd type


Type:
A numeric type. Supplies a default set of properties for voltage, contact height and amps, which can be overridden by the developer.
0 - 25kv AC OHLE
1 - 1500v DC OHLE
2 - Third rail 750v DC
3 - 3rd / 4th rail 630v DC

Set these up as an event type, and allow access from both plugins and animated files, e.g.
Code:
TranslateXFunction = WireHeight[0]

Assume at this point that the array runs from front to back of the train.
By default, set pickup points (pantographs / collector shoes) on motor cars, overridable by train.xml

leezer3

Posts : 1785
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by Delsin Thu May 07, 2020 2:28 pm

Hmm, this is a good approach, exactly what I thought of. Even takes care of what has to be handled with more complex plugins (like that Silverlink 313) Very Happy
Delsin
Delsin

Posts : 283
Join date : 2016-08-20

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by NakanoS Wed May 13, 2020 2:09 am

As a person who can't make or modify any plugin, i know your pain.

So, if i was you, gonna use Track.destination hack as pantograph state (only if there's no any track.destination function states used recently in the route). Let's say in normal or lower heights, use destination 0. For higher one, use 10. any between heights use destination 1 until 9. At the pantograph animated file, gotta use smiliar thing like this:

[object]
States = (pantograph parts at lowest position)
TranslateYFunction = destination * (height changes)

hope this works until someone find new input. good luck
NakanoS
NakanoS

Posts : 23
Join date : 2017-11-09
Age : 24
Location : Bandung, Indonesia

http://javvasharyo.weebly.com

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by Delsin Wed May 13, 2020 10:20 am

This lacks one very important thing - smooth interpolated transitions. Pantograph should follow height of the wire, not just drop to x meters at some point. That's why it has to be defined similarly to brightness - there's height 1, height 2, and a linear transition between them. If we have these heights 20m apart and a car stops somewhere in between, the .animated function should return height corresponding to the current pantograph position (pantograph offset from the centre of the car has to be specified in it then for correct route position reference), so that, say, we have 5m wire at route position 120 and 5.5m at 140 and the car stops at 137 with the pantograph offset 7m to the back, it should rise to 5.25m.
Delsin
Delsin

Posts : 283
Join date : 2016-08-20

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by NakanoS Wed May 13, 2020 7:10 pm

Delsin wrote:This lacks one very important thing - smooth interpolated transitions. Pantograph should follow height of the wire, not just drop to x meters at some point. That's why it has to be defined similarly to brightness - there's height 1, height 2, and a linear transition between them. If we have these heights 20m apart and a car stops somewhere in between, the .animated function should return height corresponding to the current pantograph position (pantograph offset from the centre of the car has to be specified in it then for correct route position reference), so that, say, we have 5m wire at route position 120 and 5.5m at 140 and the car stops at 137 with the pantograph offset 7m to the back, it should rise to 5.25m.
Well, worked at this. Not really smooth as you want tho  Sad 



As in the description said, using Track.Destination hack only possible if applied on [Car0] object.
Anyway, I think we can use Odometer value for another tricks. But ONLY works if no change ends commands on your route, since value of odometer will return to zero if train move too far away in one frame Very Happy. Gonna think later for how to use this trick.
NakanoS
NakanoS

Posts : 23
Join date : 2017-11-09
Age : 24
Location : Bandung, Indonesia

http://javvasharyo.weebly.com

Back to top Go down

Animating pantograph height changes Empty Re: Animating pantograph height changes

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum