GNL.tv is an open source racecast system for Papyrus Nascar Racing 2003. It allows thousands of people to watch a NR2003 race live on the internet. This is the first step to providing the online racing community a true live experience watching other racers competing in their leagues.

A small server application connects to a NR2003 installation on the same computer and collects standings data and all car positions during the race. A PHP based webpage connects to the server application and displays the results. There is also a java applet that displays the car positions on a track map.
Originally developed for the german Virtual Racing e.V. league, GNL.tv has now been released as open source software. The goal behind this step is to provide a solid framework for building a sophisticated TV application with the help of the racing community that addresses all requirements for a unique watching experience.

GNL.tv features:
- Very streamlined server with no impact on the performance of the hosting system
- Server may monitor a dedicated NR2003 server or run on a NR2003 client connecting to a dedicated server
- Communication with GNL.tv server is done via standardized XmlRpc interface
- Car Position updates are distributed using a custom streaming protocol
- Compressed communication leads to very low network bandwidth requirements
- Services up to thousands of viewers by caching the standing results and using proxy servers to distribute the load
- Easy to setup
- Works with all addon tracks
Visit the demo installation to get a glimpse of how GNL.tv works.
Running GNL.tv with PHP5
Please take a look at my blog entry to read how to enable PHP5 support in GNL.tv.
Downloads
For installation instructions, please consult the included readme-files. All files are released under the GPL license.
GNL.tv Version 1.4 (latest version)
GNL.tv Version 1.4 Source (source code for latest version)
GNL.tv uses the SVG file format to render track overviews. You can create these SVG files automatically based on the NR2003 track files with the utility PtfConverter. You only need this utility if you plan to convert new tracks yourself.
PtfConverter Version 1.0 (latest version)
PtfConverter Version 1.0 Source (source code for latest version)
Thanks for the nice comments. I am amazed that the app is still in use after so many years
Here is a link to a picture of my “Crew Chief”, I view it in a web browser on a second monitor.
http://www.bearbaitracing.net/downloads/misc/CrewChiefApp5.jpg
I have it display stats for 3 cars, the leader, the monitored car, and the one position below the monitored car in the standings(not necessarily the actual car physically behind the monitored car).
It shows the last lap times in the biggest fonts with color codes, green background means the other car’s stats are not as good as the monitored car, red background means the opposite.
Some of the other stats include how many laps since last pit, cars fastest lap, average lap time over the last 5 laps, gain/loss trend(how much time per lap you lost or gained over the last 3 laps averaged), estimates how many laps to catch or be caught at current gain/loss rates, fastest lap run in the race, and fastest car on the track at that moment based on an average lap time of the last 5 laps ran, this could be any car, not just the cars displayed.
I am looking at your source code and wondering if I could actually create a gui that uses the data collector and skip the web portion for the “Crew Chief”.
I have done a little Java programming, very little, and some C programs for microcontroller boards I play with, but I have not ever made a Window application… so my desire might be bigger than my ability to deliver LOL
Am having fun with it though
I like that display. That screen seems to be really helpful during a race.
When you already know Java, you can take a look at the source code of the applet. There should be a couple of parts you could reuse in the gui.
Oh man, I could slap myself, got locked into thinking the Java app needed the proxy, perfect solution =)
Thanks again.
I know it’s been a while, but do you recall if the stream read by the DataCollector for the Java app contains last lap time in a race session?
Your track overview app does not include that stat, and I cannot find it for a race session in the data collection methods.
Thanks.
I guess you are right. This kind of data is not sent via the stream. You would need to modify the GNLtv application itself to include it in the data stream.
I am not a trained programmer, never taken a class, anything I know is self taught reading books and programming as a hobby so some simple things are not so simple for me
I could see in your source where the messages are built and it looks like it would be easy enough to add the last lap value to the end of that message and additionally add the read in the Java DataCollector, but then I have to find my Visual Studio Express 2005 and get it installed on my current PC so I can compile the new executable.
I thought it might just be easier to send a request to tvserver port since it already contains that data and I wouldn’t have to mess with the main GNLtv app.
It took me a while to realize the encoding needed but I do now have a Java app that can successfully make the same request the PHP function XMLRPC_request makes, and I get back an intact xml response =)
Now I just need to parse out the “compressedData” element, decode, unzip, and parse the result and I have all my data.
Kind of the long way around the barn, but I think if I want to share this with others when I am done then I think sticking with Java is the best way for me to go.
It will be a standalone Java desktop app, and actually thinking about it now it will be a completely new Java app since I won’t be using the data collector or any of the animation and track overlay drawing, I will use the xml parser classes of course but other than displaying the data in a frame I just need to make a simple driver class to store the driver data in and make a few calculations.
=)
I think you are on the right track. Using the XMLRPC data is a good choice.
Send me a note once your application is finished and I will put a link to your website on this page.
Base64decode just isn’t working for me in Java.
The data I get from the server is fine, I can decode it in PHP…
tvserver->Java->print to Java console->copy/paste to PHP->base64decode->write to file->read file in Java->gunzip works
tvserver->Java->Java base64decode->gunzip no work because the decode isn’t right, when comparing the PHP decoded and Java decoded, the Java decoded string has a whole bunch of extra ? characters in it, and ? in place of other chars.
Figured I would have this done this weekend but Google has been no help
Figured it out, was focused on the input to the decoder not the output, had charset set all over the place except when I converted the decoded bytes into a Java string…
Now it works…
A step by step guide would be really nice for this. I can honestly say I have spent a ton of time trying to figure this stuff out, but nothing. =( If anyone has any guides I could use that would be great!
You must follow the instructions to fix the xmlrpc.php for PHP 5.
You must add tracks to the config.inc.php properly, this is one that takes some trial and error, the applet gets the track name from the data coming from GNLtv.exe which is read from NR2003.exe, so whatever the track maker put in the track.ini file as the track name, that gets fed through and the applet looks for an entry in the config.inc.php that matches that name in the $tracks array, then looks for the svg filename in that array.
My entry for Five Flags is this:
$tracks['Five Flags J9'] = array('name' => 'Five Flags Speedway', 'file' => 'five_flags_j9.svg', 'length' => 0.500);Note that the array key is different than the track name in the “name” field of that array.
Probably the easiest way to get that right is look at the error when it fails to load a track, it will say that it can’t find a track named whatever it is looking for.
Also I think you may want to start things in this order:
1) start GNLtv.exe on the PC that will run the NR2003.exe that will be providing the race data.
2) start NR2003.exe
3) start the gnltvproxy on the web server
If the proxy is started but GNLtv.exe is not running on the PC that the proxy is trying to find it on, I believe it is supposed to wait 5 minutes and then try again.
I am not sure if it does try again successfully or not, but if you were to start the proxy without having GNLtv.exe running on the PC that the proxy is connecting to, and then you try to open the Java web applet and get an error, then you remember that you need to start up GNLtv.exe and NR2003, then you go back to the applet and it still doesn’t work because you haven’t waited 5 minutes for the proxy to try again, and you think nothing works.
Make sure you have the IP addresses and port numbers correct, if you use the proxy you must change the streaming port setting in config.inc.php to 9000 instead of the default 8001 and you must specify when starting the proxy what port to listen on(9000) and what IP and port to get it’s data from(the PC that GNLtv.exe is running on)
My command to start the proxy on my Linux web server is:
./gnltvproxy -p 9000 192.168.33.96:8001That tells the proxy to accept connections coming in on port 9000 and that the GNLtv.exe is running on the PC at IP address 192.168.33.96 port 8001.
You must also make sure that firewalls on the PC running the GNLtv.exe will accept connections coming in on ports 8000 and 8001, and you must make sure that your web server will allow incoming connections on port 9000 for the streaming data to the applet.
And finally on the networking side of things, if there is a router involved, you will want to make sure the router is forwarding the proper ports to the proper computer.
For example my Windows PC that runs the NR2003.exe and GNLtv.exe, and my Linux web server that serves the stats pages and the Java web app are both behind my router, so if I want to allow someone from the internet to view the race stats on my web server I must be forwarding incoming port 80 traffic to my web server, and if I want them to be able to use the java web app, then my router must also forward incoming port 9000 traffic to my web server, where it will connect to the proxy, the gnltvproxy application running on the web server.
End user on internet —> (port 9000)web server running proxy —> (port 8001) PC running GNLtv.exe/NR2003
OR
End user on internet —> (port 8001)PC running GNLtv.exe and NR2003 and web server
Remember to think of the race stats web pages as a completely different thing than the Java web applet, it is!
It uses different data and different methods to retrieve it, the GNLtv.exe application creates two servers:
1) tvserver on port 8000 accepts HTTP requests from the race stats php application and returns an XLM document to the php applications running on the web server.
2) streaming data port on port 8001 which is either read by the Java web app OR by the gnltvproxy application running on the web server.
It’s important to understand that when the end user loads the Java web app from a web server, that Java app can ONLY make a connection back TO that same web server, so if GNLtv.exe is NOT running ON that web server, then the proxy MUST be used.
And if you use the proxy, your Java web app must then be directed via settings in the config.inc.php to connect to port 9000 instead of port 8001 (assuming you started the proxy with 9000 as the listening port)
Hope that helps.
How do I get a proxy on a web server. I have very little knowledge of this.
Hello guys ive been trying to read all this info on the program…i have a php nuke evo 2.0.7 and a nascar racing 2003 server…could some one point me in the right direction to get this running…my opinion the best thing to happen to nr2003 and i would love to have this for our league…ty in advance…you can email me or jump on our teamspeak 2 if you would like…thank you all….god bless
The proxy is an executable file and needs to be placed on your server, if you are on shared hosting you most likely will not be able to do this.