Community Forum

AI Helper traffic splines

Forum Overview >> Farming Simulator 22

CategoryFarming Simulator 22
Created30.11.2022 00:00


Wilco Willemsen (WDV0570) 30.11.2022 00:00
HI!
This is my second attempt at making a post - hopefully it'll actually submit this time.

I'm new to the Giants Editor, I've been having a go at adding TrafficSystem splines to a map that has none. It's a X16 map, the AI not being able to drive anywhere but in a short and straight line is losing it's charm rather quickly.

So for the past three evenings I've been drawing the splines on the map, making it look tidy, etc. I've left them visually enabled and they infact show up ingame. However, the AI still refuses to drive anywhere but in a straight line, with a maximum speed of 37km/h. Tractors will zig-zag the entire time.
I've added two float-values to the containers containing straight roads, T-junctions, etc.
'MaxSpeedScale'='1'
'SpeedLimit'='100'.

What have I missed? What else do I need to do, to get the AI helpers to start using the traffic splines I've put on the map?

Colin Smith (WrinkleysRule) 30.11.2022 12:06
AI splines are contained in a separate AI transform group with just the attribute "AISystem.onCreateAIRoadSpline" set on the transform group itself.
Check the vanilla games traffic/AI setup for reference.

Wilco Willemsen (WDV0570) 03.12.2022 17:48
I'll have a try with that attribute tonight, thanks!

A related question;
While having a look at the spline system of the default Elm Creek map I notice that only few roads are part of the 'ai' transform group, while the majority of the splines are part of the 'trafficSystem' transform group. What's the logic behind this, what qualifies any spline to be part of one transform group or the other?
I came across this post a while back: https://gdn.giants-software.com/thread.php?categoryId=4&threadId=10324
Apparenly I would need to assign 'aiDriveCost' to roads, which makes sense from a pathfinding perspective - don't want all the AI helpers to take shortcuts in between fields and whatnot, but I've been unable to translate that post to something I can find in my editor settings. Where do I go, what do I change?

Wilco Willemsen (WDV0570) 03.12.2022 17:49


Colin Smith (WrinkleysRule) 03.12.2022 19:09
The Ai splines are used to link into the trafficSplines, the AI cost is the value applied to terrain textures to make it easier or harder for the AI travel across area's of the map

https://i.imgur.com/FclH7Z4.png

the above image shows the AI splines in Green and Traffic splines in Red.

Quote from the post mentioned
"There is always the option to change the aiDriveCost for any terrain texture, vanilla or custom in the Terrain Layers Manager in GE or in the Layers section in the map i3d under the attributes settings for each texture --last number is the aiDriveCost i.e
attributes="0.043 0.029 0.02 1 1 8"/> --- 8 is the aiDriveCost figure (first three are the colour fourth is softness and fifth not quite sure what that refers to, I' sure someone will enlighten me, possible sound related)"

Terrain Layers Manager in GE or in the Layers section in the map i3d under the attributes settings for each texture

Terrain Layers manager can be found by selecting the terrain in GE and in the Attributes panel select Terrain Tab--Layer manager

Wilco Willemsen (WDV0570) 04.12.2022 01:41
Thanks! I've got it working now! "AISystem.onCreateAIRoadSpline" was set to the incorrect transform group. Thanks so much for the pointers!

I've been using the "SpeedLimit" (100) and "MaxSpeedScale(1) attributes, but I notice my vehicles ignoring the speed limits, they end up missing corners because they can't brake hard enough. ID10TS. I've added these to the transform groups, but also to the individual splines. What else do I need to implement to set a speed limit?

Colin Smith (WrinkleysRule) 04.12.2022 12:22
There is another AI function for all road/lane/track i3d meshes which gives the AI other paths to follow.

In GE select any of the road meshes you will find that they all have the Collision Mask (Hex) of 400df,
this consists of the following

https://i.imgur.com/1SAlrMg.png


0: "DEFAULT: The default bit",
1: "STATIC_WORLD: Collision with terrain, terrainHeight and static objects",
2: "STATIC_WORLD_WITHOUT_DELTA: Deprecated in FS22: Do not use it anymore!",
3: "STATIC_OBJECTS: Collision with static objects",
4: "STATIC_OBJECT: A static object",
Deselected is 5: "AI_BLOCKING: Blocks the AI",
6: "TRACTOR: Deprecated in FS22: Do not use it anymore!",
7: "COMBINE: Deprecated in FS22: Do not use it anymore!",
18: "AI_DRIVABLE: AI can drive over this node",

The ones to note are no 5 and 18 which disallow/allow the AI to drive using these nodes

You only need to add the "SpeedLimit" (100) and "MaxSpeedScale(1) attributes, to the individual traffic splines not to the transform group.
Regarding overshoot of corners you could always lower the speed limit on that particular spline section for example on ElMcreek in group3 of the traffic splines 'crossroads35 and 36' Speed Limit could be reduced to 30 to give a more natural turn.




Note: Log in to post. Create a new account here.