The online racing simulator
Searching in All forums
(243 results)
sdether
S2 licensed
I'm currently working on some race tracking code that creates a HUD as attached. I can probably rip out various pieces from that and approximate the layout you posted. However this code will be in C# and you'd need Visual C# Express at the least. Would that be useful to you?
Some LFSLib.NET examples
sdether
S2 licensed
Since the Tester App that's available from the LFSLib.NET site is a horrible piece of junk that you really shouldn't model WinForms apps after, I've decided to start publishing simple samples from code I'm writing anyhow for testing.

So far I have the followingAs I write new ones, they'll show up here as well (i.e. tagged w/ LFSLib.NET). Hope these help.
sdether
S2 licensed
The symptoms of this certainly are that you can press any reserved keys, but not any keys that can be bound. If this was intentional, then the docs are a bit confusing:


/key [key] [function] - e.g. /key Q handbrake (see below)
[...]
/press [key] - simulate key press

both refer to [key] and finally under "PARAMETERS for the key commands (press / ctrl / shift) :" it explicitly mentions "Letters A to Z".

Given all that, it would seem more likely that it's a bug with the press command not resolving dynamic bindings, but resolving static bindings. Either way, it'd appreciate clarification, before I descend into InterOp land for my keypresses, especially I was trying to do this from a central machine for all stations.
Key press bug?
sdether
S2 licensed
I can't seem to get a bound key pressed by any method available to me.

I bound x to pitspeed:
/key x pit_speed

If i'm in LFS and press x the pit limiter goes on and off.

But i can't programatically press it. I tried:
  1. sending IS_SCH for x
  2. sending IS_MST with /press x
  3. typing /press x in LFS
  4. creating a script with /press x and then running the script
Anyone else having this problem? Thanks!
What happened to /end
sdether
S2 licensed
I was just trying to programatically get back to the entry screen. I thought that /end used to do that (and some old Commands.txt doc seems to support that) but now it just seems to be for replay to entry screen.

So now I can only /exit if I want to go from multiplayer to single player. Right? Because /leave only drops you to the MP connect screen and nothing gets you out of single player.

It's not something I can't work around. I have these "TV cam" terminals that alternate between showing the current race or a replay. And if there is no way to get from mp to the entry, then to get to replay, i'll have /exit and respawn. Am i missing a command?
Last edited by sdether, . Reason : Overlooked a scenario
sdether
S2 licensed
I was just thinking about the marshalling by replay issue and it's something I've come across for my marshalling needs as well. Have you considered using an LFSSpectator approach? I.e. use the smx files for create an overhead and record the MCI packets at a fairly high rate. Now you should treat your race as a timeline that you can scrub back and forth across an incident. Sure it's an overhead approximation, but that's probably almost better for determining who cut whose line, etc.
LFSLib.NET 0.14b
sdether
S2 licensed
Some bug fixes related to TCP handling that deal with connections dying, plus some cosmetic clean-up. Thanks to Hollywood for feedback on the TCP bugs and naming convention clean-up.

Details are here

Docs, binaries, etc. are here
sdether
S2 licensed
Quote from revolucio :I want to set options of coordinates for each circuit in InSim,

if (p.IsInSphere(0, 0, 0, 10))...

Ok, so you want to basically have conditional hooks that if a car enters a defined area on the map, you want to be notified?

This could get fairly expensive depending on how many of those "areas" you define. Basically you'd have to have something that listens to MCI packets and then takes all your defined areas and checks whether the coordinates of any of the cars in the MCI falls inside your coordinate. You're basically doing spherical collision detection on every MCI. There's some optimizations you can do to pre-qualify areas, but one way or another, you'll be doing a lot of collision detection. There isn't really a way around doing it by hand, since LFS will not do it for you.
I'm a bad person
sdether
S2 licensed
This is somewhat off-topic...

I had to create some some button classes for the types of buttons (messages really) that I display and one of them is a notification that the driver in the 301 needs to re-fasten their seatbelt. Since this is a safety concern, we want to make sure they don't ignore it, so it blinks (really changes colors) at them until they put the safety belt back on.

Yes, that's right, I've created the equivalent of the blink tag for LFS. And yes, that does make me feel queasy.
sdether
S2 licensed
Quote from Peptis :Are you using ISF_LOCAL in the ISI pakcet?

Doh! I was so fixated on checking my button logic, that i forgot about that. Yeah, didn't set that and once i did, it worked just fine.

For LFSLib.NET reference, InSimHandler.Configuration.Local must be set to true if you want to display local buttons during multiplayer.
sdether
S2 licensed
Here's a test packet. If i send it anywhere except during multiplayer (including multiplayer connect screen) it works, but nothing happens in multiplayer:


20 Bytes:
14 2d 03 00 01 00 11 00
0a 0a 0a 0a 41 00 00 00
00 00 00 00

or

Size = 20
Type = 45
ReqI = 3
UCID = 0
ClickID = 1
Inst = 0
BStyle = 17
TypeIn = 0
L = 10
T = 10
W = 10
H = 10
Text = [A \0 \0 \0 \0]

If someone else not using my Lib could test this button packet in and out of multiplayer to see if they can see the same problem, I'd appreciate it.
sdether
S2 licensed
Ok, this ought to work:

handler.SetButton(myButton,true);

but it does not.

I'm going to dig into my code and see what I may be doing wrong, but here is some behavior that makes me think it's either not allowed or a bug in LFS:
  1. Create a button in the main menu
  2. Join a multiplayer server
  3. The button will still be visible
  4. Disconnect your insim program
  5. The button will still be visible
  6. Leave the server and the button will disappear
That doesn't seem like intended behavior.

Scawen, can you clarify if local buttons are legal in a multiplayer game? I'll dig into my code and make sure I'm not screwing something else up.
sdether
S2 licensed
Or another way (to shamelessly self promote):
  1. Install LFSLib.NET
  2. Create an InSimhandler object
  3. Subscribe to the RaceTrackSplitTime event
  4. In the event handler create a new LfsButton object
  5. Send the Button to LFS via the InSimHandler
Only reason i don't write the code is, that I'm fuzzy on the VB syntax
sdether
S2 licensed
Ok, downloadable documentation in .chm format is now linked from the doc site or directly accessible from here
sdether
S2 licensed
Quote from Peptis :Is it possible to include the documentation in the .zip file? It would be a bit faster to browse around if the pages were served locally.

I need to compile it to MS Help. Unfortunately, the current state of Sandcastle doesn't generate standalone HTML only documentation, i.e. the doc site is actually a web application.
LFS.NET 0.13b (patch X) released
sdether
S2 licensed
That should be LFSLib.NET 0.13b (patch X) released

Full patch X (and X2) compatibilty is here for LFSLib.NET with version 0.13b. I've tried to run it through its paces, but can't claim that I've gotten full coverage of everything that's now possible.

More info can be found here

The new site for LFSLib.NET and it's docs are here.

If something doesn't work, assume it's my lib, not LFS and post in this thread.

If someone can tell me how to edit the title or if it takes admin rights, edit it for me, i'd appreciate it.
Last edited by sdether, .
sdether
S2 licensed
Quote from Leifde :P.S. I should go with my suggestion?

Heh, i meant to credit Rooble with the timer solution

But yeah, timer be perfect for that.
sdether
S2 licensed
Quote from Leifde :I guess there's a way since Mechanik and Tweak do it so how would I go about monitoring a memory value continuously but still allowing the rest of my app to be used? I tried a standard loop but, as I thought, it won't let me do anything else in the app.

Any ideas?

What do you mean monitoring a memory value? Is there a variable to you are trying to see when it changes? or is it some external value (like memory used)

For the first, you'll want to just make the value a property on a class so that you get a way to intercept it being changed, at which time you can fire off an event to notify anyone who cares

For the second, either DarkTimes or Leifde's suggestion would work. A timer would get fired on its own thread (from the threadpool) every so often to check, while using a thread would required that you keep a loop running in the thread to check the value (and don't forget to sleep or you'll drive your CPU usage needlessly high)
sdether
S2 licensed
Ok, good news, bad news. You're not crazy, it is a bug. But apparently only if you go through a dedicated host. I.e. i did my testing connecting directly to an LFS client and all worked. Then i set up a server and connected a client to it and my insim code to the server. Now text from the dialog is always 42 bytes followed by zero bytes and even with those bytes, the last few are garbage.

And it's not a dedicated server problem, it looks like a problem with how the client and server communicate and what gets passed on. I.e. i also set up a client/server where the server was the full LFS and then i tested the dialog on both the server and client. The server version came through clean, the client version got munged.

BTW, you were talking about length earlier and that it's always maxed out. Do you mean the TypeIn byte? If so, that byte does not tell you how much text you have received but what the initial legal limit was on the button creation.
sdether
S2 licensed
I just tested a dialog button with the typein maxed to 95 and was able to receive 95 chars without any issues.
sdether
S2 licensed
It's possible to wrap managed Dll's and call them from unmanaged code (i.e. C++). I recently had to so something like that but it wasn't what I'd call elegant. I'll dig through source control and see if i can't dig up the code and see whether that method would work for using with my OutGauge lib (I was doing C++ data injection into C#, not the other way around, so i need to see how that would work.
sdether
S2 licensed
If you're using VB2005, i assume that means you are using VB.NET? If that's true you can use my library to get at insim, outsim & outgauge. Full patch X support should be out by monday or tuesday.

Are you doing in your d3d8 injection purely via vb or are you using a lib like gpp?
sdether
S2 licensed
Quote from Krammeh :thing is, the variables never seem to stay the same (like, within a close area).

That seems to happen only if the car is not moving. Once moving the direction stays solid and if you are not slipping it's the same as Heading for forward or -180 of Heading for reverse. So, just check speed. If it's zero, ignore direction.

The constant fluctuation of direction maybe a side-effect to Direction being defined as the direction of the car's motion and so it's not properly defined if there is no motion (or it's a bug)

So basically, look at speed and direction and you should be fine for detecting people driving the wrong way. Looking at the rate of change in heading might be useful to determine if someone is spinning.
sdether
S2 licensed
Quote from Scawen :It's ok, as all the new info uses either spare bytes or new packets, so I'll leave the InSim number the same.

TIP : InSim programs should ignore new packets they don't know about and any spare bytes - that way updates will always be compatible, if not I'll raise the version number.

Cool. that's what i was hoping. I already deserialize the struct as defined, so all i have to do is expose the spare as an actual value and I ignore (log warnings) about all unknown packets. Thanks!
sdether
S2 licensed
The lib is complete, undergoing testing and doc clean-up over the weekend.

I want to remove the asyncEventHandling option from InSimHandler. Aside from the mess of code it requires, it's behavior is underhanded in its parallelism in ways that most people that turn it on won't realize. I think it's going to be a lot safer for people receiving the events to spawn off their own threads if they really need to do complex operations at event receipt. Scream now, if you think this is a feature I should be keeping.

Quote from wabz :I think the current event based model is nicer than your proposal - for example, how would that work with LFSMessage or RaceTraceConnection stuff, where there isn't a request for each response? Probably the one way to do things would be cleaner. Or am I missing something?

This feature wouldn't be as a replacement to the current async behavior of request/event and would only apply to calls that follow the request/event pattern (i.e. not Send() and not events that come without request). But I'm punting on this addition for right now anyway, so i can get the update out.
FGED GREDG RDFGDR GSFDG