Points/Position calculations

Points/Position calculations

Postby Wuzzy » 27 Oct 2014, 19:09

When you finish a track, you usually get a score. I never really understood how this scoring works exactly, so:

How is the score calculated?
User avatar
Wuzzy
 
Posts: 989
Joined: 28 May 2012, 23:13

Re: Score calculation

Postby CryHam » 27 Oct 2014, 20:12

You mean the Points? Below Position?
I thought you've already seen it explained in challenges.xml line 63.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Score calculation

Postby Wuzzy » 27 Oct 2014, 20:22

Yes, of course I mean that score.

Hmmmm, yeah, I saw that in the XML file. But it’s a bit cryptic to me.

So as I understand it, it works like this:
The track time is “worth” 10 points. And you get more points if you are faster and less if you a slower. But I would like to know it a little bit more precise.

But it’s the details I am puzzled about. If given any track time (or whatever), how does SR calculate the score from that? Is there a formular or something like that?
The description says “one position is worth 0.5 points”. But this begs the question: How does SR determine the position?

So yeah, the description is vague, there is just an example, and that’s why I am still puzzled.

I am asking partly out of curiosity, parly for challenges and partly for gameplay reasons. =)
User avatar
Wuzzy
 
Posts: 989
Joined: 28 May 2012, 23:13

Re: Score calculation

Postby CryHam » 27 Oct 2014, 22:33

Right. Yeah it's complicated.
First, we have the time for each track:
(info written at top of tracks.ini)
{l Code}: {l Select All Code}
   #  T= track time - it's the 1st lap time (not best lap), driven with ES in normal simulation mode,
   #     with no mistakes, used rewind with "_Tool_ go back time", and no boost at all
   #     Most difficult tracks have few (2-4) sec more, to leave some room for user rewinds

So basically I do that drive with ES (for each new track) and adjust time to have 10 or a bit more points for that track.

Next, so that each car could (ideally) score 10 for perfect drive (while each having different engine power)
we have factors for each car in each sim mode:
(info from bottom of cars.xml)
{l Code}: {l Select All Code}
   <!--easy and norm are the car time multipliers for simultation modes
      less means bigger track time (more points, easier to qualify)
      track time is divided by this factor for a car,
      this way each car can be 1st on a track despite different engine power-->
   <!--made on For4-OSquare: drive a car perfectly (no boost, no going off road) then adjust it to have 1st place-->


This brings us to that GetRacePos method (code from in ChampChall.cpp, line:123)
{l Code}: {l Select All Code}
///  compute race position,  basing on car and track time
//-----------------------------------------------------------------------------------------------
int App::GetRacePos(float timeCur, float timeTrk, float carTimeMul, bool coldStart, float* pPoints)
{
   //  magic factor: seconds needed for 1 second of track time for 1 race place difference
   //  eg. if track time is 3min = 180 sec, then 180*magic = 2.16 sec
   //  and this is the difference between car race positions (1 and 2, 2 and 3 etc)
   //  0.006 .. 0.0012            // par
   //float time1pl = magic * timeTrk;

   //  if already driving at start, add 1 sec (times are for 1st lap)
   float timeC = timeCur + (coldStart ? 0 : 1);
   float time = timeC * carTimeMul;

   float place = (time - timeTrk)/timeTrk / data->cars->magic;
   // time = (place * magic * timeTrk + timeTrk) / carTimeMul;  //todo: show this in lists and hud..
   if (pPoints)
      *pPoints = std::max(0.f, (20.f - place) * 0.5f);

   int plc = place < 1.f ? 1 : std::min(30, (int)( floor(place +1.f) ));
   return plc;
}


Which describes also the magic parameter in detail. Has its value also in cars.xml (at top):
{l Code}: {l Select All Code}
   <!--global multipliers for car factors, magic - see App::GetRacePos-->
   <global easy="0.94" norm="0.95" magic="0.010"/>


I hope that already explains evth. This isn't a perfect system, sure. Works okay with some tolerance.
But yeah, surely spaceships would need their own time, but sorry this would also need driving one (which) on all tracks (at least those drivable), so nope.
Definitely car factors need some tweaking. Since they may work good on For4-OSquare, but not so great on tracks which you can't drive full throttle. Still it's a short track and driving it is easy that's why I picked it.
I'm okay if you want to tweak those and maybe you'll get better values, but beware its a complicated thing and may break sth you didn't test and it's just impossible to test every car on each track. Plus it will take a lot of time.

It gets also even more complicated if I tell you that track's ghost and track time (T=) are both used to get you the time difference on each checkpoint.
And supposedly should work for slower cars too. But that can get bad very easily. And works well for cars close to ES (track's ghost).
Code for that is in Hud_Update.cpp since line 446. ('diff =' is the time difference at checkpoint.)

And lastly there is a _Tool_ code that I used to test all factors on all my ghosts (gathered so far).
It shows postions for all user ghosts, so you would know what they would score, if you eg. change or edit any factors. But need a lot of ghosts to be good.
see CGui::ToolGhosts() in Tools.cpp since line 293.
If you want to use it, replace #if 0 with #if 1 in SceneInit.cpp line 98. Build, game will start and quit, see output in ogre.log (after 'ALL ghosts ------').
Heh is quite old, we don't have times.xml anymore, like in that coment there.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Score calculation

Postby Wuzzy » 28 Oct 2014, 01:24

Okay, thanks for this explanation. :)
User avatar
Wuzzy
 
Posts: 989
Joined: 28 May 2012, 23:13

Re: Score calculation

Postby CryHam » 28 Oct 2014, 16:31

Current output from that _Tool_, shows positions for all cars in all tracks from all my ghosts.
all ghosts.log
(27.69 KiB) Downloaded 741 times

So clearly a line with 1 along all cars on For4-OSquare. And mostly 1 along car ES and S1 which I drive the most. Rest is rather empty.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Who is online

Users browsing this forum: No registered users and 1 guest

cron