The online racing simulator
FAQ's And Good Practise: 19th May 2008
How to ask intelligent questions
You may think that this is a stupid question, but you'd be surprised. Many, many moons ago behaviour prompted a gent called Eric S. Raymond (you may know him as ESR, or one of the fathers of open-source) to write the How to ask questions, the smart way? document.

Is this a technical assistance forum?
Unless it's specifically about producing third party code relating to LFS, then no - you should consider posting here instead.

Is this the forum for the official LFS development team?
No. This forum is about programming in conjunction with LFS, although
the devs do frequent here occasionally.

Can we add vehicles?
No, not at this stage.

Can we change the vehicles?
It's possible but requires a lot of work and makes the game incompatible with other clients. For most people this should be considered a more advanced task.

Does anyone know file format X?
The odds are that we probably do. There are a few which are documented here.

Officially released file formats can also be found here.

What is InSim?
InSim is the network protocol for getting live data out of LFS. Predominately it is used for servers, but it can also be used for client side additions. Currently InSim can;
  • provide information on the version and state of LFS
  • provide information on the currently connected players, and the players currently participating in a session
  • provide the location of each racer
  • provide the current chat messages, and send chat back
  • provide information on any votes
  • display buttons on the screen of any player
  • and much more
If you're still not sure exactly what InSim is and how to use it, you may want to checkout this thread entitled Insim: Once And For All!, or Guide: My first InSim Application

For the full InSim specification checkout the InSim.txt, which can be found under the docs directory of any LFS installation. Be aware that this is simply a heavily commented C and C++ compatible header file.

You maybe interested in the following libraries, which may help with any InSim-related development.If you do use any of the libraries available, please ensure that you understand the license which they are made available under. There is a section below that may help you with this.

If you do not wish to use a third party library, then you need to know the how to acheive the following in your chosen language:
  • TCP or UDP Networking
  • How to convert C structs, or "binary strings" as they are also known in some languages, into an equivilent datatype (i.e. array, table, etc.). In many languages this is acheived by pack'ing and unpack'ing strings.
It is worth noting that "recently" the InSim protocol changed significantly, providing many enhancements. Unfortunately the previous version (3) and the current version (4) are completely incompatible and older libraries will not work.

What is OutSim?
OutSim is a subset of InSim, and provides support for motion simulators. It will only provide data for a local racer (i.e. this is useless initialising on a server application).

Data will only get output from an internal view (currently). For more information checkout the "OutSim - MOTION SIMULATOR SUPPORT" section of InSim.txt, which can be found under the docs directory of any LFS installation.

What is OutGauge?
This is a method of getting the local racer's dashboard information from LFS to an external program. Usually you'll want this if you're after getting a "real" dashboard working. Examples can be found here and here.

Outgauge packets can initialised from within InSim, or the cfg.txt file for LFS can be setup to send the Outgauge packets over UDP directly to a given address and port.

For more information checkout the "OutGauge - EXTERNAL DASHBOARD SUPPORT" section of InSim.txt, which can be found under the docs directory of any LFS installation.

What units of measurement are generally used?
Angles temd to be measured in radians, and distances are typically measured in metres, where 0 is represented as 0, where-as usually 1 is equal to 65536.

Using information from LFSWorld
You can find information on using data contained within LFSWorld in this subforum. However, you maybe interested in the following libraries;I can't program, can you help?
Of course, but please be aware that if you want to succeed in writing your own program you'll need to put in a lot of work learning the basics. You cannot run before you can walk.

More information can be found here.

Please also be aware that if you are unable to perform the basics of searching for answers, or read existing threads, then you are unlikely to be helped much. This is not elitist, but a common courtesy and a demonstration of how much work you want to put into a project.

For simple questions most members of the community will not simply provide answers based on the thinking that if we can teach you how to come up with the answers yourself then you will be a better programmer in the long term.

I want application X/Y/Z!
If you are incapable of writing a program for yourself, please post a request here.

Please remember that we are not paid to produce a program for you (unless you make a contract with a given person, obviously), and we are not obliged at all to help. We will help out because we want to, or have time to.

Please do not whine if you request the same application that has been asked for several times and you get a shitty response, or get pointed to an existing thread.

I want a cruise/money server!
There is currently an example 'cruise' server application, which is made available in this thread, and an improved and BSD licenced open source cruise application here (these are both aimed at people who can program, or package, for the moment).

Good practice guide
As a general rule, if you find something which could be classed as a cheat (mods, hacks, or any tool which could gain the racer unfair advantages) report it to the development team directly (Scawen will be particularly interested), and not here - unless you get the express permission of the LFS team.

If you have an issue with a third party addon that has been publically released (i.e. it has a thread in Unofficial Addons, it is considered polite to post requests for help in the Unofficial Addons thread, or to take it up directly with the author of that mod.

If you are having a problem please search first. You may find that it has already been discussed.

Please remember that regular posters to this subforum are not paid, and not officially associated with the LFS development team. As such do not expect an answer at the drop of a hat.

Using third party libraries and code
Various libraries released here fall under various licenses. Unfortunately this makes using the code, in some circumstances, somewhat interesting. Sadly there has recently been a bit of a problem regarding this, so I've decided to append this to the FAQ.

You can also find a discussion on what various libraries are licenced as in this thread. It also contains some brief discussions on the opinions over which licence you may or may not want to consider.

Typically when code is posted online, unless it has anything elsewhere stating otherwise, you should assume that the code is copyright to the original author, and you should ask permission to use their code.

To prevent code being reused inappropriately, the original author can apply a licence to the source code, which legally puts restrains on how that code can be used.

Before you read this, I would like to point out that I am not a lawyer. If you have concerns please approach one and discuss the relevant project with them.

I have been around this stuff for quite some time, and the vast number of licenses can be bloodly confusing sometimes, so I've outlined some of the usual suspects.
  • Public domain/Copy-free
    Complicated as this doesn't entirely exist all over the globe. Usually means "do what you want with it, I don't care".


  • GPL (GNU Public Licence)
    The GPL is known as a copyleft license, which means that you cannot incorporate GPL-covered software directly in a proprietary system. The goal of the GPL is to grant everyone the freedom to copy, redistribute, understand, and modify a program.

    If you do wish to rely on GPL'ed code, then you must either make them work at an "arms length", or the author must give special dispensation in the license.

    However, in many cases you can distribute the GPL-covered software alongside your proprietary system.

    The GPL demands that you make the source code available for any changes and for any licensed code, retaining any notifications. In many instances, code that is produced is held back from publication, until a product is deemed "ready". However, this is not a legal part of the GPL, and is typically just an ettiquette issue.

    There is nothing to say that you cannot charge for services, or providing the code in some form.

    There are also multiple versions of the GPL, which have slightly different terms regarding encryption and DRM. I have not covered these issues. If these affect your project, please research this license carefully.


  • LGPL (GNU Lesser General Public License)
    The LGPL was designed as a compromise between the strong-copyleft licenses and permissive licenses, such as the BSD family of licenses.

    The main difference between the GPL and the LGPL is that the LGPL can be linked to (in the case of a library) any program. This program can then be distributed under any chosen terms if it is not a derivative work. If it is a derivative work, then the terms must allow "modification for the customer's own use and reverse engineering for debugging such modifications". Whether a work that uses an LGPL program is a derivative work, or not, is a legal issue. A standalone executable that dynamically links to a library is generally accepted as not being a derivative work.


  • BSD Licenses
    There are a number of BSD licenses, which make this a rather tricky subject. In short they are a class of permissive license. The basic gist is:
    "Take it down to the copy center and make as many copies as you want, but don't come running to me if it breaks."

    I'd suggest you research the exact terms of the license you are using in this case as there are some ammendments. I've outlined a couple of the common ones below.


  • Apache License
    The Apache License (Apache Software License previous to version 2.0) is a BSD-like license authored by the Apache Software Foundation (ASF). The Apache License (versions 1.0, 1.1, and 2.0) requires preservation of the copyright notice and disclaimer, but it allows use of the source code for the development of free and open source software as well as closed source software.


  • MIT/X11
    The MIT, or X11 licence as it is also known, is BSD-like license, meaning that it permits reuse within proprietary software on the condition that the license is distributed with that software.

    You are not required to open source your code, or provide the MIT/X11 licenced code, or it's changes, to my knowledge.


  • MPL (Mozilla Public Licence)
    Is a BSD-like license, except that source code copied or changed under the MPL must stay under the MPL. The code under the MPL may be combined in a program with proprietary files.


  • Microsoft Public License
    "Much like a BSD-style license, except that it prohibits re-licensing if the code is distributed in source code form."


  • WTFPL (Do what the **** you want Public License)
    See http://sam.zoy.org/wtfpl/ for more details. Consider it a globally legal version of "Public domain/Copy-free".
If you wish to apply a license to your code and release it you must get the relevant copyright releases from the developers who produced the code, in writing usually (only applicable if theres more than one developer, or a developer no longer works on the project), and then apply the license in the way that your chosen license dictates. I have not covered this myself, as this is somewhat more of an advanced topic.

This section was largely provided by the wikipedia project, and the respective resources for each license.

MiscAnything else to add?
If you have anything to add please contact myself, or a moderator, and we'll add the information if appropriate.
I just wanted to draw attention to this thread as I've finished updating it for the first time in nearly 2 years (yes, I've been slacking, sorry I won't let it happen again). If I have missed a library or some item of information, or over stepped the mark in places, please let me know.

Cheers guys.
Good stuff!

My only suggested addition would be a section specifically on making a cruise or 'money' server. I know you basically cover this already, but it is one of the most frequently asked questions and it does appear to be a matter that's rather misunderstood.

That being said, the whole cruise server question might be better served by its own FAQ thread as a sticky in the Addon Requests forum...
I'd just like to bump this as I've outlined some of the issues regarding licensing of libraries and code, of which there was a recent issue. I've edited it a few times, hopefully so that we've not got any blinding problems, and hopefully so that it's all in fairly plain speaking.

At some point soon I'll probably start a thread on how each library released here is currently licensed and seeing how that affects projects that depend on it. I have the feeling that we might have a few more surprises, sadly.

I'd really appreciate any thoughts and comments. Cheers guys.
I really don't have anything to add, your doing a great job.
I would say that it would be cool to link to the text of the license, but there are so many versions of some of these it's crazy.
tbh I'd kinda expected anyone competant at producing something worth licencing, to google it quite easily, but the fact that 2 people have mentioned this is making me wonder about revising it Cheers for the feedback guys.
It's not for the person who is making the program, it's for the other people that know that my program is under MIT, but I don't have the text.
Hi TAA,
Just to point out the title says Sticky, but I found this on page 2, not on the top of page 1 as would be expected.

So here's a bump so it gets noticed
It's at the top of every page - as it should be
Please insert new user
Quote from JamesF1 :It's at the top of every page - as it should be

I know I've been away for a while, but I don't think I'm that rusty. It was definitely halfway down page 2 on this end. I wouldn't have posted otherwise. Temporary glitch perhaps

Ta anyway

[edit]
:dunce:
How stupid do I feel?

I was looking at a search page where I had been looking at the subforum before. Please accept my apologies and delete these posts as they serve no purpose other than clutter.[/edit]

FGED GREDG RDFGDR GSFDG