Community Forum

AI/Helper Traffic

Forum Overview >> Editor

CategoryEditor
Created15.04.2022 21:37


Ed Propsner (crotchfrog) 15.04.2022 21:37
Does anyone know what the AI is utilizing to move around the map? Traffic system? Textures? A combination of the two? I find that on my modded map the AI/helpers are not able to get around on their own. If I tell them to go to a specific area the status changes to "Looking for help" and it pretty much ends there, the helper just sits motionless. I feel like it's attempting to plan the route but not succeeding for some reason. I'm not sure where to start looking to troubleshoot this issue. The traffic system is fully functional, so I don't see the issue with them utilizing it to get around. I'm at a loss on this one.

Colin Smith (WrinkleysRule) 15.04.2022 22:58
Both spline and texture -- see dataS_scripts--ai/AISystems, also editor Terrain --Layer Manager--aiDriveCost

Ed Propsner (crotchfrog) 16.04.2022 17:48
Thanks Colin! I was able to dig in and found a lot of useful info but nothing that really gets me to the bottom of the issue itself. As far as the drive cost, everything seems to be in order. But how is it utilizing it? It's obviously planning/prioritizing the route by drive cost and by the looks of it the lower values are the preferred routes. Aside from a missing value, I wouldn't know if something was correct or not. The one thing I can see is that I need to add a few AI splines for bridges and such. I thought a good example was the covered bridge, the spline has a "maxWidth" attribute so if the vehicle exceeds that width, it opts for the spline running next to/around the bridge. I also found some console commands to be helpful but again, nothing that points its finger and says "there is the problem." I'm finding that the AI is not so simple to troubleshoot.

Colin Smith (WrinkleysRule) 16.04.2022 19:29
The image linked below shows the complete traffic/AI spline set up for the Elm Creek US map, traffic splines are red AI splines are green

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

My understanding on the subject (which could be totally wrong) is

The AI system and traffic system are intergrated, with the traffic splines the prority for AI movement around the map and these have various attributes controlling them, Ai splines appear to have no attributes. Hence your "maxWidth" function on the traffic spline
AI splines are just used to link various texture paths to the traffic splines. (ones with an aiDriveCost of 2.000 -- see Terrain Layer manager in GE)
A good example of these texture paths can be found at the Farm where the track goes through a little stream (gravelDirt aiDriveCost 2.000) -- splines, playerFarmFordB and playerFarmFordC which if not there would mean an aiDrive cost of 8.000 (mud01) so in effect the splines are linking the texture paths across the mud01 texture so giving the AI helper a low cost path to use.

Ed Propsner (crotchfrog) 16.04.2022 22:22
Sounds about right to me. I saw in the scripts that it utilized the object placement map as well. Using console commands in game it's possible to view the cost map as the vehicle navigates. It views all of my placed roadways as a collision. If I sent the helper somewhere, it had to be off the roadway or anything with any type of placement collision attached to it. I noticed that the AI wouldn't cross a roadway if one was in the way, making most destinations "unreachable." Removing my roadways from the placement collision map helped tremendously, as did making AI splines for areas that were drivable, but not part of the traffic system (for example a pathway winding through a forest). It's just an observation but it seemed as though the AI would choose splines over textures in many cases. I'm making progress, Thanks for the help!

EDIT:: I may have been mistaken about the roadways on the placement collision map causing a problem, I'm still testing that theory.

Ed Propsner (crotchfrog) 16.04.2022 23:28
Ok, the reason I thought my roadways were showing as a collision is because it looks like any placed items are showing as "0" on the cost map. Every one of my roadways are "0" but comparing it the original Elmcreek map, all of the roadways there are a "2." This is most definitely the problem, now I just have to figure out why. I thought it was one of the infoLayers because placement collision and tip collision are the only two that cover the roadways. Some of my roadways are originals placed by Giants, the rest are placed by me, but yet they ALL show as "0."

Ed Propsner (crotchfrog) 17.04.2022 00:15
I fixed the issue. It turns out that it was the navigation collision. Apparently, it's not what I thought it was and I covered all of my roadways with it. I did learn a lot about the AI throughout all of this and in the future, I will be a bit more mindful of how I layout my ground textures. Thanks for the help, Colin!

Colin Smith (WrinkleysRule) 17.04.2022 12:27
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)


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