The online racing simulator
Ranking System
Hello,

I plain to put a ranking system into LFSLapper. Can you put here how do you imagine a ranking system? How configure it in GLScript? Etc...


Thank's for your ideas

Gai-Luron
#2 - Krayy
Do you mean ranking as in what team drivers are highest ranked in server/wr times and/or in seniority within the team?

Or are you talking about a race points system?

Because I actually see both of those as linked. We have had some discussions within my regular race team as to how we should handle a points system, and have sort of decided that certain types of races require different points systems from others.

That being said, what I was looking at doing was to customise Lapper to enable us to parse a file with multiple points configurations (sort of like a simple .ini file format), and then enable a GUI in GLScript to select which points system will be used for that race, or race series. This ties in with a Race Manager GUI that I'm working on which will enable us to tie Lapper in to our website so that we can create a rcae series there, send it to Lapper, and then use a GL GUI to fine tune it. We'll look at having race points, as well as points for most improved during series (to encourage different driver skill levels), fastest laps in quali, practice etc and some special situations.

So flexibility is what I'm after.
Hello,

i think about an config championship file and points management

And idea is

Quote :[points "poinType1"]
1 = 20
2 = 18
3 = 16
...
RelativeToPlayer = true;
[/points]

[race "1" ]
date = dd/mm/yyyy;
Time = hh:mm;
Car = XFG+XRG;
Track = SO6;
qualify = no;
[/race]

[race "2" ]
date = dd/mm/yyyy;
Time = hh:mm;
qualify = yes;
qualifyTime = 30; // in minute
Car = RB4;
Track = SO1;
points = "poinType2"; // override championship point
[/race]

[race "2" ]
date = dd/mm/yyyy;
Time = hh:mm;
qualify = yes;
qualifyTime = 30,20; // in minute
laps = 20,10;
Car = RB4,XFG;
Track = SO1,BL1;
points = "poinType2"; // override championship point
[/race]


[championship "champ1"]
title = "Firts championship";
race = "1";
race = "2";
points = "poinType1";
[/championship]

#4 - Krayy
Hi GL,

That's pretty close to what we were looking at. Your config file does break some parsing rules for .ini files, so heres a slightly modified version that makes the following changes:
1. The race series has a name
2. The races in that sequence are linked via the "series =" line with their sequence in the series indicated by the "sequence =" line. This way the races are tied to a series
3. Some extra points given for things like fatsest lap, top qualifier, most improved grid position
4. Add in default handicaps (mass:irest) and player specific handicaps (we modify these based on results, so might need to allow for adding handicaps in points system)

Lastly we should make sure that the system is flexible enough to allow for extra settings like driving aids allowed, registered drivers only etc.


<?php 
[points]
name "poinType1"
20
18
16
...
RelativeToPlayer true;
FastestLap 1
PolePosition 
1
MostImprovedGrid 
2

[series]
name="champ1"
title "First championship";
points "poinType1";
HandicapDefault "20:0";
 
SaveReplays yes
MailResults 
krayy0@gmail.com

[race]
series="champ1"
sequence=1
date 
dd/mm/yyyy;
Time hh:mm;
Car XFG+XRG;
Track SO6;
qualifyTime 0// in minute
// qualify = no; <- specifying qualify time overrides
Laps 10
HandicapUsers 
"@krayy:20:0,4aged:30:0";
Allowresets yes

[race]
series="champ1"
sequence=2
date 
dd/mm/yyyy;
Time hh:mm;
qualifyTime 30// in minute
Car RB4;
Track SO1;
points "poinType2"// override championship point
Laps 20
HandicapUsers 
"@krayy:40:0,4aged:20:0";
Allowresets no
?>


#5 - Krayy
Or better still, do it as XML that allows .NET to read natively and also allows us to integrate it with our websites easier:



<?php 
<LFSLapperRaceConfig>

<
PointsSystems>
    <
points>
        <
name>poinType1</name>
        <
Pos1>20</Pos1>
        <
Pos2>20</Pos2>
        <
Pos3>20</Pos3>
        <
RelativeToPlayer>true</RelativeToPlayer>
        <
FastestLap>1</FastestLap>
        <
PolePosition>1</PolePosition>
        <
MostImprovedGrid>2</MostImprovedGrid>
    </
points>
</
PointsSystems>

<
RaceSeries>
    <
name>champ1</name>
    <
title>First championship</title>
    <
points>poinType1</points>
    <
HandicapDefault>20:0</HandicapDefault>
    <
SaveReplays>yes</SaveReplays>
    <
MailResults>krayy0@gmail.com</MailResults>
    <
race>
        <
sequence>1</sequence>
        <
date>dd/mm/yyyy</date>
        <
Time>hh:mm</Time>
        <
Car>XFG+XRG</car>
        <
Track>SO6</Track>
        <
qualifyTime>0</qualifyTime>
        <
Laps>10</Laps>
        <
HandicapUsers>krayy:20:0,4aged:30:0</HandicapUsers>
        <
Allowresets>yes</Allowresets>
    </
race>
    <
race>
        <
sequence>2</sequence>
        <
date>dd/mm/yyyy</date>
        <
Time>hh:mm</Time>
        <
Car>RB4</car>
        <
Track>SO1</Track>
        <
qualifyTime>0</qualifyTime>
        <
Laps>10</Laps>
        <
HandicapUsers>krayy:30:0,4aged:25:0</HandicapUsers>
        <
Allowresets>yes</Allowresets>
    </
race>
</
RaceSeries>
</
LFSLapperRaceConfig>

?>

in my opinion XML it's not very easy to read or write by human.
#7 - Krayy
Quote from Gai-Luron : in my opinion XML it's not very easy to read or write by human.

Hell I have trouble reading and writing my address

I'm fine either way. An INI parser is easy to write (I've done many of them in PERL), and yes, being human editable is probably a bonus.
XML files can be read by a human easily with the use of an XSL Stylesheet. So if you have a generic XML file, you can create a generic stylesheet to be viewed in a browser.
Read and write?
As an addendum to this topic, how about writing a generic .ini load function that we could use to load ini files into queryable arrays. Not only for race config but also for things like UserGroups e.g.

UserGroups.ini

<?php 
[admin]
krayy
gai
-luron
fred
barney

[superusers]
krayy
gai
-luron
wilma

[banned]
barney
?>


Add a new Class (IniFile) thats a Hastable of Hashtables, initialise an instance as LFSLapper.IniFile, then initialise it like:
IniFileRead("UserGroups", "./UserGroups.ini");

and access it by reading all entries as an array:

$array = GetIniFiledata ("UserGroups", "admin", GetCurrentPlayerVar("UserName"));

This would not only be for usergroups but also track data, race config etc.
Quote from Krayy :As an addendum to this topic, how about writing a generic .ini load function that we could use to load ini files into queryable arrays. Not only for race config but also for things like UserGroups e.g.

UserGroups.ini

<?php 
[admin]
krayy
gai
-luron
fred
barney

[superusers]
krayy
gai
-luron
wilma

[banned]
barney
?>


Add a new Class (IniFile) thats a Hastable of Hashtables, initialise an instance as LFSLapper.IniFile, then initialise it like:
IniFileRead("UserGroups", "./UserGroups.ini");

and access it by reading all entries as an array:

$array = GetIniFiledata ("UserGroups", "admin", GetCurrentPlayerVar("UserName"));

This would not only be for usergroups but also track data, race config etc.

hmm i like that but only one problem... no way to add to file ingame
Quote from Fire_optikz001 :hmm i like that but only one problem... no way to add to file ingame

Easy as...just write a IniFileWrite function that will dumpo the nominated hashtable in an .ini section format.
You could even use this system to set the initial Lapper vars instead of editing them in the LFSLapper.lpr file, so that the lapper file isn't touched as much. Eg:

Lapper.ini

<?php 
[LapperGlobals]
$GripDatabase "./GripPB";
$adminEmail "";
$smtpServer "";
$loginMail "";
$passMail "";
$VoteRestart = -1;
$DefaultTopCar "XFG+XRG";
...
?>

Other uses: swear words, Track names & codes, etc
Quote from Gai-Luron : in my opinion XML it's not very easy to read or write by human.

I agree

Any news?
Up

FGED GREDG RDFGDR GSFDG