Drafting in GPL - a more detailed explanation

Discussion and releases for the 1998 racing simulation by Sierra/Papyrus
Post Reply
User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 42152
Joined: 20 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Car(s) Currently Owned: Mitsubishi Lancer Evo X JDM
Contact:

Drafting in GPL - a more detailed explanation

#1

Post by PTRACER »

Since I've been receiving some questions about this lately, I thought I would try to crack the code and really understand what is going on inside GPL to produce the draft effect.

I have written about this in detail in the document below:

Download: [ SlipstreamingInGPL.pdf ]
mcmirande
New Member
New Member
Posts: 35
Joined: 2 years ago
Real Name: Marcos Mirande
Favourite Motorsport: Formula 1
Favourite Racing Car: Renault RE30
Favourite Driver: Alain Prost
Favourite Circuit: Too many...
Car(s) Currently Owned: Renault Duster
Location: San Pablo, Tucumán, Argentina
Contact:

#2

Post by mcmirande »

Thanks for all these explanations!
User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 42152
Joined: 20 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Car(s) Currently Owned: Mitsubishi Lancer Evo X JDM
Contact:

#3

Post by PTRACER »

You're welcome Marcos!

Some more testing has revealed some new information:

1. Being slipstreamed can actually give the car ahead a slight boost. This is usually seen in (real life) NASCAR, where close drafting removes some drag/downforce off the rear of the car in front, increasing its speed. The same can occur in GPL, but the effect is slight.

In vanilla GPL, you're looking at <2mph boost at 188mph @ zero distance, but it can still be as much as 1mph with a distance of 10 metres.

In the mods, the same effect is stretched over a much greater difference, and you can give the car ahead a 1mph speed boost from 145 metres away.

------------------------

2. The below is totally wrong. The code is actually for bump drafting! And it only seems to activate when the cars are physically touching each other, with leads me to believe slipstream distance is measured between collision boxes rather than from each car's centrepoint. In default GPL and all mods, the effect is almost negligible.

-̶ ̶I̶n̶ ̶t̶h̶e̶ ̶g̶p̶l̶_̶a̶i̶.̶i̶n̶i̶ ̶f̶i̶l̶e̶ ̶y̶o̶u̶ ̶w̶i̶l̶l̶ ̶f̶i̶n̶d̶ ̶t̶h̶e̶ ̶f̶o̶l̶l̶o̶w̶i̶n̶g̶ ̶v̶a̶l̶u̶e̶.̶ ̶I̶ ̶[̶i̶]̶b̶e̶l̶i̶e̶v̶e̶[̶/̶i̶]̶ ̶t̶h̶a̶t̶ ̶i̶f̶ ̶y̶o̶u̶ ̶w̶a̶n̶t̶ ̶y̶o̶u̶r̶ ̶A̶I̶ ̶t̶o̶ ̶p̶a̶s̶s̶ ̶e̶a̶c̶h̶ ̶o̶t̶h̶e̶r̶ ̶b̶e̶t̶t̶e̶r̶ ̶w̶i̶t̶h̶ ̶s̶l̶i̶p̶s̶t̶r̶e̶a̶m̶i̶n̶g̶,̶ ̶t̶h̶e̶ ̶b̶e̶l̶o̶w̶ ̶v̶a̶l̶u̶e̶ ̶s̶h̶o̶u̶l̶d̶ ̶b̶e̶ ̶h̶i̶g̶h̶e̶r̶ ̶t̶h̶a̶n̶ ̶t̶h̶e̶ ̶o̶n̶e̶ ̶i̶n̶ ̶t̶h̶e̶ ̶s̶l̶i̶p̶s̶t̶r̶e̶a̶m̶ ̶c̶o̶d̶e̶,̶ ̶b̶u̶t̶ ̶t̶h̶i̶s̶ ̶i̶s̶ ̶t̶o̶t̶a̶l̶l̶y̶ ̶u̶n̶t̶e̶s̶t̶e̶d̶.̶ ̶A̶t̶ ̶0̶.̶3̶5̶m̶ ̶(̶a̶s̶ ̶i̶n̶ ̶m̶i̶n̶e̶)̶,̶ ̶i̶t̶ ̶i̶s̶ ̶t̶o̶o̶ ̶l̶o̶w̶.̶ ̶0̶.̶5̶ ̶o̶r̶ ̶s̶o̶ ̶s̶h̶o̶u̶l̶d̶ ̶d̶o̶ ̶t̶h̶e̶ ̶t̶r̶i̶c̶k̶.̶ ̶ ̶

Code: Select all

passee_dlong_sep_coeff = 0.35      		; modifies desired dlong sep. when tailing designated passee
------------------------

3. The slipstream box does not have a height - only a length and width. If the car ahead goes down a hill or into a dip, the slipstream strength will remain the same.
Developer of the 1967v3 Historic Mod for Grand Prix Legends: viewtopic.php?t=17429

King of the Race Track, Destroyer of Tyres, Breaker of Lap Records
User avatar
MonteCristo
Moderator
Moderator
Posts: 10713
Joined: 8 years ago
Favourite Motorsport: Openwheel
Favourite Racing Car: Tyrrell P34/Protos
Favourite Driver: JV
Favourite Circuit: Road America
Location: Brisbane, Australia

#4

Post by MonteCristo »

Does it not blow your mind that GPL - developed some 25 years ago now - had all that complexity under the hood of a computer game?
Oscar Piastri in F1! Catch the fever! Vettel Hate Club. Life membership.

2012 GTP Non-Championship Champion | 2012 Guess the Kai-Star Half Marathon Time Champion | 2018 GTP Champion | 2019 GTP Champion
mcmirande
New Member
New Member
Posts: 35
Joined: 2 years ago
Real Name: Marcos Mirande
Favourite Motorsport: Formula 1
Favourite Racing Car: Renault RE30
Favourite Driver: Alain Prost
Favourite Circuit: Too many...
Car(s) Currently Owned: Renault Duster
Location: San Pablo, Tucumán, Argentina
Contact:

#5

Post by mcmirande »

Thanks Paul!

do you know how is the draft when cornering? I mean, in fast corners, the boost area is still square? I don't know how it should be either in real racing...

Cheers, Marcos
User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 42152
Joined: 20 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Car(s) Currently Owned: Mitsubishi Lancer Evo X JDM
Contact:

#6

Post by PTRACER »

mcmirande wrote: 2 years ago Thanks Paul!

do you know how is the draft when cornering? I mean, in fast corners, the boost area is still square? I don't know how it should be either in real racing...

Cheers, Marcos
Unfortunately there's no code to rotate the 'box' independently of the car, or warp it as it goes around a corner. If the car is at a 45 degree angle, the slipstream will also be projected at a 45 degree angle. Something like this (sorry for the terrible drawing!)

Image

In real life, the slipstream should follow the car in the same way the wake follows behind a boat or jet ski:

Image
Developer of the 1967v3 Historic Mod for Grand Prix Legends: viewtopic.php?t=17429

King of the Race Track, Destroyer of Tyres, Breaker of Lap Records
LasseA
New Member
New Member
Posts: 20
Joined: 2 years ago
Real Name: Lasse Albrecht
Favourite Motorsport: Racing
Favourite Racing Car: Engined Car

#7

Post by LasseA »

Big time thanks Paul for all this valuable info!

So the 26 meters towing distance claimed on SRMZ actually seems to be right, that's how max towing distance at normally achievable speeds in vanilla GPL always seemed to be 30 meters on Pribluda. I've always been wondering how exactly I am supposed to follow a car in GPL when my goal is to achieve max slipstream... So I guess in the SRMZ mods, taking wider lines could sometimes pay off to keep the tow better.

Thinking about collision boxes, you said that the collision boxes seem to be about 4.3 meters long. The only 67 car of which I could quickly find out the length info of is the L49, and it is billed as 4026 mm long.

1. Wouldn't the collision box for the 49 be too long then (if we're assuming that the Papy L49 is modeled correctly 3DO-wise)? In the context of GPL netcode, doesn't this make online wheel-to-wheel-racing harder (than it should be)? I suppose it might be a bit longer also to avoid texture glitches...

2. Do the 7 Papy 67 chassis have different collision boxes? I never doubted that they would have that until now. Do mods have that?
mcmirande
New Member
New Member
Posts: 35
Joined: 2 years ago
Real Name: Marcos Mirande
Favourite Motorsport: Formula 1
Favourite Racing Car: Renault RE30
Favourite Driver: Alain Prost
Favourite Circuit: Too many...
Car(s) Currently Owned: Renault Duster
Location: San Pablo, Tucumán, Argentina
Contact:

#8

Post by mcmirande »

PTRACER wrote: 2 years ago
mcmirande wrote: 2 years ago Thanks Paul!

do you know how is the draft when cornering? I mean, in fast corners, the boost area is still square? I don't know how it should be either in real racing...

Cheers, Marcos
Unfortunately there's no code to rotate the 'box' independently of the car, or warp it as it goes around a corner. If the car is at a 45 degree angle, the slipstream will also be projected at a 45 degree angle. Something like this (sorry for the terrible drawing!)

Image

In real life, the slipstream should follow the car in the same way the wake follows behind a boat or jet ski:

Image
Thanks Paul! I imagined both the situation in GPL and how the draft is in real life

Cheers, Marcos.
User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 42152
Joined: 20 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Car(s) Currently Owned: Mitsubishi Lancer Evo X JDM
Contact:

#9

Post by PTRACER »

LasseA wrote: 2 years ago Big time thanks Paul for all this valuable info!

So the 26 meters towing distance claimed on SRMZ actually seems to be right, that's how max towing distance at normally achievable speeds in vanilla GPL always seemed to be 30 meters on Pribluda. I've always been wondering how exactly I am supposed to follow a car in GPL when my goal is to achieve max slipstream... So I guess in the SRMZ mods, taking wider lines could sometimes pay off to keep the tow better.

Thinking about collision boxes, you said that the collision boxes seem to be about 4.3 meters long. The only 67 car of which I could quickly find out the length info of is the L49, and it is billed as 4026 mm long.

1. Wouldn't the collision box for the 49 be too long then (if we're assuming that the Papy L49 is modeled correctly 3DO-wise)? In the context of GPL netcode, doesn't this make online wheel-to-wheel-racing harder (than it should be)? I suppose it might be a bit longer also to avoid texture glitches...

2. Do the 7 Papy 67 chassis have different collision boxes? I never doubted that they would have that until now. Do mods have that?
No worries!

I think Richard claimed 35m for the original GPL, but it's not possible unless he modded his EXE. All other values are also 9 or 10m out so it's possible he purposely published them that way.

In the mods, I would say it's still far more beneficial to follow the actual racing line in the corners, but if there is an AI car say, 30, 40 metres ahead, try to follow their line as precisely as possible for that boost of acceleration. It's probably most helpful exiting slow corners that lead into long straights, but I can think of plenty of other places that would benefit you too, like say the wiggly bit of track after the Karussel.

I think I may have got myself confused when calculating the size of the collision boxes, sorry. It looks like they are 3.3 metres long, not 4.3. And all are identical in original GPL. The mod collision boxes are all slightly different, but only a few centimetres difference here and there, mostly around the nose/gearbox area. I guess the GPLEA 3DOs used in the mods must be slightly bigger than Papy's 3DOs, because even with modified collision boxes, I noticed the noses/gearboxes of the 67X cars were still warping through the barriers/ground during crashes. I'm making them longer for 67v3 (Lotus 49 is now 3.6m long for example, with no collision on the exhaust pipes).

I still can't account for the 4-5 metre difference between Prib and GPL internally though, maybe Olaf Lehmann could answer that.
Developer of the 1967v3 Historic Mod for Grand Prix Legends: viewtopic.php?t=17429

King of the Race Track, Destroyer of Tyres, Breaker of Lap Records
User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 42152
Joined: 20 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Car(s) Currently Owned: Mitsubishi Lancer Evo X JDM
Contact:

#10

Post by PTRACER »

PTRACER wrote: 2 years ago I still can't account for the 4-5 metre difference between Prib and GPL internally though, maybe Olaf Lehmann could answer that.
And now I can, so my knowledge of the slipstream physics is basically complete.

I have updated the first post with all newly found information and uploaded as a PDF. As an addition I have made a full analysis the mod team's slipstream model and why I disagree with it.

Next GPL topic will be on tyres!
Developer of the 1967v3 Historic Mod for Grand Prix Legends: viewtopic.php?t=17429

King of the Race Track, Destroyer of Tyres, Breaker of Lap Records
LasseA
New Member
New Member
Posts: 20
Joined: 2 years ago
Real Name: Lasse Albrecht
Favourite Motorsport: Racing
Favourite Racing Car: Engined Car

#11

Post by LasseA »

Slipstreaming had always been an interesting and important aspect in GPL racing for me... Hence why I absolutely can't wait for tyres!
simfan-777
New Member
New Member
Posts: 3
Joined: 1 year ago

#12

Post by simfan-777 »

Thanks for posting this Paul, very interesting.

Regarding your comment "Unfortunately there's no code to rotate the 'box' independently of the car, or warp it as it goes around a corner", I think there's an important point about how GPL works that you have not yet factored into your thinking.

GPL uses two Cartesian coordinate systems internally:

1) An absolute coordinate system locked to GPL's world. This is best thought of as equivalent to latitude/longitude or a map grid in the real world.

2) A relative coordinate system whose major axis follows exactly the track centreline. The other axis is arranged normal (at right angles) to the track centre line. This is a warped coordinate system. This system is locked to the track driven, with the origin placed at the centre of the start/finish line. One end of the system is joined to the other end at the start/finish line, so it is a closed loop with regard to the major axis.

The positions of cars in GPL are tracked using both of these coordinate systems, but slipstream calculations in GPL use a derivation of system 2.

The system 2 derivation (let's call it system 2B) follows the leading car around the track with its origin fixed to the car. As the leading car moves left or right of the track centre line, system 2B is shifted laterally relative to system 2 and that adjustment is seen instantly by the following car. At any point in time, the slipstream calculation for the following car uses system 2B to determine where it is within the leading car's slipstream. This approach was key to the sim developers achieving a simple, practical slipstream implementation. So, instead of thinking of the slipstream as sitting within a regular rectangle as you have drawn it, think of it as fitting into a warped rectangle that follows the car and the track.

This implementation probably also involves one crucial further simplification. The code that models the weakening of the slipstream with distance likely takes no account of path curvature, i.e. how tight a cornering line the track and car are following, probably because the effect of path curvature on slipstream is very difficult to model empirically. As a result, the more rapid weakening of slipstream that naturally takes place in turns is most likely not reflected in the sim, therefore compromising the fidelity of slipstream modelling for twisty tracks or track sections. This increased rate of weakening in real life is broadly a result of the slipstream air mass moving tangential to the track under cornering, in accordance with Newton's first law of motion, and thereby spreading outside the track. That's a simplification of the actual physics involved, but it's a dominant effect.

The key to understanding all of this is in the quantity you refer to as Dlat. That distance is measured along a line placed normal to the track centre line, i.e. it is measuring lateral distance in coordinate system 2B. GPL uses the same approach for all relative positional calculations, both for cars relative to the track (using system 2) and cars relative to each other for slipstream modelling purposes (using system 2B).

I hope this is helpful information. Please PM me if you need any more.
simfan-777
New Member
New Member
Posts: 3
Joined: 1 year ago

#13

Post by simfan-777 »

To expand a little, the only warping is a result of track curvature. The only effect of the car movement is the lateral shifting of coordinate system 2B. You will not necessarily see coordinates for both systems 2 and 2B persisted in variables. Any calculations that utilise system 2B may be derived always on the fly from system 2, including both the lateral shifting and the shifting relative to track start. The key to it all is the track centreline, of that I am fairly certain.
Post Reply