PDA

View Full Version : Junctions



andi06
September 17th, 2015, 07:58 AM
As you know I have a range of beta fixed track junction objects which covers most of the specialised trackwork that procedural junctions can't cope with: three way points, diamond crossings, catch points, slips, double crossovers etc.

I'm minded to complete these by updating the meshes and textures to match my procedural track assets.

As well as being a graphic and functional solution these objects contain additional scripted 'intelligence'. For instance the diamond crossings include two invisible junctions (one on each leg) which share a single mutex and are scripted so that when one junction opens the other is closed. The diamonds can be switched by the user or linked to other junctions such that the signalling surrounding the asset responds by setting itself correctly. In addition a built-in trigger monitors train movements and if it finds trains on both legs at the same time, the script responds by de-railing both of them. This is a diamond crossing which 'works-out-of-the-box' and doesn't need any special triggers or signals.

Similar logic is applied to slips and double crossovers to prevent the existence of simultaneous conflicting paths.

786

By and large the AI plays nicely with these objects but there is one bug which prevents them from working perfectly: The problem is that trains crossing any fixed-track junction which has more than one attached node are not releasing control of the junction properly after they have crossed it. Trains on a schedule will keep control until the entire schedule is completed, user driven trains until they stop. This bug has been reported and logged but I don't know whether it has been looked at. Ordinarily it wouldn't be on your priority list right now.

So before I start doing a lot of work on the meshes is there any chance of your looking at this issue and indicating whether I can expect to see it fixed? I can provide maps to illustrate the problem.

I've never seen any design documents for 'Interlocking Towers' and some aspects of the script library that goes with these objects might cover similar ground (I have a 'signal box' asset which allows paths to be selected from an on-screen menu). Is there any chance of making this available?

WindWalkr
September 17th, 2015, 08:12 AM
Send in a simple test route. I'll make sure it gets looked at.

No, there's no real overlap evident between what you're doing and the interlocking towers, except in the sense that both provide a form of "interlocking" to exclude conflicting paths. I'll try to get a draft of that document added to the trainzdev document folder soon, so you can check it for yourself. There are other changes that you may find interesting, if not directly relevant to this point.

chris

andi06
September 24th, 2015, 07:30 AM
I now have a pilot object for this project, a left hand catch-point:

799

This shows two procedural track stretches attached to either end of a fixed-track catch point.

A couple of queries arise:

1. The [Set Direction] button on the Surveyor/Tracks/Trackside tab will change the direction of spline junctions (including junctions in procedural track) but for Fixed Track objects it is currently necessary to open Object Properties which includes a scripted 'change direction' widget. It would be convenient if the Surveyor/Trackside button also operated on fixed track objects.

2. The lever object is created by taking any standard mojunction, cloning it and changing the asset kind from mojunction to scenery-trackside. The cloned object is then placed, and detected and controlled by the junction itself. This works well but the alteration removes the red/green direction arrows so that these levers don't have those arrows. Would it be possible to add the arrows to these levers, perhaps by making them available as an attachment? They appear to include a billboard capability which, as far as I can see, I wouldn't be able to replicate.

We've discussed both of these matters in the past and I got the impression that they would be relatively trivial to implement. Is there any chance of adding them to the game?

WindWalkr
September 24th, 2015, 09:13 AM
1. The [Set Direction] button on the Surveyor/Tracks/Trackside tab will change the direction of spline junctions (including junctions in procedural track) but for Fixed Track objects it is currently necessary to open Object Properties which includes a scripted 'change direction' widget. It would be convenient if the Surveyor/Trackside button also operated on fixed track objects.

That should be trivial, and i'll push for it to go in asap.




2. The lever object is created by taking any standard mojunction, cloning it and changing the asset kind from mojunction to scenery-trackside. The cloned object is then placed, and detected and controlled by the junction itself. This works well but the alteration removes the red/green direction arrows so that these levers don't have those arrows. Would it be possible to add the arrows to these levers, perhaps by making them available as an attachment? They appear to include a billboard capability which, as far as I can see, I wouldn't be able to replicate.

That is less so. I'll add a request for it, but the functionality simply doesn't exist on the object type that you'd be using, so it either means duplicating a bunch of functionality (not ideal) or moving it out to some common location (requires quite a bit of thought and potentially messing around throughout the codebase.)

chris

andi06
September 24th, 2015, 10:08 AM
Thanks Chris.

Some information which might suggest an alternative approach.

The invisible track segment used for the root track of the junctions belongs to a specific asset-group <kuid:122285:70000>. The altered levers can only be placed on tracks of this type. (using a placeable-on-splines-of-group table)

The junction script searches for a Trackside asset on this track and if it finds one it toggles mode0/mode1 (or any included animation) to match the junction blade state.

The trackside asset itself is unscripted.

andi06
October 17th, 2015, 02:54 PM
The [Set Direction] button on the Surveyor/Tracks/Trackside tab will change the direction of spline junctions (including junctions in procedural track) but for Fixed Track objects it is currently necessary to open Object Properties which includes a scripted 'change direction' widget. It would be convenient if the Surveyor/Trackside button also operated on fixed track objects.
Thanks for implementing this, I didn't realise it was also in the previous build. There are a couple of problems though:

Crash to Desktop
1. This is in build 78966, didn't happen in 78924
2. Make sure that you have <kuid2:122285:4040:20> installed.
3. Create a new route
4. Find the above asset (JK Point 20-XX-3.5 Crossover 3.5) in the Surveyor list.
5. Select it and you will be dumped to the desktop.
6. Nothing helpful in the log but a Crashdump is available on request.
I think that the above applies to any SceneryWithTrack but the asset quoted is one that I've actually tested on an empty map.

Set Direction Operation
The majority of my fixed track objects respond as expected but certain objects (double crossovers, single and double slips) have three possible states. The Set Direction button will toggle between states 0 and 1 (including the scripted internal linking of multiple nodes) but will not select state 2. This may be something I can handle in the script library but I can't see any hints in the logs as to how you are implementing the switching.

[Edit: Ignore this, I've found out what you are doing and fixed the problem]

WindWalkr
October 17th, 2015, 08:28 PM
Thanks for the update. I can't repro the crash so you might want to send in the crashdump.

chris