The online racing simulator
Searching in All forums
(118 results)
Peptis
S2 licensed
Quote from burnsy1882 :i think the reason why it doesn't work locally is because LFS sends the buttons to a specified connectionid, and a local or self hosted game doesn't have the connectionid's. but don't quote me on that , as that's what i've gotten from my testing. i tried running it locally, not connecting it to a server, and found the same problems.

LFS treats buttons differently depending on whether the InSim program is connecting to a client or a host. There is a "local" setting that you need to set for client connections.
Peptis
S2 licensed
The following page documents the RAF file format: http://www.lfs.net/?page=RAF. From that page, you can see that the RAF file contains three variables that denote the forward vector: FX, FY and FZ. The forward vector is a unit vector that points in the direction the car is pointing.

In Matlab you can work out the heading (in radians) by doing: heading = atan2(-FX, FY);

The rate of change is: rate = diff(heading) / sampling_period;


To read the FX and FY values from the RAF file you should look at the Matlab functions: fopen, fread and fseek. All of the byte offsets you need can be found in the page that I linked to above.

The command you need to read the FX and FY values from the file will look something like this: fx = fread(fid, 1, 'int16');

You just need to find the correct offsets in the file and use fseek to skip to them.


You might want to look at the other information that is stored in the RAF file. Some of it may be useful to you.
Peptis
S2 licensed
Quote from [DUcK] :(this is sooo off topic, wonder if anyone will find us in this part of the forum?:tilt

Well, I was searching for "hot chick" and...
Peptis
S2 licensed
PenaltyReset is now re-released under the GPL.

I have updated the zip file; it now includes the source code required to build the application.
Peptis
S2 licensed
I'm not 100% sure, but I think when there is only one (maybe two?) lap left LFS gives out the 30 and 45s penalties. When there are more laps left in the race then LFS gives DT and S/G penalties.
Peptis
S2 licensed
Can someone please provide me with some code to use to calculate pitch and roll from a RAF file?

That is, I'm looking for something similar to this from the RAF file documentation.

To work out heading from the forward-vector
-------------------------------------------
float b = FX / 32767.0f; // convert FX to a float from -1 to 1
float e = FY / 32767.0f; // convert FY to a float from -1 to 1
float heading = atan2(-b, e); // heading (anti-clockwise from above)

I haven't done this type of mathematics for years and it's doing my head in!
Peptis
S2 licensed
I think that your sourceforge idea is a good one.

Also, thanks for the lib, it's been very nice to use.
Peptis
S2 licensed
Quote from Shotglass :not exactly useful with just 3 datapoints ... you can plot pretty much any curve through these

The shape of the curve is determined from the physical model.

I would guess that the curve would have to be monotonically decreasing and that its second derivative would be positive over the range. With these constraints you can get a pretty good approximation of the curve with only three points. If we had a theoretical model for the tyre curve then we could do even better.
Peptis
S2 licensed
I think the racing line is good because it helps new players find a good line around the track.

One must note that the racing line is not "the ideal line", which depends on setup, driving style, etc... Hence, it just gives new players a starting point from which they can improve from. More advanced drivers will no doubt find their own (quicker) lines.
Peptis
S2 licensed
Quote from haelje :do you offer the code for your app ?

Yes, I will. In fact, I am using sdether's lfsLib.NET so I think I may have to as his library is released under the GPL. I just need some time to sort it out as I'm not 100% what is required of me under the GPL at this stage.

If you have an urgent need for the sources then PM me and I'm sure we can work something out. If it's just an idea that you want to include in the app, PM me and I may be able to add it in for everyone's benefit.
Peptis
S2 licensed
Quote from burnsy1882 :http://burnsy.no-ip.info/finalgear/replays/S6-R13-R1.mpr

Thanks for the replay. I've tracked down the bug and it should be fixed now. I've uploaded the new version in the first post.
Peptis
S2 licensed
Quote from Hollywood :For the league I help run (LOTA), we were looking at re-enabling the use of the reset button to represent the realistic options of being pushed out of sandtraps, getting rolled over, etc. for our tin-top series (GTC). Our thoughts would be since the reset gives you instant advantage of fixing damage, etc. that we would give penalties.

I just released an app that does this exact thing last week. Here's a link to the thread topic:

http://www.lfsforum.net/showthread.php?t=34529

Quote from Hollywood :a) Attempting to apply a 30 or 45 second penalty multiple times does not result in additional time being added to a driver's total time, i.e. if you give five 30 second penalties during the race, the total time was only incremented by 30 seconds.

You are correct, the way that LFS does time penalties makes them unsuitable for what you're talking about.

Quote from Hollywood :b) If a driver currently has a stop-n-go or drive through penalty, then using the admin commands to assign him a different penalty wipes out the first penalty. A scenario might be that the driver was accessed, by LFS, a stop-n-go penalty for speeding coming out of the pits. Then on cold tires, the driver loops it and hits the reset button. The InSim app then assigns a drive-through penalty to the driver. The driver completes the drive-through penalty and now has no more penalties, i.e. LFS does not enforce the original stop-n-go penalty.

My app gets around this problem by keeping separate penalty counts for each type of penalty.
Peptis
S2 licensed
I'm using lfsLib.NET for my PenaltyReset application that I released last week. Could someone please summarise what I need to do to conform to the GPL 2 license?

Do I need to release the source with the binaries, or can I just give them out on request?
Peptis
S2 licensed
I don't like the idea of having the look left/right button look at the closest car as it can be confusing. Under Becky's system, you wouldn't know how far you've turned your neck, so you wouldn't be able to quickly tell how far left/right you were looking. This would be very disorienting IMHO.
Peptis
S2 licensed
Quote from burnsy1882 :i've tried this program recently to help new racers in our races finish instead of usually just dropping out. but there was a bad side effect from the program. if a person came into the pits just a little to fast, or left too fast, and got a DT, that's fine, as they go around again and serve the DT. however, as soon as they cross the line and the DT is lifted, your program slaps on another DT, and as such, they have to do that one too.

if you would like to have the replay of this happening, i'll post it. but please look through your code to fix this.

As Flinty said, I thought we fixed this problem. Please send me the replay and I'll look into it.
Peptis
S2 licensed
Quote from mcgas001 :Its good, i like it but 1 thing is the penaltys just keep counting....need to make some kinda max so they dont end up with like 20, 5min stops

IMHO, there's no reason to put a maximum on the number of penalties. If a driver destroys their car 20 times then they deserve 20 penalties.

I may be missing something of course. Is there a situation where a driver could receive 20 penalties through no fault of their own?
PenaltyReset
Peptis
S2 licensed
I have made a new InSim program that allows admins to give drivers long (>10 seconds) stop-go penalties for resetting their car.

Comments:

The purpose of this program is to limit the number of drivers dropping out of the race in endurance events. By keeping as many cars in the race for as long as possible then it should make the race more enjoyable for all. It also gives those drivers who have suffered an unlucky crash (buggy physics, someone else hitting them, etc...) another chance and not waste all the hours of practice that they put in for the event.

When a driver rolls/destroys their car on a server running this mod their race is not necessarily over. Instead, they may reset their car and receive a (long) stop-go penalty in the process. The length of the stop-go penalty is entirely up to the admins to choose, but in creating this mod I intended the stop-go penalty to simulate the time it would take for the marshalls to roll a car back onto its wheels and do whatever repairs need to be done. Alternatively, it could simulate the time required to jump into a spare car.

I won't suggest a duration for the stop-go, but admins should keep in mind the fact that they are trying to keep drivers from dropping out of the race, so it should not be too long. Drivers who receive a penalty for resetting shouldn't be able to beat someone who hasn't crashed their car, but they will at least be able to continue racing and challenge all the other drivers who have.

Aside: Some endurance events allow drivers to warp back to pits if they destroy their car. The disadvantage of such a system is that the driver's lap count is reset, so nobody knows how many laps that driver has completed. This is confusing for the drivers and causes a headache for admins after the event trying to work out how many laps everyone has done.

Before you start flaming the idea, remember, it's OPTIONAL; nobody is going to be forced to use it. Moreover, it's meant to make racing more fun, you're not against fun are you?

Usage (for drivers):
  • The program keeps track of the number of penalties drivers receive; multiple resets result in multiple penalties.
  • The program also keeps track of the number of normal stop-go penalties and drive-through penalties.
  • Penalties for resetting the car are referred to as "long" stop-go penalties.
  • The program will send you a message whenever the number of penalties you have changes.

  • The program tells you how long you need to stop when you enter the pits.

  • You can only complete one penalty each time you enter the pits. This is the default behaviour of LFS.
  • The program may optionally (up to admins) remind you of how many penalties you have every time you complete a lap.
Be careful when you are attempting to complete a stop-go penalty for resetting. LFS will still display "[FINISHED]" after 10 seconds. You should not leave the pits at that time, instead you should wait for X seconds (where X is set by the server admin) to complete your penalty. I pop some rather large buttons up on the screen to remind you of this ().


Installation (for admins):

Requirements:
  • .NET 2.0 must be installed on the machine running PenaltyReset. It is not required to be running on the server if the server is not running the PenaltyReset Program. (.NET 1.0 may work, but has not been tested).
  • IP address of server (doesn't need to actually run on the server machine, it can though).
  • InSim must be running on the server.
  • InSim port number.
  • Admin password.
  • Resetting should be allowed on the server.
To get the program running, start LFS first and then start PenaltyReset. Settings can be made in the PenaltyReset.xml file.

Example: Host IP address is 123.123.123.123 and InSim port is 29999 with password "racing":


<connectionOptions>
<HostAddress>123.123.123.123</HostAddress>
<Port>29999</Port>
<AdminPassword>racing</AdminPassword>
</connectionOptions>

You should use 127.0.0.1 as the IP address if you are running the program on a local host.

Other options in PenaltyReset.xml
  • PenaltyDurationInSeconds - Duration of long stop-go penalties received for resetting car (default is 5 minutes: 300).
  • MessageColour - LFS colour prefix to display PenaltyReset messages with (default is red: ^1).
  • AnnounceStopTimeToPlayer - If true the program tells the player how long they stopped whenever they complete a pit/penalty. Useful for debugging (default: false).
  • AnnouncePenaltiesEveryLap - If true the program reminds the player of how many outstanding penalties they have to complete (default: true).
  • LogToConsole - If true the program logs all the messages sent by it to players and some other status information to the console (default: true).
  • LogToFile - If true the program logs all the messages sent by it to players and some other status information to the console. Useful for admins to track events after the race (default: true).
  • LogFileName - Name of file to log messages to (default: log.txt).
This program has been tested quite a bit, but if you find any bugs then please let me know and I'll try to iron them out. Please test the behaviour of LFS with and without PenaltyReset running before submitting a bug report as a lot of the functionality is either intentional or the way LFS is supposed to work.

Version tracking:

Version 1: Initial release.

Version 1.01
FIX: Bug where drive-through penalty count was not decreased.
FIX: Drive-through penalty counts are now announced.

2/2/2008: Archive updated to include source code.

Last edited by Peptis, .
Peptis
S2 licensed
Quote from FL!P :I have a problem related with TeamSpeak messages. Something causes LFSRelax to exit, but I'm not sure what. Possibly people joining or quitting the channel. All I see when it happens is a message in LFS that says something like "Insim application closed". This crash doesn't occur when I turn TeamSpeak messages off from LFSRelax's config file. But when they're enabled, it always crashes soon or later.

Am I the only one to see this?

Same thing happens for me.
Peptis
S2 licensed
There are also some tracks where you can get a really fast time by hitting the wall on the start/finish straight. The HLVC system exists for a reason.
Peptis
S2 licensed
Quote from danowat :Because pretty much everyone checks their forum PM more than there email

No wonder you have over 3000 posts!
Peptis
S2 licensed
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.
Add "time" parameter to Stop-Go penalties
Peptis
S2 licensed
I'm currently writing an InSim application that detects car resets and gives out a Stop-Go penalty to the driver. It's meant to be used in endurance races where we want to allow drivers to keep racing when they flip their car but still punish them appropriately for doing so. (It's the easiest way I can think of to simulate the driver getting towed to the pits and getting their car fixed.)

The only problem is that the current Stop-Go penalty duration is only 10 seconds, which is not sufficiently long enough to punish drivers for landing on their roof. It also opens up exploits where a driver would be better off resetting their car when they are heavily damaged than trying to get back to the pits and repair it as the Stop-Go would take less time than actually repairing the car.

What I am asking for is another parameter to be added to the /p_sg command that allows the host to specify the length of the Stop-Go penalty.
Possible problem in penalty handling
Peptis
S2 licensed
I think I may have identified a problem with either your library or LFS.

I'm writing an InSim application that gives out Stop-Go penalties to players when a certain event is triggered. In the event handler I send the stop go like this:

handler.SendMessage("/p_sg " + PlayerName);

The player receives the Stop-Go correctly in LFS, however in the handler for RaceTrackPlayerPenalty, i.e.,

void handler_RaceTrackPlayerPenalty(InSimHandler sender, RaceTrackPlayerPenalty e)

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.

(When the user then completes their stop go e.NewPenalty has the value of Enums.Penalty.StopGoValid as is expected.)
Peptis
S2 licensed
Hehe, I was on the server at the time (my name is in the results) and I can remember you talking about your cat.
Peptis
S2 licensed
Perhaps the X-System could allow passengers in the XFG until the LFS bug is fixed. Passengers are only going to slow the car down, so why not let someone have a passenger if they really want?
FGED GREDG RDFGDR GSFDG