The online racing simulator
Searching in All forums
(192 results)
Brilwing
S3 licensed
XML is fine.

I think we should start with a xml-schema file that discribes the format.

We should also find a good compromise between using tag elements and attributes, because attributes makes the XML easier to read (by humans).

I also want that the times in the XML are not formated, because the main goal for the stats file format should be that it is processed by programs.

I hope I have some time in the next view days for a small proposal.
Brilwing
S3 licensed
You can open the file in a spreedsheet application (Excel, OpenOffice), than it should be easier too read.
I wanted to keep the file format simple, because my league tool is written in PHP and I upload the file with a webform. The file is than parsed with php, and the data are stored in a mysql database. Stats, standings etc. are than calulated dynamically using the data from the database.

It is not difficult to change my stats tool to store the data in a different format. So if anything comes out of this discussion, it is very likly that I will support the new file format.
Brilwing
S3 licensed
Quote from CLRS530 :Every stats tool uses or calculates other values and was developed for various reasons so:

1. you couldn´t really do a common format

I don't think so, because stats tool does only collect the data from insim and stores it in a csv like text file.
So nothing is calculated, except unfinished racers, that do not cross the start finish line.

Quote from CLRS530 :
2. if you have a common format why should there exists more then one program?

Good point. I already thought of using your liveforstats tool , but I run my lfs-server with linux/wine and I have no GUI, and afaik your tool runs only under windows and needs a GUI.
My tool is written in java and runs on every OS that has a java runtime.
Brilwing
S3 licensed
I though of a common stats format myself some time ago, because I have written my own stats tool to manage the austrian championship.
So I think it is a good idea to have a common format.

The format of my tool is similar to CVS and here is an example:
http://dev.guglhupf.net/gstats ... O5_race_0608271626.gstats

I have also already implemented the new InSim features since patch 0.5V3 that pitstop, flag and takeover are stored in the gstats file, but I have no example at hand.

Compared to your Race.lsf proposal my stats file contains much more informations, and I need all these infos for my league tool. I also to not like abbreviations like UName1, because UserName1 reads much better.

XML would also be a good choice, because with a proper XSLT file, the stats could be rendered in the browser without any additional tools involved.
Brilwing
S3 licensed
Thanks Scawen. Really great work
Now I can even make better stats for the austrian championship
Brilwing
S3 licensed
Quote from Becky Rose :Ideally

PIT
Time in pits
Current lap
Car Repaired 1 or 0
Car Refueled 1 or 0
Tyres Changed nnnn (FR,FL,RR,RL) 1 or 0
Penalty 1 or 0

Looks good for me, but the penalty could be a drive through or a stop and go.
So my suggestion for penalty:
1 DRIVE_THROUGH
2 STOP_AND_GO
4 COMPLETED_DRIVE_THROUGH
8 COMPLETED_STOP_AND_GO
Brilwing
S3 licensed
I had the a similar problem, because I want to know the lap number when someone enters the pits. My solution is that I parse the chat message that is send. It is not the prettiest way, because the message is language depended. But I don't no any simpler way.

I think this could also work for penalties.
Brilwing
S3 licensed
You can put the jars manually in your classpath. You need:
commons-logging: http://jakarta.apache.org/commons/logging/
commons-cli: http://jakarta.apache.org/commons/cli/
log4j: http://logging.apache.org/log4j/docs/
junit: http://junit.org
and jinsim

Or you can use Yeast, which is a tool that a made to manage these dependences. This means that the jars automatically downloaded
Yeast can be found here: http://yeast.openbakery.org
Last edited by Brilwing, .
Brilwing
S3 licensed
Quote from Pablo.CZ :I'm trying to make my own appl based on JInSim v0.3 and I have problems with getting

total time, split1 time, split2 time, split3 time, (last) lap time
front gap, back (rear) gap
actual lap number, total number of laps

Thx for help.

I have done such a program (except the front and back gap) and you find the source code here: https://openbakery.org/svn/repos/trunk/gstats/

The output of the program is a textfile that contains the stats and you find an example here:
http://dev.guglhupf.net/gstats ... O5_race_0608271626.gstats

I use the *.gstats files in a php program to manage the austrian championship league. (see liveforspeed.at -> Events/ÖLFSM)
Start of the Austrian Championship on 1.10.06
Brilwing
S3 licensed
This year the second season of the Austrian Chamionship starts on the 1.10.06.
Every austrian Live for Speed racer is welcome to participate.
The first race is on Westhill International with the BMW Sauber F1.

Details can be found on liveforspeed.at:http://liveforspeed.at/?q=node/239
Brilwing
S3 licensed

Here is an example file my stats tool generates:
http://dev.guglhupf.net/gstats ... O5_qual_0608271639.gstats

I upload this via a web form, an php parses this file an generates the proper SQL-Insert statmements.

Here is a code snipped that inserts a driver into the DB:

$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db($db_name,$db);

function executeStatement($query) {
global $db;

mysql_query($query, $db);
if (mysql_errno($db) != 0) {
echo mysql_errno($db) . ": " . mysql_error($db). "\n";
}
return mysql_insert_id();
}

function insertDriver($line = "") {
#LFSWorldName;Nickname;CarName;startingPosition;Plate

global $raceId;
global $drivers;
global $db_table_drivers;

$token = explode(";", $line);

$query = sprintf("INSERT INTO %s VALUES('',%d, %d, '%s','%s', %d, '%s', '%s')",
$db_table_drivers,
$raceId,
0,
mysql_real_escape_string($token[0]),
mysql_real_escape_string($token[1]),
$token[3],
mysql_real_escape_string($token[2]),
mysql_real_escape_string($token[4]));

$driverId = executeStatement($query);
$drivers[$token[0]] = $driverId;
}

Brilwing
S3 licensed
I follow your thread now for quite a while, because I have also created a new stats tool, because lfsstats does not enough for me.
I have postet it in our austrian forum, because it is also work in progress.
You can check it out here: http://alphabasis.net/schneefee/phpBB2/viewtopic.php?t=289 (note: the posts here are in german)

For all guys that cannot read german here is a short summary:
My stats tool create a csv like file with all the stats. You can use it with replays, and I also have it running on our lfs server to generate the stats directly during the races.
I'm writing on a module for our website, so that I have an upload form and this data from the stats file is inserted into a mysql database. The stats, standings etc. are than generated live on the server with this php written module.
Brilwing
S3 licensed
Now I really discovered a bug

In the ResultResponse.java 32 bytes are read from the buffer for the carName, but this must be 4 bytes. To the rest of the values are not correct
Brilwing
S3 licensed
First of all you jinsim is a great tool. I have played around with it for some time now and it saves me a lot of time, and I really like this lib


I have some improvement suggestions:
I found out that jinsim uses a lot of cpu time. First in the examples you stop the main thread with a:

while(true) {
}


This is not a good idea, because the loop here produces a lot of no-operations on the cpu, so the cpu load is 100%.
This can be avoid by a dead-lock (the only dead-lock I know that make sense ):

String lock = new String("lock");
synchronized(lock) {
lock.wait();
}


This does the same as the loop, but does not cost any cpu time.

After I have done this, the cpu load was still high (about 50% on my machine), so a investigated the code a bit and found the cause:
In the Receiver class the run method waits for packages you have following loop:

while(isRunning()) {
...
}


When you add the command
Thread.sleep(1);
at the end of the loop, than the cpu load is near to idle on my machine, because the thread scheduler does not process this loop too excessive.

Another minor issue is that the Request classes (e.g. NewPlayerInfoRequest) the setValue method is protected, and I use this request at the start of an race to get the starting position of each player and I have to set the player id using this method.
It would be nice if the method is public, because so I don't have to make a subclass to achieve the same behavier.
Brilwing
S3 licensed
Yes it is possible to install Windows XP on the new Intel Macs. I've also seen vidoes where someone run HL2 on a Mac mini and on a Macbook. Video drivers are only available for the Mac Mini, but I think that also soon drivers will be available for the other Intel Macs (see http://wiki.onmac.net/index.php/Users/Drivers)
One problem that is left is if force feedback devices will work.
Brilwing
S3 licensed
The answer is really simple here. There are no software patents in europe and hopefully never will. So the microsoft patents only apply to the US.
Brilwing
S3 licensed
First of all I tried the skin viewer with Virual PC and it didn't start, so this is no option.
With the new Intel based Mac is looks better. There is already a Wine version that work on the Intel Macs (http://forum.osx86project.org/index.php?showtopic=8699) but I don't know if LFS will run with this version, and I have no MacBook to test this.
One other option is to install/run Linux an try WineX there. I think it is possible to get LFS work, because on a normal PC with Linux LFS works fine, except the force feedback wheels.
FGED GREDG RDFGDR GSFDG