The online racing simulator
making apps for LFS, how to?
(20 posts, started )
#1 - CSU1
making apps for LFS, how to?
If theres one area of this internets age that flew over my head at mach 7 is computer language, code C+, C++, Vb, python, assembley and all of the rest of them , I never could get to grips with writing my own for use with something or I just never tried or had a good bash at it....which is why I start this thread, I want to learn how to...but I need help.

For LFS I want to make an application. I want it to read network debug info and display it in a small moveable window that is used as referance to connection health whilst driving.

I have no idea where to start here and pointers as to where to start, what programms and literature to get would be greatley appreciated.

csu
#2 - Ian.H
I'd start reading up on C / C++.. ASM is all but dead these days, VB is a "practice language" (like having stabilisers on a kid's bike until you can ride a real bike) and will teach you very bad coding habits, IMO.

Interpreted languages such as Perl / Python can be useful too and well worth learning one or more scripting languages like these if you have the time.

Where to start? the same as everyone...

#include <stdio.h>
int main() {
printf("Hello World!!!!11111one\n");
return 0;
}



Personally I've never read any books per-se on "how to code".. reference manuals / code snippets etc have worked well for me.. but everyone's learning techniques are different.

One thing I do love about coding, is there's always something new to learn

How to code specifically for the sort of app you're considering, I don't know as yet, I haven't delved into the world of InSim.. but there's plenty of smart and friendly people here that I'm sure would offer some advice if you posed some specific questions to them.

Just my take on it all anyway.



Regards,

Ian
I think this would be more relevant in the programmers forum, rather than LFS technical assistance. Moved.

Quote from Ian.H :VB is a "practice language" (like having stabilisers on a kid's bike until you can ride a real bike) and will teach you very bad coding habits, IMO.

I understand what you are getting at with the coding habits, the very loose structure in VB allows you to get away with stuff other languages never would. That doesn't mean you cant' write good code in VB of course, it just requires a bit more self discipline

I don't know what you mean about VB being a "practise language". Does that make all my programs "practise programs"? I know C/C++ as well (though admittedly not as well as VB) and don't really see the big difference, or why it is treated as a kiddie language.
#4 - Ian.H
Hi Bob..

Quote from Bob Smith :I understand what you are getting at with the coding habits, the very loose structure in VB allows you to get away with stuff other languages never would. That doesn't mean you cant' write good code in VB of course, it just requires a bit more self discipline

I don't know what you mean about VB being a "practise language". Does that make all my programs "practise programs"? I know C/C++ as well (though admittedly not as well as VB) and don't really see the big difference, or why it is treated as a kiddie language.

Ahh sorry, I didn't mean any "offence" by that.. more that it's an easy language to get to grips with (reference to 'kids' wasn't meant literally in regards to VB, more of a (bad?) analogy), but has some sloppy handling of things.. but as you mention, a lot can depend on your own discipline.. but that will only really come with a fair amount of experience you need better understanding of the language (whatever it is, not VB only).

FWIW.. I coded in VB for a fair few years back in the day.. in various formats (VB4-6, VBS, VBA) and only moved over to start learning C++ after a friend who I consider somewhat of a C wizard persuaded me to learn it.

What it really boils down to though is "the right tool for the right job" IMO.. whatever the OP is more comfortable with working in (once he learns a bit about some of the options available).. I guess I'm just slightly biased towards C / C++ as I've now managed to achieve a lot more in that than I ever did with VB.. but that said, I'm still a C++ n00b really and would struggle to code some of the apps in C++ that you have in VB



Regards,

Ian
Quote from Ian.H :Ahh sorry, I didn't mean any "offence" by that..

Oh not at all, it's just I've often seen VB slated by coders from more "proper" languages and, being reasonably comfortable on both sides of the fence, I don't see what the big deal is. I've always wondered if I'm missing something from the biggir picture.
VB seems to have nice syntax and often requires less lines of code to achieve the same basic operation (although it does make extra hassle for other things, so it's swings and roundabouts a bit). For quick and simple programs it just seems to be quite convenient.
I'm impressed that it only took 1 post before it turned into a slagging match between languages. If you're not confident with programming in general I wouldn't suggest starting with C or C++, and I'd recommend something memory managed, like C# or VB, or even php or python.

The long and short of it is that if you want to use InSim / Outsim / Outgauge (which will give you things like player position, autocross penalties, etc.) then you need to use a language capable of;
1. Networking
2. Unpacking structs / binary packed strings (whatever you want to call them)

The problem is that you want data that isn't exposed by any of the above - network debugging data.

I assume you want ithe network debug data specific to LFS, not in general for the computer?
#7 - CSU1
Quote from the_angry_angel :
I assume you want ithe network debug data specific to LFS, not in general for the computer?

Yes just LFS data. is insim able to tell me ping, and the percentage of lost or dropped packets?

edit
...and which of these should I begin with:

Visual Web Developer
Visual C#
Visual Basic
Visual C++
SQL Server
Visual J#

E;
http://blogs.msdn.com/coding4f ... ve/2006/11/02/938703.aspx

Quote from CSU1 :Yes just LFS data. is insim able to tell me ping, and the percentage of lost or dropped packets?

You have to count the packet loss yourself.

Send the following IS_TINY packet (in hex):

04 03 03 03

and LFS will reply with (in hex):

04 03 03 04

For network programming, I suggest python.
Quote from wheel4hummer :You have to count the packet loss yourself.

Send the following IS_TINY packet (in hex):

04 03 03 03

and LFS will reply with (in hex):

04 03 03 04

For network programming, I suggest python.

but... then you need the server admin password and ip or you can only measure the packet loss on the local pc which should be 0.00000000000...00001% ^^
Quote from GeForz :but... then you need the server admin password and ip or you can only measure the packet loss on the local pc which should be 0.00000000000...00001% ^^

Yes, you would need the admin password. But, insim does not have to be on the local pc. You can run an insim app from your computer, which pings a remote server across the world.
yea sure. I just wanted to say that you probably can only monitor your own pc->own server connection which is useless for the majority of drivers because they have no server (and probably wont get any ip/port/ pw)

-> insim isn't the choice for such an app but hooking network traffic or sth. like that
Quote from GeForz :yea sure. I just wanted to say that you probably can only monitor your own pc->own server connection which is useless for the majority of drivers because they have no server (and probably wont get any ip/port/ pw)

-> insim isn't the choice for such an app but hooking network traffic or sth. like that

Oh. I think I misunderstood his question. He meant the ping between the individual users and the LFS server. Nevermind then.
#14 - CSU1
Quote from the_angry_angel :
The problem is that you want data that isn't exposed by any of the above - network debugging data.

Quote from GeForz :-> insim isn't the choice for such an app but hooking network traffic or sth. like that

so i needs to get me network debugging data....from logs or something?
If only it was that easy.

I guess you want to get data on which players are lagging, ping time to the server, etc.?
For that you'd either have to;
1. read the memory LFS allocates for that data
2. do some mad screen scraping and estimation
3. write your own OS level diagnostics tools to sniff the network data to and from LFS
4. Do something mad and create some mad InSim <-> master server hybred which looks for the name of the server you connect to (insim), you then query the master server itself (using its own, "undisclosed" protocol) to get the IP of the server you're connecting to, so that you can ping, etc. it yourself (no guarantee that the address you get will actually respond to ICMP data)

The thing is that LFS doesn't publically make available what you want.

You could do what wheel4hummer suggests but;
1. you only get the response time between the server and the insim client (not the same as players)
2. you'd need the administrative password for every server you play on to do it
#16 - CSU1
Quote from the_angry_angel :If only it was that easy.

I guess you want to get data on which players are lagging, ping time to the server, etc.?

No, the data that the 'PPL display' will need is local only. It does not need other client informatiom via master, only ping, packets lost/dropped from master to me.

It's only a silly rice ad-on to know whats going on when your hammering through 32 cars and dust and all.

lag and network restrictions on client networks is the only bottleneck in most multiplayer platforms and I feel a small 'early warning' like this could add to the racing envoirment/experience.
I'm obviously not understanding and you've got a couple of contradictions there.. at least in my eyes.

You want it local? Errr? Wuh? I think I know what you mean, you only want the details between you and the place you're connecting to?

Between you and the master? Due to how networks work your connection between you and the master maybe fine, but your connection to the server you're playing on may not be.
#18 - CSU1
Quote from the_angry_angel :? Errr? Wuh?
, your connection between you and the master maybe fine, but your connection to the server you're playing on may not be.

ok, I thought that client connects to a big huge master server somewhere in Germany or something like a friggen ultrapeer....

lets say in one second the .com server that you are connected to sends you eg.30 packets, if LFS only received 20 packets(updating 10 cars in close proximity...hammering through dust n' all:tilt
would the client begin to lag?

can the client and master to agree if they got the same 'packet amount received' every second? if so could you post a link to the number?
Quote from CSU1 :ok, I thought that client connects to a big huge master server somewhere in Germany or something like a friggen ultrapeer....

All the master server does is list the LFS servers, send skins to S2 players, and a few other things. The actual race data goes to the LFS server that you are playing on.

Quote from CSU1 :lets say in one second the .com server that you are connected to sends you eg.30 packets, if LFS only received 20 packets(updating 10 cars in close proximity...hammering through dust n' all:tilt
would the client begin to lag?

What on earth is a ".com server?" Something.com is just a domain. And, if the server sends you 30 packets, but you don't reply, then you willl probaly be disconnected from the server. With TCP in non-blocking mode, a server would send a packet, and wait for the reply. If the reply does not come back within a certain amount of time, then I think the packet is sent again.
Quote from CSU1 :Yes just LFS data. is insim able to tell me ping, and the percentage of lost or dropped packets?

edit
...and which of these should I begin with:

Visual Web Developer
Visual C#
Visual Basic
Visual C++
SQL Server
Visual J#

E;
http://blogs.msdn.com/coding4f ... ve/2006/11/02/938703.aspx


If you are going to develop on Microsoft's .NET platform then I would recommend Visual C#. It's very clean and elegant, it often forces good coding practices on you (this is not a plus for everyone), and it's very powerful. Plus you get Visual C# Express for free, which is just one of the best IDE's ever in my opinion. In addition there are a lot of extremely good tutorials and resources.


using System;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, world!");
}
}
}

I would avoid Managed Direct X for games, but instead use XNA.

making apps for LFS, how to?
(20 posts, started )
FGED GREDG RDFGDR GSFDG