Trajectories

Learn from us and show us your work.

Moderators: Developers, Lead Developer, Founders

Post Reply
GerScaniaTrucker
Posts: 11
Joined: 07 Jun 2017, 11:42

Trajectories

Post by GerScaniaTrucker » 21 Apr 2018, 12:59

HOW TO USE TRAJECTORIES:

1. Why we need trajectories?

There are multiple reasons for using them in-game... Ofc you can achieve most of the things (except the ST DLC stuff) with custom prefabs, but you know, that prefab creation isn't easy and takes some time...

Trajectories can save time and work, so to speak. In ATS they were already introduced for Truck Stops, Gas Stations and Parking Lots and will be used for the ST DLC. In ETS 2 they were introduced with the ST DLC, although they work perfectly for the same things, as in ATS.
With those custom, self-drawing AI-lines, we don't have to create new prefabs for the AI and have the same result faster in-game.
We can let AI drive through a company prefab, create custom merges/splits for the AI, let cars park, stop, assign the behaviour on that line and so on...

2. Where I find them?

At the moment there is no shortcut for the Trajectory item, but you can select it via the "Item type" dropdown menu:

Image

3. So.... How do I use them?

Maybe you first just draw a line with it. :wink: They behave the same way as Building Items...

Image

Congraz, your done! Thx and have a good day! :slight_smile:

Nah... Ofc that's not it... AI can already drive on it (you can test it via the Traffic Tool (O)), but it will lead to nothing...

First we want to have it connected with a previous road part.

I've choosen a rail road here and moved the trajectory node to a very nearby position to the actual AI line...

Image

If you don't know the exact postion of the AI line, it is mostly in the middle of the lane, but you can check it via the Traffic Tool

Image

Now to the first cool thing: the trajectory don't have to be perfectly aligned with the AI line of the previous road stretch or prefab, even not in height... But it should quite nearby... To know the radius of such a trajectory, we can again start the Traffic Tool and check the radius of the node there, when you move it away from the road again:

Image

Also I would always recommend to snap the projectory to road height via ALT GR

Anyway, you can see that the node here is below the actual railroad, as the railroad is 0.5m tall:

Image

When i switch to the Traffic Tool again, you see that the AI will still dont jump, but drive straight forward on the same height:

Image

So the train will should now drive further just normal, without strange behaviours (here a proof):

Image

Now we have connected the first/start node with the road fine...
Let's go on and try to connect the end/second node!

For this I moved the second node to a different railroad stretch:

Image

We take a look at the Traffic tool and see: It's properly connected! :slight_smile:

Image

BTW: If I rotate the Trajectory Node, it will still connect properly, but be sure not to rotate it over 90°:

Image

Otherwise the line direction is inverted and the ai will behave strange and drive crazy, like i have demonstrated here:

https://youtu.be/-ZQvEbkkD1M

So... the nodes are connected, so the the train should be able to drive throught that part without the railroad and drive again on the railroad again further... Let's test...

Image

Oh... see?
The train jumps...
But now on the start node... on the last node everything is fine:

Image

Well, what happened?

Apparently we need to cut the whole trajectory via clicking on the middle mouse on the first node, because the game need at least three nodes (two "outer" nodes and one "inner") to connect between two external AI nodes...

Image

So lets check now: https://cdn.discordapp.com/attachments/ ... -55-40.mp4

Alright, everything works fine, congraz, your first properly working trajectory! :slight_smile:

One thing, though: you see the trajectory got a bump, because of the new node... Just adapt the height by yourself then.... Either via ALT GR or NODE PROPERTIES

For rail roads though, you have adapt the node manually via node properties to 0.5m higher property then the other nodes, because as I've mentioned it before, the rail road is 0.5m high :wink:
now we want to make a split to the other lane:

Image

For this draw a new trajectory line, press the middle mouse to split it or create three nodes already at the beginning and ALT GR it with the first node of the first trajectory...
congraz, your first split! :slight_smile:

Image

The ai will now choose randomly a trajectory and therefore the route it generated! :slight_smile:

The same way it would work with a merge :wink: you just have to snap both end trajectory nodes to each other and they will seek both a possible route further, they find in the radius, I've mentioned at the beginning...

Now you may say: But I want to customize the nodes and want different probablity of the AI choosing a lane, well, for this we press P and click on a node of the trajectory, you want to be the one, which will be choosen by the AI less often... I choose the lower one and this window appear:

Image

Looks complicated, but it isn't, really ^^

Well, now just tick the box next to "Low Probability" and from now on this trajectory will be choosen less often by the AI...
there is also a workaround for this (don't know why), so you can click on a node of the trajcetory which should be prefered by the AI and tick in the properties the "Prefered item"...

Image

The other boxes are self explaining, like "Force this way" and "Limit Displacement" for trailers...
The "Public" checkbox is for the ST DLC and to the "Parking spot", an other nice feature, I come later on :wink:

We come to the "Access rule" dropdown menu... again pretty self-explaining

Image

Blinker as well (DO NOT WORK FOR TRAINS, please don't try ^^):

Image

Now the Priority Modifier:

Image

The higher the number, the higher the priority... pretty self-explaining :wink:

Anyways, there is a thing you have to keep in mind: If possible don't use all numbers there. They are there and work proper, but I would recommend to use the default "Priority Modifier"... These are:

4 - minor left
5 - minor right
6 - minor straight

10- major left
11- major right
12- major straight


This section is for the ST DLC only, so you don't need to use it for now :wink: :

Image

We come to the trajectory rules:

Image

Again: Here the most rules apply for the ST DLC, so they are out of interest for now...

However, especially the last ones under "Order" are the interesting ones for us:

Image

This is the rule for parking AI... but here comes the cool part: It can be used for stopping only and gas station, timed parking, so after a while the car continues it's journey and even train stops at a station :wink:
let's take a look...

Image

You see that the param description changed, when I've choosen the order "Parking spot"... first i would suggest you to choose the node where the vehicle should park...

0 is always the start node and the other nodes are counting by placing after the first node...

Now to the first param: Time: Here you set up how long the vehicle should park...

0 means it will park forever there

Starting from 1 it will mean RL seconds the AI vehicle will stop there...

Second param: Engine:

-1 means the AI turns their engine off when they have stopped...

1 means the AI will keep their engine on

Now click on "Add" and the rule will be added:

Image

If you want to remove the rule, just select it in the white box and click on the Remove button

If you want to edit the rule, select it, edit the properties and click on Set

Now on to the random time parking:

Image

Engine is clear, I guess

LB Time means the lowest possible time to stop there... Here means 0 really zero and not forever...

UB Time - max. time possible to park there

As of 1.31, we have a new rule:

Image

Dependend on the Node, it can handle a range as a radius from this Node... Pretty self-explaining... :wink:

-

4. Are there some negative sides of Trajectories?

Yes, there are and you have to be aware of them, as they might interfere your workflow...

1. There are only the already defined access rules possible to choose

2. You might have seen my spilt before with the road as the main road... Well this does not work, if you want to split a trajectory "main" line...
Here is an illustration, which shows you how we have to create splits with trajectories:


Image

So: after the merge/before the split there has to be a short trajectory before/after the road... NEVER TRY TO CREATE A NEW TRAJECTORY STARTING FROM AN INNER NODE OF AN EXISTING TRAJECTORY!

3. Trajectories do not can read traffic rules, nor speed limits... So you cannot put a sign next to it and it will apply the rules to the trajectory... Also no traffic areas work for them.... Trajectories are dependent on the access and traffic rules of the previous item (road/prefab)! BE AWARE OF THAT!

4. Trajectories ignore traffic lights and crossing AI paths!


-

That's it I guess... I hope now you understand the Trajectories better and also know what's possible and what is not...

If you have any questions, then ask...
Creator and Lead Developer of the "NaturaLux" - modification for ETS 2 & ATS
Lead Developer of "Tregion"
Creator & Developer of the "Realistic Map"

Image

User avatar
SimulatorSam
Posts: 1
Joined: 28 Nov 2017, 13:48
Location: United Kingdom
Contact:

Re: Trajectories

Post by SimulatorSam » 28 Apr 2018, 21:54

Very useful tutorial, thank you! :P

Sketchzi
Posts: 1
Joined: 09 Mar 2018, 10:51
Location: Earth

Re: Trajectories

Post by Sketchzi » 05 May 2018, 04:37

How do you spawn train/vehicles there?

GerScaniaTrucker
Posts: 11
Joined: 07 Jun 2017, 11:42

Re: Trajectories

Post by GerScaniaTrucker » 11 May 2018, 18:10

Hotkey: O and then NUMPAD -, after that NUMPAD * or NUMPAD / for switching traffic types.
Creator and Lead Developer of the "NaturaLux" - modification for ETS 2 & ATS
Lead Developer of "Tregion"
Creator & Developer of the "Realistic Map"

Image

thieme
Posts: 7
Joined: 24 Jul 2018, 16:07

Re: Trajectories

Post by thieme » 17 Jan 2019, 20:38

Does the AI on trajectories react on the players truck?
A OG from Delft. I know it on my duimpje.

User avatar
Plum2018
Posts: 120
Joined: 24 Dec 2018, 16:24

Re: Trajectories

Post by Plum2018 » 17 Jan 2019, 22:41

As far as I know yes. :)
Currently working somewhere in Germany... ;)
Youtube channel for latest development updates :D : https://www.youtube.com/channel/UCTeTGc ... 6CMXLL_c_w

thieme
Posts: 7
Joined: 24 Jul 2018, 16:07

Re: Trajectories

Post by thieme » 17 Jan 2019, 23:29

Plum2018 wrote:
17 Jan 2019, 22:41
As far as I know yes. :)
Ok I'll try it some time, thank you
A OG from Delft. I know it on my duimpje.

sven_engelen
Site Admin
Posts: 162
Joined: 14 Apr 2017, 00:15
Location: Venlo, Limburg, The Netherlands
Contact:

Re: Trajectories

Post by sven_engelen » 18 Jan 2019, 11:05

It reacts to the player truck but spawning sometimes becomes ehh... weird.
Image
Tregion Admin;)
Currently working on Utrecht and bugfixing ofcourse :P

JoeP82
Posts: 1
Joined: 21 Jan 2019, 16:56

Re: Trajectories

Post by JoeP82 » 21 Jan 2019, 17:05

Is it then possible to get AI to return to normal path of a road at the end of a trajectory node? Currently end node just makes the AI stop/disappear at the end.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest