Magic Data Discussion

Posted by TomMK 
Re: Magic Data Discussion
Date: September 29, 2018 07:00AM
Posted by: mralpha
Thank you. I get it. That's why, sometimes, even the engine sound is distorted and does not correspond to downshifts etc .. All this because I did not explain how in the Monza finish line the car did not touch more than 299 km / h, when it must be very faster. I downloaded some of your performance files to see if we could understand each other better. Thanks again.
Re: Magic Data Discussion
Date: December 14, 2018 12:21AM
Posted by: SDI
TheFueleffect Schreef:
-------------------------------------------------------
> I tested several failure rates with the no chicane
> version of Silverstone 2001, but the results were
> pretty random. Definitely need more testing to
> hopefully understand the mechanics behind these
> values.
>
> Any new insights?
> I must say I've never understood the way these
> failure rates worked. I've always assumed higher
> values means higher failure rate, but that appears
> not to be the case.

The values are probabilities and they are relative to each other. Also, 630 will be added to each, so even if you use 0, it still has a chance to occur. I think the total sum should not go beyond 131080.
If a failure will occur for a car (this is determined randomly before the race), then it will pick a failure based on the relative probabilities. So the higher the value, the higher the probability that failure will be the one to occur (a car will never have more than 1 failure).

By the way, is there a latest version of all the magic data values and their meaning somewhere? Is it the list posted by Atticus? Because I might have some more info about the magic values by now (I stopped following this thread years ago).

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Magic Data Discussion
Date: December 14, 2018 03:49AM
Posted by: TomMK
René - there isn't one - we need to go through all the discoveries that have been recorded in this thread (and maybe others) and create one. I'll put it on my todo list.

=====================================================


Intel NUC 8i3, 8GB RAM, MS Sidewinder Wheel
Re: Magic Data Discussion
Date: December 14, 2018 07:24AM
Posted by: kedy89
SDI schrieb:
-------------------------------------------------------
> TheFueleffect Schreef:
> --------------------------------------------------
> -----
> > I tested several failure rates with the no
> chicane
> > version of Silverstone 2001, but the results
> were
> > pretty random. Definitely need more testing to
> > hopefully understand the mechanics behind these
> > values.
> >
> > Any new insights?
> > I must say I've never understood the way these
> > failure rates worked. I've always assumed
> higher
> > values means higher failure rate, but that
> appears
> > not to be the case.
>
> The values are probabilities and they are relative
> to each other. Also, 630 will be added to each, so
> even if you use 0, it still has a chance to occur.
> I think the total sum should not go beyond
> 131080.
> If a failure will occur for a car (this is
> determined randomly before the race), then it will
> pick a failure based on the relative
> probabilities. So the higher the value, the higher
> the probability that failure will be the one to
> occur (a car will never have more than 1
> failure).
>
> By the way, is there a latest version of all the
> magic data values and their meaning somewhere? Is
> it the list posted by Atticus? Because I might
> have some more info about the magic values by now
> (I stopped following this thread years ago).


Was looking for info on this for ages, thanks! Always had wondered why cars had failures that were set to 0 in the md. How does the cof in the perfs come to play in that regard? Since I've seen cars having a failure despite the perf value being 0, I assume there's also a fixed value added to that?


Do you know if there's any meaning behind the values that are used? The original mds use these
0
744
1489
2234
2978
3723
4468


The latest info on md values is the list posted by Atticus I think.




Some mods
F1 1996 | F1 2002 | F1 2007 | F1 2011 | F1 2013 | F1 2015 | F1 2018
Re: Magic Data Discussion
Date: December 14, 2018 10:23AM
Posted by: SDI
There's no further meaning to them. Perhaps they were calculated from actual failure rates in the real F1 season. Else they are just arbitrary.

The retirement chance for each team in the perf file is used to determine IF the car will fail. Remember that this is done ONCE for each car BEFORE (!) the race. Only if the car will have a failure, it determines in which lap and segment it will occur, and also determines what kind of failure it will be using these relative probabilities in the magic data. It loops through the probabilities and adds them up, also adding 630 extra each time. Then it takes a random number that is lower than this sum. Then it will do the same loop again, adding up the values and also adding 630 like before, but stops the loop when the random number is smaller than the intermediate sum.

This 630 value can be changed in the executable, 32-bit value at offset 0x22241c in the decrypted GP4 1.02.

René Smit, Independent Software Developer.
Download my GPx tools here.



Edited 2 time(s). Last edit at 12/14/2018 11:02AM by SDI.
Re: Magic Data Discussion
Date: December 14, 2018 03:15PM
Posted by: SDI
Here are some remarks from me regarding the latest descriptions in the list Atticus posted. I might have more later.

> desc73='rail-line' length at the start (a segment nr before which flag 0x80 in car.flags_ce is not cleared)
Confirmed. I'm calling it formation duration (in segments), but rail-line length sounds good too. The old description ("a segment nr before which flag 0x80 in car.flags_ce is not cleared";) is true (I think it came from me) but an irrelevant implementation detail by now.

> desc74=laptime (e. g. 70800 equals 1:10.800)
Indeed a lap time. I call it a lap time indication, and it's used to determine the hotseat turn duration, number of runners in non-race sessions, and some other things.
It is also used in relation to the CC crossover point (desc77).

> desc75=laptime finetune (+/-1000 equals +/- 1.0)
This is a real-time factor, but it is in relation to the lap time indication (desc74) as follows:
real-time factor = desc74 / (desc74 + desc75)
So negative should speed up the time, positive should make it slower.

> desc76=????? - helps decide if a tyre set needs changing? (dw)
This is indeed related to cc crossover point (desc77)

> desc79=????? - segment nr (start of some range) related to pit in/out
Number of segments from the start of the pits. Related to determining surface type under car.

> desc80=????? - segment nr (end of some range) related to pit in/out
Number of segments from the end of the pits (so higher means TOWARDS the start of the pits!). Related to determining surface type under car.

> desc81=????? - cc race grip? (another perf factor)
This is similar to desc63 and desc64. There's a chance desc63 and desc64 are not used (higher chance on lower opposition level), and desc81 is used instead. A value of 256 means 1.0.

> desc82=????? - unk (dw) player wet?
Not sure what it is exactly, but it is a time duration (ms), used when the car is not in the pits, though it is related to the pits.
Could be something like an indication for the pitcrew to come out, but that's a very wild guess.

> desc83=????? - unk (dw) player grip?
This should be the segment where the player car starts in quicklaps mode.

> desc90='handbrake' (at -312)
Seems to be a lateral offset from the pitbox.

> desc96..desc101
These seem to be tyre wear factors for each tyre type.

> desc126..desc133
As explained already, these failure type chances are relative to each other. The sum is always 100%. The game adds 630 to each value before adding them up. Maximum sum 131080.
If a car gets a failure at all, is determined per team (what you edit in the performance file), before it determines the failure type. , before the race. The lap and track location too.

> desc134..desc137
These values are part of the bump table but not used.

René Smit, Independent Software Developer.
Download my GPx tools here.



Edited 1 time(s). Last edit at 12/14/2018 03:17PM by SDI.
Re: Magic Data Discussion
Date: December 14, 2018 08:37PM
Posted by: kedy89
SDI schrieb:
-------------------------------------------------------
> There's no further meaning to them. Perhaps they
> were calculated from actual failure rates in the
> real F1 season. Else they are just arbitrary.
>
> The retirement chance for each team in the perf
> file is used to determine IF the car will fail.
> Remember that this is done ONCE for each car
> BEFORE (!) the race. Only if the car will have a
> failure, it determines in which lap and segment it
> will occur, and also determines what kind of
> failure it will be using these relative
> probabilities in the magic data. It loops through
> the probabilities and adds them up, also adding
> 630 extra each time. Then it takes a random number
> that is lower than this sum. Then it will do the
> same loop again, adding up the values and also
> adding 630 like before, but stops the loop when
> the random number is smaller than the intermediate
> sum.
>
> This 630 value can be changed in the executable,
> 32-bit value at offset 0x22241c in the decrypted
> GP4 1.02.


Thanks a lot for the info! Thought I've seen cars having a failure despite perf value being 0 before, guess I mixed some things up then.


Is there any hint at a value determining how long it takes the pitcrew to come back out again when cars are double-stacked? Happens occasionally in changing conditions, or when cars have to pit for damage repair.




Some mods
F1 1996 | F1 2002 | F1 2007 | F1 2011 | F1 2013 | F1 2015 | F1 2018
Re: Magic Data Discussion
Date: December 14, 2018 09:16PM
Posted by: SDI
kedy89 wrote:
-------------------------------------------------------
> Thanks a lot for the info! Thought I've seen cars
> having a failure despite perf value being 0
> before, guess I mixed some things up then.

Must have been an engine failure. It's still possible to overheat the engine, independent of the failure probabilities etc.

> Is there any hint at a value determining how long
> it takes the pitcrew to come back out again when
> cars are double-stacked? Happens occasionally in
> changing conditions, or when cars have to pit for
> damage repair.

Not that I know of. How long does it take right now?

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Magic Data Discussion
Date: December 14, 2018 10:17PM
Posted by: Noog
What a great thread this is. A gem on every page. Thanks to everyone.

SDI Wrote:
-------------------------------------------------------
snip...
> > desc74=laptime (e. g. 70800 equals 1:10.800)
> Indeed a lap time. I call it a lap time
> indication, and it's used to determine the hotseat
> turn duration
, number of runners in non-race
> sessions, and some other things.
...snip

Ah. So that's how that's done! I tend to drive two cars twice and it always bugs me when certain circuits swap me over to the second car (2nd session) just before the flag. I knew it was in the magic data somewhere (after I had copied and pasted bits from other MD files) but I never thought to try that specifically.

Brilliant René. Your in-depth under-the-hood knowledge of this game is remarkable, but could you answer a little question please?

SDI Wrote:
-------------------------------------------------------
snip...
> desc73='rail-line' length at the start (a segment nr before which flag 0x80 in car.flags_ce is not cleared)
Confirmed. I'm calling it formation duration (in segments), but rail-line length sounds good too. The old description ("a segment nr before which flag 0x80 in car.flags_ce is not cleared";) is true (I think it came from me) but an irrelevant implementation detail by now....snip

I never understood the 'rail-length' explanation, but I'm afraid I don't understand the 'formation duration' explanation either. I suspect I would understand if I had made more progress with track building, but it's the one thing I have no idea about, so in the meantime, could you elaborate further please?

Thanks.
Re: Magic Data Discussion
Date: December 14, 2018 10:31PM
Posted by: SDI
Imagine the cars starting in Mexico on the long straight towards the first corner. If they all have more or less the same reaction time (this is randomized), they will stay in the 2 by 2 grid formation for a short time (to maximize the slipstream from the car in front, or whatever). This is the rail-line length. After that you will start to see them swerving left/right to overtake and take position for the first corner. So this value should be higher on tracks like Mexico, because the first corner is so far ahead.

If you set the rail-line length greater than or equal to the number of track segments, they will hold their horizontal starting grid position forever. You can easily try this out. I tried it out in F1GP (I've been working on this lately), it already had this magic value, and they could even drive quickly through corners using this unconventional line. Not sure how that is in GP4 :)

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Magic Data Discussion
Date: December 15, 2018 12:28AM
Posted by: landex
What means cmagic nr.73: "In-line Cars Start Range ?"?
Re: Magic Data Discussion
Date: December 15, 2018 12:46AM
Posted by: Noog
Got it. Thanks very much.

Might I ask another question please? I'm sure if it's on-topic or not, but it might be...

I'm currently refining a set of substantial revisions to PRBlanco's Performance Calculator spreadsheet which cover the F1 years from 1978-1991. Each uses real-world GP results to generate unique and highly accurate perf. files for each race in each season but it allows the user to easily tweak various characteristics to introduce more randomness (or even outright bias) in relation to each team, car and driver (i.e. it creates automatically the longer form perf. file that allows for car-specific, as opposed to team-specific, failure rates and/or car power factors).

It works really well for me, in the sense that it produces a number of unexpected results in any given season, especially in qualifying. But when you play the season ten times over or so the composite result mirrors the original real-world Driver and Constructor Championship results extremely closely. That said, I'm finding it a real challenge to make it usable for people less familiar with Excel than I, but i hope that makes sense in principle and that someone other than me think it might be a worthwhile project too.

Anyway, my question is this.

What would be the best way to replicate, let's say for arguments sake, the early Andrea de Cesaris (RIP) phenomenon, i.e. a very quick driver who tends to make somewhat reckless mistakes, compared to a less dynamic, but more reliable old workhorse like Alain Prost, for example. At the moment I tend to increase the failure probability of de Cesaris's car (and increase his qual range and race range stats) and this does the job, but I wonder is there a better way to simulate (what would you call it), hot-headedness? Is there some kind of driver specific aggression factor anywhere?

(No offense to de Cesaris or Prost fans by the way!).



Edited 1 time(s). Last edit at 12/15/2018 12:49AM by Noog.
Re: Magic Data Discussion
Date: December 15, 2018 12:53AM
Posted by: SDI
landex Schreef:
-------------------------------------------------------
> What means cmagic nr.73: "In-line Cars Start
> Range ?"?

That's rail-line length as explained above.

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Magic Data Discussion
Date: December 15, 2018 12:54AM
Posted by: SDI
@Noog: I think that's a good question, but probably off topic. Seems more related to performance files.

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Magic Data Discussion
Date: December 15, 2018 01:26AM
Posted by: Noog
My workaround is probably all that can be done then I guess.

Thanks again and keep up the great work: GPxPatch especially is fundamental to the longevity of this game IMHO.
Re: Magic Data Discussion
Date: December 15, 2018 09:09PM
Posted by: SDI
@Noog Thanks. Regarding a driver specific aggression factor there might be more we can do. Can you repost your question in a new thread?

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Magic Data Discussion
Date: December 17, 2018 01:43AM
Posted by: SDI
Some more info:

> desc51=cc aggressiveness (added to car.field_108. related to cc grip factor, 32769 low, 65536 & 0 mid, 32768 high)
> desc52=cc aggressiveness finetune

Like desc63 and desc64, seems to be more like a min/max range for a random value, though not entirely.

> desc65=cc error chance (some chance. same chance multiplied with race perc.)

Seems to be in the same league as cc aggressiveness. No further details.

> desc84=black flag penalty

This duration must be between 10000 and 30000 ms.

> desc49=????? - subtracted from diff between field_e2 of 2 cars and then compared to speed of first car

Has anyone found if this is related to slipstreaming or overtaking?

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Magic Data Discussion
Date: January 09, 2019 03:54AM
Posted by: TomMK
I've updated the list of descriptions using the recent work by Atticus and René. This is a sample Magic Data set for Melbourne.

[GP4 magic file]

18          ; desc1= Front wing [CC dry setup]
18          ; desc2= Rear wing
21          ; desc3= 1st gear
28          ; desc4= 2nd
35          ; desc5= 3rd
42          ; desc6= 4th
49          ; desc7= 5th
56          ; desc8= 6th
20          ; desc9= Front wing [CC wet setup]
20          ; desc10= Rear wing
19          ; desc11= 1st gear
26          ; desc12= 2nd
33          ; desc13= 3rd
40          ; desc14= 4th
47          ; desc15= 5th
54          ; desc16= 6th
18          ; desc17= Front wing [Player dry setup]
18          ; desc18= Rear wing
21          ; desc19= 1st gear
28          ; desc20= 2nd
35          ; desc21= 3rd
42          ; desc22= 4th
49          ; desc23= 5th
56          ; desc24= 6th
5688        ; desc25= Dry brake balance
19          ; desc26= Front wing [Player wet setup]
20          ; desc27= Rear wing
19          ; desc28= 1st gear
26          ; desc29= 2nd
33          ; desc30= 3rd
40          ; desc31= 4th
47          ; desc32= 5th
54          ; desc33= 6th
5738        ; desc34= Wet brake balance
54          ; desc35= Softer tyre [52 Hard, 53 Medium, 54 Soft, 55 Supersoft]
53          ; desc36= Harder tyre [52 Hard, 53 Medium, 54 Soft, 55 Supersoft]
100         ; desc37= >= 50 AI chooses softer tyre, otherwise harder
16384       ; desc38= 
16384       ; desc39= 
16384       ; desc40= 
16384       ; desc41= 
16300       ; desc42= Track grip
16384       ; desc43= 
16384       ; desc44= 
24          ; desc45= Drag - top speed only affected, minimal effect in corners (17 - 31)
1014        ; desc46= Player-only downforce and drag
16930       ; desc47= Engine power output - e.g. altitude simulation? Affects acceleration
4891        ; desc48= Fuel per lap - see also desc70/71
384         ; desc49= Slipstream? Some distance in feet that is subtracted from the distance between 2 cars. This is then compared to the speed (?) of one of the cars (the one behind), and if the speed is less, something is triggered. Not sure what that something is. Player only??
16788       ; desc50= Player tyre wear factor - see also desc72
64768       ; desc51= CC aggressiveness min - now configurable in GPxPatch 4.50 (added to car.field_108. related to cc grip factor, 32769 low, 65536 & 0 mid, 32768 high)
512         ; desc52= CC aggressiveness max - now configurable in GPxPatch 4.50
490         ; desc53= [Ace] CC power factor
520         ; desc54= [Ace) CC grip factor
487         ; desc55= [Pro] CC power factor
510         ; desc56= [Pro] CC grip factor pro
485         ; desc57= [Semi-Pro] CC power factor
500         ; desc58= [Semi-Pro] CC grip factor
483         ; desc59= [Amateur] CC power factor
485         ; desc60= [Amateur] CC grip factor
480         ; desc61= [Rookie] CC power factor
470         ; desc62= [Rookie] CC grip factor
512         ; desc63= CC random performance range min
2048        ; desc64= CC random performance range max
32          ; desc65= CC error chance - now configurable in GPxPatch 4.52
4           ; desc66= CC recovery sectors
2           ; desc67= Sectors to pit-in begin
19          ; desc68= Sectors to pit-out end
20480       ; desc69= Pre-pit speed limit
11735       ; desc70= Fuel consumption Player
10904       ; desc71= Fuel consumption CC
4197        ; desc72= Tyre wear
48          ; desc73= Track sector after which AI cars stop being cautious on 1st lap
86890       ; desc74= Hotseat turn duration - e.g. 70800 equals 1:10.800
0           ; desc75= Hotseat turn finetune - +/-1000 equals +/- 1.0
15400       ; desc76= Helps decide if a tyre set needs changing? (dry to wet / wet to dry) - higher values = quicker reaction
21000       ; desc77= Same as above? (dry to wet, wet to dry)
25          ; desc78= Rain chance
6           ; desc79= Segment nr (start of some range) related to pit in/out. Related to determining surface type under car.
6           ; desc80= Segment nr (end of some range) related to pit in/out. Number of segments from the end of the pits (so higher means TOWARDS the start of the pits!). Related to determining surface type under car.
256         ; desc81= CC race grip (always 256)
20000       ; desc82= A time duration (ms), used when the car is not in the pits, though it is related to the pits.
136         ; desc83= Segment where the player car starts in quicklaps mode
10000       ; desc84= Black Flag penalty (ms) (must be between 10000 - 30000)
2048        ; desc85= Black Flag severity (1024=80kph)
240         ; desc86= (Wet) CC engine mapping (higher, more detuned)
115         ; desc87= (Wet) CC tyre wear and grip factor (higher, more)
110         ; desc88= (Wet) CC tyre wear factor (lower, more)
13          ; desc89= (Wet) CC grip factor (lower, more)
0           ; desc90= "Handbrake". Stop car moving in garage? Seems to be a lateral offset from the pitbox.
1814        ; desc91= Car depth in garage (Player car)
896         ; desc92= Car depth in garage (AI cars)
0           ; desc93= Car orientation in garage 
0           ; desc94= Pitstop stall depth from pitlane (Player + AI)
0           ; desc95= Pitstop stall depth from pitlane (Player + AI) finetune
16384       ; desc96= These seem to be tyre wear factors for each tyre type (always 16384?)
16384       ; desc97= These seem to be tyre wear factors for each tyre type (always 16384?)
16384       ; desc98= These seem to be tyre wear factors for each tyre type (always 16384?)
16384       ; desc99= These seem to be tyre wear factors for each tyre type (always 16384?)
16384       ; desc100= These seem to be tyre wear factors for each tyre type (always 16384?)
16384       ; desc101= These seem to be tyre wear factors for each tyre type (always 16384?)
44          ; desc102= pitstop group 1 %
23          ; desc103= stop 1
12          ; desc104= pit window 1
0           ; desc105=
0           ; desc106=
0           ; desc107=
0           ; desc108=
0           ; desc109=
29          ; desc110= pitstop group 2 %
15          ; desc111= stop 1
8           ; desc112= pit window 1
34          ; desc113= stop 2
8           ; desc114= pit window 2
0           ; desc115=
0           ; desc116=
0           ; desc117=
27          ; desc118= pitstop group 3 %
11          ; desc119= stop 1
6           ; desc120= pit window 1
26          ; desc121= stop 2
6           ; desc122= pit window 2
40          ; desc123= stop 3
6           ; desc124= pit window 3
0           ; desc125=
744         ; desc126= failure chance : suspension
744         ; desc127= failure chance : loose wheel
1488        ; desc128= failure chance : puncture
2488        ; desc129= failure chance : engine
1488        ; desc130= failure chance : transmission
744         ; desc131= failure chance : oil leak / water leak
744         ; desc132= failure chance : throttle / brake
1488        ; desc133= failure chance : electrics
16384       ; desc134= 
16384       ; desc135= 
16384       ; desc136= 
16384       ; desc137= 
19968       ; desc138= bump factor
13          ; desc139= bump shift

[bumptable]

41,1
73,0
274,1
293,0
329,2
361,0
864,2
880,0

=====================================================


Intel NUC 8i3, 8GB RAM, MS Sidewinder Wheel



Edited 1 time(s). Last edit at 01/09/2019 04:26AM by TomMK.
Re: Magic Data Discussion
Date: January 09, 2019 04:26AM
Posted by: landex
Real nice, Tom! Thanks

Other thing: Does the bumps do any significant effect? I try all from 0 to 3, the car vibration feels all same.
Re: Magic Data Discussion
Date: January 09, 2019 08:24AM
Posted by: RHill
Can I just confirm for the cc aggressiveness min and max values...

When talking about the minimum, does high mean high aggressiveness or high minimum value (ie braking early).

Same goes for max...does high mean high aggressiveness so late braking?
Sorry, only registered users may post in this forum.

Click here to login

Maintainer: mortal, stephan | Design: stephan, Lo2k | Moderatoren: mortal, TomMK, Noog, stephan | Downloads: Lo2k | Supported by: Atlassian Experts Berlin | Forum Rules | Policy