The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.30 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
An API for AI Drivers
07-26-2006, 09:55 PM,
#1
An API for AI Drivers
This is something I've been thinking about for a long while. I know its not on the priority list for VDrift, but I'd like to outline here why I feel it perhaps should be, and then to look at some issues to be considered in how it would be designed and implemented.

The most obvious benefit of AI drivers would be that you have someone to race against. Sure, there's multiplayer but my experience with many games is that for every person who'll go online there's 10 who won't. Driving solo around a track is fun ... but driving against a dozen opponents is a lot more fun!

Very good AI drivers already exist in Torcs and RARS and depending on the design of the API they could be ported to VDrift rather than needing to be written from scratch - which brings me to the question of implementation.

Both Torcs and RARS used C/C++ for the AI drivers, whereas it was mentioned earlier here that perhaps a scripting language like LUA could be used. I have no preference one way or the other, but there's a few issues a scripted solution would need to address.

First is performance - would the game slow to a crawl with multiple AI cars driving at the same time?

Secondly, persistent data storage - at initialization stage an AI driver needs to analyze the track, calculate the ideal racing line and braking distances etc then store it in arrays for reference while actually driving, plus information about what its doing while driving so that it remembers who its overtaking & so on. Would a scripted solution allow such data to be retained?

Third, but perhaps not as important, is the ease of porting the drivers from the other games to VDrift if the language is significantly different.

The actual API would be pretty straightforward in concept. Every iteration of the game's process loop the drivers' code would be called via an update function. The API would provide the driver code with comprehensive information about the state of all cars on the track (their location, speed, yaw, yaw-rate, accel rate, damage; the type of track segment they're on including curve type, radius, height changes, banking etc - the list goes on). From this the driver AI can populate variables saying what gear it'd like to use, what amount of clutch, brake, accelerator and of course steering. This is passed back to the game.

I really feel that this'd be a significant enhancement to the game. Although I've developed AI drivers myself for some time I don't feel qualified to create the API as I know nothing about VDrift's internals. It'd need someone who knows VDrift in depth to decide what information is available to put in the API and how best to do so.

Anyway, I hope this has stirred interest in the idea & please forgive the length of this post Smile

regards,
locus
Reply


Messages In This Thread
An API for AI Drivers - by locus - 07-26-2006, 09:55 PM
RE: An API for AI Drivers - by jamse ales - 08-27-2020, 04:34 AM
RE: An API for AI Drivers - by ledam40306 - 09-15-2020, 09:28 AM
RE: An API for AI Drivers - by ledam40306 - 09-24-2020, 09:51 AM
RE: An API for AI Drivers - by jamse ales - Yesterday, 03:47 AM
RE: An API for AI Drivers - by ledam40306 - Yesterday, 08:01 AM
[No subject] - by thelusiv - 07-26-2006, 11:24 PM
[No subject] - by locus - 07-26-2006, 11:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)