The online racing simulator
#1 - Knu
Insim problem: "position" in IS_MCI/IS_NLP is always zero
This is very confusing. First I thought the problem was my app, but I checked, and the packet analyzer shows, that the rest of the packet is perfectly ok. For example an IS_NLP: ( 0C 25 00 01 24 00 03 00 04 00 00 00 ).

Tested on W43 and W47, with 1-6 players - same thing.
i'm confused

1) 0C is that the length of the IS_NLP packet? Shouldn't that be 84 (hex)?
2) there is no position indication in a nodelap packet (see your post title)
3) what is the problem you are aiming at? Just the bold 00 doesn't tell me much tbh
#3 - Knu
Quote from Victor :i'm confused

1) 0C is that the length of the IS_NLP packet? Shouldn't that be 84 (hex)?
2) there is no position indication in a nodelap packet (see your post title)
3) what is the problem you are aiming at? Just the bold 00 doesn't tell me much tbh

InSim.txt:
struct NodeLap // Car info in 6 bytes - there is an array of these in the NLP (below)
{
word Node; // current path node
word Lap; // current lap
byte PLID; // player's unique id
byte Position; // current race position : 0 = unknown, 1 = leader, etc...
};

struct IS_NLP // Node and Lap Packet - variable size
{
byte Size; // 4 + NumP * 6 (PLUS 2 if needed to make it a multiple of 4)
byte Type; // ISP_NLP
byte ReqI; // 0 unless this is a reply to an TINY_NLP request
byte NumP; // number of players in race

NodeLap Info[32]; // node and lap of each player, 1 to 32 of these (NumP)
};

Thanks for your reply!

1) x0C is 12 and is perfectly fine as (4 + 6*1 + 2).. or am i missing something?
2) well, the InSim.txt says otherwise this might be one of the new features.
3) the problem is that byte 'position' is always zero.

Sorry for any confusion
I'm getting correct positions in NLP.

Perhaps show your code
right, i had an old version of the InSim.txt .. yet i did get the latest patches. Anyway, I now seem to have the proper insim.txt from w47 and yeah you're right. Sorry

gotta look at it again.
#6 - Knu
Quote from GeForz :I'm getting correct positions in NLP.

Perhaps show your code

I'm not sure which part of code you need? Because after I send an IS_ISI the problem is not in my code (as packet analyzer proves).


Edit: I'm also having troubles with IS_RST, which gives me Finish, Split1, Split2, Split3 all equal to 65535.
And yet again, the packet analyser gives the same info, here's the complete packet exchange (I hope that helps):
IS_ISI ->: 2C 01 01 00 00 00 20 00 00 00 E8 03 6E 33 31 31 00 00 00 00 00 00 00 00 00 00 00 00 49 53 52 4D 00 00 00 00 00 00 00 00 00 00 00 00
IS_VER <-: 14 02 01 00 30 2E 35 57 34 37 00 00 44 45 4D 4F 00 00 04 00
IS_TINY ->: 04 03 01 13
IS_RST <-: 1C 11 01 00 00 00 00 00 42 4C 31 00 00 00 00 00 23 00 DD 01 [B]FF FF FF FF FF FF FF FF[/B]

Maybe, someone would be so kind to replicate/confirm this?

Thank you
I'm not sure either ^^

All I can say is that i receive positions:
3-driver NLP: 18 25 00 03 ' ca 00 03 00 02 01 ' c1 00 03 00 03 02 ' 9a 00 03 00 04 03 ' 00 00

I don't know at which point there is an error but. Perhaps start with showing your INI packet.
I really can't understand this. As I know you use my library (http://www.lfsforum.net/showthread.php?t=25390), I checked it with my TestApp (included in the zip-file).

The very first IS_MCI has Position 0, while any other values are already filled. But the next IS_MCI have correct Position-values...

Checked with W47 in Single-Player mode, connection type TCP. Both requesting IS_MCI with IS_TINY and waiting for IS_MCI because of 'interval' set in IS_INI works fine here.

Regards
Jens (Red Runner)
Well... 0 "some"times or once is not necesarily an error ^^
It's just LFS doesn't know as stated in the doc.

But Knu says it's always 0

Also my RST is working:
ISP_RST: 1c 11 22 00 0d 00 01 00 4b 59 32 00 00 00 00 01 00 00 52 02 fe 01 68 00 44 01 ff ff
#10 - Knu
Just in case it helps, my initial problem:


-IS_ISI
0000: 2C 01 01 00 00 00 10 00 00 00 E8 03 6E 33 31 31 ,...........n311
0010: 00 00 00 00 00 00 00 00 00 00 00 00 49 53 52 4D ............ISRM
0020: 00 00 00 00 00 00 00 00 00 00 00 00 ............
-IS_VER
0000: 14 02 01 00 30 2E 35 57 34 37 00 00 44 45 4D 4F ....0.5W47..DEMO
0010: 00 00 04 00 ....
-IS_NLP
0000: 0C 25 00 01 03 01 03 00 02 00 00 00 .%..........
-IS_NLP
0000: 0C 25 00 01 08 01 03 00 02 00 00 00 .%..........
-IS_NLP
0000: 0C 25 00 01 0C 01 03 00 02 00 00 00 .%..........
-IS_NLP
0000: 0C 25 00 01 11 01 03 00 02 00 00 00 .%..........

I ran out of ideas to try
hmm i'm currently doing some insim stuff as well and actually noticed that at some point the mci packets were all the same. I could drive all i wanted, but no value at all changed. This was with w47.
Then I tried W45 and that worked.
Then went back to W47 and there it worked again strangely enough.

Haven't been able to reproduce it ever since unfortunately. But it does look like there's _some_ bug there.
i think there's a circumstance that LFS doesn't know where a car is anymore and then you get these static packets.

a related issue i encountered earlier when i had the static packets was that on autox with layout and route-checkers, the route checker did notice that i missed some checkpoints and lfs msg'd in red "wrong route", but it did not kick me.
Now, with working mci packets, if i take a wrong route, it kicks me as it should.

just thinking out loud :P
some more.

I now have the bug again. Mci packets with just 1 racer look like this all the time, no matter where i drive to :

20 26 00 01 00 00 01 00 &......
0f 00 c0 00 00 40 1f 00 .....@..
00 a0 97 fc 00 c0 ff ff ........
00 00 00 00 00 e5 00 00 ........

I noticed when it all worked, and I joined a race with my car, the first 3 mci packets also looked like this, but then started working.
Looks like some starting values for mci and then it just either gets stuck on them or fixes them.
Knu and Victor, you are talking about two different things.

Knu's "position" is also known as the "race standing", i.e. your current position in the race, 1st, 2nd, 3rd, etc. Victor's position is the car's location. I don't think these are LFS bugs and now I'll explain in each case.

Quote from Knu :Just in case it helps, my initial problem:

...

I ran out of ideas to try

OK, well I don't know what the actual problem is, what issues does it cause?

Position "0" just means that LFS hasn't worked out the race standings. As it involves searching through all the cars, and comparing each car with the others in the list and doing a sort, I don't do it every frame, it's done approximately once per second. So the "position" isn't 100% accurate and lags a bit behind real time, 3rd place man could pass 2nd place man and for a second his position would still be 3. In the case when you only have one car in the race, LFS doesn't bother to work out positions, so you are not in a list position list and the result is zero.

Does that help? If I know what you want to achieve and how this causes a problem, this will help me to consider it more.

Quote from Victor :i think there's a circumstance that LFS doesn't know where a car is anymore and then you get these static packets.

a related issue i encountered earlier when i had the static packets was that on autox with layout and route-checkers, the route checker did notice that i missed some checkpoints and lfs msg'd in red "wrong route", but it did not kick me.
Now, with working mci packets, if i take a wrong route, it kicks me as it should.

just thinking out loud :P

Are you running a host on Wine again? That sounds identical to your issue that when we went on one of your wine hosts, after a minute or two, no-one could see any more cars and also it was impossible to join your host - the reason being that your host stops receiving UDP packets.

If the host isn't receiving position updates then the symptoms would be as you described, plus no-one could join that host and no-one already on the host would be able see anyone else's car.
You receive MCI over TCP??
Ever tried to receive over UDP if there is the same result ??
No that's nothing to do with it, it's the UDP packets being sent from the guest to the host that stop working.

All car position packets from guests to host are sent as UDP.
Quote from Knu :Just in case it helps, my initial problem:

[code]
-IS_ISI
0000: 2C 01 01 00 00 00 10 00 00 00 E8 03 6E 33 31 31 ,...........n311
0010: 00 00 00 00 00 00 00 00 00 00 00 00 49 53 52 4D ............ISRM
0020: 00 00 00 00 00 00 00 00 00 00 00 00 ............

Quote from InSim.txt :
// zero : LFS sends NLP / MCI packets using your TCP connection
// non-zero : LFS sends NLP / MCI packets to the specified UDPPort

I mean that.
Knu get´s the MCI over TCP Connection. If a port is send within IS_ISI it´s sent over the UDP Port, isn't it ??
OK, I see my post was not clear.

I'm talking about the multiplayer guests, the people who joined the host and are driving cars (not the InSim clients). Their cars position packets are always sent to the host using UDP.

I was suggesting that Victor's problem was that his host stopped receiving UDP packets from his guests, and that's why his MCO packets always reported the same car positions, even though his InSim connection continued perfectly well.

FGED GREDG RDFGDR GSFDG