The online racing simulator
Searching in All forums
(243 results)
sdether
S2 licensed
Jeez... First we get inundated with nearly every other "Programmer Forum" thread being yet another LTC clone request. Now we're also getting slap fights about people creating LTC clones.

My hat's off to Krammeh (i assume the attribution for LTC is correct). It's certainly sparked a phenomenon and the sincerest form of flattery is imitation.

Once someone puts their stuff out on a public server, it's there for everyone to draw inspiration from. If its popular and not being offered for others to use, someone will try to re-implement it. That's not theft. Until you take a Patent out of it (which you unfortunately can), ideas and processes are not intellectual properties.

Can we get back to talking about the actual coding of InSim apps (and no, InSim is not a special LFS term for Cash Server).
LFSLib.NET 0.16b with InSim Relay support
sdether
S2 licensed
New version is out featuring bug fixes and support for the InSim Relay.

Details here
sdether
S2 licensed
I'll try to package up 0.16b (with Relay support) of my lib today or tomorrow and release it. That way people can do some more testing against the test server before it goes live.
IS_CPP question
sdether
S2 licensed
Am I smoking something or did IS_CPP always report a (0,0,0) vector if not in Shift+U mode? The docs just say:


// Position vector (Vec Pos) - in SHIFT+U mode, Pos can be either relative or absolute.

So the behavior outside Shift+U is not defined. I thought it used to actually provide the camera's current position.

The reason i ask is that if I hit the Shift+U, it enters the mode at the place the current car was at that point, but if i request a IS_CPP, just set the ShiftU flag and send that back, it puts the camera at (0,0,0) and makes LFS upset.

The only workaround I can see is to request a IS_CPP and get the IS_MCI for the current car and use that coordinate info to mod the IS_CPP before sending it back.
sdether
S2 licensed
Quote from Hollywood :[color=#0000ff]The following code in RaceTrackPlayer always returns zero because it is doing an integer divide, i.e. byte / integer = integer.

Thanks for fix. 0.16b will be out as soon as the relay stuff goes official.
sdether
S2 licensed
Quote from Krammeh :Is there any tool, where I can see what the XY co-ordinates are, that surround the pits/garages?

Not that I can tell. While Pth files widen the drivable area to include the pits, this is a clue easily picked out visually, but not programmatically. On top of that, I don't know of a place where the "pit enter/pit leave" nodes are recorded.

It would be useful information to map out, imho. I'd start with recording the nodes for pit start & pit end. Once you have that you could see if you get any false positives if you just say


if(car between pitstartNode and pitEndNode &&
car between currentNode.DriveLeft and currentNode.LimitLeft)
{
// this assumes pits are always on the left of the track (bad assumption)
car is in pit
}

the Pth Limit on the pit side gives you the outer bounds, but whether the Drive line gives you the inner bounds is something that would have to be tested.
sdether
S2 licensed
Quote from Peptis :I guess we need to hear from Scawen on this issue. I assumed that you'd get a StopGo packet when you receive a stop-go penalty and a StopGoValid packet when you complete one correctly.

That certainly sounds like the sensible order, so yes, it's a matter for Scawen to chime in with intent.
sdether
S2 licensed
Quote from Hollywood :FYI, you can use sdsether's LFSLib (written in C#) with any VisualStudio.NET language (VB, COBOL, J#, IronPython, think there is a Ruby one somewhere, etc.) and its up-to-date and fully functional.... one of the beauties of the .NET platform.


P.S. Before anyone gripes, I know there are compilers that compile other languages into the Java bytecode...

[offtopic]You might say, it's one of the theoretical beauties of virtual machines. Except that .NET is the only one actively pushing the multi-language to one bytecode aspect, while Java does it almost despite of Sun and Mozilla and Adobe aren't even considering letting you address their VMs with bytecode.[/offtopic]

That said, yes, LFSLib.NET can be used in any language that can consume .NET dlls and I've even got it running under mono on linux (and i got a modified version mostly runnning on WM5 phones as well). As for IronRuby, the early alpha is finally out and will be hosted on RubyForge, but it's probably another 6 months out from being a viable .NET language.
sdether
S2 licensed
Quote from Peptis :
e.NewPenalty has the value of Enums.Penalty.StopGoValid instead of Enums.Penalty.StopGo. Is this correct? I thought that you'd get a Enums.Penalty.StopGo on receipt of a penalty and Enums.Penalty.StopGoValid when you complete it.

I'm not sure I understand what the valid vs. lacking valid versions of the penalty are, but I just looked at the packets coming in and that's what LFS is sending. So that's either what it's supposed to be or it's a bug in LFS.
sdether
S2 licensed
Quote from Victor :i just tried it. I connect to relay, then select a host. Then i send a ping packet and the relay relays it to the host which replies back. The relay sends this reply back to client.

Yeah, my bad. Broken in my lib. My Ping event was looking for a TINY/PING instead of a TINY/REPLY.

Great. I'm feature complete. Thanks!
sdether
S2 licensed
I lied. There still is something after all... Ping and connection maintenance.

I get a TINY/NONE from the relay every ~20 seconds and reply to that with a TINY/NONE. Does that qualify for the connection maintenance?

And should ping's go through? Whether i'm connected to a host via the relay or just the relay, my ping packets seem to get swallowed.
sdether
S2 licensed
Victor,

I'm done with my testing and the relay seems to work as advertised. The only suggestion I would still have is adding ReqI for IR_ERR_PACKET2. Might help people debugging, although it's a design time thing really. Once you know that a packet is invalid, you shouldn't be sending it again or at least not be reacting to it at runtime.

Thanks!
sdether
S2 licensed
I just tested this (with no server side handicap), just joining with the FZR and 200kg of handicap and whether i was connected to the server via the client's or the servers insim connection, the 200 came through fine in the NPL and the connection stayed alive
sdether
S2 licensed
Quote from Victor :actually, just go to lfsworld's insim setup page - you have access to it.

Ok did that.. However that didn't have slots for things like insim port and admin pass. I can email those if you need them.
sdether
S2 licensed
BTW, I thought i saw that TINY NONE was a valid response now... I was connected to the LX server via the relay and was getting TINY NONE as keep-alive from the server, to which my API automatically response with TINY NONE. This results in an IR_ERR for me.

Also, would it be possible to let me set up a server and have you add it to the relay.. i want to make sure my lib does things properly and the easiest would be if i could syntesize action on the server to watch.

thanks
sdether
S2 licensed
Unless the system works as Max(global,local)
sdether
S2 licensed
Only now getting around to implementing this. I should probably wait until i queue requests up, but here goes one

Can we make IR_HLR use a ReqI for consistency? My API always returns a request id to the caller to use for checking incoming messages and since IR_HLR is a request, it would be nice if it fit into that paradigm


struct IR_HLR // HostList Request
{
byte Size; // 4
byte Type; // IRP_HLR
byte ReqI;
byte Sp1;
};

Also, can we have ReqI instead of Sp0 on IR_ERR. I guess that only partially works since you can send a IR_SEL without an ReqI.

thanks
Last edited by sdether, . Reason : added ReqI for IR_ERR request
sdether
S2 licensed
Quote from dawesdust_12 :But what if you want to do like how CTRA has different restrictions depending on car, you'd need to have said restriction per car, not a clean sweep.

Well, this just lets the server do it per player. So CTRA could look at the player and his/her car and set the restrictions depending on car or driver skill.

It be a nice way for a license server system to create closer races, i.e. restrict the players based on past performance and dole out points according to race results and restrictions in place.
sdether
S2 licensed
Quote from Hollywood :o Add a packet that allows for adjusting the voluntary handicaps, such as:

That wouldn't make them very voluntary would it?

But, I agree, that would be useful. Although i think it would be more versatile and wouldn't require InSim changes if we could just get commands for these actions, such as:


/intake_restriction <value>
/add_mass <value>
/add_mass_position <value>

LFSLib.NET 0.15b
sdether
S2 licensed
Mostly bug fixes, including fix to my broken implementation of AXI and AXO (thanks GeForz).

Details are here

Docs, binaries, etc. are here
sdether
S2 licensed
Quote from GeForz :So when you connect to the "CTRA Bump & Jump" server your local insim dies? Mine does not

Thanks for the feedback!

Just connected to CTRA Bump & Jump and my InSim died. Are you using TCP or UDP? I'm using TCP and I thought the socket was being closed on me. But may I was reading the debug trace wrong and LFSLib.NET dies for some reason.. Lemme track it down

Update: Problem solved. It is on my end. There is a bug in LFSLib.NET with AXI and AXO packets. Ok, time to prep 0.15b


Update 2 : And I see you've amended your post pointing out that same bug Yeah, I had the case statement for what to do when you get that type of packet, but not the case statement to recognize it in the first place. duh.
Last edited by sdether, . Reason : Found the problem
sdether
S2 licensed
Quote from Krammeh :the insim does not die when I load/unload layouts on the LTC server.

This isn't a problem with the server (there my insim stays connected), it only happens on the client.
sdether
S2 licensed
I just noticed that the same happens if i start up a single player game using a track that has a layout file associated. So it doesn't seem to be a server issue, but something in the track loading process kicks InSim
sdether
S2 licensed
Quote from revolucio :Thanks for the answer, but i dind't know to use that, can you explain me how to use that, please?

I guess we need a bit more info on how you are writing this app. What language are you writing it in, are you using any kind of insim library?

Also, the connection packet you are looking for is IS_NCN. Your insim application connected to a server will receive this when a new user connects to the server (not joins the game, btw).

Right now, there is a message the server sends to all connections notifying them that user 'x' connected. You want to send more information of that kind to everyone?
Lfs State Inspector
sdether
S2 licensed
If you've ever wondered how exactly the InSim state changes as you hop through LFS, I got a little app for you:

http://www.claassen.net/geek/b ... /lfs-state-inspector.html

I've spent too much time trying to watch IS_STA packets and created this real quick to help me figure out what i need to watch out for. There's both binary and source releases.

Hope this is of use to someone.
FGED GREDG RDFGDR GSFDG