Skip to main content

Solar System: Inside Project CARS' Galileo Engine

The Art Technology Of Project CARS

This is the latest in the series of articles about the art technology of games, in collaboration with the particularly handsome Dead End Thrills.

Grid 2 may have vandalised one for the sake of selling The Most Expensive Game Ever That Isn't This (£125,000 plus whatever it takes to scrape that grotesque livery off), but gaming's real answer to the BAC Mono is the hip, gorgeous, and ever so slightly mad Project CARS. With barely-legal performance for a game still in alpha, its exposed wishbones and dampers only add to the sense of crowdsourced cool. Mmmm, those naked springs.

I'm hesitant to use the word 'guts' in what's now basically a porn metaphor, but be warned: this is about the game's insides. Its parts. Maybe turn off your webcam if that's going to cause you problems.

Image-based lighting is key to pCARS' often photorealistic looks, a dynamically convolved cubemap driving its ambient lighting to avoid the flat, CG-like surfaces of mere mortal car games. But we're not going to talk about that because then we'd end up talking about everything, and I have to pick the kids up at 5. So, while we're on the subject of time...

The 'Galileo' lighting engine in pCARS - and by extension the game's day/night cycle and much of its weather - boasts accurate modelling of sun and moon positions based on the Astronomer's Almanac algorithm, and tested against data from NASA and the US weather agency. So says render and tools programmer Kevin Boland, who at one point had it simulating the planetary alignment of the solar system as well, "but even for us that was a little OTT.

"The initial brief was just a timecycle, day to night. Then Ian [Bell, cofounder and head of studio] started asking for some more features. And then more... and more... Soon the task from my point of view required a complete rethink. It became clear very early that we need to be as realistic as we possibly can. So our goal became to write something that we could grow as the expectations of the system got bigger and bigger."

The new model differs from more traditional weather simulation "in the same way chalk and cheese differs," he explains. "Before, we would try to model every scenario we could think of. We'd fixate upon what the game would look like going from sunny to thunderstorm, and trying to balance that. It was a nightmare as no matter what we did it never met our expectations, or a new requirement would come in."

A traditional time-of-day system might keyframe in changes in sky colour or atmospherics based on the clock, "but 12am in England is very different to 12am in California, and 7pm in July looks very different to 7pm in mid-winter," says art director Darren White. "It soon became clear that if we drove everything by sun elevation then these different dates and locations would almost sort themselves out."

Take Spa Francorchamps, for example, known in this game as 'Belgian Forest'. What pCARS wants to know about that are longitude, latitude, altitude, orientation to true north, time and date. In return it gives you the sun or moon's position in the sky, the phase of the moon, the temperature, and plenty more.

"Pretend the day doesn't work based on the 24hr clock, but on a 0-360 degree clock for the sun's altitude in the sky - you can key a lot of elements from that," says White. "For example, if the sun's at '0' it's at the horizon, so it's sunrise; '180' is sunset, and so on. From that we can set items like its colour, intensity, etc. It could drive things like weather and rain, too; the system is flexible enough for us to have wetter roads at night if we want, though most weather elements have one keyframe throughout the timecycle and the changes in weather come from blending between different conditions."

Anything else? Boland: "Sound is fun. Did you know that, based on your altitude and temperature, the density of air changes and thus how sound travels? I have all the code in for this. If you then factor in wind direction, we could have some pretty awesome stuff relating to sound. This actually came about because we needed to know the base temperatures for the tire modelling, which is again related to altitude of track, sun altitude, and then angle of refraction, giving the intensity of the sun for heat.

"In future we'll have a calculation for the season and then combine that with the weather conditions. The weather feeds in other elements to the physics systems, like water levels for the tires, amount of spray being thrown up, etc. What I'm saying is that our system allows us to model more effectively the chain reaction that happens. Not everything is driven by sun elevation but it's the theoretical starting point for almost all of it, just like in the real world."

Going purely on screenshots, this might seem to run counter to how pCARS often appears. Recently added lightning storms evoke the terrifying night races of Slightly Mad's Shift 2 Unleashed, where the game would become almost hyper-realistically tense. Elsewhere in pCARS you'll find dawns, dusks, coronas and refractions that occupy other edges of reality.

Adding to the confusion, there's often no telling where studio art direction stops and community input begins when it comes to those screenshots. pCARS comes with the TweakIt tool that grants full control over the weather system's many parameters. I use it all the time, commanding Mother Nature just like Sean Connery in that Avengers movie. At least I think there was an Avengers movie; remembering it just makes me black ou--

"There's no point in making a complex weather system if you don't push the weather to extremes," explains White. "It makes for more interesting visuals and more varied and challenging racing. We developed all the tools to make pretty much whatever weather conditions we wanted to, so I guess the more hyperrealistic visuals and more dramatic conditions like thick fog and torrential thunder storms came from us pushing the tools as far as we good.

"The community has driven the art direction and there was always a loud voice demanding realistic visuals, so we've pushed that as much as we can. Occasionally users post reference that is more extreme and hyperrealistic, such as anamorphic lens flares or Hollywood style post processed images, but the majority of the community tend to argue against that, preferring something that's more a recreation of what you'd see with your own eyes."

Those early adopters/players/testers - oglers? - of pCARS are used to being newly bowled over with every key update, the game really only competing with itself when it comes to DX11 motorsmut. And more is on its way. The team has started implementing fullscreen fog "but it won't work with MSAA in DX9," while arguments are being had over crepuscular (god-) rays, the angle, intensity and colour of which would involve sun elevation and possibly weather.

In the meantime, shots from recent pCARS builds can be found here, though you'll be better served by the official community galleries. I'd have more but my graphics cards, like the famously rectangular Icarus, flew too close to the sun over Bathurst.

Game and developer can be followed on Twitter.

Read this next