Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Ultimate Traffic Controller

Discussion in 'Assets and Asset Store' started by michealcaj, Mar 19, 2020.

  1. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    191






    Get here :

    https://assetstore.unity.com/packages/tools/ai/ultimate-traffic-controller-110492

    Video tutorials







    ULTIMATE TRAFFIC CONTROLLER

    HOW TO SETUP AI

    1. go to the prefab folder, drag and drop any of ai prefab vehicle.

    2. delect the existing car model.

    3. if you got your car model ready, drag and drop this in the scene and child this to the AI prefab.

    4. reset the position of your car model and the AI prefab and resize,make sure the car model is facing the right

    direction.

    5.now edit your vehicle's tyre mesh name,if not name proply. e.g(frontleft,frontright,rearright,rearlight).

    8.place the renamed wheel meshes in the right slot, located in ESvehicle component

    9.now your that your vehicle Ai is ready, next thing is set up a part for it to follow.

    SETTING PATh FOLLOW

    1. go to (Gameobject/EasyTrafficSystem/Vol2/AddPathParent), this should add a single path in your scene

    2.now add your first path by selecting the path you just added , add hover mouse to the position were you

    were you want the first node to be in ur scene and click on( KEY A)

    3. you should see a menu on the left top side of the scene this contains settings for that path.

    4. the menu on the top left lets you align in the x,z axis , which would make the node placing accurate.

    5.you can as many nodes as you which.

    6. to join path to another path, you should select any node in the first path and then select any node in the

    second path next click on (key J) to join

    5. to dissconnect nodes from a joint select the joint node and click on L to detach.

    HOW TO SETUP SPAWN POINTS

    this packages contains two type of spawn methods which are:

    i. gataway

    ii.randomly(deprecated )

    Gateway

    1. create an gameobject call this spawnmanager

    2. add ES SpawnManager to the gameobject.

    3.make sure spawntype is set to gateway.

    4. create another empty gameobject name it spawn0.

    5. add component ES gateway spawn setup to spawn0.

    6.add a box collider ,set collider size (20,20,20) depending on the size of vehicles.

    7.drag spawn0 to the nearest node , this node should be the first targeted node

    8.drag and drop the target node into the target node slot located in ES gateway spawn setup

    9.drag and drop spawn0 to the spawnpoints slot located in spawnmanager gameobject.

    10.goto prefab folder and drag and drop any ai vehicle to the vehicle slot in spawnmanager gameobject.

    11. set amount of spawned vehicle, start time , delaytime, and check parentspawnedvehicle.

    12. click on play. then UTC would spawn ai that would follow specified path.

    HOW TO SETUP EXIT POINT

    note: the exit gameobject is in charge of deleting ai vehicles once they collide with the exit gameobject collider.

    1. create an empty gameobject name it exit0.

    2. add (destroy Ai) component.

    3. add a box collider and check istrigger

    4. place the exit0(gameobject) at the last node on the path gameobject.

    5. You are good to go.

    Components included in this package

    -EsVehicleAI : this component consist of (wheelsettings,enginesettings,steersettings,AI settings,sensorsettings,

    pathsettings).

    -wheelsettings :



    this holds the wheel collider and wheel meshes of the vehicle, once you drag and drop ur wheel gameobject

    into the frontwheelmeshes and rearwheelmeshes, wheel object position and rotation will now align with the wheel collider's without extra scripting

    enginesettings :



    here you can set the overall torque applied to ai engine , more higher value leads to more aggressive drivers.

    the brakeforce is the stopping force applied to wheels.

    steersettings :



    maxsteerangle : this is the max angle your steer wheels can attain

    targetangle : (read only) the steer wheels will gently interporlate to this angle. note this is read only so UTC will calculate the acurate values.

    turnspeed : this is the speed of the steer wheels when rotating towards its targeted angle.

    AI settings :



    the ai settings consist of the values that governs the ai driver behaviour , here you can tweak values to get extreme,aggressive drivers or calm drivers,

    steer balance factor : this stables the steer wheels of the vehicle to avoid uncessary slips or increases node target accuracy.

    topspeed : this is maxspeed of the vehicle.

    smoothtargetspeed :this is speed the vehicle returns to when it detects danger.

    cautios angle : this is the angle btw the vehicle and the target node, if the current angle exceeds the cautios angle ai takes precution.

    cautios speed : if the current angle exceeds the cautios angle ai takes precution and return speed to cautios speed.

    realsebraketime : how long it takes the ai to realse its brake after applying brakes to wheels.

    avoidobstacles : if this is checked true ai tries to avoid anything in front of it ;)

    smartdelect : this auto destroys useless ai vehicle in your scene always check true , unless you wanna code your own delect script.

    spawndistance : this spawns ai vehicle within the specified range based on player position if player exist.

    avoidpath : the path ai selects when overtaking another vehicle or obstacles.

    sensor settings:



    this allows users to toy around with the ai sensor, sensors are used to detect other ai or player and obstacles.

    you can change sensor size, tweak its startposition , also edit its angle :note higher sensorangle leads to smarter ai especially when avoidobstacle is checked true.



    The path settings Is what enables the AI track it's node accurately. here users can increase the distance apart from the AI and it's target node I.e how close is it to the target node before checking for the next target node if any exists.

    The OverTake distance apart : this is the distance between the AI and the object that is supposed to be avoided.

    The OverTake speed: this is speed that the AI vehicle tries to achieve when overtaking.
     
    Last edited: Mar 29, 2020