Automatic AI - Performance-based Dynamic AI Scaling

From Simwiki.net
Jump to navigation Jump to search

How AI Should Actually Work

A performance-driven solution for automatic, accurate, real-time player-matching AI difficulty leveling

Premise

  • You are role-playing a professional race driver
  • You are racing at a professional level which means you have the experience, skill, and driving license to compete at the level the sim presents
  • That means that, whatever your skill level, that is the skill level the AI should be: Instead of you matching the AI, the AI should match you
  • If we accept this premise, never having to see an AI difficulty slider ever again is within reach

Goals

  • Automatic AI difficulty based on current event qualifying, and practice if run, with graceful automatic fallback to past performance by class or track, with graceful final fallback to manual AI difficulty level

How It Works

  • You start lapping in qualifying and the game adjusts AI difficulty in realtime based on your clean laptimes
    • This could start in practice so that qualifying is "pre-seeded" with performance data to pick the AI closer to the player's performance sooner
  • You run qualifying until the end or until you are at race pace
  • AI difficulty is based on a bell curve, using average and standard deviation performance metrics, with some limited randomness, to place the AI "around" you in terms of performance
  • If your performance falls outside a certain range then past performance based on class and track is used and, if past performance data is not available, then fallback to manual AI difficulty level

Benefits

  • You never have to set an AI difficulty level ever again if you run qualifying
  • You don't have to expend energy on finding an appropriate AI difficulty level that could be better spent actually racing
  • No magic needed:
    • Both Player and AI performance are based on actual laptimes driven by the player and AI in real-time.
    • There's no guessing. You adjust whatever parameters influence AI behind the scenes and watch for laptimes in real-time to increase. In this way, it works automatically and dynamically for any car class or track.

Options

  • User selectable AI strategies could be provided to personalize the experience:
    • Simulation: As described above
    • Dynamic: AI also adjust in a Race session in the same way as Simulation so that you're always competitive
      • Could adjust lap by lap so that it's not too obvious. One or more AI might have a great few laps and fallback to normal laptimes so that it feels less fake.
      • Bell curve method means player exists within a bubble or window of AI performance levels, perhaps near the lead, perhaps near the back, perhaps in the middle. It doesn't need to feel like rubberbanding AI.
    • Arcade: Simplistic rubberbanding AI as seen in many arcade games

Problems and Solutions

  • What performance should AI have in practice or qualifying before the player puts in laptimes?
    • AI Should drive based on past performance data for the class or track
    • AI could start at the low end of a bell curve of likely performance

Ideas

  • Lap-to-Lap Variability
    • Lap-to-lap consistency should be variable within a bell curve based on average and standard deviation metrics
    • This will alleviate situations where you are top 3 and either you run away from them or they run away from you
    • Not ideal but you could also have some deeper logic within your 'rivals' (by laptime) grouping that keeps them within similar performance (ie. rubberbanding or bell curves or something)
  • Self Correcting Logic
    • Imperfect starting performance metrics may lead to large gaps in the field as session duration grows (ie. endurance racing)
    • A lower threshold could be monitored and, if triggered, small changes made until field gaps come back into spec
    • The idea would be to prevent the player from running away from the field or getting left behind by the field simply due to long race duration and game AI flaws
    • This is a form of rubberbanding but hopefully could be made to be unnoticeable