• Welcome to Twisted DIRT Forums.
 

how do i adjust ai speed for jumps and slowing down for turns?

Started by gokitty199, May 06, 2014, 02:58:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gokitty199

what the title says. the ai case the finishline double and they case my tripple. they go to fast into the first corner and go way out of bounds into the other side of the track and have to get reset. any way i can fix these, it will help me in the future

NoooUGH

I don't have an answer because I don't even know how to make track raceable (be cool if you can tell me). But I don't think having buggy AI is a big problem. Most people don't race with AI.

mcm2boys

This is something that hasn't been used very much as far as i know, most testing attention was given to just getting the splines to work, but here are my thoughts on improving the AI performance.

I'll start by giving an overview.
I think what you need to do is add extra sections just for the AI that are overlaid on top of the main track loop that you lay out just to create a track path to keep all riders on the track and going in the right direction. These extra sections should typically be 1/2 the width of the main loop and concerntrate in areas where you want the AI to follow different paths on the same part of the main loop. This would mostly be around corners (for an inside and outside line) or over straight sections that have 2 lanes with different rhythm sections. The nodes in these sections will have target speeds set to control the speed of the AI  through this path.

Now a few details:

Creating an AI section:
Select a node on the main loop where you want the AI section to start. Set the spline width to about 1/2 of the main loops width. Now click out the nodes of the new section and then join it back into the main loop, by holding down the CTRL key and clicking on the node on the main loop that you want to join back into. This will automatically add extra sections to the main loop where the new AI section joins to the main loop.

NOTE: Make sure that there are at least 2 nodes between any joins in the main loop otherwise you will receive the dreaded compiler error, 'A section of the spline contains less than 2 nodes - compilation aborted' - also make sure that each new AI section has more than 2 nodes in it.

The parameters for the current selected node and the section that it lies in should now appear in the Spline rollout under the Activities tab. You need to tell the game that this new section is for AI, to do this set the parameter named 'Is override section' to true - ! this must be done for each Section that isn't part of the main loop - ie every new AI section !

Now create a new AI section for each path that you want the AI to follow.


Finally adjust each node so that it is where you want it and at the same time set the target speed in the nodes parameter list, so that they slow down properly for corners. If you set the speed to -1 after the corner so that the AI will start to accelerate to top speed again. The AI speed is also controlled by the physics so they won't just hit the speeds you set, they will try to apply brakes or accelerate to meet the speeds that you set, if you set too aggressive values then the AI may wheelie or stoppie trying to adjust.

Here are some Target speeds for corners from the stock tracks to use as a guide:

90 degree corners:  inside 30 - 40, outside 40 - 50
tight 180 degree corners:  inside 20 - 30, outside 30 - 40

There are other parameters that you can set, most have a nme that seems to say what it controls, you'll have to take it from here..


This is still very experimental - welcome to the bleeding edge.. and don't forget to share what you find out..

gokitty199

Quote from: mcm2boys on May 07, 2014, 04:14:12 PM
This is something that hasn't been used very much as far as i know, most testing attention was given to just getting the splines to work, but here are my thoughts on improving the AI performance.

I'll start by giving an overview.
I think what you need to do is add extra sections just for the AI that are overlaid on top of the main track loop that you lay out just to create a track path to keep all riders on the track and going in the right direction. These extra sections should typically be 1/2 the width of the main loop and concerntrate in areas where you want the AI to follow different paths on the same part of the main loop. This would mostly be around corners (for an inside and outside line) or over straight sections that have 2 lanes with different rhythm sections. The nodes in these sections will have target speeds set to control the speed of the AI  through this path.

Now a few details:

Creating an AI section:
Select a node on the main loop where you want the AI section to start. Set the spline width to about 1/2 of the main loops width. Now click out the nodes of the new section and then join it back into the main loop, by holding down the CTRL key and clicking on the node on the main loop that you want to join back into. This will automatically add extra sections to the main loop where the new AI section joins to the main loop.

NOTE: Make sure that there are at least 2 nodes between any joins in the main loop otherwise you will receive the dreaded compiler error, 'A section of the spline contains less than 2 nodes - compilation aborted' - also make sure that each new AI section has more than 2 nodes in it.

The parameters for the current selected node and the section that it lies in should now appear in the Spline rollout under the Activities tab. You need to tell the game that this new section is for AI, to do this set the parameter named 'Is override section' to true - ! this must be done for each Section that isn't part of the main loop - ie every new AI section !

Now create a new AI section for each path that you want the AI to follow.


Finally adjust each node so that it is where you want it and at the same time set the target speed in the nodes parameter list, so that they slow down properly for corners. If you set the speed to -1 after the corner so that the AI will start to accelerate to top speed again. The AI speed is also controlled by the physics so they won't just hit the speeds you set, they will try to apply brakes or accelerate to meet the speeds that you set, if you set too aggressive values then the AI may wheelie or stoppie trying to adjust.

Here are some Target speeds for corners from the stock tracks to use as a guide:

90 degree corners:  inside 30 - 40, outside 40 - 50
tight 180 degree corners:  inside 20 - 30, outside 30 - 40

There are other parameters that you can set, most have a nme that seems to say what it controls, you'll have to take it from here..


This is still very experimental - welcome to the bleeding edge.. and don't forget to share what you find out..
thank you, jamieT gave me a quick rundown but you gave me a much more in depth explination. thanks for all your hard work :) cant wait to start giving to the community

mcm2boys

you're welcome. Looking forward to running some more new tracks..  :)