Jump to content

how to program road traffic stop/start at lights and rail barriers


Empfohlene Beiträge

Hi

I am relatively new to this type of 3D modelling and have so far sorted much that I needed through reading the manual translation and much trial and error. One thing that is so far eluding me is how to create events that will allow road vehicles to stop at traffic lights and barriers when necessary and then to restart once the barriers go up or the lights change. 

Getting the trains to open and close the barriers is pretty straight forward but I am finding it really difficult to get to grips with the English translation that I assume might point me in the direction of how to solve the above problem.

Any tips that would start me off on this process would be greatly appreciated. I now realise that I have perhaps been a little too ambitious in terms of 1st layout size, 12000 x 5000 'N' gauge, having now put in around 450 hours of most enjoyable computer time with at least the same amount of time still required to complete this layout but I do not regret one second. A day without learning is a day lost but sometimes you just need a bit of help to move your learning curve up a notch.

Many thanks in anticipation of some assistance.

Pete 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi guys

I typically control crossings with a variable, initiated and altered by trains coming and going. For example 0 for open crossings, +1 for each train entering, -1 for each train leaving. Everything above 0 (>0) shuts and keeps crossings shut until the variable is 0 again. The same variable can be taped on to control road traffic. The new V5 version of MBS introduced keywords and track contacts, both giving more options and flexibility to control traffic on crossings.

Cheers

Tom 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Thanks for the advice offered to my problem. Perhaps I am just being a bit thick and overlooking the obvious but having set up a test track oval with both road and rail I am still unable to figure out how to incorporate variables into my events. I have tried numerous alternatives but none seem to work. At the moment the only way I can get crossing barriers to function is by setting each train to trigger the animation when it is located on a particular track. I have set a variable of +1 to close and -1 to open in the variables list for the one crossing that I am using on the test track and tried alternative setting in both the event, condition and action sections however nothing seems to work so I am clearly not getting that part right. I think I need a more detailed bit of guidance to sort this please. I suppose it's a bit like flying really. The principal is pretty straight forward but to fly a modern jet needs a bit more guidance than it does for a single engine gypsy moth.

thanks 

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 28 Minuten schrieb 220hotwheels:

I have set a variable of +1 to close and -1 to open

That has no relation to your particular problem.

A variable may be use as a counter when multiple tracks are crossed. It's to ensure that all trains have passed before the barrier opens again. It has nothing to do with stopping road traffic at a barrier or traffic light (which is what you're struggling with at the moment.)

To stop any traffic, you need to use a track (in version 4) or a contact (in version 5) on the road at a distance to the actual signal or barrier. Use the event of a vehicle treading on that track element or contact to trigger the following:

Make the status of the signal or barrier your condition.

State that when the condition is met (i.e. the state is "stop", "close" or similar), the triggering vehicle has it's target speed set to 0.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Pete,

please have a look to the demo layout "Bahnübergangs-Steuerung" with Content-ID 3FD7F227-BFD1-4630-A162-00F7EFA87D34.

Unfortunately the whole description is in German. Nevertheless I hope, that you can interpret the event description which I realized with this layout.

There are 2 essential variables "Zugbelegung" (reservation by train) and "Autobelegung" (reservation by street car) which are used to regulate the traffic around the railroad crossing. The rough scenario is as follows:

The variable "Zugbelegung" counts the blockings of the railroad crossing by the trains.
The variable "Autobelegung" counts the blockings of the railroad crossing by the street vehicles.

When an train approaches the railroad crossing or a street vehicle enters the street section crossing the railroad tracks the corresponding variable is counted up. After the train or the street vehicle has left he railroad crossing, the coorresponding varable is counted down. So long, this scenario is similar to that described by you in the post above.

If the variable "Zugbelegung" is counted up to > 0 while the railroad crossing is open and it is reserved by any street vehicle, all further street vehicles which intend to cross the railroad crossing but have not yet entered it will be stopped. After all other sreet vehicles have left the ailroad crossing and therefore the variable "Autobelegung" is found set to 0, the railway barriers can be closed. After the closing is finished, the train signals protecting the railroad crossing can be opened and the (possibly waiting) trains can pass.

After all trains have passed the railroad crossing (variable "Zugbelegung" set to 0) the railway barriers will be obened and, after the opening is finisheed, all waiting street vehicles can now pass the railroad crossing.

Please look at the event definitions for understanding the railroad crossing control.

Many greetings
BahnLand

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Pete

Perhaps you can export your trial and post it here so I and who else wants to help can have a look.

We're all pretty much currently gipsy moth pilots trying to handle an A380 (the new MBS V5). There will be some literature on it eventually in September when it is officially released. Until then your best bet is the forum and what you can find out on your own or with some help from others here. If your layout is V4 it will be ok as well to have a look.

Cheers

Tom

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Tom

Thanks for your reply and the offer to take a look at my test track. The first attempt was a bit of a disaster so I am starting a new one but it did at least give me some thoughts for my main layout which is V4. Despite everyone's advice I am still at a loss as to how to use variables. No doubt in the fullness of time it will come to me so all of my "Events" are quite basic using either track or road sections to control events. My challenge at present is to get 4 buses operating between a bus station and ferry terminal. The basic instructions are not so difficult but the challenge lies in getting everything to gel with the trains. The big challenge is at a level crossing with 4 tracks used by 16 different trains all crossing at various times. So far I have applied the principal of stop each bus at a bus stop just before the crossing and then at the appropriate moment, when the last carriage of a train has passed and triggered the crossing gates to open that will start the coach from the bus stop. Whilst this set of events is still in it's infancy I realise there is much still to learn to ensure a smooth flow for each bus but given time I will sort it in much the same way I have with the various boats that operate on my lake that are tied to the bascule bridge operation. No doubt variables would make for a simpler events control which is why I posted my question on the forum, the medium of which I am a complete novice too so I hope all will bear with me if I seem a bit slow to understand some of the finer points of it's use.

Over the next few days I will set up another test track and then attempt to export it, once I have found out how to do so!!!. I suppose I could always send my main layout this way but am a bit loath to embarrass my self with all you knowledgeable guys. 

Thanks once again for all your advice and offer to assist me.

Cheers Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Pete

Exporting is almost the same as saving a  layout. Just that you need to click on the little arrow on the Save button to get a drop-down with the export option on its bottom....

exp1.JPG.6ead82f87823d86f2ce1924898e514cf.JPG

Once you clicked that, a window comes up requiring you to christen the file and tell the MBS where it should store it.

exp2.thumb.JPG.fd3452f6a2a819d05f3656a95de2b9c0.JPG

If you just started digging into the fabulous world of virtual model training I reckon to jump straight onto V5. Even though it shares the chore fundamentals with V4 it is a world further up than the predecessor. So much more powerful with less effort, once you got used to it. I transformed another member's first layout into a small size so it can be saved and kept updated in V5 (there is a limit of only 150 items in a layout for the trial version). In this, there is some basic event management (EM) for the 2 trains. All it does is starting them, slowing down and coming to a halt on the next station. Might give you some clues on how to do things by going through the EM. Another reason why is that the catalogue in V4 won't grow any further, it will stay as it is now.

Cheers

Tom

 

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Tom 

Let me get this straight then. V5 is the beta version. Do I simply click on the section for auto update to beta version to get the trial of V5 and by doing so do I affect my current layout in V4 or can I run both simultaneously. Also for the future will my V4 layout transfer to V5 once it has passed it's trial stage and I have upgraded or would I need to start all over with my current V4 layout.  My present layout has thousands of items so far and I have really only just started. Admittedly much of my work now is fine tuning and finishing the scenery, as much of it is just "placed" roughly at present, but that will be at least another 500 hours work followed no doubt by much change as my experience and knowledge grows. I haven't had so much fun since starting my own businesses 45 years ago. Computers then were almost wind up toys.

Are you suggesting that I export my main V4 layout as is for you to look over and offer your advice or just my test track layout, which I will complete later today.

Cheers

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Pete

Here  you can download a copy of V5 beta. You can run it as trial or upgrade to pro (if you have a pro 4V you will get a discount of 25%)

You can run both V4 and V5 on the same machine, no problem. During installation, it offers to import and convert into V5 all your layouts of V4,  but V4 keeps original copies as well. Basically, the designing and creation of a layout has not changed. But the EM or EC has, hugely.

You may export whatever you wish, just let me know if it has to stay in V4 because V5 files don't run in V4.

Cheers

Tom

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Tom

Many thanks again for your advice. I have now downloaded and purchased the full version of V5 but have not had chance to look at it in any great detail. After doing so I will probably continue with V5 only using V4 for possible experiments, therefore any recommendations you can let me have to simplify my various operations will be greatly appreciated. As you will see I have only really touched the surface of event control and many of the aspects of my work so far need to be tweaked but then that's part of the enjoyment. If you got everything right straight away where is the fun in that! The bus operation is currently only partly worked out as I was hopeful that through the forum I might be able to produce a more professional system. Anyway I will be interested in your views.

The relevant file is attached.

Chers

Pete

220hotwheels Fairmont layout.mbp

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Pete

I love your layout. Like me, you must be living somewhere near the water. Speaking of water, I noticed that you boosted the number of items, as well as the number of polygons quite a bit in placing truckloads of small sheets as your water surface. As with all other primitives, you can define their size in the object window.

water.thumb.JPG.1e9a6b073b543e164ccf9b44556742a7.JPG

Always bear in mind that with more objects/polygons your fps rate will go down resulting eventually in a poor display of moving vehicles. So it is a good strategy to optimize numbers of objects and also to carefully select objects with a view to the total number of polies.

You can find the info on polies under the "i" section of the object window .

water2.thumb.JPG.72de3114cb03869ffbba199b990e193e.JPG

...easy to detect the potential here for savings by using a few large sheets only9_9 Another comment in the "water zone" I want to make is: You can texture the mainboard under the water sheets too. you will be amazed by the effects you can create that way. 

That's all for now, I have to dive into your EM to find out what you're trying to do later.

Since you bought V5 now and only started recently altogether there is no point in keeping V4 on your machine for trials. So if you're wanting to keep your machine optimal you might as well take V4 off.

Cheers

Tom

 

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Tom

Thanks for the comments and advice. I'll certainly look into every aspect of your recommendations. I have briefly looked at V5 events simply trying to set up the bus WCF 01 to depart from the ferry terminal to the bus stop at Fairmont station but so far I have got no where. Clearly using the knowledge from V4 isn't the answer. I'll do more experiments tomorrow along with looking at the water aspect.

Thanks once again for your help.

cheers 

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Pete

I recon to do something more important first. I feel this layout needs sorting by layers. So please create layers for roads, tracks, water traffic, buildings, plants and so on.

This will allow blending all things unnecessary out while on one job. Also, the same thing as with water I noticed on cobblestone paving. You can either convert to larger sheets or scrap these sheets altogether and use texture directly on the mainboard.

I will modify the journey of the Lkw7.5t, top of the list in your EC, as a sample for you.

Cheers Tom

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Tom

What can I say but ooops, I guess the jump in with both feet approach this time has it's drawbacks. 

Many thanks in advance for your guidance re the EC scenario but your further recommendations pose me with yet another question. I can create the different layers as you have suggested but at the moment I am at a loss as to the best way to isolate the various elements not required on a particular layer so that I am left with just the layer needed, ie just rail tracks, roads etc.I do keep referring back to the manual but struggle at times with the English translation and so just play around until I get it right or make a complete mess. No doubt the answer will be fairly obvious, once you know, a bit like the "export a file" question so if you could point this addled brain of mine in the right direction once again I would be most appreciative.

Cheers

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Pete

Here is the modified layout. When you do the sorting by layers you can also start reducing the number of items in general. Likewise to the water surface and some paving, I noticed that you used many spline-tracks in their original length as they come out of the catalogue. The file you're getting here is a 2.6MB whopper and your layout isn't complete yet. My machine was cranking at times, it takes ages for the objects popups to show up, it even responds quite lame when you just want to activate an object. My laptop is a quite grunty piece of equipment but on this layout, I see limits I haven't seen before.

So optimizing the number of objects and allocating everything into an appropriate layer should be the first priority. This will set some muscle of the machines free. Everything that's not needed in a task can be just turned off and so give also a better general view.

To sort stuff efficient into layers you can do the following:

Activate the item you want to shift. Then click at the coloured line at the top of the object property window (see pic)

Inkedwater_LI.thumb.jpg.410d7008efea7f71f80706632003558d.jpg 

A dropdown with all the coloured lines and their names will pop up and you just click on the new coloured line of your choice, done!

 

Cheers

Tom

Bearbeitet von metallix
Link zu diesem Kommentar
Auf anderen Seiten teilen

Hey Pete

You can also shift objects in bulk using the method above. To activate more after the first one press and hold Ctrl while left-clicking every item you wish. If you accidentally get a wrong item in between just left-click it again to get it out of the selection. When you're ready activating just let go Ctrl and do the shift as per above.

Cheers

Tom

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Tom

Thanks for all your efforts and for the example of EC. My computer doesn't seem to have a problem handling things at present but I take your point about reducing as much as possible. Whilst I can see the effect of getting rid of so many blocks of water for one large item I don't see any relevance for either track or road. If for example I remove 10 standard section of track each of 1806 polys and replace it with a single length the that new length is simply 10 x 1806. The same seems to apply to roads but water is different so I can see the merit in that.

Regarding the layers. I can see the merit in following your advice and will do so despite this being something of a monumental task which I assume will involve removing all rolling stock in order to accommodate this procedure but I cannot see how I can reduce the overall file size by much. 

Out of interest I renamed your file Fairmont V5 modified, had to realign several bits of track at numerous points and then saved the file and backed up the database using the new file name. The size of the saved file has now jumped to almost 5.5, double what it was which leaves me somewhat puzzled. 

Anyway I have plenty to keep me occupied for the next few weeks. I'll let you know how I get on.

Cheers

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 4 Stunden schrieb 220hotwheels:

Hi Tom

Regarding the layers. I can see the merit in following your advice and will do so despite this being something of a monumental task which I assume will involve removing all rolling stock in order to accommodate this procedure but I cannot see how I can reduce the overall file size by much. 

Pete

 

Hi Pete

You're not reducing file size by this, but you gain visibility and some increase in performance of your machine during working times by simply turning layers (of stuff you're not working with) off. So for instance, if you first create a layer "loko's" and one for "cars" you can sort these vehicles into the layers. Later on when you want to pick the tracks and road parts you simply turn the vehicle layers off ......and they're out of the way, but still in place.

vor 4 Stunden schrieb 220hotwheels:

Thanks for all your efforts and for the example of EC. My computer doesn't seem to have a problem handling things at present but I take your point about reducing as much as possible. Whilst I can see the effect of getting rid of so many blocks of water for one large item I don't see any relevance for either track or road. If for example I remove 10 standard section of track each of 1806 polys and replace it with a single length the that new length is simply 10 x 1806. The same seems to apply to roads but water is different so I can see the merit in that.

 

1

Your math is correct here. The reason for reducing the number of items is also and in case of tracks in particular, to spend less time waiting for object lists to materialize and when working in them to find specific items easier and quicker in a smaller pool of items. Another way to achieve this is grouping. You can group items together, preferably those you will hardly look for when editing EC, so they will only appear as one single listing in object lists.

vor 4 Stunden schrieb 220hotwheels:

Out of interest I renamed your file Fairmont V5 modified, had to realign several bits of track at numerous points and then saved the file and backed up the database using the new file name. The size of the saved file has now jumped to almost 5.5, double what it was which leaves me somewhat puzzled. 

1

Maybe @Neo can clue us upon this one....

During a walkabout on your layout,  I noticed also many animations cycling along uncontrolled. Unfortunately, that is how they typically come out of the box, so to speak. Best practice here is to turn them off after placing them. The reason why is, apart from reducing drag on the system: There is now a new feature EC-protocol (that tab right next to the EC one on the right) It displays in real-time all the things going on on a layout, including each track getting entered and also getting left. It does all its marvelous work only when it is activated (visible). It indicates in red where to look for the problem. In V5 a problem also puts the whole layout on pause. If there is a problem, you want to tackle, you will want to have the list displaying as little as possible of other garbage, ideally only the events related to your problem. That is why I halted all your traffic while doing the truck run bit in your EC. Once you are happy with every single bit of movement on its own you can run them all simultaneously, because you won't need to watch the protocol then anymore. However, it is a good idea having main switches to turn whole branches off, in case you want to further extend or modify your layout, facing the problem of having to monitor things again.  

Cheers

Tom

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Tom

You're a star. Without your assistance and advice I think I would still be in the stone age part of this hobby. I had thought that I had turned off and reset all animated elements as I introduced them but clearly enthusiasm must have got the better of me during layout modification. I'll try to be more vigilant in the future. I have started to set up different layers the first element that I have chosen for this purpose is the roads, largely because they are larger and therefore more easily seen when selecting. Once they are done then I'll tackle the rail tracks. The water aspect is a bit easier to sort. I have experimented with one part replacing around 50 squares for just 1 and playing around with the baseboard prior to placing the new sheet. You're right about getting great effects by using different mediums under the water.

I have only briefly looked at how you set up the LKW van. Once again how right you are about the use of variables, although I would never have got there without your help. In fact even now it's going to take me some time to digest just how to apply this example to everything else. I assume the track contacts are created by the events program or are these separate items to be selected and renamed from the on line catalogue. I must sound like a real numpty with some of the comments and questions that I ask.

I had also noted that all other trains etc were on stop and pondered on how to restart them so once again many thanks for the heads up on that part.

I'll keep you posted on my progress, if that's OK.

Many thanks once again.

Cheers 

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Pete

You're welcome. Don't rush it with variables and EC in general. It would seriously harm self-confidence of me and others who are way more skilled in the EC than I am if a freshman just picks it up on a glance and shines with virtuous handling of it. :D

The beauty with layers is to get clear sight even when you're sorting. Just turn the layers invisible and everything you allocate to this layer disappears pronto, so you don't double select. Another practical thing to do is turning the base plate transparent. Just double click on the base somewhere and tick in the box.

aaarbeit_LI.jpg.a63399cbfa5f6ecb5311f62a3a3a29c5.jpg

To turn it solid later on just click on one of the still solid edges to get the property window activated and untick the box.

Yep let's stay in touch.

Cheers

Tom

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Tom

Once again thanks for the advice. The chances of me picking up variables quickly is akin to doing a moon walk next week. A challenge, though keeps the mind active so bring it on is all I can say.

All the best, I'll let you know how I get on even if it has resulted in using a very large hammer to my very expensive system!!!

Cheers

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Tom

Since our last communication I have spent my time creating layers as you suggested and checking round to turn off all animations that I can fined. Part of this operation highlighted that some track sections, mainly around crossing barriers, has jumped out of alignment I assume due to the conversion from V4 to V5. These are now sorted and so I turned my attention to your penultimate message in particular the bit about the new feature EC-protocol (the tab next to the EC one on the right) so that I could turn the other locos etc back on. Clearly I am not looking in the proper place as I seem unable to locate said tab, and you were bothered that as a total novice I might pick up variables with ease. At present I seem to have difficulty picking up the hammer, so to speak, let alone knocking in the nail!!! Dare I say that your screenshots have so far proved invaluable. Once I have solved this little mystery then I can get back to rationalising tracks, roads etc to try to reduce my file size for whilst everything seems to run fine on my PC if I have to transfer to my laptop then everything slows. Talking of speed I am once again a bit puzzled. When I first started with 3D Train Studio I saved each days work using the date as part of the name ie Fairmont100819.backup then the following day would be Fairmont110819.backup etc and each day the file sizes grew significantly until I was upto 41,000kb. Even then I had no issues with program lag. Now at 2,750kb lag is sometimes apparent as you found and I cannot explain this.

Cheers

Pete

Link zu diesem Kommentar
Auf anderen Seiten teilen

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Du musst ein Benutzerkonto besitzen, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen.

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...