NOTA-TV

NOTA-TV

Moderators: smartie, Thor, PepeAmpere, Moderators, Content Developer

User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

NOTA-TV

Post by PepeAmpere »

I after more then month of touching the idea from many sides, its time to create own thread for thing that we can call "NOTA-TV" for some time.

Image

This subproject of great NOTA world have some parts

Lua widget, that makes SVG files
  • Alpha version is finished
  • you can check the code on project site
BTW0: We tried some aprroaches:

Using bitmap icons - the same like in game
  • [+] - icons are finished
    [-] - icons are ugly and only way how to work with them is using filters (not comfortable)
    [-] - icons are stored on-line and there are downloaded - so no watching off-line
    [-] - if many units (more then 100-200) Firefox and Opera are not fast enough and you see slideshow, only in Chrome you see nice smooth moves
Using vector icons
  • [-] - you have to create many new icons
    [+] - but icons are nicer and its easier to work with them (coloring, black borders)
    [+] - big numbers of units are not so bad for any browser
In archive you can check examples of two results.

Currently the vector aprroach is under development, we work on new icons now, polishing the size, and solving some strange interpretation of SVG in some browsers.

BTW1: we found this forum thread where there are previous tries of other people to make SVG replay. (Un)fortunately we found it when our widget was almost fisnihed - but for comparation its good and there are some good ideas and dead branches of developent.

BTW2: Today (10.10.12) IljaK said, he let look the world on his widget doing almost the same - his svgs are advanced in one way - it shows the players chat and drawing, too.

BTW3: There was made some arrangement with Dansan that there will be possible to upload SVG replays to replays storage near end of the year, maybe (Conditions of this deal are not specified, yet, its not solved what to do with automaticly sent replays - are they valuable enough?, registred or registred+trusted+ users can upload files?, etc..)

BTW4: Big thx for dansan replay storage, we use map images stored there for background of our replays - note - in current state on-line viewing is still needed

Currently under eyes of:
  • PepeAmpere
  • TheFace
Some tech stuff:
  • Widget record everytime you play as Spectator (so when watching standard replay, too) and saves result in ./demos or ./demos/nota-tv (if created)
  • Theres present some older version in NOTApack (for windows users) - you can just download and test
  • Currently work just for NOTA, but theres no problem to "localize" the widget for other games. Its done by creating "<mod_name>-icontypes.lua" in Widgets/nota-tv/ folder from your game icontypes.lua and adding transition info for using new icons (its still changes, when final release, the manual or some easier solution will be here)
TV Page
  • not started yet
  • it will be some kind of neverending "broadcasting", mostly SVG replays + some autogenerated stuff (like news from forum, last comments in choosen forums, short autocreated adds, next program)
  • http://nota.machys.net/tv - would be the adress (NOT DONE)
NOTA :: LOBBY part
  • lobby should contain the same as the page "broadcasting"
  • lobby will offer watching svg files like standard video with pause, rewind and other controls.
  • lobby let you easily change the settings of recording widget to change the default speed of replay and the how preciese the moves are captured (for creating your own videos)
Currently strongly developed by NOTA :: lobby team:
  • danil_kalina
  • a1983
"that other TV autogenerated stuff"

There is idea to have some 5-15 second pause between every match show in "page-TV broadcasting" where some "whats next" and "whats new in spring comminty" stuff will be placed
  • because of lack of manpower, this only nice idea, nothing more
If made, its sure there would be:
  • One random headline from springrts.com news tab
  • Next 1-3 replays info
  • some changes in ledders and maybe info from PlanetWars
  • ...
Technical description for parsing the file.

1) ignore first four lines

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<!--
2) on 5th line you find head of [general] settings

Code: Select all

[general]
3) next lines contain all important global settings of video
  • each on own line
  • name of setting starts on first letter, ends with ":"
  • sector of settings ends with empty line and with next section
  • all values of current version of SVG file are listed below:

Code: Select all

gameID:67d59b503e300574a0996a1f97174d8b
everyWhichFrame:120
speedUp:2
shift:5
realSpeedUp:4
mapName:Valles_Marineris_v2
gameVersion:91.0
gameModName:NOTA 1.69
gameLength:0:16:7
widgetVersion:0.58
alliances:3
playerCount:5
types of variables:

gameID (string)
everyWhichFrame (int)
speedUp (int)
shift (int)
realSpeedUp (float)
mapName (string)
gameVersion (string)
gameModName (string)
gameLength (string) -> <int>:<int>:<int>
widgetVersion (string)
alliances (int)
playerCount (int)

4) another section - [playersInfo], that contains data about players. From previous section you know the number of players (called in spring "teams") and number of teams (called in spring "alliances").
  • Section ends with empty line
  • line without "-" at the beggining means - here is team no. <some_integer>
  • line with "-" is line describing one players property (how? described below)

Code: Select all

[playersInfo]
team:1
-0,0,256,256,[NOD]Smoke_Fumus,ru,5
-1,150,0,256,[o]PepeAmpere[CZ],cz,6
team:2
-2,0,159,256,danil_kalina,ru,5
-3,0,129,129,PoW,sk,4
5) players info coded like: "-idNumber,Red,Green,Blue,PlayerName,twoLettersCodeOfFlag,Rank"

types of variables:

idNumber (int)
Red (int <0-255>)
Green (int <0-255>)
Blue (int <0-255>)
PlayerName (string)
twoLettersCodeOfFlag (string)
Rank (int)

6) Section of Notalobby settings ends with first ending comment symbol below the playersInfo section

Code: Select all

-->
7) Last thing is to describe parsing of objects (icons). Go down in file until you find

Code: Select all

[IconDefinitions]
Definitions are splited into paragraphs => empty line is separator - when you find empty line, current definition ends and on next line new definition starts.

I show you some basic example and there will be some partial examples below (not everytime part of this one - this on is only ilustration of one block).

Code: Select all

<ellipse id="57" ry="2" rx="2" y="-1" x="-1" class="p1">
<set attributeName="visibility" to="visible" begin="17.5s" dur="27s"/>
<animateMotion path="M 230 513 l 15 2 l 18 10 l 20 -1 l 13 -15 l 10 -6 l 12 -6 l 20 -3 l 17 -11 l 19 -6 l 21 0 l 20 0 l 19 -1 l 18 0 l 20 0 l 15 -4 l 12 -1 M 499 471 z" begin="17.5s" dur="9s"/>
<animateMotion path="M 499 471 M 499 471 z" begin="26.5s" dur="9s"/>
<animateMotion path="M 499 471 l 15 -3 l 8 3 l -7 -3 l -7 -2 l -21 -2 l -20 1 l -12 -16 l -15 -12 l -8 -12 l -8 -10 l -13 15 l -4 8 l 7 10 l 5 -7 l 2 -17 l 15 -5 l 20 -3 l 2 0 M 457 411 z" begin="35.5s" dur="9s"/>
</ellipse> 
FIRST LINE - DEFINITION

First line of definition every time gives you information about the icon itself, it can start with three possible tags:
  • "<rect" - means rectangle defintion

    Code: Select all

    <rect id="52" height="8" width="8" y="-4" x="-4" visibility="hidden" class="p4">
  • "<ellipse" - means dot definition

    Code: Select all

    <ellipse id="54" ry="2" rx="2" y="-1" x="-1" visibility="hidden" class="p1">
  • "<path" - all other icons definition

    Code: Select all

    <path id="3" d="m-6.06312,-0.598846l5.650921,-4.111298l5.650938,4.111298l-2.158445,6.652451l-6.984957,0l-2.158457,-6.652451l0,0z" visibility="hidden" class="p2">
As you can see, each of them have own definition structure - but for first tests you can ignore the complicated ones and use only rectangles + dots

All three types of icons have some common parameters
  • id - unique identifier (created by widget, lower number means unit was made sooner, bigger -> later)
  • class - class containts specification of color, stroke-strength and default visibility, its string made as:

    "p" + "<0..n>"

    for example: p2 or p0

    where n is number of players (teams) and its the first number that was at player description in section [playersInfo]
unique parameters are
  • for rect - height, width, relativeX,relativeY

    Code: Select all

    width="8" height="8" y="-4" x="-4"
  • for ellipse - rx, ry, relativeX,relativeY

    Code: Select all

    rx="2" ry="2"  x="-1" y="-1"
  • for path - some path definig the icon (this will be maybe enhanced by some global definition)

    Code: Select all

    d="m-4.93437,2.77619l1.87515,-4.70625l6.25048,0l1.87515,4.70625l-10.00077,0z"
SECOND LINE - ANIMATION

look at example:

Code: Select all

<set attributeName="visibility" to="visible" begin="21s" dur="83.5s"/>
this line is everytime the same, only parameters are:

begin = time of video, when icon shows on the screen
dur = time, for which the icon stays on the screen

for Danil: if you want to change the speed of the video (and get real game time speed), just mulitply these two values by realSpeedUp parameter, that is prepared for you in section [general]

THIRD AND OTHER LINES

every line from third to one before last starts with

Code: Select all

<animateMotion path=" 
after two situations can happend

1) it is desctiption of no move, of static unit sitting on the place for some time. Example:

Code: Select all

<animateMotion path="M 122 280 M 122 280 z" begin="5s" dur="226s"/>
2) it is desctiption of move. Example:

Code: Select all

<animateMotion path="M 230 513 l 2 -1 l 21 1 l 18 8 l 19 -4 l 14 -9 l 11 -7 l 20 -3 l 17 -10 l 19 -6 l 20 0 l 19 -4 l 19 -1 l 18 -1 l 17 8 l 16 1 l 17 4 l 0 0 M 497 489 z" begin="16.5s" dur="9.5s"/>
  • Values after "M" are absolute position values of icon (first x, second y)
  • Values after "l" are relative pos values of icon (first x, second y) so you get new absolute value by addition previouse absolute (x,y) value with current (x,y) value.
  • It makes sense, that in all cases you start with M value.
  • Every move ends with M value, too.
  • Desctiption of move itself ends with "z".
Remaining values of line have the same meaning as previouse line. So begin is begin time of this move and dur is duration of that move. You should apply the same multiplier as I suggested to Danil in previouse section to get "real game time" replay.


LAST LINE

On last line theres closing tag of one three types i described in FIRST LINE section. So one of these

</rect>
</ellipse>
</path>

Other notes

- only videos made by widget 0.588 and higher keeps these rules
- there are some things not specified correctly and deeply (for example drawing of icons and work with colors - i will complete the sections that will make problems later)
Attachments
two_examples.zip
- Frozen fortress game replay shows SVG with bitmap icons
- Valles Marineris replay shows usage of 17 example vector icons
(458.7 KiB) Downloaded 134 times
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: NOTA-TV

Post by knorke »

[-] - icons are stored on-line and there are downloaded - so no watching off-line
SVG can include bitmaps via this: http://en.wikipedia.org/wiki/Data_URI_scheme
(for icons vectors are still better imo)
Btw the map image is stored online too atm..
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: NOTA-TV

Post by dansan »

- icons are stored on-line and there are downloaded - so no watching off-line
A website does not need to work offline, but regarding the lobby:
If you cache the SVG for the lobby to be able to watch it offline - then why not cache the icons aswell? Then simply manipulate the cached SVG to use the cache.
It's a text file. I just did it using wget and vi, and it worked.
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: NOTA-TV

Post by danil_kalina »

dansan wrote:
- icons are stored on-line and there are downloaded - so no watching off-line
A website does not need to work offline, but regarding the lobby:
If you cache the SVG for the lobby to be able to watch it offline - then why not cache the icons aswell? Then simply manipulate the cached SVG to use the cache.
It's a text file. I just did it using wget and vi, and it worked.
The idea to make Game-Dependent unit SVG icons. And put them to the game itself.
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: NOTA-TV

Post by danil_kalina »

Image
Attachments
TV.png
(395.83 KiB) Downloaded 5 times
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: NOTA-TV

Post by smoth »

oh wow
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOTA-TV

Post by PepeAmpere »

knorke wrote:
[-] - icons are stored on-line and there are downloaded - so no watching off-line
SVG can include bitmaps via this: http://en.wikipedia.org/wiki/Data_URI_scheme
(for icons vectors are still better imo)
Btw the map image is stored online too atm..
We will work only on vector icons way. With map, true - any idea how much space will need such text representation of some minimap (800*600 for example)?
dansan wrote:
- icons are stored on-line and there are downloaded - so no watching off-line
A website does not need to work offline, but regarding the lobby:
If you cache the SVG for the lobby to be able to watch it offline - then why not cache the icons aswell? Then simply manipulate the cached SVG to use the cache.
It's a text file. I just did it using wget and vi, and it worked.
On/Off-line thing (for map) is marginal for me now, we create it on-line only now for simple SVGs, there was only problem with icons, downloading each file was slowing down some browsers, its not problem now when using vector icons

Lobby SVG viewing have no on/off-line problem, becouse lobby knows how to get the minimap (of course im map is present, downloaded) and icons will be vector-ones.
danil_kalina wrote:The idea to make Game-Dependent unit SVG icons. And put them to the game itself.
There will be simple set of icons that we create, every game "localization" can use own mapping from their own classes.

I think Spring dont like SVG vector formalism, so there no easy way (and need, too) how a and why to do that (reuse). But I know you dont like current NOTA icons 8) .
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOTA-TV

Post by PepeAmpere »

Big update of first post: technical description for file parsing finished. 8)
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: NOTA-TV

Post by danil_kalina »

Image
Image
Attachments
tv2.PNG
(647.33 KiB) Downloaded 5 times
tv1.PNG
(648.15 KiB) Downloaded 5 times
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOTA-TV

Post by PepeAmpere »

gameID added in head of the SVG file

last version on project site
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: NOTA-TV

Post by danil_kalina »

Image
Attachments
battle.gif
(1.66 MiB) Downloaded 4 times
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOTA-TV

Post by PepeAmpere »

Great! So we have second (and much better) SVG interpret :). Btw here is full match you show. We won a lot of endorphines that night.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: NOTA-TV

Post by SinbadEV »

PepeAmpere wrote:Great! So we have second (and much better) SVG interpret :). Btw here is full match you show. We won a lot of endorphines that night.
Any idea how to view SVGs in browser? I keep trying to view the link and it just wants to download it... tried chrome, opera, firefox, IE and safari and I know at least 3 of those CAN display SVGs.
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: NOTA-TV

Post by dansan »

SinbadEV wrote:Any idea how to view SVGs in browser? I keep trying to view the link and it just wants to download it... tried chrome, opera, firefox, IE and safari and I know at least 3 of those CAN display SVGs.
The google-code site uses the wrong mime-type (they send application/xml). I've uploaded it to another site, and apache sends it automagically correct (as image/svg+xml): http://replays.springrts.com/replay-Nuc ... 809344.svg
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: NOTA-TV

Post by SinbadEV »

dansan wrote:
SinbadEV wrote:Any idea how to view SVGs in browser? I keep trying to view the link and it just wants to download it... tried chrome, opera, firefox, IE and safari and I know at least 3 of those CAN display SVGs.
The google-code site uses the wrong mime-type (they send application/xml). I've uploaded it to another site, and apache sends it automagically correct (as image/svg+xml): http://replays.springrts.com/replay-Nuc ... 809344.svg
That is pretty epicly awesome... while clearly it might be a tax on bandwidth, it would be even more epic if you could generate those visualizations based on the replay files as they are uploaded to the server and one could preview the replay before downloading and watching it in Spring.
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOTA-TV

Post by PepeAmpere »

SinbadEV wrote:
dansan wrote:
SinbadEV wrote:Any idea how to view SVGs in browser? I keep trying to view the link and it just wants to download it... tried chrome, opera, firefox, IE and safari and I know at least 3 of those CAN display SVGs.
The google-code site uses the wrong mime-type (they send application/xml). I've uploaded it to another site, and apache sends it automagically correct (as image/svg+xml): http://replays.springrts.com/replay-Nuc ... 809344.svg
That is pretty epicly awesome... while clearly it might be a tax on bandwidth, it would be even more epic if you could generate those visualizations based on the replay files as they are uploaded to the server and one could preview the replay before downloading and watching it in Spring.
exactly this is planned :wink: and more :twisted:
  • btw1: you can generate those visualizations by widget we created (for other games then NOTA you will get only dots video, because "icon" mapping files are prepared just for NOTA now, but i can make mapping file for you)
  • btw2: when Nota :: lobby 4.0 is realeased (soon), you will be able to watch your own replays in this mode, too, as danil shown above
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: NOTA-TV

Post by danil_kalina »

btw3: we can watch a real-time play in the lobby, Battle Room. we need to make autohost use this widget for creating unit position.
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: NOTA-TV

Post by dansan »

danil_kalina wrote:btw3: we can watch a real-time play in the lobby, Battle Room. we need to make autohost use this widget for creating unit position.
:shock: - best idea ever! - I did never think about that application of the svg-movie-writer!

You can have an instant peek into the game state (without replaying the simulation), if the autohost is running spring-headless with the widget and writes the svg in realtime.

Is it possible to request a specific position in the svg-stream, or must it be replayed completely? Or can a "screenshot" be requested from the widget, which it'd write to disk, and send the URL via chat to the lobby? That'd make spec-cheating so much easier :twisted:
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: NOTA-TV

Post by dansan »

SinbadEV wrote:That is pretty epicly awesome... while clearly it might be a tax on bandwidth, it would be even more epic if you could generate those visualizations based on the replay files as they are uploaded to the server and one could preview the replay before downloading and watching it in Spring.
The bandwidth is not the problem, but the CPU is - to use a widget you must run the simulation!

Normally autohosts run as spring-dedicated. Then they don't run the sim, and use very little CPU. Running the full game-simulation for each replay-upload is to much, and frankly not necessary. And autohost-owners cannot be made to run their servers in headless-mode. That may be possible for a single host or two, but not for all.

So I imagine some kind of feature that you can either
* upload it manually (through lobby/browser by a user)
* together with the demo-file (if you run spring-headless) or
* press a button on the replays-site to tell it to run the sim on this replay (because it is somehow special).

There is no progress on this, because I'm to busy until x-mas, but it will come, because nota-tv is to frakkin' awesome :)
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: NOTA-TV

Post by danil_kalina »

dansan wrote:Is it possible to request a specific position in the svg-stream, or must it be replayed completely? Or can a "screenshot" be requested from the widget, which it'd write to disk, and send the URL via chat to the lobby? That'd make spec-cheating so much easier :twisted:
for now, widget just writes units positions to memory first. and when the battle is over it saves generated data to SVG file.

to go to any second of battle, lobby parse the whole SVG file for taking units positions. Parsing is fast, less than a half of the second.

to show TV game in real-time, lobby needs data from start of the battle. but it is not critical at all.
Post Reply

Return to “NOTA”