The online racing simulator
Ok I will add this in the next release
Quote from Brilwing :Ok I will add this in the next release

Hi Brilwing,
any plans about the next release date?

Starblue
Quote from Starblue :Hi Brilwing,
any plans about the next release date?

Starblue

I was busy with other stuff, I try to create a version in the next days.
Quote from Brilwing :I was busy with other stuff, I try to create a version in the next days.

Excellent
I'm currently working on a new version of the tracker for IGTC endurance league and it could benefit from the "hide message with special prefix" feature

Starblue
Starblue: There is a way around it. You could send a clickable button to all the players on track. Maybe "Panic" or "Help" button. When clicked, It sends a message to all admins privatly(MTC).
Quote from mcgas001 :Starblue: There is a way around it. You could send a clickable button to all the players on track. Maybe "Panic" or "Help" button. When clicked, It sends a message to all admins privatly(MTC).

Yes, thanks for the suggestion We already thought about using a button but clicking a button with a mouse while you are driving is a lot less easy than just pushing a binded button on your wheel
Plus, there is another workaround: modifying the library by myself But I prefer to use official library releases if possible

Starblue
JInsim Outgauge performance
Nice work guys. Has anyone used jinsim with outgauge?

I played around with a bit today. I was wondering what kind of performance you guys were seeing.

Running the Speedometer example with a replay I'm frequently seeing a delay of ~1 second or more. It's especially noticeable in higher power cars like the GTR's that can stop on the dime.

The specs of my system are:
AMD Athlon 3400+
6800GT
1GB memory
Java 6u3
FPS: ~90

I tried running a different setup:
* LFS on the AMD machine above
* Speedo example on a lan machine
- 1.86ghz Pentium M laptop
- 2GB memory
- onboard video (gets 6-10fps running LFS)
- Java 6u3

I got roughly the same performance. For my final test, I created my own test class using active rendering and it seemed to improve a bit but there was still a noticeable delay. So I guess I was wondering... is anyone is using JInsim for realtime stuff with outgauge and having good results? Perhaps I just need to upgrade my h/w

Also, besides the performance issues, I noticed the outgauge response would often contain bad speed values. For example, the speed should be 60mph but getSpeed() returns 7.56005E-39. This happens once every few seconds causing the speedometer needle to flicker to ~0mph. To prevent this I just ignore any speed updates greater than 0 and less than 1. The needle rotation also jumps past the 270 degrees even though it shouldn't be anywhere near that value. I'm not sure if this is a bug in JInsim or LFS's outgauge.

I should point out that I've done all my tests with multiplayer replays. I'm not sure if that causes any issues.
I only used OutGauge in the Speedometer example and with the short tests I can remember any delays, but my tests were only very brief.

I will try to run some longer tests and do also so some profiling.
I'm getting great performance out of it now. I think I might have just had too many applications open at the time
Quote from Technique :I'm getting great performance out of it now. I think I might have just had too many applications open at the time

Nevertheless i will run a test in the profile, just to make sure that everything is fine
I can't get the Hello World example to compile either in command line or using Eclipse. I don't care much about command line as I wouldn't be using it, but... damn Eclipse is such a bitch! I don't know how to create a project from an existing java file. The other day I think I got it, but there were errors everywhere and I think it was because I had to link the commons logging jar file to my project, and I couldn't do it. And Eclipse tutorials are quite poor...

Could anyone post a quick guide on running the Hello World example in Eclipse? It could be very useful for beginners in Java like me to get started

EDIT: OK, I finally got it to work I found the way to create a project from existing sources (it wasn't as hidden as I thought, I was just blind), and then I added the common logging JAR, but totally forgot to add the jinsim JAR Anyway, after that Eclipse asked me to move "package net.sf.jinsim.examples.helloworld" and so I did. Then I found how to add arguments to the run call, and there I go with my "driver says: Hello World"

Gonna try the other examples next!
Quote from MaKaKaZo :
Could anyone post a quick guide on running the Hello World example in Eclipse? It could be very useful for beginners in Java like me to get started

Good idea! I love Eclipse but I remember it was quite a pain the first time I used it...trying to understand its many perspective windows and how to import an existing project, libraries and such
I'll try to make the tutorial you suggested.

Quote from MaKaKaZo :
EDIT: OK, I finally got it to work [...]

Gonna try the other examples next!

I'm glad you solved it and.... welcome to Jinsim!!

Starblue
Hi!

I just have two quick questions ...

Is this still active? Any changed need for Patch Z?

Is it possible to get the temperature of the wheels? and if so, how?

Cheers,
buk
Quote from bukhem :Hi!

I just have two quick questions ...

Is this still active? Any changed need for Patch Z?

Is it possible to get the temperature of the wheels? and if so, how?

Cheers,
buk

Yes, I think it's still active...no changes where needed for patch Z.
As for wheel temperatures, Insim&Outsim don't give this info.
Hi.

I hope one of you guys has an idea on this ...
I run a dual-head setup here.
The main screen shows LFS, the second screen - an 8" touchscreen - shows my application.

That all works pretty good as long as I dont run LFS in fullscreen mode.
When I do that I don't get any mouse events anymore on the second display.
Running TouchBuddy excatly that is working, I just don't have an idea on how to get the mouse back on the second display ...

So, any thoughts?

Thanks and greetings.
This is killing me and to save my life I can't figure out a solution.

I am trying to read a Path file, AS1.pth to be exact. It was going along swimmingly until I need the number of nodes. When I do a readInt() I get a wacky number 536936448, but I know for a fact that AS1 has 288 nodes. Am I using the wrong function call here? Any suggestions?


File pathfile = new File("c:/temp/AS1.pth");
if (!pathfile.exists()) System.exit(0);
FileInputStream fi = new FileInputStream(pathfile);
DataInputStream di = new DataInputStream(fi);
byte[] bLFSPTH = new byte[6];
di.read(bLFSPTH, 0, 6);
String _LFSPTH = new String(bLFSPTH);
// _LFSPTH must match LFSPTH
if (!_LFSPTH.equals("LFSPTH")) System.exit(0);
// version header
byte version = di.readByte();
if (version > 0) System.exit(0);
// revision header
byte revision = di.readByte();
if (revision > 0) System.exit(0);
// number of nodes
int nodes = di.readInt();
...

Not JInSim related, but...

I think you're running into a byte ordering problem. The decimal number 536936448 is 0x20010000 in hex. The decimal number 288 is 0x120 in hex. So it looks to me like the least significant bit (LSB) is first. You can try doing this in your code instead of the readInt():


int nodes = di.readByte() + (di.readByte() << 8) +
(di.readByte() << 16) + (di.readByte() << 24);

You'll have to do that with all value types larger that a byte. And you might have to mask the bytes returned from readByte with 0x000000ff (i.e., di.readByte() & 0x000000ff).

If would probably be best to abstract the calculation into a method call for each data type you need, to save typing

Try that and see if it works.
Get all players on connect
Hi.

I currently wonder how I can get a list of players that is currently connected.
I'm writing a small app that keeps track of lap and split times and therefor would need a list of existing players when it connects to the LFS-Client.

Thanks for your help.

Greetings.
After the client connects you can request the list of connections and players.


// request for connection info
client.send(new TinyRequest(Tiny.ALL_CONNECTIONS));
// request for player info
client.send(new TinyRequest(Tiny.ALL_PLAYERS));

After getting the initial list above you need to listen for new connections and players by checking the packet type in your packetReceived and then dealing with the appropriate type (NewConnectionResponse or NewPlayerResponse).
Quote from bukhem :Hi.

I currently wonder how I can get a list of players that is currently connected.
I'm writing a small app that keeps track of lap and split times and therefor would need a list of existing players when it connects to the LFS-Client.

Thanks for your help.

Greetings.

This is a generic answer, not JInSim specific. As stated in the insim documentation, at any time you can request info about all connections and players sending an IS_TINY, with the following values (marked in red) in the field SubT:

enum // the fourth byte of IS_TINY packets is one of these
{
TINY_NONE, // 0 : see "maintaining the connection"
TINY_VER, // 1 - info request : get version
TINY_CLOSE, // 2 - instruction : close insim
TINY_PING, // 3 - ping request : external progam requesting a reply
TINY_REPLY, // 4 - ping reply : reply to a ping request
TINY_VTC, // 5 - info : vote cancelled
TINY_SCP, // 6 - info request : send camera pos
TINY_SST, // 7 - info request : send state info
TINY_GTH, // 8 - info request : get time in hundredths (i.e. SMALL_RTP)
TINY_MPE, // 9 - info : multi player end
TINY_ISM, // 10 - info request : get multiplayer info (i.e. ISP_ISM)
TINY_REN, // 11 - info : race end (return to game setup screen)
TINY_CLR, // 12 - info : all players cleared from race
[COLOR=Red] TINY_NCN, // 13 - info : get all connections
TINY_NPL, // 14 - info : get all players[/COLOR]
TINY_RES, // 15 - info : get all results
TINY_NLP, // 16 - info request : send an IS_NLP
TINY_MCI, // 17 - info request : send an IS_MCI
TINY_REO, // 18 - info request : send an IS_REO
TINY_RST, // 19 - info request : send an IS_RST
TINY_AXI, // 20 - info request : send an IS_AXI
TINY_AXC, // 21 - info : autocross cleared
};

With TINY_NCN the server will send an IS_NCN packet for each of the connections present (UCIDs).

With TINY_NPL the server will send an IS_NPL packet for each of the players present (PLIDs).

If you are keeping track of both connection IDs and players IDs (you should), you must do both.
I have not tested it, but I think a tiny request will do. e.g. extend the net.sf.jinsim.examples.console.Console example with:

client.send(new TinyRequest(Tiny.ALL_RESULTS));

But when you want to keep track of all players, you must also response when a player connects or leaves, also when he joins the race.

I have done a stats application that tracks the laps over every driver etc.
Here is the source, but I'm currently refactoring this app, so there will be lots of bugs:
https://openbakery.org/svn/repos/trunk/racecontrol/
Quote from bdshan :After the client connects you can request the list of connections and players.


// request for connection info
client.send(new TinyRequest(Tiny.ALL_CONNECTIONS));
// request for player info
client.send(new TinyRequest(Tiny.ALL_PLAYERS));

After getting the initial list above you need to listen for new connections and players by checking the packet type in your packetReceived and then dealing with the appropriate type (NewConnectionResponse or NewPlayerResponse).

Thanks, works like expected.
Good morning folks.

Is it possible that there is some inconsitent namen of "IDs" in the library?
If I got that right, there are two IDs per player.

1.) The "connection"-ID, given to the player during the connection.
Sometimes this id seems to be refered as getId() or getConnectionId(), depending on the InSimResponse-Class

2.) The "event"-ID, given to the player when he takes part in an event (race,qualy). I'm just guessing here, didn't really check when an "NewPlayerResponse" gets triggered.
This id seems to be refered as getId() or getPlayerId() depending on the InSimResponse-Class

I'd will to prepare some patches against the current HEAD when there is a chance that they will be at least checked.
I'd try to add some documentation as well, cause that part seems to be missing in some classes.

Greetings.

FGED GREDG RDFGDR GSFDG