The online racing simulator
Searching in All forums
(243 results)
sdether
S2 licensed
Quote from Dygear :That's not the point. I would like people to learn how to buld an InSim app along with myself.

If you are trying to build a GUI application, look at the Tester App that's on the page linked to by my sig. It's a simple Windows.Forms application for connecting to LFS, sending and receiving messages, etc.
sdether
S2 licensed
Andy,

If you just want to communicate with LFS from VB.NET and not worry about implementing the InSim protocol, take a look at this. It's in C#, but if you just reference the dll, you can use it directly in VB without having to worry about C#.

HTH,
ether
sdether
S2 licensed
Quote from Dygear :You rock!
Edit1, just noticed in Express, they change all of my tabs to spaces. Is there anyway to keep it tabbed?

Don't know about Express, but in Visual Studio under Tools->Options->Text Editor->C#->Tabs, you can change that behavior.

Quote from Dygear :
Edit2, Oh error, "Exception of type 'LiveForSpeed.InSim.Exceptions.InSimHandlerException+NoVersion' was thrown." On line 18.

LiveForSpeed.InSim.Exceptions. ... andlerException+NoVersion generally means that LFS didn't respond. Either you connected on the wrong port (set config.LFSHostPort = 30228; for your setup) or LFS wasn't ready yet. Basically it takes about 10 seconds after LFS shows the first splash screen before it accepts insim connections.

using System;
using LiveForSpeed.InSim;

namespace ConsoleTester
{
class Program
{
static void Main(string[] args)
{
// Create InSimHandler option. The first false tells it that we don't
// want Asynchronous event handling, the second false tells it
// that we don't want to use the App Config to set up configuration
InSimHandler handler = new InSimHandler(false, false);
// Gets the config object (this is just for easier access to it)
Configuration config = handler.Configuration;
// The IP address that LFS is on
config.LFSHost = "127.0.0.1";
// The port LFS listens for InSim on ( /insim= )
config.LFSHostPort = 30000;
// The port we want LFS to talk back to us on
config.ReplyPort = 30001;
// Should LFS send keep alive ACKs and should we automatically reply
config.UseKeepAlives = true;
// Use the split message package structure
config.UseSplitMessages = true;
// Turn on guaranteed Delivery
config.GuaranteedDelivery = true;
// Send ISI packet.. Also sends VER packet to make sure
// that we're talking to an instance of LFS that's compatible
handler.Initialize();
// Now we should be connected and know the LFS version, so
// we query it
Console.WriteLine("LFS info:");
Console.WriteLine(" Product: {0}", handler.Version.Product);
Console.WriteLine(" Version: {0}", handler.Version.Version);
Console.WriteLine(" Serial: {0}", handler.Version.Serial);
// Closes the connection to LFS.
handler.Close();
Console.WriteLine("Press RETURN to exit");
Console.ReadLine();
}
}
}

sdether
S2 licensed
Quote from Dygear :Ya know what sdether, I might try C# providing one thing. You help me setup what I have to, in order to get a simple LFS InSim program to connect to InSim. For example, it connects to InSim and asks for LFS version. Ok?

First Step, what do you use to program in, and how do you set that up. (I sware if I have to install those stupid playform files, I am sticking with C++).
Second Step, some example code to get the example program to connect to the LFS server and ask for the version.
I'll take over from there.

I program in Visual Studio, but I realize that that is a luxury. Visual C# Express, SharpDevelop or MonoDevelop are all good, free resources. One way or another you will have to have .NET installed (or mono on linux).

If you look at http://www.claassen.net/geek/lfs/ you will see a zip file with a GUI tester application. However, below is a simple, command line example to do what you asked for:


using System;
using LiveForSpeed.InSim;

namespace ConsoleTester
{
class Program
{
static void Main(string[] args)
{
InSimHandler handler = new InSimHandler(false, false);
Configuration config = handler.Configuration;
config.LFSHost = "127.0.0.1";
config.LFSHostPort = 30000;
config.ReplyPort = 30001;
config.UseKeepAlives = true;
config.UseSplitMessages = true;
config.GuaranteedDelivery = true;
handler.Initialize();
Console.WriteLine("LFS info:");
Console.WriteLine(" Product: {0}", handler.Version.Product);
Console.WriteLine(" Version: {0}", handler.Version.Version);
Console.WriteLine(" Serial: {0}", handler.Version.Serial);
handler.Close();
Console.WriteLine("Press RETURN to exit");
Console.ReadLine();
}
}
}

Basically with my lib, by virtue of connecting to LFS, the handler object will already have the version information. The ouput looks like this:


LFS info:
Product: S2
Version: 0.5Q
Serial: 2
Press RETURN to exit

Hope that helps.
Last edited by sdether, .
sdether
S2 licensed
Any particular reason you are punishing yourself with C++ Messiah and myself have tackled InSim in C# already. Even if you don't want to use someone else's Lib, we're both released under GPL, so you could always use our source to learn how to do it in C#.

Personally, I avoid languages that make me manage my own memory, because these days the performance gains just don't seem to be there unless you are writing video games (and even Managed DirectX games are making inroads). Not trying to start any language preference war, just trying to make sure you are choosing C++ for the right reasons.

If your concern is ability to move your code to other platforms, I know my lib runs under mono, and pretty much anything written against the 1.1 spec of .NET will run under mono. The way I see it, the only real drawback to .NET/mono is having to install the runtime (23MB). However, it comes standard with every windows OS shipped and installs with SP2 for XP and the new Ubuntu and Fedora Core distributions come with mono pre-installed, so the runtime requirement is quickly becoming a non-issue.

Just a thought.

cheers,
ether
Last edited by sdether, .
sdether
S2 licensed
Quote from ORION :Very unlikely i'd say.
Doesn's this app just control the ingame shift+u camera?

You'd think so, but no. With InSim you can put the camera anywhere, but as FrankMD you may come across visual aritfacts. Basically shift+u limits you to the boundaries used by cars, so there are lots of places you can put the camera that don't give you artifacts that you can only get to with insim. But going behind the fence may or may not work as desired. I.e. you may find out that the fence isn't textured on the back, since it wasn't intended for you to be viewing from there.
sdether
S2 licensed
Quote from farcar :Yeah anything counts so to speak.
I was also interested in RL racer's views on LFS. What's realistic and what's not.
My bet is that most aspects of LFS are in fact close to the real thing with the biggest differences being G-forces and other loads on your body when racing. My (limited) karting experience will attest to that.

I'll second the impact of not feeling the g-forces. While I'm not a RL racer, I have autocrossed extensively and done some track time. Recently I've had the opportunity to spend some seat time in a Force Dynamics 301 w/ LFS and while there are still low speed grip issues, they are much less severe when you can feel the g-forces.

The XR GT Turbo was very well behaved although still a bit more tail happy at low speeds than my car (which is similar in power/weight ratio).

The FO8, which I could barely drive at all with my normal wheel and pedals, became controllable. The biggest difference was that you felt the loss of traction before you could see it on screen and that meant I could correct in time. Without the forces, by the time i realized it on screen, i usually couldn't catch it.
sdether
S2 licensed
When all is said and done, I hope sales of the triplehead2go will be good enough that ATI and Nvidia recognize that triple head cards have a market and decide to just build a GPU with 3 outputs.

Truly, having fast 3D cards with dual head make almost no sense to me. I use dual head for work all the time. It's really good for programming. But i never use it for gaming. Always just use a single head because almost all games will have the focus of the action in the center, where with dual head you just get a big bar. We'll see what develops.
sdether
S2 licensed
Quote from Scawen :Yes, a projector is a great solution, if you have a plain white wall, and you can rearrange your room and put the racing seat in the middle. I tried this once with a friend's projector, and it was great. Only thing is, i can't lose that space, i need that wall for other things, and so the three monitor solution is good because i can have them on the window side, and my racing seat there facing the window. So... projector is great if you have some space available, but 3 monitors is good for space restricted people like those who live in and around London.

Another problem with the projector is that while you can blow it up real nice, it's not that high res. And if you go with a 16:9 projector you're basically looking at 960x600. You can really see every pixel when you get close to that projection.

I'm definitely going to check this device out once it drops. Dell keeps running crazy deals on 19" LCDs that picking up a third isn't going to be too hard. And yeah, those are 1280x1024 @ 60Hz native, like most 19" LCD, so the 15:4 "special" mode would be much appreciated.
sdether
S2 licensed
Is there another location to get the pack from other than the link on the first page? The file i downloaded from there did not have any dds files, just the pic and skins folders

thanks,
sdether
sdether
S2 licensed
Quote from Kegetys :It sounds very odd that you would get a performance increase from having the mipmaps "pregenerated" in the DDS files. There are mipmaps in use already in LFS (You can clearly see this, especially with AF off), the mipmaps are just generated when the texture is loaded instead of keeping them in the DDS files.

After reading all this Mipmap stuff, i decided to do some test. When coming down the back straight on Blackwood, the office buildings in the distance always exhibited bad banding. I thought this would be alleviated by upping the anti-aliasing and ansiotropic filtering, but it didn't. So last night, i created mipmaps for the building texture and the banding almost disappeared completely. From that I would say that LFS either doesn't generate mipmaps, or the generated ones are just not the same as pre-generated ones.

Edit: I just read the replies from Scawen, so I don't know whether my observations were some psychological effect or what, but I swear the banding that had bugged me since the Demo was no longer there after I generated the mipmaps.. hrm
Last edited by sdether, .
sdether
S2 licensed
I played with the dual head thing for a bit. I can just stretch the window across multiple screens, but as has been pointed out, that is amazingly slow. Once I told the hardware to treat both screens as a single surface ran fullscreen across both at full framerate. I played some with moving the view around, but unfortunately never ended up with a view that felt better than a single screen.

I've contacted Nvidia about a triple head card, so far no response. If someone finds a person over there that's responsive or willing to get emails to count the demand, i'll resend my request.
sdether
S2 licensed
Hrm... Ok, that's a strange arrangement for the color, but i'll go with that for now.. Here's the revised (and a lot wordier) file spec:


offset type number description
------ ---- ------ -----------
0 char 6 LFSCFG
6 byte 1 0
7 byte 1 Version byte (0.5P is 250)
8 char 15 filename of the skin associated to
the .COL file (part between <CAR>_ and .JPG
23 byte 1 0
24 byte 1 First Body Red Component (10-160)
25 byte 1 First Body Green Component (10-160)
26 byte 1 First Body Blue Component (10-160)
27 byte 1 0
28 byte 1 Second Body Red Component (10-160)
29 byte 1 Second Body Green Component (10-160)
30 byte 1 Second Body Blue Component (10-160)
31 byte 1 0
32 byte 1 Third Body Red Component (10-160) (only UFR)
33 byte 1 Third Body Green Component (10-160) (only UFR)
34 byte 1 Third Body Blue Component (10-160) (only UFR)
35 byte 1 0
36 byte 1 Unused Body Red Component (10-160) (only UFR)
37 byte 1 Unused Body Green Component (10-160) (only UFR)
38 byte 1 Unused Body Blue Component (10-160) (only UFR)
39 byte 1 0
40 byte 1 First Wheel Red Component (10-160)
41 byte 1 First Wheel Green Component (10-160)
42 byte 1 First Wheel Blue Component (10-160)
43 byte 1 0
44 byte 1 First Wheel Red Component (10-160)
45 byte 1 First Wheel Green Component (10-160)
46 byte 1 First Wheel Blue Component (10-160)
47 byte 1 0
48 byte 1 Unused Wheel Red Component (10-160)
49 byte 1 Unused Wheel Green Component (10-160)
50 byte 1 Unused Wheel Blue Component (10-160)
51 byte 1 0
52 byte 1 Unused Wheel Red Component (10-160)
53 byte 1 Unused Wheel Green Component (10-160)
54 byte 1 Unused Wheel Blue Component (10-160)
55 byte 1 0

.COL Color components
sdether
S2 licensed
I did a quick pass through the .COL file and came up with this:


S2 .COL file specification.
---------------------------

TYPES :
=======
char: 1-byte ascii character
byte: 1-byte integer
int: 4-byte int

offset type number description
------ ---- ------ -----------
0 char 6 LFSCFG
6 byte 1 0
7 byte 1 Version byte (0.5P is 250)
8 char 15 filename (part between <CAR>_ and .JPG
23 byte 1 0
24 int 4 First Body ARGB color value
28 int 4 Second Body ARGB color value (only some cars)
32 int 4 Third Body ARGB color value (only UF GTR)
36 int 4 Fourth Body ARGB color value? (unused)
40 int 4 First Wheel ARGB color value
44 int 4 Second Wheel ARGB color value
48 int 4 Third Wheel ARGB color value? (unused)
52 int 4 Fourth Wheel ARGB color value? (unused)

Except that I seem have been a bit too fast on the trigger on the color values. I figured, since they were already 3 bytes followed by a 0 byte that just smelled a whole lot like ARGB ints. But when i load them up as ints and convert them to ARGB, the colors are all wrong. The values seem to just go from 0A (components at 0) to A0 (components maxed out).

Did a search here and RSC and couldn't really find anyone else having dug through this. anyone got a suggestion?

ether
sdether
S2 licensed
Quote from bbman :Yeah, but since you can just watch the races on normal servers (though taking a slot which can be used from someone else to actually race), the only problem should be disable the button to join the race... And that the input doesn't come from the connected clients, but from the Racing-Server... And this data is streamed to the clients, like a video-stream... Or am I way off?

It may be as simple as that, but I have a feeling it is not. The data isn't really streamed to you as in the sense of a video. What's really happening is that the servers sends you information for running your simulation and keeping it in sync with all other clients. Because of this, i have to assume that the client does a fair bit of responding where it's at. The reason why I can see this not being easy to proxy is that i bet that depending on your processing speed, network speed, packet loss and a number of other factors, your conversation with the server is going to be quite a bit different from the conversation another client has with the server.
sdether
S2 licensed
Quote from bbman :Why not using another server as a relay? The gameserver gets the updates from the clients and sends it to another server (the LfSTV-Server), where the audience connects to... Such a server-version wouldn't be hard to make (I think), as the option to just watch is already built in the normal servers...

The problem most likely would be that even while you watch as a client, there is some kind of handshaking going on. I.e. the servers sends you a packet and you have to respond in a specific way for your connection to be maintained. At that point the proxy needs to be smart enough to handle those responses and also pass them on and be able to handle any requests from the clients.

Just because you're only watching doesn't mean that your machine isn't doing a fair amount of back-and-forth to sync up the simulations running on the server and client.

Of course, this is all speculation
sdether
S2 licensed
Quote from the_angry_angel :IPTV is certainly a good content delivery option, but still we dont have a good method for relaying at a reasonable speed. The ultimate option is to use LFS netcode.

I agree. I think HLTV is the model to mimick. But that'll require implementation from Scawen. Maybe something for S3.

I mean trying to figure out whether you can have some kind of proxy that transmits the netpackets from one client to a bunch of clients is a possibility. But it really depends on the amount of handshaking that's specific to the connection that goes on. Maybe Scawen can comment whether this is possible (i.e. worth sniffing traffic to figure out) or whether network traffic is built so that a client/server handshaking is too complex to fake.
sdether
S2 licensed
Scawen:

To take a horrifically simplistic view of this, as much as I understand Direct3D can render TrueType fonts. Couldn't you just replace your font with calls to render your text using TrueType fonts? If that was possible, you could put the name of the true type font into the cfg and then people could substitute whatever Unicode font they have for the default one. The only thing missing then is that the translation files are stored as UTF-8/16/32 instead of ASCII with latin-1.
sdether
S2 licensed
Yeah, it should work. I've changed the track on dedicated servers with InSim before without issue.
sdether
S2 licensed
Quote from boxer :lol are you denying penalties for those offences do not exist? How is it not more realistic?

I just looked at my quote of your statement and had not trimmed it appropriately. I was referring purely to the blue flag, for which I have not seen any penalty in any race i've watched. I've seen penalties for blocking and for improper passes, but not for not yielding the line during a blue flag situation. Could be I don't watch enough racing, but from the definition of the blue flag, i don't see how a purely advisory flag could yield a penalty.

The rest of the flag penalties, I agree would be realistic and useful. Except that many of those situations are human judgement calls and hard to execute well in code.
sdether
S2 licensed
Quote from boxer :The rules in LFS should be made slightly more realistic. If you ignore a blue flag after a certain ammount of time, you should be penalised. Over-taking under yellows should also inflict a penalty. What exactly the penalties would be, im not sure, but surely it would encourage drivers to obey the flag rules?

Actually that wouldn't be more realistic.

Quote :According to the General Competition Rules, the blue flag is an advisory flag only, and may be held stationary or waved. In all cases the overtaking car has the responsibility to make a safe pass.

Slower people should move off the line, especially when being lapped, but there is no inherent right for a passing car to get the line simply because they are faster.

I know there are a lot of people that think they have some sort of divine right to pass, but they don't. The passer is always responsible to pass safely. Now if the slower car is purposely blocking, they should get a black flag. But determining blocking versus just staying on their line is something that's unfortunately not yet in the realms of the flag system of LFS (or really, any game).

I've seen a lot of crashes that were caused by people agressively passing in a turn, where in IRL they wouldn't dare because of safety. And then they start screaming about the guy they crashed into not respecting the blue flag.

I'm not saying these are the only culprits. I've seen plenty of people "ambling around the track, not worried if they cause a pile up" like Tristan put it, but i've seen just as many people driving like hot lappers blaming every crash in a hair pin on someone not getting out of their way.
sdether
S2 licensed
Very cool. Can't wait to see what people come up with using this.

It'll probably be a couple of weeks before i have the time to get the new methods into my Lib to let it work seamlessly as a relay client.
sdether
S2 licensed
Quote from mkinnov8 :
The CRC is here to provide a clean place for people to race, we have one private server and two public ones. One is on a testing deal, we get the server free as long as there are people using it. At this time, we cannot risk this server not being used, and so we are keeping it public. The other 23 man server will be used for events etc, so sometimes this will be public, sometimes private. And we do have a private server. I am not willing to go into much more detail in public regarding our servers... What I will say is this.. If the community thinks the CRC is not doing its job, come to the website, register and tell us what we should be doing, tell us that this that and the other is wrong, come and show us how to do it... I cannot afford to rent servers at this time. If there is some kind soul that wants to donate, please, please do so, its not for us personally, its for the community.

I was not trying to criticise the CRC, just wanted to point out that if you guys can't keep private servers full, maybe a pay server wasn't a usable solution. But if the CRC cannot afford to own private servers, then maybe the pay-to-play server idea is something that would work?

There do seem to be plenty of serious racers, just not when they go online without prior organization. Events are great, but i'm willing to bet that many of us generally have to go for pick-up games when we have time. Personally, between work and family, I'm lucky if i get an hour late at night to do some racing, so I look for the best server then.

Of course, I don't know if things are worse other places and i've been lucky, or maybe i'm too oblivious to notice, but while there are few servers with people around during my time to race (US West Coast, usually 10-mighnight), I have had very good experiences online. There's almost always an AS National GTR race going with 5-10 people and aside from mistakes, everyone seems to be driving cleanly. Maybe i'm the noob that this thread is about -- nobody's complained to me, but I am usually the slow guy
sdether
S2 licensed
Quote from tristancliffe :1. Make LFS more expensive. Price ourselves out of the main consumer market, and only the serious will tend to bother with it. Overall sales will decrease, but it'd sort the men from the boys.

2. Make LFS more 'simulated' Get rid of nearly every arcade/noob add on, and make it as pure as a pure thing on national Pure Day. The fun-runners won't want to bother because the learning curve is too steep. The more serious people will put the effort in, and ultimately be rewarded with the best online experience.

I think one way or another it'll decrease sales. I don't think less sales would be popular with the dev's and they do deserve good sales for their hard work.

Here's an alternative that would have it both ways. Create a set of pay "subscription only" servers. Voila, you got a playground for just those who are dedicated, and still plenty of sales for the dev's and normal servers.

But then again, that's basically what the CRC is for, but without the cost. I guess my follow up question would be, is the CRC not serving this need of having servers limited only to people who have proven themselves serious? Or is the problem that there are just not enough serious racers to have enough servers with enough people online all the time?
sdether
S2 licensed
Would the SMX files be a useful start of 3DS rendering? They're completely devoid of texturing, low poly and don't really have much in terms of world objects, but at least it's the basic landscape?
FGED GREDG RDFGDR GSFDG