Behavior, Content, Money – 3 Things you should never give away for free!!!

BCmoney MobileTV

Video Game XML schema and JSON serialization

Posted by bryan on May 17, 2010 in HTML, JavaScript, JSON, Multimedia, XML with 1 Comment


No Gravatar

8-bit Mario

The original!!! In HTML5 to boot, wowowowow!!!


In honor of the recent uptake in video games designed on the web completely using open web technologies (i.e. HTML5, CSS3, JavaScript2), I decided it might possibly be useful to someone out there someday if I share a generic XML schema for describing levels, characters and secrets in games. This schema is data-focused, not transaction or interaction-focused; as such you might consider it incomplete, as it is missing the requisite timing information, animations, transitions, object drawings & renderings, etc… all admittedly required to put together a complete game.

That information is what I consider implementation-specific though, as there’s not a single foolproof/clean way to markup interactivity or logic information for a very wide array of games, screens, operating systems and devices. There are a number of initiatives already under way to model some aspects of the interactivity problem though, started by people much brighter than myself. See VRML, WebGL, and SMIL + SVG, Canvas/Javascript or even just plain old Flash/Actionscript for some interesting approaches in this area of interactivity and animation modeling.

What’s wrong with Video Games nowadays?
One of the biggest problems in the Gaming and related industries nowadays is not the lack of hardware or software capabilities, but rather, keeping up with the increasing capabilities in terms of processing power and new technology possibilities. In addition, margins are getting arguably thinner on games, with teams required to be bigger and bigger to ship products out the door on time. The point is though, is that there is always a better way than multiple groups of people separately beating their collective heads against a wall trying to keep up with innovation. The answer lies in open standards.

Who stands to gain from standardization?
Everyone from the consumer down to the MMORPG companies (i.e. Linden with SecondLife, or Blizzard with WoW) to Educators (i.e. Northern Ontario School of Medicine with OpenLabyrinth or the millitary with their infamous adoption of SCORM in desperation to reach a standard for training simulations) to the Game Designers, Creatives & Developers whose jobs would be made easier, to the big-time game production shops (i.e. EA, LucasArts, HB Studios) who could collaborate with their audiences directly to churn out hits at an even faster rate, we’re even talking right down to the console manufacturers themselves (i.e. Sony, Nintendo, Microsoft) would be interested in a standardized solution that enabled them to boast a larger number of titles and higher sales. But the problem is they haven’t the time nor resources to get together and really focus on hashing out the standard (or multiple standards) that would be required to solve the problem(s) they face, and most importantly even agreeing on what their biggest (common) problems are. Hence there remains a lot of waste across each of these industries, and the best we have to look to will continue to be collaborative groups like the W3C, which certainly does have the time to develop interoperable standards to support collaboration. What does this mean?

The platform will eventually be the web, its practically inevitable. This may sound odd at first, but especially when one considers that processing power continues to increase across the board. Heck, I never thought I’d admit it but even Microsoft’s continually improving adherance to such open standards is starting to shine through with their impressive GPU-accelerated HTML5 demos for IE9 Beta.

This should be considered a major win though for the open web in general; what it shows is that the big guys are willing to play with cool new open standards, they just might not necessarily waste all their time and R&D Budget with a risk of winding up on the bleeding edge of a new technology rather than on the “cutting edge”. So its an eternal cat & mouse game, as they try to divide up the larger piece of cheeze amongst themselves and their proprietary consoles. With the right guidance, leadership and grassroots demand they can and will realize the benefits or sharing a lot more of the cheeze in the name of drastically increasing the number of people who incorporate cheeze consuming and making into their daily diets (so much they’d be happy to help bake more, or, at least pay for someone else to make more for them).

A modest proposal
With that lengthy premise out of the way, keep in mind, the following schema is just a first kick at the can for fun, so let’s see what we end up with. What I’d ultimately like it to be is a way of unlocking the complex and seemingly cryptic/exclusive world of game development, for the common man with an idea and some spare time/energy.

This is why I also created a prototype for a new HTML5 online game development studio to go with the new formats.

View an Example XML below:

 

	
		
			
				          
					
						
							
							
							
							
						
					
					
						
							
							
							
							
							
							
												
					
					
						
							
														
						
					
					
						
							
						
					
				
			
			
				          
					
						
							
														
						
					
					
													
													
							
							
														
							
												
					
					
					
						
							
						
					
				
			
			
				          
					
						
							
							
							
							
							
							
						
					
					
						
							
							
														
												
					
					
						
							
						
					
					
						
							
							
						
					
				
			
			
				          
					
						
							
							
						
					
					
						
							
							
							
							
							
												
					
					
						
							
														
						
					
					
				
			
			
				          
					
						
							
							
							
							
							
							
						
					
					
						
							
							
							
							
												
					
					
						
							
							
						
					
					
						
							
							
						
					
				
			
			
				          
					
						
							
							
							
							
						
					
					
						
							
							
							
												
					
					
						
							
						
					
					
						
							
						
					
				
			
			
				          
					
						
							
							
							
						
					
					
					
						
							
						
					
					
				
			
			
				          
					
						
							
														
						
					
					
						
							
							
												
					
					
						
							
							
							
						
					
					
				
						
		
		
			Press & Hold A + Start buttons after getting back to the start screen.
			If you touch the flagpole of any level with either 1, 3, or 6 seconds left on the ones place of the timer, you will get that amount of fireworks. For example, if you touch the flagpole with 126 seconds left on the time, you will get six fireworks!
			If you just walk along the sea floor, Bloopers will never be able to kill you because they are forced back up just before they hit the floor(or you).
			
		
		
			Jump (or swim, in two levels)
			Jump (or swim, in two levels)
			Control Pad Left/Right: Move
			Control Pad Down: Enter a pipe while standing on it - not all work, thoughd
			Jump (or swim, in two levels)
			Choose between one- (Mario) and two-player (Luigi) games on opening screen
		
	

If you prefer a different flavour of data format, there’s also an equivalent JSON serialization you can try on for size (though debatable if its much more useful than XML, except that it can probably work more efficiently and easily with thin-client JavaScript webapps):

{
    "videoGames": {
        "videoGame": {
            "@attributes": {
                "guid": "B000TUZCQI",
                "title": "Super Mario Bros.",
                "description": "Super Mario Bros. is a platform video game developed by Nintendo in late 1985.",
                "plot": "All is not well in the Mushroom Kingdom!",
                "maxPlayers": "2",
                "URL": "http://www.bcmoney-mobiletv.com/widgets/videogames/",
                "audio": "http://www.vgmusic.com/music/console/nintendo/nes/index-sz.html#Super_Mario_Bros",
                "video": "http://www.gamefaqs.com/nes/525243-super-mario-bros/videos/gs_video-6275779",
                "rating": "E",
                "userRating": "9.0/10",
                "admin": "MarioTeam",
                "adminEmail": "supermario@nintendo.com",
                "releaseDate": "1985-10-18",
                "last_accessed": "2010-05-17T03:49:45"
            },
            "stages": {
                "stage": [
                   "levels": {
                      "level": [
                      ]
                    }
                ]
            }
        }
    }
}

Now, without any further adieu, here’s the classic 8-bit Nintendo game Super Mario Bros. as glorious HTML5 (not coded by myself, but borrowed here from its MIT license over at Nihilogic);

Play Now

The Bros. come to the Web in glorious HTML5


Then, just check out the code for yourself:

Remember, I’m acknowledging in advance that this is incomplete and experimental. In any case, its something that would be really nice to have according to my brief work with clients in the gaming industry (and from feedback from those who’ve put in many more years there) it would also be a nice way to store game timelines and edit them quickly & collaboratively, encouraging reuse of components and potentially streamlining game development.

Prototyping this concept is all I was going for this time around… I hope someone with more experience could suggest some improvements, but imagine the power of a fully-RDF based representation of a game, which pulls in new data based on the flow of the gameplay from the World Wide Graph (aka Web 3.0 for the marketing aficionados out there). This could be the personal agent-driven learning and entertainment experiences which have long been touted as an advantage of the Semantic Web, and certainly worth a re-visit sometime soon… until then!

  1. bcmoneyMarch 24, 2011 - 2:10 pm #1

    UPDATE: After writing this, I’ve found tons of amazing examples of HTML5 and/or CSS3 powered gaming experiences. Here is a complete NES & SNES emulator with several games:
    jSNES

    Reply
Leave a Reply

No trackbacks yet.

No post with similar tags yet.

Posts in similar categories

BC$ = Behavior, Content, Money

The goal of the BC$ project is to raise awareness and make changes with respect to the three pillars of information freedom - Behavior (pursuit of interests and passions), Content (sharing/exchanging ideas in various formats), Money (fairness and accessibility) - bringing to light the fact that:

1. We regularly hand over our browser histories, search histories and daily online activities to companies that want our money, or, to benefit from our use of their services with lucrative ad deals or sales of personal information.

2. We create and/or consume interesting content on their services, but we aren't adequately rewarded for our creative efforts or loyalty.

3. We pay money to be connected online (and possibly also over mobile), yet we lose both time and money by allowing companies to market to us with unsolicited advertisements, irrelevant product offers and unfairly structured service pricing plans.

  • Archives

  • Switch to our mobile site