DumbAI

DumbAIMisc  0.2

  • Thread starter Thread starter ancient_3
  • 14 comments
  • 575 views
ancient_3 updated DumbAI with a new update entry:

new UI and new pit stop strategy

Dumb AI 0.1

new UI:
  • DumbAI parametrization can be done on the setup menu before the race
  • main Window while racing or replay serves only to look at different track & variables to check for model logic ; it is deactivated by default
  • DumbAI logs are shown in the lua debugger

new functionalities and bug corrections:
  • sliders are now correctly connected to model variables
  • all AI cars put selected tyres at the start
  • enhancement of Blue Flag behavior with a...

Read the rest of this update entry...
 
ancient_3 updated DumbAI with a new update entry:

qualifying & alternate strategy

Changelog:

New functionalities:
- qualifying session: AI waits for a random amount of time before going out on track, then run 3-4 laps (depending of pit location against the finish line) and go back to pit to wait 60 seconds before going out for another run

- alternate pitstop strategy: if Mixed Compound selected, alternate pitstop strategy reverse the strategy for the last quarter qualified -> those AI start with the harder compound and pit at 2/3rd of the race

Small things:
  • ...

Read the rest of this update entry...
 
Hi, not really in this 0.2 version but if you untick Qualifying behavior and keep Normal pit strategy, then you should only have the blue flag behavior (and the AI starting tyres set to what you chose, softer by default).

The Normal pit strategy should not work, it is based on tyreWear with a threshold of 0.9 that AI should never attain in fact. So it should not override normal AC/CSP behavior.

I'm working on 0.3 version where I'll add fuel management and debug this normal pitstop strategy but also add a kill switch for every functionalities of the app, like @fto_10 also proposed. In the end, I think I'll use a small .ini where any users will be able to write which functionnalities he wants at start of the app so that it is done once for good.

It takes a little time because I want AI to be able to assess during the race when to change tyres correctly and when to go refuel and adapt its global initial strategy for the whole race.
 
Hey ancient_3

First all your mod is really awesome and makes a lot bettter racing with AI. I really appriciate the effort and it become a mandatory add-on for me.

I am wondering in the future do you think it is posssible to make pit-stop strategy for the AI fuel based in order to replocate race for 1994-2009 era?

I would really love that and hope that this is somethingh that you can add so AI would run 1-or 2 stops based on theirr fuel level.

Again thanks for the hard work and I really hope this project will be continued
 
Hey ancient_3

First all your mod is really awesome and makes a lot bettter racing with AI. I really appriciate the effort and it become a mandatory add-on for me.

I am wondering in the future do you think it is posssible to make pit-stop strategy for the AI fuel based in order to replocate race for 1994-2009 era?

I would really love that and hope that this is somethingh that you can add so AI would run 1-or 2 stops based on theirr fuel level.

Again thanks for the hard work and I really hope this project will be continued
Thank you !

What are the rules for this 94-09 era ? They must pit at least once in the race to refuel and it is possible for them to change tyres while refueling ? Do they have some pitstop to change only the tyres ?

I would like to use the next update to clean up things about pitstop strategy.

I selected 5 theoretical cases:
  • case 1: no pit stops, either for fuel or tyres. AI must do the race with initial fuel amount and tyres
  • case 2: free pit stops for tyres but no pitstop for fuel. AI can pit stop when it wants according to tyre wear thresholds given by the app but can not refuel.
  • case 3: free pit stops for fuel and tyres. AI can pit stop when it wants according to tyre wear & fuel level thresholds given by the app.
  • case 4: 1 mandatory pit stop to change tyres compound with no refuel (current F1 rules I believe). AI must pit stop at least once and must have used two compounds in the race. AI must do the race with initial fuel amount.
  • case 5: 1 mandatory pit stop to refuel. AI must pit stop at least once to refuel, can use whatever tyre compound it wants in the race.

All cases look easy to read but are sometimes more complex to implement :-) in any case except case 1, AI must be able to assess its tyre wear and grip and project its fuel consumption with many intermediate cases once the mandatory pit stop have been done . Case 3 is in fact more complex than it seems and I have to deal with original AC /CSP behaviour in any cases... ;-)
 
Last edited:
Thank you !

What are the rules for this 94-09 era ? They must pit at least once in the race to refuel and it is possible for them to change tyres while refueling ? Do they have some pitstop to change only the tyres ?

I would like to use the next update to clean up things about pitstop strategy.

I selected 5 theoretical cases:
  • case 1: no pit stops, either for fuel or tyres. AI must do the race with initial fuel amount and tyres
  • case 2: free pit stops for tyres but no pitstop for fuel. AI can pit stop when it wants according to tyre wear thresholds given by the app but can not refuel.
  • case 3: free pit stops for fuel and tyres. AI can pit stop when it wants according to tyre wear & fuel level thresholds given by the app.
  • case 4: 1 mandatory pit stop to change tyres compound with no refuel (current F1 rules I believe). AI must pit stop at least once and must have used two compounds in the race. AI must do the race with initial fuel amount.
  • case 5: 1 mandatory pit stop to refuel. AI must pit stop at least once to refuel, can use whatever tyre compound it wants in the race.

All cases look easy to read but are sometimes more complex to implement :-) in any case except case 1, AI must be able to assess its tyre wear and grip and project its fuel consumption with many intermediate cases once the mandatory pit stop have been done . Case 3 is in fact more complex than it seems and I have to deal with original AC /CSP behaviour in any cases... ;-)
These are awesome scenarios!


More precisely, between 1994 and 2004 (in 2005 you could only change tires if they were heavily damaged, in 2006 it was similar to 1994–2004, and from 2007–2009 it became closer to the modern era—if you’re interested, I can elaborate on those as well), pit stops were primarily determined by fuel level. Since the fuel tank size was reduced, it wasn’t possible to fill enough fuel to run the entire race, so at least one mandatory stop was required.


During refueling, teams would also change the tires. In terms of compounds, there were only Soft and Hard options. Teams were free to choose which compound to start the race with, but they had to use that same compound for the entire race. Tires were much more durable back then, so fuel strategy dictated the pit stops. Some drivers stopped once, others twice, and in certain cases even three times. Choosing a two-stop strategy gave you a weight advantage compared to those doing a single stop, which created incredibly interesting strategic battles.


Regarding setup, I was thinking it would be great if you could define percentages for strategies—for example, 40% one-stop, 60% two-stop, or even 40% one-stop, 40% two-stop, 20% three-stop—so the game could randomly assign fuel strategies for each driver. Another nice feature would be the ability to set the strategy individually for AI drivers, allowing unique fuel plans for each race.


These are just ideas, and I know it’s much easier to talk about them than to actually implement them. Unfortunately, my coding skills are nowhere near yours, but I’d be happy to help with testing if you want.

Let me know if you need any more info and thanks for hearing me out I really appriciate it.
 
These are awesome scenarios!


More precisely, between 1994 and 2004 (in 2005 you could only change tires if they were heavily damaged, in 2006 it was similar to 1994–2004, and from 2007–2009 it became closer to the modern era—if you’re interested, I can elaborate on those as well), pit stops were primarily determined by fuel level. Since the fuel tank size was reduced, it wasn’t possible to fill enough fuel to run the entire race, so at least one mandatory stop was required.


During refueling, teams would also change the tires. In terms of compounds, there were only Soft and Hard options. Teams were free to choose which compound to start the race with, but they had to use that same compound for the entire race. Tires were much more durable back then, so fuel strategy dictated the pit stops. Some drivers stopped once, others twice, and in certain cases even three times. Choosing a two-stop strategy gave you a weight advantage compared to those doing a single stop, which created incredibly interesting strategic battles.


Regarding setup, I was thinking it would be great if you could define percentages for strategies—for example, 40% one-stop, 60% two-stop, or even 40% one-stop, 40% two-stop, 20% three-stop—so the game could randomly assign fuel strategies for each driver. Another nice feature would be the ability to set the strategy individually for AI drivers, allowing unique fuel plans for each race.


These are just ideas, and I know it’s much easier to talk about them than to actually implement them. Unfortunately, my coding skills are nowhere near yours, but I’d be happy to help with testing if you want.

Let me know if you need any more info and thanks for hearing me out I really appriciate it.
I'll be more than happy to have some feedback from your tests. In fact, most of my time is spent testing , which is not always easy if the problem occurs in a part of the race that need some time to reach: takes a lot of time to get there and understand what's happening.

I have refactored the code this week-end and now I'm gradually introducing the functionalities step by step. Plenty of problems are low level and comes from the interaction with "natural" AC/CSP behavior.

For example, I spent some time on the qualifying session , which is easier to test for basic functionalities. So I can safely say that, apart from the start of the session where I was not successful to overide AC/CSP behavior, we may have qualifying sessions where the AI checks for rain and goes back to pits if weather has changed, is sure to get the softest compound when track is dry or wet tyres when track is wet and goes out for only 3 laps and then get back to pits to change tyres (if weather has not changed before the end of these 3 laps).

AC/CSP has already a random distribution for AI starts (cars are blocked for a definite amount of time and not available with lua) so this should be sufficient to ensure some variability in the session and not have every AI on track at the same time in qualifying. But for example, another issue is that if weather changes while AI is going out from pits with the wrong tyres, it will get teleported back to the pit to change its tyres as long as it is not out of the pitlane. I suppose it is linked to the physics.setAIPitStopRequest() function behavior in the pitlane, so I may be able to solve it by making a special check but you see the kind of things that happens.

But once AI is on track, it seems one can manage to do many things for pit stop strategy. I have finished the information gathering necessary to compute fuel estimation and tyre wear. I also used random assignation for each AI. So I'm pretty sure it will be possible to have different strategies distributed amongst AI. But have to keep in mind that to make AI able to assess how much time per lap is gained is really difficult so better to think at those AI strategies as "planned templates", similar to weather plans, instead of "intelligent AI strategies". However, it is theoretically possible to include some feedback from tyre wear and fuel consumption while racing and adapt strategies accordingly. Just difficult to code and many low level problems to solve before :-)

I'll try to advance the race session work this week and get it altogether to make a clean new release so that you and others can test
 
Last edited:
Well I'm a bit less optimistic since I spent hours trying to understand why AI kept pitting sometimes, whatever my lua code. In fact, reading the CSP logs, the unexpected pit in qualify was due to AI that had low fuel. I didn't expected that because I ran the test with fuel consumption at 0. Seems AC/CSP keeps hand on some specific elements, such as fuel management for example. And if AC/CSP triggers a pit stop, you can't override it in the current CSP version 0.3.0.140

While testing the Qualify session, I was able to fill the tank with setCarFuel, get the computed tank level with statecar::fuel with the good consumption rate for computation, but I still had one AI pitting too early in its Qualify run. And when checking the CSP log, it seems the lua modifications can't override the native behavior of CSP/AC: it keeps its initial fuel estimate for tank filling and make AI pit just as if you made nothing, including if you selected fuel consumption rate of 0 in CM, they keep consuming fuel whereas the lua access tells you the tank level is constant ...

For Dumb AI, let's say that trying to implement a particular pit strategy will be useless if AC/CSP keeps messing with its own fuel estimates that you can not override.

As a consequence, for the next release, instead of adding new pit strategy stuff , I'll wrap up properly the blue flag behavior and the tyres compound management, which work well. And then wait for updates or explanations that would solve those issues about fuel...
 
Last edited:
Back