DumbAI

DumbAIMisc  1.1

  • Thread starter Thread starter ancient_3
  • 101 comments
  • 6,186 views
Hey Ancient,

Regarding point number 2 (“some AI drivers returned to the pits again just two laps later”), it appears this is not a bug. I hadn’t realized that those cars were involved in an incident on the straight in Canada. The impact wasn’t severe enough to cause retirement, but it was sufficient to require a pit stop for repairs. I’ll run some further tests, but for now everything looks fine.

As for point number 1 (“this may not be related to the app itself, but I’ve noticed that one AI driver often performs an extremely fast pit stop, while the rest of the field spends the expected amount of time in the pits according to the car.ini settings for tire changes and refueling”), this issue still occurs. However, I don’t think it’s related to the app either.

Do you still need the car/track combination? I can upload it and send it to you via PM if that’s easier.

Best wishes,
Philip
if they spent an amount of time like the tyre changing time , should be OK then :-)

I'm still interested to have just the track name, just to have a look at pits positions in blender and project pitlane.

I started to work on version 1.1 , in which I'll add possibility to save settings and also working on adding a new log system (in DumbAI main window instead of in the lua debug)

Thanks again for the testing, it is motivating to have some feedback about the app :-)
 
if they spent an amount of time like the tyre changing time , should be OK then :-)

I'm still interested to have just the track name, just to have a look at pits positions in blender and project pitlane.

I started to work on version 1.1 , in which I'll add possibility to save settings and also working on adding a new log system (in DumbAI main window instead of in the lua debug)

Thanks again for the testing, it is motivating to have some feedback about the app :-)
Sure it's Canada 1998 by shin:
 
Hi Philip,
I tried the track with 31 Kunos F488 GT3 bots and was not able to recreate the issue , sorry. Everyone went to pit and spent the correct time there. I specifically looked at the first pit areas and they spent like 20 seconds there, what I'd have expected considering the time computed from the .ini.

To all, I tried the app with URD GTE2019 pack and noticed the Dumb AI can not work for Tyre Wear as their tyre files are encrypted .ini . I'm a bit bored with that I must say. I may put a default value for tyre wear taken from their former GTE mod that is not encrypted or from a Kunos GT3 so that the app doesn't crash but that makes few sense if you run with specific tyre wear and bots don't have the same...
 
Last edited:
Hi Philip,
I tried the track with 31 Kunos F488 GT3 bots and was not able to recreate the issue , sorry. Everyone went to pit and spent the correct time there. I specifically looked at the first pit areas and they spent like 20 seconds there, what I'd have expected considering the time computed from the .ini.

To all, I tried the app with URD GTE2019 pack and noticed the Dumb AI can not work for Tyre Wear as their tyre files are encrypted .ini . I'm a bit bored with that I must say. I may put a default value for tyre wear taken from their former GTE mod that is not encrypted or from a Kunos GT3 so that the app doesn't crash but that makes few sense if you run with specific tyre wear and bots don't have the same...
Hey ancient.

To me the first AI always gave magic lit box there when they went for refueling

I will try to recreate again see of there is any changes and let you know.
 
Hey ancient.

To me the first AI always gave magic lit box there when they went for refueling

I will try to recreate again see of there is any changes and let you know.
Hi Philip,

While debugging future 1.1 version, I noticed the bots behave strangely if you are running the race as a bot yourself and if you navigate between bots to observe what they do. And I was able to observe something like you did.

1) I saw a bot going back to pit without writing anything in the log, just as if DumbAI had been disabled.

2) this bot was really quick to do the pitstop. I looked at my code and saw that I gave a 3 seconds bonus for bots as they are a bit slower in the pitlane and depending on cars, the way I wake up them to make them go back on track may make them lose another couple of seconds. That may explain why with F1 cars, the pitstop is too quick but most likely, it is rather just vanilla AC that took control on the pitstop loop and disabled DumbAI

3) if you run a race as spectator, player 0 (yourself made as a bot by ctrl-C) does not follow DumbAI rules as the app is applied only to cars 1 to cars xx (considering they are bots). I wonder if it is not the same that happens if you get focus on another bot car.

I made the exact same race again but driving the car instead of running as a spectator and everything went well , all DumbAI functions were correctly applied.

Anyway, I changed the pit bonus to only one second for future version 1.1

Also I'll try to clear a bit how DumbAI is applied : maybe if I check if car is driven by AI instead of just using car index, it will be cleaner.

Here is a preview of UI for 1.1 as a bonus ;)
preview_1_1.webp


Load / save file system using .ini format has been added and is debugged. I added the possibility to set a default ini that is loaded at start of the session so that one can start to race without bothering about DumbAI settings

I just finished to debug Tyre Change only , with a new functions that make bots able to run out of fuel.

Still have to debug ReFuel only and Mandatory Refuel strategies, and verify that TyreChange&Refuel and Mandatory Mixed Compounds have not been destroyed by my modifications.

And then define alternate strategies and grid position accounting, for each strategy, and debug them :)
 
Last edited:
Hi Philip,

While debugging future 1.1 version, I noticed the bots behave strangely if you are running the race as a bot yourself and if you navigate between bots to observe what they do. And I was able to observe something like you did.

1) I saw a bot going back to pit without writing anything in the log, just as if DumbAI had been disabled.

2) this bot was really quick to do the pitstop. I looked at my code and saw that I gave a 3 seconds bonus for bots as they are a bit slower in the pitlane and depending on cars, the way I wake up them to make them go back on track may make them lose another couple of seconds. That may explain why with F1 cars, the pitstop is too quick but most likely, it is rather just vanilla AC that took control on the pitstop loop and disabled DumbAI

3) if you run a race as spectator, player 0 (yourself made as a bot by ctrl-C) does not follow DumbAI rules as the app is applied only to cars 1 to cars xx (considering they are bots). I wonder if it is not the same that happens if you get focus on another bot car.

I made the exact same race again but driving the car instead of running as a spectator and everything went well , all DumbAI functions were correctly applied.

Anyway, I changed the pit bonus to only one second for future version 1.1

Also I'll try to clear a bit how DumbAI is applied : maybe if I check if car is driven by AI instead of just using car index, it will be cleaner.

Here is a preview of UI for 1.1 as a bonus ;)
View attachment 1514613

Load / save file system using .ini format has been added and is debugged. I added the possibility to set a default ini that is loaded at start of the session so that one can start to race without bothering about DumbAI settings

I just finished to debug Tyre Change only , with a new functions that make bots able to run out of fuel.

Still have to debug ReFuel only and Mandatory Refuel strategies, and verify that TyreChange&Refuel and Mandatory Mixed Compounds have not been destroyed by my modifications.

And then define alternate strategies and grid position accounting, for each strategy, and debug them :)
Hey Ancient,

Yes — I was actually using Ctrl+C at that time as well when I observed the quick fuel usage, usually for the pole sitter.

I’ll run another test without using it. So just to confirm — the solution is simply not to use Ctrl+C?

The new features look awesome — I can’t wait to try them out! 😍

Best Wishes,
Philip
 
Hey Ancient,

Yes — I was actually using Ctrl+C at that time as well when I observed the quick fuel usage, usually for the pole sitter.

I’ll run another test without using it. So just to confirm — the solution is simply not to use Ctrl+C?

The new features look awesome — I can’t wait to try them out! 😍

Best Wishes,
Philip
Hey,

"the solution is simply not to use Ctrl+C?"

Yeah , could be. It is hard to give a more definitive answer with AC and CSP ^^ Some people (including myself) saw strange behavior when looking at race from AI point of view. The main one seems to be that the bot created from Ctrl+C seems to never follow the lua app instructions :-D

So when I debug, for pit strategy, usually I just start the race and go directly back to pits to stay and observe bot behavior, then I use the replay if I need to look at something that specifically happened during race (blue flag behavior debug etc...)

While debugging version 1.1, I observed a nasty bug where DumbAI was not correctly overriding the fuel level in the particular case in which car would pit at the specific lap that was expected by vanillaAC and another one even more tricky that would happen only when car would pit while having less than a little amount of fuel (probably 5L or something) in which case vanilla was able suddenly to take control again. Took me the afternoon to find a workaround.... but seems I found it with a small approximation (fuel is now free for the part of the pitlane ranging from pit position to normal AI spline, when they go out of pits)
 
Last edited:
ancient_3 updated DumbAI with a new update entry:

global update

Change log:

- new UI with tyres names and cleared presentation

- new load/save file system based on .ini format with the possibility to have a default.ini launched at start of the session

- new race strategies: "Mandatory Mixed Compounds without Refuel" & "Mandatory Refuel"

- consolidation of all older race strategies

- addition of a new AI behavior: "Running out of fuel"

- new random alternative race strategies, adapted to each race strategies

- fuel strategy adapted...

Read the rest of this update entry...
 
Hey Ancient,

First of all, the new update is awesome! I tried your suggestion not to use Ctrl+C, and everything works perfectly now. Thank you for this great update! 😍

There are two things I noticed in the new update:
  1. For some reason, not all compounds appear in the app, as you can see below. (This was working fine before.)
1771756388925.webp

  1. If I select mandatory refuel in situations where I don’t expect any compound change during the pit stop — only a tyre change to the same compound — does “Allow alternative strategy” override this setting?
I believe this might be the case, as I noticed some drivers went back to the pits after refuelling for an additional compound change. However, I wanted to ask for clarification.

(When I switched this option off, everything worked perfectly in this regard.)

Also I have an additional question:
If I use AI limitation in CM will DumbAI still work? (I know AI limitation creates temp folders in the cars folder)

Thanks in advance and best wishes,
Philip
 
Last edited:
Hey Ancient,

First of all, the new update is awesome! I tried your suggestion not to use Ctrl+C, and everything works perfectly now. Thank you for this great update! 😍

There are two things I noticed in the new update:
  1. For some reason, not all compounds appear in the app, as you can see below. (This was working fine before.)
View attachment 1515241
  1. If I select mandatory refuel in situations where I don’t expect any compound change during the pit stop — only a tyre change to the same compound — does “Allow alternative strategy” override this setting?
I believe this might be the case, as I noticed some drivers went back to the pits after refuelling for an additional compound change. However, I wanted to ask for clarification.

(When I switched this option off, everything worked perfectly in this regard.)

Thanks in advance and best wishes,
Philip
Hi Philip,

Thanks for the review :)

For the first point, I just tested it with Kunos SF70 and Kunos Lotus Exo 125 and everything is OK here, every tyres types appear. So I'd say it is linked to the car mod.

DumbAI reads up to 7 tyres types from the tyres.ini file in the car data and looks for 'FRONT',"FRONT_1","FRONT_2","FRONT_3","FRONT_4","FRONT_5", "FRONT_6" and "REAR","REAR_1","REAR_2","REAR_3","REAR_4","REAR_5", "REAR_6" fields and then, for each of them, it looks in the file at their "WEAR_CURVE" field to load the .lut file that eventually allows to compute the tyre wear and the need to get back to pit.

So in your case, likely there is something wrong there for the hard compound ?

If the mod is free , you can tell me where to download it and I'll have a look or if it is not free, you can still try to get the tyres.ini by: getting to Content in CM, select cars, then select your car, click on unpack data. Then navigate to your car folder in assettocorsa\content\cars , open the new data folder and tyres.ini should be in it.


For the second point, first I'd like to thank you for testing such detailed situation, it is the hardest to do for me as it takes a lot of time to experiment any situations, and there is a good amount of them with all these race strategies :)

For Mandatory Refuel, the bot logic is the following:
Was there an expected pitstop for fuel considering the race conditions sent by user (race length, fuel_mult, car max fuel content etc...) ?

If no, then create a new fuel strategy where I will divide my fuel amount into artificial stints so that I make at least one pitstop.

Then, a new choice, am I under an alternate strategy or not ? If not, just split my fuel amount in half and let's go . If I'm under an alternate strategy:
- if I chose a softer compound, then split my fuel amount in 3 and make a second pitstop. If everything is correct in the tyre strategy, I should now have the softer compound as default so this should result into 3 stints with softer compound only.

- if I chose a harder compound, let's keep it at one stop but increase the lenght of the first stint for about 75% if max fuel in tank allows it and then let me get back to the initial default tyres compound for the shorter second one, so this should result into 2 stints, one with harder compound and the other with initial default.

If there was an expected pitstop, then nothing happens for this strategy so it should not change its tyre compounds during race. (I made a mistake and forgot to add Mandatory Refuel strategy in this loop and so only Tyres&Refuel and Mandatory Mixed Compounds with Refuel do adjustement between fuel and tyres compounds currently so I'll correct it for the next update, so thanks again for the report )

So either you are in the case where bot had alternate strategy with harder compound with no expected pitstop at first glance, and so in race, should have made a pit stop later than default and changed its tyres compound from harder to default for this second stint, or something else is wrong in my code :)
 
Last edited:
Hi Philip,

Thanks for the review :)

For the first point, I just tested it with Kunos SF70 and Kunos Lotus Exo 125 and everything is OK here, every tyres types appear. So I'd say it is linked to the car mod.

DumbAI reads up to 7 tyres types from the tyres.ini file in the car data and looks for 'FRONT',"FRONT_1","FRONT_2","FRONT_3","FRONT_4","FRONT_5", "FRONT_6" and "REAR","REAR_1","REAR_2","REAR_3","REAR_4","REAR_5", "REAR_6" fields and then, for each of them, it looks in the file at their "WEAR_CURVE" field to load the .lut file that eventually allows to compute the tyre wear and the need to get back to pit.

So in your case, likely there is something wrong there for the hard compound ?

If the mod is free , you can tell me where to download it and I'll have a look or if it is not free, you can still try to get the tyres.ini by: getting to Content in CM, select cars, then select your car, click on unpack data. Then navigate to your car folder in assettocorsa\content\cars , open the new data folder and tyres.ini should be in it.


For the second point, first I'd like to thank you for testing such detailed situation, it is the hardest to do for me as it takes a lot of time to experiment any situations, and there is a good amount of them with all these race strategies :)

For Mandatory Refuel, the bot logic is the following:
Was there an expected pitstop for fuel considering the race conditions sent by user (race length, fuel_mult, car max fuel content etc...) ?

If no, then create a new fuel strategy where I will divide my fuel amount into artificial stints so that I make at least one pitstop.

Then, a new choice, am I under an alternate strategy or not ? If not, just split my fuel amount in half and let's go . If I'm under an alternate strategy:
- if I chose a softer compound, then split my fuel amount in 3 and make a second pitstop. If everything is correct in the tyre strategy, I should now have the softer compound as default so this should result into 3 stints with softer compound only.

- if I chose a harder compound, let's keep it at one stop but increase the lenght of the first stint for about 75% if max fuel in tank allows it and then let me get back to the initial default tyres compound for the shorter second one, so this should result into 2 stints, one with harder compound and the other with initial default.

If there was an expected pitstop, then nothing happens for this strategy so it should not change its tyre compounds during race. (I made a mistake and forgot to add Mandatory Refuel strategy in this loop and so only Tyres&Refuel and Mandatory Mixed Compounds with Refuel do adjustement between fuel and tyres compounds currently so I'll correct it for the next update, so thanks again for the report )

So either you are in the case where bot had alternate strategy with harder compound with no expected pitstop at first glance, and so in race, should have made a pit stop later than default and changed its tyres compound from harder to default for this second stint, or something else is wrong in my code :)
Ahh, I totally understand now.

Regarding the tyre issue, I didn’t notice any problems to be honest, and it worked well in your previous versions. However, please let me know if I’ve overlooked something. Here is the car:

Regarding the alternative strategy, the following is happening on my side:

Medium was the default, so every car that chose Medium is doing a one-stop race (around 90–100 L of fuel), which is exactly the expected behaviour.

However, those using the alternative strategy (choosing Soft, as Hard is currently unavailable due to issue #1) selected Soft but are still running a one-stop strategy — they are also starting with around 90–100 L of fuel. I assume they then perform a very short second and third stint afterwards, but at the moment it isn’t divided into three “equal” stints, at least not on my side.

Please let me know if my understanding is incorrect or if you need any additional data.

Thanks again,
Philip
 
Ahh, I totally understand now.

Regarding the tyre issue, I didn’t notice any problems to be honest, and it worked well in your previous versions. However, please let me know if I’ve overlooked something. Here is the car:

Regarding the alternative strategy, the following is happening on my side:

Medium was the default, so every car that chose Medium is doing a one-stop race (around 90–100 L of fuel), which is exactly the expected behaviour.

However, those using the alternative strategy (choosing Soft, as Hard is currently unavailable due to issue #1) selected Soft but are still running a one-stop strategy — they are also starting with around 90–100 L of fuel. I assume they then perform a very short second and third stint afterwards, but at the moment it isn’t divided into three “equal” stints, at least not on my side.

Please let me know if my understanding is incorrect or if you need any additional data.

Thanks again,
Philip
arf, something is strange, I downloaded your car and here I have all tyre compounds in DumbAI as expected:


test_bar.webp



So I don't know what to do ?!?
Medium was the default, so every car that chose Medium is doing a one-stop race (around 90–100 L of fuel), which is exactly the expected behaviour.

However, those using the alternative strategy (choosing Soft, as Hard is currently unavailable due to issue #1) selected Soft but are still running a one-stop strategy — they are also starting with around 90–100 L of fuel. I assume they then perform a very short second and third stint afterwards, but at the moment it isn’t divided into three “equal” stints, at least not on my side.
For this part, so if I sum up things, you are in race conditions where Mandatory Refuel is selected in DumbAI but in your case, the race conditions (fuel multiplier and race lenght) make that a pit stop for fuel would have been expected whatever Mandatory Refuel selected or not.

I think you're in the mistake I mentionned in my post:

If there was an expected pitstop, then nothing happens for this strategy so it should not change its tyre compounds during race. (I made a mistake and forgot to add Mandatory Refuel strategy in this loop and so only Tyres&Refuel and Mandatory Mixed Compounds with Refuel do adjustement between fuel and tyres compounds currently so I'll correct it for the next update, so thanks again for the report )

So no, in this 1.1, they do not adjust their fuel to make a shorter first stint if they have an alternate compound that is softer, nor do they add a supplementary pit stop. I'll add the fuel adjustment for Mandatory Refuel strategy in the next hot fix.

Also, I think I must precise that the fuel strategy has some "edge" situation that can leads to confusion.

First, keep in mind it is computed with an estimation at start from fuel_cons.ini . But then fuel level is assessed in "real time" during the race. DumbAI takes a 10% margin in this fuel consumption, just to be sure that AI won't run out of fuel. And I suspect there is a first consumption margin in fuel_cons.ini . So it is likely that the expected pit stop strategy will not exactly be the same as what happens during the race as it is almost sure that the car will consume at least 10% less that what was computed, hence they will stop later than expected because the pit stop is triggered only when fuel level is below "fuel quantity needed to perform another lap"

Second, there is a random value in fuel estimation to make some diversity between bots , +/- 5% that will apply to the base 10% so that the bot ends up from a 15% margin up to a 5% margin. In rare cases, when you're near the limit of the fuel tank size, it can lead to different strategies.

Here is an example with your car, on Kunos Monza, 15 laps with fuel consumption rate set at x5.

I obtain this:

Abdullah Al-Mutawaa fuel_strat = 98.1, 98.1, 98.1 = total of 294 L
Cédric Levratti fuel_strat = 135.4, 135.4 = total of 270 L
Robert Kajetanowicz fuel_strat = 96.7, 96.7, 96.7 = total of 291 L
Jacques Villeneuve fuel_strat = 139.5, 139.5 = total of 279 L
Mika Salo fuel_strat = 136.9, 136.9 = total of 274 L

Why two different strategies ? because of the random effect.

86.325 km to race, 1.68 km/L => 0.336 km/L (due to fuel rate) => mean 10% margin of DumbAI = 0.3024 km/L => 285 L

Here the max fuel tank is 140. Estimates are all in the range of 10% of variation in fuel. 285 L is more than two fuel tanks.

So bot will first try to make two stints => 142.5 L per stint => not possible due to tank max size => then three stints => 95 L => OK for tank max size.

Now say that bot estimated with only 5% margin: consumption is now 0.3192 km/L => 270 L

bot first tries to make two stint => 135 L per stint => OK , only one pit stop.

What will happen during race ? Likely everyone will spend less fuel than expected. With 10% of margin, real consumption may be like 280 - 28 => 252 L

For Jacques Villeneuve, likely, he will make a longer first stint than expected and have a shorter second one.

For Abdullah Al-Mutawaa, that means it is possible that at his first pit stop, he will be able to finish with only a fuel tank and then switch to a 1 pitstop strategy (but it is not likely as he will use the same estimate with margin than before).

Now you see why it is not easy to explain what happens in race. Not to mention that it is almost impossible to assess tyre wear before start...

I made these random picks while I did'nt know exactly how fuel was managed by AC. Now with more experience, I wonder if it would not be easier to pick only the fuel_cons.ini value without any margin or random effects and then assess dynamically fuel consumption per lap to correct projection with real data when pit stop occurs. Should be more accurate and easier to debug...
 
Last edited:
Back