The online racing simulator
LFSpitboard
1
(45 posts, started )
#1 - Vain
LFSpitboard
Hello.

I created a small application for LFS patch X that displays a virtual pitboard using LFS's new button interface.
The application will display some relevant race information (lap, position, pit-instruction, gap forward, gap backwards, laptime) on the left hand side of the screen when you pass the start/finish line. The pitboard will always contain the information from the last time you crossed the finish line. That means the second time you cross the finish line the pitboard will display the position you had after lap 1, the gaps after lap 1 and the laptime you did in lap 1. That is because I can't predict the time the car behinds you needs to finish the lap, but I need that time to calculate the gap between you and the car behind you.
View the attached screenshot if you still can't imagin what this program is supposed to do. On the screenshot I finished the second lap and recieved information about lap 1 of 5. I finished lap 1 in position 1 and had a drive-through (D/T) penalty (there is also Stop & Go 'S&G' and 'PIT' which tells you that you didn't yet serve the mandatory pit). Being first there was no gap to any car in front, but the gap to the car behind was +4.04 seconds. I did a laptime 1:54.38 in lap 1.
The purpose of this program is to replace the top-right part of the LFS hud. If you don't need any other on-screen information you can now hit shift+f and you will still have all necessary information since the pitboard will still be displayed. That way you can race without the HUD.

To install LFSpitboard extract the attached archive into any folder. The default configuration expects that you extract it into the LFS folder so LFSpitboard's poath is .../LFS/LFSpitboard/LFSpitboard.exe.
To run the program follow these steps:
1. Start LFSpitboard.exe
LFS should be starting now.
2. After having loaded LFS should now report that LFSpitboard connected in the top left corner. LFSpitboard will state that has connected to LFS.
3. Start a race or qualification or join a host.
Note: If the above procedure doesn't work or you want to disable it for any other reason you can open cfg.xml in LFSpitboard's folder and search for the value "start" in the line "LFSExec" and set start="0". LFSpitboard won't attempt to start LFS.exe anymore then. You will have to start LFS manually and manually type "/insim=12500" (12500 being the configured InSim-port in cfg.xml) into a chatbox to allow LFSpitboard to connect.
LFSpitboard will only work in a race or qualification. It won't work in practice mode. If you join a host mid-race LFSpitboard's data won't be reliable. It will only work properly after a restart has occured.
Later releases will hopefully have an improved behaviour regarding this.

The pitboard will be displayed each time the viewed car crosses the finish line if it has already finished more than one lap. It will disappear if you switch the view to another car, hit shift+b, cross a sector-time or more than 15 seconds have passed. The program will stop to track the race if a car has done more laps than necessary to finish the race.

The purpose of this release is to test the program on a wider userbase. It is an early release and is expected to fail once in a while. For this purpose it displays a lot of debugging information. I didn't remove the debug-messages so if you run into any problems you can send me its logged data.

Later down the line I'd like to improve LFSpitboard's behaviour for situations like mid-race join and practice, add customizable pitboard-layouts and a editable fuel and tyre strategy.

Please report any issues with running the program so I can fix them. Also report all questions and suggestions you can come up with.

Update to R4
Changelog for R4:
- Recompiled for InSim v5.
- No other changes.

Update to R3
Changelog for R3:
- Added basic qualification functionality.
LFSpitboard tracks the best times of all cars and shows the position of the viewed car. It calculates the gaps from the viewed car's best time and the best time of the car in front and behind on the laptimes-table. It also displays the last done laptime by the viewed player.
- In a race LFSpitboard will now calculate the amount of fuel you need to finish the race and automatically set it if you are running out of fuel (this only works if you don't have the F12 menu displayed while crossing the s/f line). This feature currently only makes sense if you need less than 100% fuel to finish the race. More in-depth functionality like editable strategy and tyre-advice will come later.
- LFSpitboard can now start LFS by itself. In cfg.xml under the category "LFSExec" there is the option "start" which determins wether LFSpitboard attempts to start LFS (can be 1 or 0). If 1 LFSpitboard will try to load "LFS.exe" which is expected to be located in the path given by the location-variable (which is relative to the position of LFSpitboard.exe). The standard configuration is set up so it works if LFSpitboard.exe resides in .../LFS/LFSpitboard. If "InvokeInSim" is 1 LFSpitboard will set the "/insim="-parameter to its InSimport so LFS automatically initializes InSim.
- During a race the pitboards now use color-coding to inform you about the development of the displayed values. Position and gaps are colored if they get worse or improve. The pit-instructions are colored red if you ran over them once.
- There is now an additional fourth line on the pitboard that is displayed if LFSpitboards has additional information, like the amount of fuel the driver should set before pitting. In this line LFSpitboard will also anounce the last lap.
- Fixed a bug in the laptime-lookup function that could cause negative fuel usage to incur.
- Removed some debug output from code-sections that seem to work properly.

Update to R2
New features:
- The pitboards now disappear after a user specified amount of time. Default is 15 seconds. They still disappear if you cross a sector time before that, hit shift+b or switch the view to another car.
- LFSpitboard can now load some data from a config-file (cfg.xml). It can now read the InSim-port, OutGauge-port, admin-pass (only important when you are hosting) and the maximum lifespan of pitboards.
- LFSpitboard now tracks the fuel in the tank of the viewed car. From the last two fuel readings at the start/finish line it will predict your current fuel and fuel usage per lap. If you don't have enough fuel to complete 2 more laps it will display the "PIT"-instruction. That means if you wish to do so you can ignore the PIT-instruction once. If you don't pit after that you'll run out of fuel.
Please note that this feature only works properly if the view stays with the viewed car for several laps.

Vain
Attached images
lfs_00000001.jpg
Attached files
LFSpitboard R4.zip - 272.7 KB - 357 views
Seems to be great !!! Thanks and Congratulations
#3 - joen
Just tested it out, cool stuff Vain Will think about suggestions when I'm thinking clearer
works so far, but it looks a bit like squeezed... like 4:3 but it should be 16:10 u know what i mean? stretch it a bit in width
Nice stuff Vain, must have read my mind as I was only thinking about this a couple of days ago.

Shame it's not inbuilt in LFS, but this will certainly do untill such a time
it seemed that it doesn't work if for "creating a game" a multiplayer-password is set. if i had set one, i got the error message: "Insim : password does not match your multiplayer admin password" and LFSpitboard were closed. i deleted the password in the multiplayer server config and then anything works fine. so perhaps u need the possibility to adjust the password used by LFSpitboard with a config-file or starting-argument ?
but great program !!!

btw: is there a possibility to include refuel infos to the board, something like "number of laps u can drive with current fuel" ?
nice the addons for X are coming making use of new options.
This is awesome! I've always wanted LFS to use a pit board instead of the giant letters plastered across the screen. I can't wait to get home and give this a shot.

This app puts LFS just a little bit closer to nKP in this regard. Great job.

edit:
Quote from Vain :Later down the line I'd like to improve LFSpitboard's behaviour for situations like mid-race join and qualification, make the insim-port editable using a config-file and add customizable pitboard-layouts, aswell as fuel-tracking to warn the user when runs out of fuel.

Will the new InSim let you use different fonts or anything like that? It would be nice if it looked more like a real pit board, with big block letters:
http://www.imotorgear.com/asse ... t_images/37030100P001.jpg
#9 - joen
Maybe not entirely specific to this handy little app, but I was wondering. With the new insim features would it be possible to construct your own OSD?
So you can choose whichever on screen info you want displayed? If so that would be a great way to customize the available screen info to your personal preferences.
#10 - axus
Sweeeeet! Love you lots, Vain!

Just a question, is it not possible to use the time from the end of the previous sector on the pitboard? I mean, if the gap is more than one sector, you wouldn't care about it much...
#11 - Vain
Hello.
Below is today's work, release R2.

But first thanks for the kind words. Some issues above have been dealt with in R2, so I won't comment on those. About the rest:
Cue-Ball: I have a couple of text-colors available and can change the button background between light and dark. I could theoretically make each letter an own button (so it gets a rectangular shape drawn around it), but it'd be rather slow to build up on screen. I'll try to look into more advanced formatting later. LFSpitboard first has to learn what important information is and what isn't.
joen: Basically yes, you can do a lot things with the new buttons system. Just so you get an imagination of how versatile the system is: Except for the graphs it'd be definitely possible to do something like an InGame-implementation of LFSworld.
axus: I wondered myself about wether I should record the gaps at the last split. But I thought that if you want to be informed about everything just hit shift+f. My objective isn't to give you all information possible, but the information you could find on a real pitboard. And that's usually what the guy with the three stop-watches manages to put on it within one lap. The point is that gaps should just give you an indication of how the race is progressing. Are the gaps increasing? Decreasing? Is the car infront a position or a lapee? That kind of thing. I don't think 0.2 deviation in the gaps make much of a difference there.

About LFSpitboardR2:
New features:
- The pitboards now disappear after a user specified amount of time. Default is 15 seconds. They still disappear if you cross a sector time before that, hit shift+b or switch the view to another car.
- LFSpitboard can now load some data from a config-file (cfg.xml). It can now read the InSim-port, OutGauge-port, admin-pass (only important when you are hosting) and the maximum lifespan of pitboards.
- LFSpitboard now tracks the fuel in the tank of the viewed car. From the last two fuel readings at the start/finish line it will predict your current fuel and fuel usage per lap. If you don't have enough fuel to complete 2 more laps it will display the "PIT"-instruction. That means if you wish to do so you can ignore the PIT-instruction once. If you don't pit after that you'll run out of fuel.
Please note that this feature only works properly if the view stays with the viewed car for several laps.

I also made some minor fixes, like moving the pit-instruction to the end of the third line.

To update just copy the new files over the old ones.

Vain
Attached files
LFSpitboard.zip - 255.7 KB - 446 views
very very great tool
some questions: could there be an bug in counting the position ? or is the position wrong if you switch the car and see this car driving over the start-line so the pitboard appears ? (all positions in the board were ones less the ones showed in normal huds ???)

i think you are right if you say: if more info is needed use SHIFT+F, but could it be possible to make an option (in the config-file or so) to enable the pitboard in the splits too ? some tracks are really long and a lot of stuff happens during one lap, so it would be great if you can use this pitboard for the split.

did u use a InSim-library, or did u do the protocoll implementation by yourself? if yes, which one u used ?
#13 - joen
Quote from Vain :
joen: Basically yes, you can do a lot things with the new buttons system. Just so you get an imagination of how versatile the system is: Except for the graphs it'd be definitely possible to do something like an InGame-implementation of LFSworld.

Nice, now if I could only code Will be interesting to see what people will come up with in the future. Would be nice that if you enter a server an app could give you a quick overview of your stats on that track/combo for example.

Going to try out the new version tomorrow
#14 - Vain
@haelje: Under which circumstance was the counted position wrong? I can't guarantee correct position counting of positions when LFSpitboard wasn't active at the start of the race.
I count the amount of laps each car did and in what order the cars crossed the finish line. So when in lap five of six car A, the leader, crosses the finish line and then disconnects the second car, car B, will recieve "P2" on his pitboard for lap 5. On the other hand LFS will state that B is the leader. However, strictly speaking the retired car A has done the same amount of complete laps and finished the last driven lap earlier than car B. So despite having retired it is still in front. Only from the 6th lap on car B has both done the most laps and finished the last lap first. In that particular example car B will finish the race as the leader (first to have finished 6 laps), but the pitboard at the chequered flag (which reports the race as of lap 5!) will still say P2. I admit that this can cause confusion, but it's the better implementation. At the end of the cool-down lap (when car B sees the pitboard for the end of lap 6) the position should coincide with what LFS reported as the finishing order.
@Split-timings: On the Nordschleife the drivers get a pitboard every ~9-10 minutes. Don't complain!
If I iron out the system I could perhaps improve LFSpitboard with more information like gaps at the last split, however then the laptime-measurement-position wouldn't be the same as the measurement-point for the gaps, which is confusing. I could perhaps go so far to turn LFSpitboard into a button-driven clone of LFScompanion. LFSpitboard could then add information in realtime as it appears. Yellow flags-report for the whole circuit, gaps, changes of position, strategic advice, etc. I'll decide on that depending on how much time I can spend on this.
I wrote the InSim implementation myself. Using C++ it's a real snap to do. I use SDLNet for receiving and sending strings of data via TCP and UDP. SDLNet is very convenient to use, and it supports almost all plattforms you can think of. Learn to use one library, master all operating systems.
Apart from SDLNet I also use the XML-engine IrrXML. Another very small but effective library, that also supports all major operating systems and architectures.
(So yes, actually LFSpitboard supports Linux and Mac.)

* Immediate to do List:
- Make the PIT-instruction for the mandatory pit smarter. The driver shouldn't be instructed to pit as long as he has zero pits, but only when he is running out of laps to serve the mandatory pit and didn't yet stop at the pits.
- Think about splitting the different bits of information into different buttons to allow important changes to be highlighted in a different color. E.g. I'd like to color the "PIT" instruction when the driver *has* to pit *this* lap.
- Raise LFSpitboard's awareness of the events in the race and display advice. If the player runs out of fuel and has to pit tell him "SET 12% FUEL" below the "PIT" instruction. Perhaps give advice on other cars too. If a much quicker car comes up from behind and there are still many laps to go LFSpitboard could inform the player that the car behind is much quicker so the player can decide wether it's worth to defend the position.

Vain
#15 - axus
Fair enough about the sector difference. One other suggestion - if the gap to the car behind is increasing gaps to the car behind, can the text be made green... yellow for constant and red for decreasing? - And a similar thing to the car in front albeit with reversed colours.
Great work Vain
But listen to me. This mod is great in race and many 'clean' races are on private servers (eg.: league'races)...its really necessary you do permit admin pass change to we can have accès on hosts with admin pass u means ?

And one question :
I'm a noob in programing and I dont know if is possible but you think is it possible to made A day one server version (this one is only 'client') it will be great on some servers visitors dont need to load this mod if its installed in dedicated host ?

LFS Lapper is great to qualify session on many days (before races)
LFS stats is great to results after races
Your soft seem great to use during 'offical' races (if server version)
This is a great InSim app and I like it a lot. Thankyou very much
Looks great. Didn't try it out yet, but since it behaves like a real pitboard with information from previous lap, could it also appear few seconds before you cross the finish line? You'd need to know apropriate node numbers for every track config I guess. Hmm actualy dissapearing node would be nice too, when you drive away and wouldn't see the board anymore.
#19 - Vain
@gwendoline:
LFSpitboard release R2 (download link above) supports admin passwords. You can set the password in the file cfg.xml (open with notepad, or whatever program you want to use).
I won't make this a server-side application because I need to use OutGauge to track fuel-usage. OutGauge only works locally. Also unrequested pitboards are very disruptive to users and in the future the pitboards will be very customizable, which isn't sensful as a server-side InSim-application.
@X-ter: Thanks.
@axus: I'd like to implement the coloring of important information. But first I'll have to experiment how LFS responds to large amounts of buttons and how quickly I can draw them on the screen. That will determin how freely I can format the pitboard.
But at the end of the story I'd like the pitboards to work like a third eye for the driver. LFSpitboard should one day be able to tell you everything a team-member could tell you via VoiceCom. Notification of the development of gaps is just of the important things LFSpitboard should be able to display.
@Misko: Right now I don't track the car coordinates at all. I thought about it and I'd like to add it as an option, but for now there are more important features to implement.

There won't be a release for a couple of days because I'm rather busy with work. Waiting for the weekend.

Vain
Well, you've set a high standard to continue, if you keep it up, it'll be a damn fine ickle fing.
@ Vain: Great improvments on R2. I love it.

Maybe you just miss add (back the 'board') the pit-babe who carry it like this
Disregard , didnt realise it worked a lap behind LOL
#23 - Vain
I updated the top post and attached the current release R3.
Changelog for R3:
- Added basic qualification functionality.
LFSpitboard tracks the best times of all cars and shows the position of the viewed car. It calculates the gaps from the viewed car's best time and the best time of the car in front and behind on the laptimes-table. It also displays the last done laptime by the viewed player.
- In a race LFSpitboard will now calculate the amount of fuel you need to finish the race and automatically set it if you are running out of fuel (this only works if you don't have the F12 menu displayed while crossing the s/f line). This feature currently only makes sense if you need less than 100% fuel to finish the race. More in-depth functionality like editable strategy and tyre-advice will come later.
- LFSpitboard can now start LFS by itself. In cfg.xml under the category "LFSExec" there is the option "start" which determins wether LFSpitboard attempts to start LFS (can be 1 or 0). If 1 LFSpitboard will try to load "LFS.exe" which is located in the path given by the location-variable (which is relative to the position of LFSpitboard.exe). The standard configuration is set up so it works if LFSpitboard.exe resides in .../LFS/LFSpitboard. If "InvokeInSim" is 1 LFSpitboard will set the "/insim="-parameter to its InSimport so LFS automatically initializes InSim.
- During a race the pitboards now use color-coding to inform you about the development of the displayed values. Position and gaps are colored if they get worse or improve. The pit-instructions are colored red if you ran over them once.
- There is now an additional fourth line on the pitboard that is displayed if LFSpitboard has additional information, like the amount of fuel the driver should set before pitting. In this line LFSpitboard will also anounce the last lap.
- Fixed a bug in the laptime-lookup function that could cause negative fuel usage to incur.
- Removed some debug output from code-sections that seem to work properly.

Scroll up to download. Have fun.

Vain
Wow! Thanks Vain

Just a quick feature request if I may.

As the program already tracks best lap times, would it be possible for the board to also display your best lap time so far? (This feature was removed from the main program in Patch X and you now need to hold Ctrl + Shift to see your best lap time).

#25 - tade
OK the program seems to be just great and it has an even greater potential. But I have this problem...

I'm using CSR sound mixer, which needs outgage 35555 to work and Pitboard works on 12501 (it also changes outgauge's mode to 1 and delay to 100, when CSR needs the above numbers to be 2 and 1 respectively). So could there be a way to run both applications at once? Unfortunately CSR mixer does not seem to be configurable in any way, so I was just wondering if something can be done w/Pitboard...
1

LFSpitboard
(45 posts, started )
FGED GREDG RDFGDR GSFDG