Who can write a Spark TV proxy server?

derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
edited February 2011 in Modding
<div class="IPBDescription">like hltv / uttv</div>The idea behind this is programming a Proxy
which connects to a SparkEngine-gameserver
and streaming it to other clients - like hltv was.

Also a Client would be useful, where Spectators
could look to more than one player at once.


I think EnemyTerritory had this.
Could this be done serverside?



<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Featurelist:<!--sizec--></span><!--/sizec-->

<ul><li>delay, password, maxusers, port, ip,
rate, updaterate, kick, ban</li><li>dispatch users</li><li>proxies should could connect to each other:
gameserver->masterproxy->proxieservers->clients</li><li>own voice and chatsystem, so spectators
could chat with each others and commentatorscan
commentate the game like at TV.
(commentators can use voicecom specs can't?)</li><li>it should be possible to place text messages,
images and videos (flash support is already in!?)
on the screen. Important feature foradvertisement.</li><li>Graphical Admin Interface (gai)</li><li>storage of settings in files hot loading of themtrough the gai</li><li>server should be able torecord and replay demos</li></ul>
«1

Comments

  • KoruyoKoruyo AUT Join Date: 2009-06-06 Member: 67724Members, Reinforced - Shadow
    edited February 2011
    Maybe some hooks to own3d.com/livestream.com/justinTv.com etc? :B

    Atm most streams i look are via own3d.com and xsplit.

    (last big event was Assembly Winter 2011)
  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
    edited February 2011
    u mean some livestream integration?
    or a webapplet for watching in a browser?
    i do not think this can be done without uwe.


    u know that owne3d.tv is from austria too ;)?
  • KoruyoKoruyo AUT Join Date: 2009-06-06 Member: 67724Members, Reinforced - Shadow
    edited February 2011
    Well i never liked that i need to install an app to watch a livestream => its much easier to do stream it to the webz... (like using my suggested pages)

    I know own3d is from austria - atm the best streaming service if you ask me... Their programm (xsplit) has lots of cool features, only a little thing still needs some work => you cant record fullscreenmodes of applications, means that you need to use window mode in your monitor resolution and fake maximize it via programms like Shiftwindow...
  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
    i would always prefer a hltv over a webstream, because i want to look to what i want to look and i want it 1920x1200 full aaf (if i would like it that way) an without:

    buffering
    annoying commentators
    videofragmets
    ###### resolution
    unwanted overlays
    have to pay for viewing
    ..
    .


    but it would be so cool to have both combined!
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    This really isn't something the community can write.. It would require reverse engineering the entire network protocol, and being able to save/restore it to disk. That's hardly a trivial thing to write when it may require extensive changes after the next patch.
  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
    isn't networking coded in lua?
  • LazerLazer Join Date: 2003-03-11 Member: 14406Members, Contributor, Constellation, NS2 Playtester
    <!--quoteo(post=1832595:date=Feb 16 2011, 08:57 AM:name=derWalter)--><div class='quotetop'>QUOTE (derWalter @ Feb 16 2011, 08:57 AM) <a href="index.php?act=findpost&pid=1832595"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->isn't networking coded in lua?<!--QuoteEnd--></div><!--QuoteEEnd-->
    I think most of it is. What this sounds like really is a mod where an ns2tv client can connect to a server and do little but receive data and ping to prove connectivity. This is where things start to get tricky however. The ns2tv client needs to also act like its own relay server allowing people to connect and do nothing but spectate and watch all the live data being sent through it. If this can be done purely with LUA I'm unsure. I'm sure its possible to build pure spectator clients to receive the gameplay data and connect them directly to the game server, but this would take up lots of slots and also slow down the game because of all the connected clients; making the separate relay server a requirement.
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1832654:date=Feb 16 2011, 03:34 PM:name=Lazer)--><div class='quotetop'>QUOTE (Lazer @ Feb 16 2011, 03:34 PM) <a href="index.php?act=findpost&pid=1832654"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I think most of it is. What this sounds like really is a mod where an ns2tv client can connect to a server and do little but receive data and ping to prove connectivity. This is where things start to get tricky however. The ns2tv client needs to also act like its own relay server allowing people to connect and do nothing but spectate and watch all the live data being sent through it. If this can be done purely with LUA I'm unsure. I'm sure its possible to build pure spectator clients to receive the gameplay data and connect them directly to the game server, but this would take up lots of slots and also slow down the game because of all the connected clients; making the separate relay server a requirement.<!--QuoteEnd--></div><!--QuoteEEnd-->

    The networking is all in C. It would be utterly insane to do all the low level networking in Lua, you would get awful performance.
  • JirikiJiriki retired ns1 player Join Date: 2003-01-04 Member: 11780Members, NS1 Playtester, Squad Five Silver
    edited February 2011
    They're planning a HLTV, and done with C/C++ it'll be much faster.

    I've modded NS LUA somewhat and I'll say its doable in theory but I wouldn't get hopes up on performance. Too much overhead to relay data.
  • Dalin SeivewrightDalin Seivewright 0x0000221E Join Date: 2007-10-20 Member: 62685Members, Constellation
    <!--quoteo(post=1832706:date=Feb 16 2011, 08:06 PM:name=devicenull)--><div class='quotetop'>QUOTE (devicenull @ Feb 16 2011, 08:06 PM) <a href="index.php?act=findpost&pid=1832706"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The networking is all in C. It would be utterly insane to do all the low level networking in Lua, you would get awful performance.<!--QuoteEnd--></div><!--QuoteEEnd-->

    But exposing Socket API methods to Lua would be nice, or even some basic raw data fetch or stream APIs. Then custom DLLs can be disabled, and all will be right with the land.
  • PlasmaPlasma Join Date: 2003-04-26 Member: 15855Members, Constellation, Squad Five Blue
    You may want to experiment with simply having a client that acts as a proxy between a real player and a server; and then match viewers (who want to watch the match) connect to a 'pretend' server that fools the game into thinking they are playing, but really you're just receiving the same data being sent to the real player (who's running the TV proxy).

    Probably won't work like that, though.

    Another idea is to wait for demo recordings to be supported, then try steaming demo recordings from one player to the web (and let spark playback demo recordings downloaded from the web in real time) as a way to do it as well.
  • pairdimepairdime Join Date: 2011-03-03 Member: 84403Members
    I would love to see something like this for NS2 and its mods...
  • HughHugh Cameraman San Francisco, CA Join Date: 2010-04-18 Member: 71444NS2 Developer, NS2 Playtester, Reinforced - Silver, Reinforced - Onos, WC 2013 - Shadow, Subnautica Developer, Pistachionauts
    My interest level in this thread is rediculously high.
  • Jason WhoreJason Whore Join Date: 2011-04-11 Member: 92514Members
    if there will be a live-video-thingy i want to spectate in 3rd person and free roam also
  • wulf 21wulf 21 Join Date: 2011-05-03 Member: 96875Members
    As you may know or not, I'm experimenting with writing a record plug-in. I already can save and restore a single game state but its still a little buggy. What is supposed here doesn't sound that impossible to me, you don't really need to "reverse-engineer" the networking.

    What you hypothetically would need is to start a local server and client, just like if you are starting a local game. Only difference is, that the client does <i>not</i> connect to the local server, but a remote server. Then you would need some possibility to transfer data from the client VM to the server VM.

    Determining <i>what</i> data should be transferred is actually an easy task and doesn't even need to be rewritten with every built. Just override the function Shared.LinkClassToMap to store all the classes/ents/networkvars in a table before calling the original Shared.LinkClassToMap. That way you would have the table of vars rebuilt everytime you start your proxy and if the devs change any of them, you would have the current vars automatically. (Actually that's the same thing I'm doing for my record plug-in). Additionally you would need the angles and origin Vector of every entity as these are not explicitly stated as networkvars.

    The difficult thing would be doing the actual transfer. (Even if server and client run on the same physical machine, they are separate virtual machines). As a workaround the data could be dumped in temporary file(s). A smart possibility would be writing a C/C++ library that allows to temporary store in and read data from the RAM but that would depend on how DLLs are handled by the engine. If the server and the client would have running their own instance of the DLL, data transfer on that way wouldn't be possible. If the engine however would create only one instance of every DLL then both server and client could access the same part of the RAM.

    Then the server needs to create every entity that started its existence in the client and destroy every entity that is not longer there on the client, the others need their vars updated. And of course the server needs to allow spectator clients only.

    Last but not least the server running the actual game server needs a modification, too. As I already pointed out in another thread, clients only receive updates about entities that can be seen or heard from the current position. There is a Lua function called GetIsEntityRelevantForPlayer or similar (can't currently check cause I'm writing this on a computer that doesn't have NS2 installed). It would need to be overridden to always return true if the client is a Spark TV proxy.

    You see: networking between game server-->Spark TV proxy and between Spark TV proxy-->Spectator would entirely been done by the game's own network code and you don't need to know anything about it.
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    edited June 2011
    <!--quoteo(post=1832480:date=Feb 15 2011, 08:38 PM:name=derWalter)--><div class='quotetop'>QUOTE (derWalter @ Feb 15 2011, 08:38 PM) <a href="index.php?act=findpost&pid=1832480"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->i would always prefer a hltv over a webstream, because i want to look to what i want to look and i want it 1920x1200 full aaf (if i would like it that way) an without:

    buffering
    annoying commentators
    videofragmets
    ###### resolution
    unwanted overlays
    have to pay for viewing
    ..
    .


    but it would be so cool to have both combined!<!--QuoteEnd--></div><!--QuoteEEnd-->
    Demosmoother? Oh yes please!
  • vizioNzvizioNz InversionNS2.com Join Date: 2003-12-21 Member: 24595Members, Constellation, NS2 Playtester
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    I'm already doing this. The gamestate-recorder in GameOvermind has this ability built-in, it's only a matter of streaming to a spectator-server, instead of writing to a file. I'll get on it after v11 is out.
  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
    cool! will you implement some of my suggested features?
    or tell me which features have you planed so far?

    tell us more technical details pls!!!!
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Some of your suggestions require Server-Client Lua sync to be put in (for the GUI per example), but other than that most of it is already done. I'm first concentrating on getting ordinary demos to work flawlessly (which I'm working on right now, and will be making a post about it when I'm finished), then I'll be moving on to a TV-system which I'll be able to simply build right on-top of that, but that won't be until v11 is out and proven to work correctly.
  • swalkswalk Say hello to my little friend. Join Date: 2011-01-20 Member: 78384Members, Squad Five Blue
    edited January 2012
    <!--quoteo(post=1893389:date=Jan 10 2012, 05:56 PM:name=player)--><div class='quotetop'>QUOTE (player @ Jan 10 2012, 05:56 PM) <a href="index.php?act=findpost&pid=1893389"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'm already doing this. The gamestate-recorder in GameOvermind has this ability built-in, it's only a matter of streaming to a spectator-server, instead of writing to a file. I'll get on it after v11 is out.<!--QuoteEnd--></div><!--QuoteEEnd-->
    So what you have now is something like a HLTV that can record games? I would love that mod :P
    Release? :P
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    What I have now is a demo-recorder that records the WHOLE game (every single little thing in the map, all perspectives, all entities, all sounds, all effects, et cetera). Building a HLTV off of that would be a mere formality (contrary to NS1 FP-demos & HLTV-demos, which were physically different).
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    Any big performance hit for this? And, when is it done *points finger, WE NEED :D*
  • JibrailJibrail Join Date: 2009-04-16 Member: 67200Members
    <!--quoteo(post=1893591:date=Jan 11 2012, 06:46 PM:name=player)--><div class='quotetop'>QUOTE (player @ Jan 11 2012, 06:46 PM) <a href="index.php?act=findpost&pid=1893591"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->What I have now is a demo-recorder that records the WHOLE game (every single little thing in the map, all perspectives, all entities, all sounds, all effects, et cetera). Building a HLTV off of that would be a mere formality (contrary to NS1 FP-demos & HLTV-demos, which were physically different).<!--QuoteEnd--></div><!--QuoteEEnd-->
    great job man, keep it up. just wondering what is the file size like?
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Can't give (semi)definitive information on any of that yet. Like I said, I'll make an extensive and technical post about it when it's running and in a more polished state. Won't be that long (weeks rather than months).
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1893608:date=Jan 11 2012, 08:17 PM:name=player)--><div class='quotetop'>QUOTE (player @ Jan 11 2012, 08:17 PM) <a href="index.php?act=findpost&pid=1893608"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Can't give (semi)definitive information on any of that yet. Like I said, I'll make an extensive and technical post about it when it's running and in a more polished state. Won't be that long (weeks rather than months).<!--QuoteEnd--></div><!--QuoteEEnd-->
    Alright, keep it up. We will still be here :P
  • fanaticfanatic This post has been edited. Join Date: 2003-07-23 Member: 18377Members, Constellation, Squad Five Blue
    edited January 2012
    <!--quoteo(post=1893591:date=Jan 11 2012, 07:46 PM:name=player)--><div class='quotetop'>QUOTE (player @ Jan 11 2012, 07:46 PM) <a href="index.php?act=findpost&pid=1893591"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->What I have now is a demo-recorder that records the WHOLE game (every single little thing in the map, all perspectives, all entities, all sounds, all effects, et cetera). Building a HLTV off of that would be a mere formality (contrary to NS1 FP-demos & HLTV-demos, which were physically different).<!--QuoteEnd--></div><!--QuoteEEnd-->
    Hot ###### man, looking forward to seeing this. Out of curiousity, how many cpu resources does this currently consume and approximately how many kbs/mbs of hdd space are used for the demo file for each second recorded?
  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
    7zip lib for the win :)

    yeah sounds cool, keep us updated!
    if you need help msg me, maybe i can help!!!


    btw hltv server could RECORD and PLAY demos!
    so you uploaded the demo to the hltv server and played it.
    all the viewers who connected to the hltv server where watching
    the same demo live :)
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    <!--quoteo(post=1893719:date=Jan 12 2012, 02:51 AM:name=derWalter)--><div class='quotetop'>QUOTE (derWalter @ Jan 12 2012, 02:51 AM) <a href="index.php?act=findpost&pid=1893719"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->7zip lib for the win :)<!--QuoteEnd--></div><!--QuoteEEnd-->
    Very close, I'm using bzip2 to compress\decompress the demos on-the-fly, so it's already built into the file-format
  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
    small side-question: why bzip2>7zip, etc.?

    i think i know why, but before i write crap and expose my ignorance, i better just ask you why you made this choice :P
Sign In or Register to comment.