Grand Theft Auto 5 is being used to test the AI of driverless cars.

As reported by Bloomberg, a startup called Nio is using Rockstar's chaotic open world title to rapidly test how its AI behaves under very specific conditions, with the hope of getting autonomous electric cars on the road by 2020.

Princeton University, Waymo (formerly the Google self-driving car project), Toyota, and software platform Universe are doing similar work.

Apparently GTA 5 is perfect for such trials because it generates data that’s very close to what AI cars get when out on the road, and is "the richest virtual environment that we could extract data from", according to Princeton University professor Alain Kornhauser.

The game contains 262 vehicles, 14 weather conditions, more than a thousand unpredictable NPCs, and things like traffic lights, bridges, intersections, and tunnels.

"Just relying on data from the roads is not practical," said Nio's Davide Bacchet.

"With simulation, you can run the same scenario over and over again for infinite times, then test it again."