DumbAI

DumbAIMisc  0.6

  • Thread starter Thread starter ancient_3
  • 47 comments
  • 2,132 views
ancient_3 updated DumbAI with a new update entry:

new blue flag behavior

Change log:

- 3 new UI options for blue flag:
"None" is AC/CSP vanilla behavior, "Secure" is blue flag behavior from Dumb AI 0.3 and "Enhanced / Dangerous" is a new experimental blue flag behavior

- new UI slider for AI Caution: if "Enhanced / Dangerous" is selected, gives the value of caution that AI should use to overtake during outlap event (0.5 the more agressive up to 1.0 "vanilla" AI caution ; 0.6 as default)

- new option "Enhanced /...

Read the rest of this update entry...
 
Just a curiosity, is this mod compatible with AI Whisperer?
Yes for sure if you disable the Blue Flag behavior.

If you keep it enabled, DumbAI mod only modifies the AICaution for outlapping bot and puts a maximum speed value for the AI outlapped bot with a lateral move aside of the main AI spline, only at specific time of the race (when the bot is outlapped) so it depends on what AI Whisperer is doing at the same time for these same bots. One problem I think may be that my mod would restore AICaution to 1 after the bot has finished to outlap so it then depends on how AI Whisperer would manage AI Caution values. @Tetri should know better than me about this ;)
 
Last edited:
Just a curiosity, is this mod compatible with AI Whisperer?
Saw the notification from @ancient_3

Both are perfectly compatible, apart from the AICaution mods from aiwhisperer. In the next update i'm gonna use SPlineOffset as well, so that would be 2 conflicts, but nothing really noticeable, AICaution would be the one really missing.

That's only if you use elasticaution from the behaviors tweak or have made modifications to the AICautionlevel.

In this case, DumbAI would need a small modification in its code.

The part where

if oneOfThemIsOutLappingMe == 0 then
physics.setAISplineOffset(i, 0, false)
physics.setAICaution(this.ac_id, 1)
end

Unless i missed a condition, this makes the AICaution and SplineOffset always reset on every frame, overwriting whisperer (which updates at 10hz)

i 'm not sure this is needed, it could be called once at the end of the blueflag situations ?


That would fix any conflict (and optimise perfs a little, preventing repeated calls on default values every frames), since Dumb AI would take priority with its faster script update.

What do you think @ancient_3 ?



Something like :

--in the variables :
was_outlapping_previous = false


--then in apply_behavior

function this.apply_behavior()
local sum = 0
for key, value in pairs(this.is_outlapping) do
sum = sum + value
end

if sum > 0 then
physics.setAICaution(this.ac_id, this.ai_caution)
this.was_outlapping_previous = true
else
if this.was_outlapping_previous then --RESET
physics.setAICaution(this.ac_id, 1)
this.was_outlapping_previous = false
end
end
end

I guess you could apply the same logic to detectblueflag and checkisslowrunner so that they don't apply any mods until the situation is detected

(Quickly done with the quick resume of Dumbai from my chatbot, so probably to be checked and tweaked properly, but you get the idea)
 
Last edited:
ancient_3 updated DumbAI with a new update entry:

AI Whisperer compatibility & minor improvements

Change log:

- Compatibility with AI Whisperer app from Tetri:
setAICaution & SetAISplineOffset are only modified during Blue Flag events so that AI Whisperer can retake hands on these variables just after the event.

- minor improvement: Removed the functionnality to change line if outlapping process was taking too long as it created sometimes collisions in beginning part of some straights where outlapper would try to overtake just after the turn while...

Read the rest of this update entry...
 
Saw the notification from @ancient_3

Both are perfectly compatible, apart from the AICaution mods from aiwhisperer. In the next update i'm gonna use SPlineOffset as well, so that would be 2 conflicts, but nothing really noticeable, AICaution would be the one really missing.

That's only if you use elasticaution from the behaviors tweak or have made modifications to the AICautionlevel.

In this case, DumbAI would need a small modification in its code.

The part where

if oneOfThemIsOutLappingMe == 0 then
physics.setAISplineOffset(i, 0, false)
physics.setAICaution(this.ac_id, 1)
end

Unless i missed a condition, this makes the AICaution and SplineOffset always reset on every frame, overwriting whisperer (which updates at 10hz)

i 'm not sure this is needed, it could be called once at the end of the blueflag situations ?


That would fix any conflict (and optimise perfs a little, preventing repeated calls on default values every frames), since Dumb AI would take priority with its faster script update.

What do you think @ancient_3 ?



Something like :

--in the variables :
was_outlapping_previous = false


--then in apply_behavior

function this.apply_behavior()
local sum = 0
for key, value in pairs(this.is_outlapping) do
sum = sum + value
end

if sum > 0 then
physics.setAICaution(this.ac_id, this.ai_caution)
this.was_outlapping_previous = true
else
if this.was_outlapping_previous then --RESET
physics.setAICaution(this.ac_id, 1)
this.was_outlapping_previous = false
end
end
end

I guess you could apply the same logic to detectblueflag and checkisslowrunner so that they don't apply any mods until the situation is detected

(Quickly done with the quick resume of Dumbai from my chatbot, so probably to be checked and tweaked properly, but you get the idea)
I got the idea and made an update. If you can try it and tell me ;)

This trick won't be perfect as even if you're on 10Hz , if the outlap process takes too long, AI Whisperer will inject its modifications while DumbAI is still putting its ones...

In the end, when you're ready with a new complete AI behavior , these apps should be merged , so that you would benefit of the "strategy" parts of DumbAI while integrating its Blue Flag behavior directly into you AI modifications : much cleaner way to solve the problem :)
 
Last edited:
Definitly something i wanted to do at some point. Looked into it, should not be too hard🤟.

I'm still trying absolute nonsensical lunatic changes to see if i can finally make that AI up its game (i miss free time), so for now let's have them separated, your blue flag seems to be "clean", which is absolutly not the case with AIwhisperer😂
 
Hey @ancient_3

First of all, let me say again that the app is absolutely amazing and works really well.

I’ve encountered one issue, which seems to be related to AC AI behavior rather than the app itself. I’m having trouble finding a solution when one AI car is trying to lap another. Even when the lapped car moves off the racing line and there is plenty of space, the lapping car still gets stuck behind it.

Example:


Using the same mod, I don’t experience this issue on the F1 1992 Kyalami track. This makes me think the problem may also be related to the 1998 Suzuka track by Shin, which appears to be narrower than Kyalami.

I would like to ask whether you could advise on any possible solutions for this. For example, I was thinking about increasing the throttle limit for lapped cars in the app settings.

I also wanted to ask @Tetri whether AI Whisperer could help in this situation.

I understand that this may not be directly related to the app, but I wanted to ask for your opinion or suggestions, and I hope that’s okay.

Thank you so muich for this amaizing app,

Philip
 
Last edited:
Hey @ancient_3

First of all, let me say again that the app is absolutely amazing and works really well.

I’ve encountered one issue, which seems to be related to AC AI behavior rather than the app itself. I’m having trouble finding a solution when one AI car is trying to lap another. Even when the lapped car moves off the racing line and there is plenty of space, the lapping car still gets stuck behind it.

Example:


Using the same mod, I don’t experience this issue on the F1 1992 Kyalami track. This makes me think the problem may also be related to the 1998 Suzuka track by Shin, which appears to be narrower than Kyalami.

I would like to ask whether you could advise on any possible solutions for this. For example, I was thinking about increasing the throttle limit for lapped cars in the app settings.

I also wanted to ask @Tetri whether AI Whisperer could help in this situation.

I understand that this may not be directly related to the app, but I wanted to ask for your opinion or suggestions, and I hope that’s okay.

Thank you so muich for this amaizing app,

Philip

Hey,

yup, AI whisperer can fix this. You need AIHintsReader as well.

The idea is that the AI calculates whether it can overtake or not on those straight, and usually if it's too narrow, safeguards prevent some cars from overtaking properly.

Also, if it's a Shi track, there might be a little AI app running. I 've seen him integrating this lately, maybe with the car you're using it 's giving bad results. you can check for that AI lua app in the extension folder of the track, rename it to something different and see if it fixes your issue.


Otherwise, what you need are overtaking zones. Using AIHintsreader, you can create new aihints called "ZONE1". Once created, you can then apply specific settings for those zones in AIwhisperer (higher aggression/lower aicaution), overwriting the safe settings from AC.


It sounds a little overcomplicated at first but it is actually pretty easy to setup, 5 mins max. Then you save the settings and it's automatically called for everytime you would launch that car/track combo.
 
Last edited:
Hey @ancient_3

First of all, let me say again that the app is absolutely amazing and works really well.

I’ve encountered one issue, which seems to be related to AC AI behavior rather than the app itself. I’m having trouble finding a solution when one AI car is trying to lap another. Even when the lapped car moves off the racing line and there is plenty of space, the lapping car still gets stuck behind it.

Example:


Using the same mod, I don’t experience this issue on the F1 1992 Kyalami track. This makes me think the problem may also be related to the 1998 Suzuka track by Shin, which appears to be narrower than Kyalami.

I would like to ask whether you could advise on any possible solutions for this. For example, I was thinking about increasing the throttle limit for lapped cars in the app settings.

I also wanted to ask @Tetri whether AI Whisperer could help in this situation.

I understand that this may not be directly related to the app, but I wanted to ask for your opinion or suggestions, and I hope that’s okay.

Thank you so muich for this amaizing app,

Philip

Hi Philip,
Yes I'd say it is a mean DumbAI blue flag situation :) Native AC AI is always balancing between changing line for overtaking or keeping the normal AI spline and it seems it heavily depends on how the other bot is located aside the AI spline and the track limits. I suppose there is also collider computation and speed differential assessment, with most probably a computation to avoid cars that have suddenly crashed

So even if Dumb AI modifies caution value, depending on where you are in the track layout, this is not always sufficient to provide a smooth quick overtaking.

There is no good combination for every track but here are some elements that may enhance this situation:

- change the bots AI Agression in CM: I use between 20 & 30 values which seem to be ok without creating too much incidents. Aggression of 50 gives very strong outlapping results but also some crashes. Depends on the other bots values as well I believe

- lower the max speed limit when outlapped in Dumb AI: it can help some times but also it can make leader being stuck behind at a lower speed, losing more time. Heavily depends on the track layout, works best to enhance overtake in straights and in strong braking at the end of straigths but may have reverse effects on tracks such as Monaco or Hungary

- increase the blue flag situation detection distance in Dumb AI: which is 100m by default, I made some tries but not extensive , I'm not yet sure how much it impacts. Makes the AI bot detect the situation earlier so max speed and spline offset are launched earlier, this may help to decide the leader bot to overtake, but depends really how AC manage this overtaking decision with changing lines or not, how much meters in front of the overtaking car are used to compute the overtake decision etc...

I'm definitely interested about experiments about this but unfortunately, I lack a bit of time to make extensive tries. Also overtaking decision is a task that @Tetri is investigating I think so we may find some progress one day in this area.
 
Last edited:
Hi Philip,
Yes I'd say it is a mean DumbAI blue flag situation :) Native AC AI is always balancing between changing line for overtaking or keeping the normal AI spline and it seems it heavily depends on how the other bot is located aside the AI spline and the track limits. I suppose there is also collider computation and speed differential assessment, with most probably a computation to avoid cars that have suddenly crashed

So even if Dumb AI modifies caution value, depending on where you are in the track layout, this is not always sufficient to provide a smooth quick overtaking.

There is no good combination for every track but here are some elements that may enhance this situation:

- change the bots AI Agression in CM: I use between 20 & 30 values which seem to be ok without creating too much incidents. Aggression of 50 gives very strong outlapping results but also some crashes. Depends on the other bots values as well I believe

- lower the max speed limit when outlapped in Dumb AI: it can help some times but also it can make leader being stuck behind at a lower speed, losing more time. Heavily depends on the track layout, works best to enhance overtake in straights and in strong braking at the end of straigths but may have reverse effects on tracks such as Monaco or Hungary

- increase the blue flag situation detection distance in Dumb AI: which is 100m by default, I made some tries but not extensive , I'm not yet sure how much it impacts. Makes the AI bot detect the situation earlier so max speed and spline offset are launched earlier, this may help to decide the leader bot to overtake, but depends really how AC manage this overtaking decision with changing lines or not, how much meters in front of the overtaking car are used to compute the overtake decision etc...

I'm definitely interested about experiments about this but unfortunately, I lack a bit of time to make extensive tries. Also overtaking decision is a task that @Tetri is investigating I think so we may find some progress one day in this area.
Thanks @ancient_3 !

Right now my settings are the following:

AI agression: 20-30, I even tried with 50-60
Max speed limit: 120, I can try to reduce this but this seems like already pretty slow.
Blue Flag situation detectiod: 100M, I can try to increase this.

I will try out to play wtih these settings.


cheers,
Philip
 
Hey @ancient_3

I have a quick question regarding DumbAI and blue flag behavior.

I’ve noticed that even though I set the maximum speed when being lapped to 120 km/h, the lapped AI still limits its speed to around 40–50 km/h during blue flag situations.

Is there a way to make them reach the configured speed limit?

Thanks in advance,
Philip
 
Hey @ancient_3

I have a quick question regarding DumbAI and blue flag behavior.

I’ve noticed that even though I set the maximum speed when being lapped to 120 km/h, the lapped AI still limits its speed to around 40–50 km/h during blue flag situations.

Is there a way to make them reach the configured speed limit?

Thanks in advance,

I suspect it may be linked to the bug where low AI have difficulties to manage throttle pedal when driving at too low speed. I think CSP proposes something to deal with it in new AI behavior options but maybe is not sufficient in our case.
I'll try to find some workaround with other lua commands.

Thanks for the bug report !
 
Last edited:
I suspect it may be linked to the bug where low AI have difficulties to manage throttle pedal when driving at too low speed. I think CSP proposes something to deal with it in new AI behavior options but maybe is not sufficient in our case.
I'll try to find some workaround with other lua commands.

Thanks for the bug report !
@Philip00 So while some low AI have really this issue, it was not the cause of the bug: I simply had a variable name change that did not follow through the app to the inner bot code and it was simply putting a undefined value as max speed limit when outlapped, whatever you changed in the UI. Sorry for this stupid thing.

I just made a corrective that I tried with 120 km/h max and observed 122 km/h in the replay of the outlapped bot in a straight, so should work now, hopefully.

A good Christmas surprise is that the new CSP 0.3.0 preview 212 brought the changes that were necessary to override native AC AI pit stop strategy, so next DumbAI update will rewrite all pit stop management (tyre / fuel / damage) including fuel management so that we have a normal behavior where AI pits before it runs out of fuel (will try to manage running out of gas issue when pit stop to refuel not allowed) and/or out of tyres and then new pit strategies with fuel only, tyres only and mixed fuel and tyres pit stops :)
 
Last edited:
Back