The online racing simulator
LFS-TV, replay streaming.
(143 posts, started )
Tested some streaming over the interwebs, it works good but for some reason LFS doesn't download the missing skins. It displays the "can't load skin" errors but doesn't ask or attempt to download them.

So i guess i'll be watching tonight's SimFIA DTM with white cars.

*Edit

Full race streamed fine, enough proof of concept for me.
Average bandwidth finally settled at 1.8 kb/s.
Yea, I was the server, worked like a charm the whole time, good work Filur.
And here is the source (php 5) if anyone needs / wants to turn it into something fancy. I don't think i'll continue working on this and i doubt i'll bother diving into a compiled language at the moment.

It carries a sufficient portion of the MIT license, ie. do whatever you want with it.
Attached files
mpr_stream.rar - 3.7 KB - 449 views
Quote from Tomi :The main problem I imagine would be to watch the replay live (I mean with a slight delay).

If someone connect to the stream at midrace, LFS will read the mpr from the start and won't know where does the stream file start. Also, if the spectator do a fast forward by changing the speed, LFS will not detect the point where it can't go forward longer and will probably send an error (or crash) instead of waiting for the stream.

It's a problem indeed, but you could do some insim tricks at both ends to make up for it somewhat.


client -> server "bringeth me current race time"
server -> lfs (IS_GTH)
server -> client <time>
client -> lfs (IS_STP <time - ~15s>)

Perhaps triggered by an /out message.

When LFS tries to read beyond the end of the replay, it'll just stop and return to the replay select screen.
Quote from Peptis :I don't think that this is currently possible. AFAIK the replay files do not contain the simulation state information; Instead, the user inputs are loaded from the MPR and fed into the physics engine to generate the next simulation state. Hence there is no way to 'chop' previous data from the file as the current simulation state depends on all that previous data.

We would require the equivalent of keyframes in the MPRs for that sort of mid-race join system to work.

You're quite right in thinking that, and you're mostly correct. However, my thinking is that there must be some very rudimentary initial form of state (i.e. purely car position) - for instance you can currently join a server and save a replay and it will start from the point you joined, not from some predefined "start" point.

Just to clarify my previous post, when I say chop and change, I meant that there would be a significant amount of differences, not purely the header, as we know it currently.

But as filur's elegantly put solution negates this, its potentially a moot issue.
Quote from the_angry_angel :But as filur's elegantly put solution negates this, its potentially a moot issue.

It could be useful overall, but connect to the MoE 24hr lfs-tv stream to see the exciting finish and you'll need to wait almost 2 hours for the fast-forward to complete.

I guess that's pretty much the worst case scenario though.
How about voice-over possibilities?
Quote from JamesF1 :No, what I meant is this:

Each race replay would have a specific header, containing information about the track, the cars, etc. I would presume (although I don't KNOW) that this could be relatively easily generated for any given moment in the race (seeing as each replay has a header).

When a client joins, they get sent the header based on the MAIN REPLAY POSITION.

So if a client joins at the start, they get a header based on the start. If I client joins mid-race, they get a header based on that point in the race.

Then, the stream will essentially be the same. So, what I'm suggesting is that, should it be viable, each client gets sent a custom header, and is then "passed onto" the "regular" stream...

Maybe I don't explain it very well

That's exactly what I wanted to say !
Quote from traxxion :How about voice-over possibilities?

I guess you could sync an audio stream to current race time, maybe just make a client request an audio file off a webserver with an offset / resume set based on race time, buffer up a certain amount and re-sync at certain intervals.
Quote from Peptis :Instead, the user inputs are loaded from the MPR and fed into the physics engine to generate the next simulation state. Hence there is no way to 'chop' previous data from the file as the current simulation state depends on all that previous data.

That's only true for the single player replays where the user inputs are stored. In the MPR replays however the data packets the client receives from the server (car position, speed, ect.) are stored. So it should be possible to cut the replay and let it start from a later position, you only have to modify the header.
but Flo, how could you tell where the race currently is? you have the whole replay file from the start on your system. so the software would somehow need to know where exactly to start with a 15 second lag or so. that means you would need to get the last part of the mpr-file only... but if you dont cut it correctly (you need bytewise precision) lfs will completely freak out.
Yes, that's the problem. You need to find the right place to cut the replay as well as creating a new header. I only wrote that it "should" be possible, not that it's easy.

But to come back to the initial discussion. I think that for a first version of LFS-TV it would be more than enough to be able to watch the race from the beginning. So we'd only need a program which streams the temp.mpr from the server to the clients - nothing more.
#39 - Tube
everything we need now is a "relay" server which receives the mpr from the server and sends the streams to clients, or am I missing something?
Quote from Tube :everything we need now is a "relay" server which receives the mpr from the server and sends the streams to clients, or am I missing something?

I'd guess you don't need the exact mpr from LFS server, it's enough if there's somebody connected as spectator and he, as the tv-server, is sending his temp-mpr to clients. So everything we need is ready. Right?
As far as I know (AFAIK), dedicated servers do not make temp mpr files.
Quote from maczo :it's enough if there's somebody connected as spectator and he, as the tv-server, is sending his temp-mpr to clients. So everything we need is ready

I'm with you on this one

All that has kept me from trying the files above is that they are php5 which I dont have yet
php5 is a programming language, you can download it from php.net. This program is not ment to be run on a web server, it's ment to be ran on your computer. PHP IS A PROGRAMMING LANGUAGE. Is has nothing to do with web servers. Did you know you could use C# in your web pages? That also does not have alot to do with web servers. PHP for this applicatoin is ment to be ran stand alone. Redefine your thinking.
Quote from Dygear :-message-

Easy man.

Our webserver only has php 4.3 so i cant try it there. And I have Apache running on my pc, but I haven't been able to get PHP5 working on that, yet....
But you don't need Apache for it . PHP scripts can be run without any web server installed whatsoever. Run the appropriate PHP executable in command line or create a shortcut to do it for you (can't remember if it's the CLI or CGI you should use , sorry) and stick the script path after it. E.g. php-cgi myleetscript.php

Or whatever the equivalent is in *nix environs, the principle is the same.

Apologies if you already know this and stuff
I dont know what's your problem Dygear, really... have I done something wrong to you? I think I've clearly stated here:
http://www.lfsforum.net/showthread.php?t=11824
that I'm completely new to php, and you were very helpful then.

Please try to bear in mind that there are people that freak out when they see a sentence packed with words like "client" "web server" "web host" "cgi - cli" etc. etc. At least I do

I didnt know that there was such thing as a php executable, nor that I can run it from the command line. So thank you for that Pringles.

So is it still ok for me to post here, even when Im not a pro like all of you guys here are? I was just very enthusiastic about the LFS TV-like possibility that was found by Filur.





PS Thanks for the download link. I had already found that one yesterday though, but I don't understand how to install/use it; I apologise.
PPS I will still try to get the files posted by filur to work, with or without being called stupid here.
Quote from traxxion :.. I don't understand how to install/use it; I apologise.
PPS I will still try to get the files posted by filur to work

It should be enough to extract the archive wherever you'd like to put it and by method of choice run "path/to/php.exe path/to/script.php". You can also add "path/to/php" in your environment variable PATH to have php available from command line anywhere. You could also probably just drag 'n drop the script onto php.exe. Or use file association. etc.

Since the scripts are sort of sketchy you may need to use absolute paths in the script configs. (server.cfg/client.cfg).

Quote from traxxion :I'm completely new to php

One good example for demonstrating that PHP doesn't rely on a webserver might be that it's relatively simple to write a decent webserver in PHP.

It's tricky to make a PHP webserver fully support PHP though.
Yep, I'm reiterating filur's post (I want to feel clever for once ). The easiest way to install and run PHP scripts without a web server is to download that ZIP shared somewhere above, extract it to the default location, e.g. c:\php.

If you don't set the environment variable PATH (which you can do from control panel> system> advanced> environment variables> system variables) you will have to run php from its own folder and use the full path to the script. It's tedious.. e.g. c:\php>php ..\myleet\scripts\foo\bar.php, or drag n drop etc. Easiest way is to set the variable.

Setting the file association to the php interpreter (the executable) is a neat way to easily run scripts from anywhere, but if you use a PHP editor and want it to open scripts by default you may not have the luxury of having both.

Quote :So is it still ok for me to post here, even when Im not a pro like all of you guys here are?

I'm an almost complete newbie to PHP and I haven't been told to keep quiet yet so I'm positive it's no problem!

Start with simple stuff, learn the basics and you'll pick up PHP in a flash (no, not Flash )
Webcasting Live from Mexico
Hi guys:

I am not and expert however we are webcasting Live our champ races using video streaming with my self narrating the race live as well.

I am very intrested on what ever application would let me webcast smoother my races.

Every wednesday at 10:00 pm mexico city, time zone you are most welcome to watch, spanish though.
Any ways I left my msn, nelsongpv@hotmail.com
just in case some one would join me braodcasting in english, along with me.

LFS Mexico: www.automovilismovirtual.com

LFS Colombia: www.avlatinoamerica.com/colombia

Colombian League is ready to start.


I am ready to test any new application, let me know guys.

Saludos
Nelson

LFS-TV, replay streaming.
(143 posts, started )
FGED GREDG RDFGDR GSFDG