Tuesday 27 September 2011

Creating my own Markup Language.

Creating our own Markup Language

Inspired by my lifelong addiction to Football Manager I was thinking of creating a markup language with a purpose for football. The idea of this could be used with a real time location based infographic app/data viewer. This came out of a few hours work and is very much an example of understanding how markup works and what are its possibilities. Given more time, this example could become a lot more complex. 


The  < Matchinfo > is fairly self explanatory. The < ID > section refers to the associated info to that could be assigned to that specific stadium - ie travel info, average attendance, current people check-in there (read Facebook/Foursquare tie in).

< match2 >

  < matchinfo >
    < date > 2011-10-08 < /date >
    < stadium > Reebok
        < id > 16 < /id >
    < /stadium >
    < city > Bolton < /city >
    < kick-off > 15:00 < /kick-off >
    < time > 15:23 < /time >
  < /matchinfo >
< /match2 > 



This section describes a specific event.
The fictional event describes Rooney equalising for Man Utd at the Reebok, with Cahill at fault for the goal.

The  < match2 >  refers to which game it is in the league fixtures for that day.

Now we get onto the information of the specific event.
We can see the event which occurred was a shot (no 4 of the game), it was on target and resulted in a goal (the second of the game). The < placement > 301 < /placement >  refers to a grid reference given the the goal itself.
If you imagine the goal is split into 3 horizontal sections, each split into 4 boxes.

  < Event >
      < action >Shot
          < shotno > 04 < /shotno >
      < /action >
      < type > On Target < /type >
      < outcome > Goal
          < goalno > 2
      < /outcome >
      < placement > 301 < /placement >
  < /Event >


The idea of  Context  is to give a more human approach to the data and event.
It is given a rating between 1-10 as to how against the run of play the goal is. This has been given an 8 with 10 being completely against the run of play, 1 being very, very likely. The  timing refers to how this goal affects the scoreline - this being an equaliser.
The idea of  blame  is perhaps an unnecessary one but gives an indicator as to who was at fault in the game. In this respect Cahill can be seen as being at fault. This could always be set to  none  if the event was a moment of brilliance rather than poor defending or goalkeeping.

  < context >
      < run-of-play > Against < /run-of-play >
          < rating > 8 < /rating >
      < contraversial > no < /contraversial >
      < timing > equaliser < /timing >
      < goals > 1:1 < /goals >
      < blame > Cahill < /blame >
   < /context >
The Ball data would be the most important when thinking of a live feed graphic. The < assistfrom > & < endpoint > directly refers to the start and end point of the pass that led to the goal.Again, like the goal, the pitch would be split into a grid reference system. In this grid, the pitch would be split a1 - e5 with c straddling the half way line and a or e being either goal area or corner. There are also a few extra data entries connected to the pressure and assistfrom fields. The extra data assigned to assistfrom is the play. This related to either open play or dead ball situation. A dead ball situation could then be further extended to being a corner, free-kick, goalkick, etc.
   
     < assistfrom > d2
       < play > open < /play >
     < /assistfrom >
     < pressure > none
       < rating > 2 < /rating >
     < /pressure >
     < endpoint > b3
     < height > feet < /height >
     < /endpoint >
   < /ball >

The next section describes the players involved, their locations, affiliated ID's, image database #'s, etc.
From these ID's you could incorporate player profiles, stats from the match and the rest of the season and so on.

 < team > Man Utd
    < player >
      < position > attacker < /position >
      < name > Rooney < /name >
      < playerid > 0028910 < /playerid>
      < location > b3 < /location >
      < colour > Red < /colour >
      < number > 10 
      < img /> 289
    < /player>

    < player >
      < position > midfielder < /position >
      < name > Young < /name >
      < playerid > 0031518 < /playerid >
      < team > Man Utd < /team >
      < location > d2 < /location >
      < colour > Red < /colour >
      < number > 18 < /number >
      < img /> 315
    < /player >
< /team >

    
< team > Bolton
    < player >
      < position > defender < /position >
      < name > Cahill < /name > 
      < playerid > 0003206 < /playerid >
      < location > a4> < /location >
      < colour > White and Blue < /colour >
      < number > 06 < /number >
      < img/ > 32
    < /playe r>

    < player >
      < position > goalkeeper < /position >
      < name > Jaaskelainen < /name >
      < playerid > 0011222 < /playerid >
      < location >x2>< /location >
      < colour > Sky Blue < /colour >
      < number > 22 < /number >
      < img / > 112
    < /player >
< /team >

There is a lot which could be edited and streamlined into a more cohesive script and language. I could make use of putting each team into a separate <div>;

< team id="Bolton" >
  
  < player id="Cahill">
  < position > defender < position >
  ...

This could allow for better understanding of the script and use of easier manipulation by making separate sections for each team then player (div within div).

No comments:

Post a Comment