Apr 6 2010

Windows Phone Basic Architecture for Game Developers

Summarizing my MIX10 experience, main thing I was focused on is of course Windows Phone Series. This is huge thing for Microsoft, long expected inside the company to show that we haven’t overslept the deal totally. Device and OS shows some opportunity and I can’t wait to see how it will it shape and break into the market.

For developers it’s another chance to shine. As I recall, I think one of Capcom’s managers said that new platforms’s begining of the lifecycle is the best time to introduce new brands, IPs and products. Best time for Indies if we reffer it to game development. Best time to introduce new crazy apps if we say – any application is at stake. Microsoft promises to reveal some tools for apps promotion on its marketplace but let’s be honest. Looking at Xbox Live and PSN stores, looking at Apple’s Appstore, when you have countless number of applications it’s just not that easy to highlight yourself as at the beginning.

If you consider to start coding a few things may be important to you. First, hardware specification can help you estimate Windows Phone’s capacities:

  • Symmetric multi-touch of Capacitive type with at least 4 or more contact points.
  • Sensors – A GPS, Accelerometer, Compass, Light, Proximity
  • Camera with 5 megapixel or more , flash and a camera button
  • Multimedia – Codec acceleration
  • Memory – 256 MB RAM or more , 8 GB Flash or more
  • GPU – DirectX 9 acceleration
  • CPU – ARMv7 Cortex/Scorpion or better
  • Optional keyboard
  • 3 Hardware buttons – Back, Start, Search is a must and other buttons like buttons for Volume and Power.

Phone will support two native screen resolutions:

If I understood the message correctly it seems that MS and its partners prepare to launch two types of devices. Full with 480 x 800 and some mini/small (and presumably cheaper) device with 320 x 480. That still has to be confirmed.

Screen resolution is important for designers and graphicians. As you can easily measure screen proportions are not standard, that’s what you have to mind while preparing graphical content. Zune HD for example supports 240 x 320 and 272 x 480 which means 16:9 and 4:3 proportions (just like TV sets support). On Windows Phone it’s equivalently 5:3 and 3:2.

As you see keyboard is optional so definitively prepare yourself to design touch-screen supported user interface. The only buttons you will have are below three (Back, Start and Search):

Sensors have their equivalent APIs accessible from Silverlight and Xna frameworks. These two technologies are the only ones you can pick up for your development. Positioning is as follows: Xna – strong focus on gaming, SL – any other type of application. Screens and sensors can obviously be used for application control, but interesting thing is that WP7 will have speech recognition module that you can also consider in your development.  WP7 will have Push notitication service that will allow you to communicate and send messages to Phone on battery consumption efficient way. As for APIs mentioned already, Windows Phone will support Silverlight 3.0 and Xna 4.0. For gaming, if you invested your time in WritableBitmap based engine written in Silverlight and targetting Web – you can easily port it to Phone without any Xna consideration (as this feature is in SL3).

After Shawn’s lecture I found that most of buffers important in graphics (Xna) are 16bit. So we can predict how many colors will WP7 support and how big structures we can render (as for vertex/index buffers in 3d world).  It also matters for texture size so putting it all shortly how much detail we can show on the screen. Xna 4.0 on WP7 will be DX9 compatible but at initial stage and release timeframe we won’t be able to develop shaders freely in HLSL. Instead Xna exposes five customizable Effects for Shading, Environment Mapping, Alpha Testing, Multi Texturing and Skinning. It’s said that future versions of OS/Xna will presumably support HLSL but it’s not said when. Shawn has released very cool demo from his MIX10 presentation where all these effects are presented (with source code). I recommend to check it out, and generally to follow his blog, currently it’s best updated and most accurate resource on anything new in Xna 4.0


Mar 15 2010

MIX10 starts in 15 minutes. Launch your browsers!

MIX 10 starts very soon. I’m pressed to go to another room as MS employee to watch it literally just like you if you’re not here.

I recommend to launch http://live.visitmix.com/ and watch it with me. More on my Twitter and new blog posts just after the keynote.

01.MIX_JustBefore

Update: just got a message that keynote  room is open for us (MSties) too.. hehe.


Feb 25 2010

Portability Primer – Sticking to basic principles helps

I had a very interesting discussion yesterday. I want to summarize it below.

There is a fresh new group of developers who want to start making games. They have quite a decent (but various) programming experiences with different platforms, different project types and scale. All outside gaming of course. During my discussion I heard two very interesting questions, I’ve tried to answer then and will answer also here.

1) Which platform choose for casual indie games.

2) What if we choose wrong platform, how about portability?

Questions seem to be academic and I have a feeling, that I answered quite academically. As for first problem, I asked more questions to better understand it. I was curious what games is that group aiming at and for what audience in specific.

Answers I’ve heard were not clear which I understood as the group is rather looking for certain ideas, than have a complete vision of a certain title. Sounds like a pitfall, right? In further discussion we agreed that first goal is rather to better understand technologies and possibilities potential platforms can offer.

Fair enough. Knowing what you can do and binding it together with some assessment on who usually has such a platform and what games that player expects can help to work on realistic ideas and innovations that have better chance to work. It is good to know though, that it’s not real game development. Rather a technological training, which later can help to better discuss differences and potential on platforms like Facebook, iPhone, XBLA, XNA, PSN and Steam, just to mention a few different examples.

Answering to the second question: what if we choose wrong platform, how about portability?

In this case I believe that sticking to basic programming principles can help. Most programming platforms have for sure one thing in common -> objects and object oriented mechanisms. Syntax may vary and language specific elements can trick out porting efforts. Avoiding them should be part of that best practice, I think. Having objects on mind, in front I’d design abstraction layer with objects that share common elements. Any specific platform just should expose it in its implementation.

Simplified example: If I want to develop 2d sprite based scroller shooter, I need objects like screen that supports pixel-by-pixel redrawing, sprites, some routines for clipping, collision detection for sure. Those should have interfaces which are platform independent as much as possible. Then adding DX, GDI, Silverlight with WriteableBitmap, Xna support or whatever technology should become a task bound to platform but not breaking game features themselves.

This approach is implemented in Unity and Unreal Engine too.. what we see there is a common interface (even including WYSIWYG editors) and platform related implementation that we don’t care much designing game at its basic level.

Sounds very much obvious, yet question like this is really fantastic, because it reveals inexperienced developers or developers who have been bound to a single technology stack for long, if not forever. No big deal, good moment to start learning as many different technologies and languages as possible to push the perceptional horizon further.

From these obvious truths in answer, I suggested to these guys a task, challenge for the team of five as I heard.

I suggested them to develop some short game which isn’t time-consuming as for development. Let’s say it’s Tetris.

In this challenge each team member has to pick a technology and/or platform, different to the rest. When everybody finishes, then each developer should take somebodies else code and port it with the thought and structure of the original concept to another platform&technology.  Take C# or Flash port of Quake (originally in C) as good example of similar task.

When everybody finishes group should meet and discuss what was the biggest pain and if somebody failed, why?
Conclusions taken from that final discussion should help them to avoid practices that are potentially dangerous in such migration.

Interesting porting paths (to and back), I can recommend are:

  • Direct3d to OpenGL
  • Xna to DirectX
  • WPF Xaml+C# to Direct2D based 2d vector graphics and sprites
  • From HTML5+Canvas+Javascript to Silverlight and WritableBitmap

Even with Tetris complexity, above examples should be good to reveal some bad habits.


Feb 19 2010

What makes Pixel Junk Shooter so great?

I really enjoy my time spent on playing Pixel Junk Shooter. I haven’t finished it yet, currently I’m in 3rd stage. I’d beaten two interesting bosses and got addicted to the game mechanics. From developer perspective, meantime, I started asking myself a question: What makes this game so great?

I found this game by reading various reviews and watching movie clips like that one above. First thing I noticed, was how well game mechanics and visuals are connected. Literally it’s just a scroller shooter, but much of its spirit is made by fantastic 2d fluid simulation presented visually in very attractive way.

If you’re a programmer interested in further investigation, take a look at below movie, it shows similar concept:

Above clip shows an application developed by Microsoft MVP Rene Schulte. Rene published .NET Framework sources on his personal pages. He’s programmed basic example of technology that can inspire for Pixel Junk Shooter alike physics in games. The only technical problem left to do, is that in PJS you have different fluids interacting between each other (liquid fire, lava, water, oil, etc). Skill to master by a smart coder, I believe.

Aside of fluids, I can’t stop thinking on Pixel Junk Shooter without connecting it to old Amiga games. Sometimes it’s really abstract but it triggers my imagination for potential sequels.

For example, shooting part of game’s mechanics remind me Cannon Fodder. I dream to play Cannon Fodder with two analogs. It should be so much better and PJ’s Shooter shows that well. In Cannon Fodder though, encounters were more dynamic and not so much was to rescue:

Some of game’s mechanics remind me old games from Psygnosis (currently and for long SCE Studios Liverpool).  Take strange combination of Lemmings or maybe rather Benefactor, put it together into a scroller shooter action game with puzzles strictly related to fluid physics. If you take a look at this game this way you immediately start dreaming on more Lemmings/Benefactor alike features. I did, I believe that many ideas should fit well into Pixel Junk Shooter. Imagine situation that little folk you have to rescue moves, and moves in very stupid/uncontrolled way. Imagine situation that you’re bound into a conflict between two sides and rescue good and leave bad guys. Imagine situation, that even though there are two bands of miners who fight/compete for something, you have to rescue both groups before deadly lava will kill them all.

Maybe some of that mechanics will appear in further levels. I’m not sure now, as currently I’m fascinated with maxing up results on these first 15 levels. I’m pretty sure though, that this game will surprise me even more. If not, then it’s definitely worth further experimenting and development.

I’m really glad this game showed up. It proves well my theory of evolutionary design.  I’m expecting good sequels and clones of that concept in near future. It’s rather obvious that games where mechanics are strictly bound to physics seem to be 100% success warranty. I can’t recall any example where it was not.


Dec 4 2009

Blitter and direct access to Silverlight frame buffer

silverlight

Can Silverlight be used for serious game development?

Some time ago I found interesting project, C# port of Quake engine optimized for Silverlight. Demo published by authors currently doesn’t work (dunno why), but videos show that they achieved fair 60fps with it.

I started wondering how was it done. Quake uses it’s own 100% software renderer. No hardware acceleration was supported at that time. So, to port it to C# and Silverlight developers needed just very fast blitter and/or access to frame buffer (window pixel table or memory pointer equivalent).

One of Silverlight MVPs, Bill Reiss , actually has developed a library that solves all of these problems. Library is called: SilverSprite and you can check its sources on Codeplex. It’s really interesting project, because its API is very close to Xna API developed by Microsoft. Bill gives several examples how to easily port Xna game to Silverlight. He also spoke for Channel 9 on this topic. Whole that coverage is really awesome.

I checked above resources by myself and Silverlight triggered my curiosity as for serious game development. I wanted to investigate and find answer to that original question on blitter/frame buffer. I’ve written a simple implementation of WriteableBitmap based routines to build some benchmark.

You can run this benchmark by yourself too:
* Silverlight 4.0 compatible
* Silverlight 3.0 compatible

I used direct pixel table access to clear the screen and it does not slow down Silverlight a bit. I added also a Blit method that is able to render any UIElement that Silverlight supports (or you create). This is first bottleneck I found. Rendering UIElements can slow down Silverlight heavily. Mixing these two techniques (Pixel Table and UIElements) is definitely an area for further analysis and optimization, but WriteableBitmap looks like a direction, where you can go and check if you can make software renderer (real-time ray-tracer) by yourself. Another interesting aspect of this simple test is performance comparison between SL3 and SL4. Silverligh 4.0 seems to work faster so I assume that SL team might have actually optimized WritableBitmap.Render() routine between these two versions.


Dec 2 2009

Project Natal, interesting tracks for developers at Gamefest 2010

Term Project Natal should be recognized by many of you. Many more were totally astonished by this announcement coming from Microsoft at last E3 conference. Since that moment, not only gamers and game developers have started thinking on new challenges and opportunities, but also regular, little geeky gadget boys and girls sometimes outside gaming community. I’ve seen also many innovators in different areas of technology who started asking questions. If you anyhow missed the announcement, below clip should explain the technology itself:

If you’re interested in Project Natal and you’re a developer, you cannot miss next Microsoft Gamefestconference. In February, 2010 in Seattle’s edition, I spotted two very interesting session tracks covering Natal from design and technological perspective. I think this is first time, when technical details of Natal will be presented to broader audience. As far as I know, up to the moment only internal Microsoft teams and studios have access to this information. Some chosen 3rd party developers with interesting project opportunities probably were also invited for testing.

Broad communication means that Project Natal is closer and closer to gamers. I hope that post Gamefest 2010 era will also show some critical improvements in Xna to allow community developer check it out too. Track details are below (taken from the conference pages):

“Project Natal” – Design

“Project Natal” not only revolutionizes the way people play games, but also changes the way games are designed and created. The “Project Natal” Design track will present innovative thinking and ideas to help you take your game from office to living room—creating new ways to work, building showcase experiences, divining user intent, and designing gestures for UI versus game interactions. Discover best practices and what makes the “magic” in a “Project Natal” game.

“Project Natal” – Technology

“Project Natal” provides a groundbreaking new way for games to use natural user motion to interact with the Xbox 360. Experience the future now, with this cutting-edge technology! Join us to learn how to develop world-class titles using “Project Natal”, which provides many exciting new features that can be challenging to programmers. In the “Project Natal” Technical track, we will walk you through how to overcome these challenges with a combination of classic techniques and new thinking. We will explore the depths of this exciting technology and dive deep into gesture recognition, avatar retargeting, speech recognition, advanced raw stream processing, handling different player environments, and many other topics. No controller required!


Nov 26 2009

Infamous “Hello world”

Yeah,

Another “Hello world” in the blogosphere. I feel like I had already done that before. I’ve been blogging since 2004 or 2005 if I remember correctly. Many initiatives with different scope and content maturity. Once in Polish (my native), once testing international reader. Language proficiency in this history has taken also a very crucial part.

I remember very well that first post on MSDN Blogs in English. I tried to make my first professional blog on that platform, sharing my thoughts on Microsoft technologies with local and international readers.

For the moment, idea was not bad, but I quickly realized that with every post written, I’d been more and more interested in local only reader. Reasons were many. In Poland, I was presenting at conferences, trainings and other events for local developers. Language itself was not the problem, but if two Poles do talk, why use English in the background when I referred to something online.

So my English Posts category is long dead there. Quite recently I stopped marking Polish posts with [PL] prefix in the title. I realized that I’m not going to post any more English posts on that site. Not since that blog is cross posted on http://www.msdn.pl pages. [PL] prefix was nice, because I noticed that many other Polish bloggers used that prefix style to highlight their rare English postings (with [EN] for a change). Really interesting observation in social context and unspoken netiquette growth.

With growing popularity of that blog (as for my own acceptable scale), I realized that those pages are more official, regardless of my own statement.

Redesigning my private pages is the reaction. More and more I needed something rather private, something not so strongly branded with “MS only” label. Some place where I could start discussing and examining different topics. Some place where I could tell my international friends and colleagues that this is the place where they can follow my progress.

So I started with this entry. There will be more soon, that’s the blogging idea, right?

To give you short introduction what you can find here in the future, I’m going to explain basic content categories:

  • Home – this page obviously gets everything
  • Game Industry- My thoughts in this area from tools to design, from trends in business models to simple demands on the market. Definitely an industry worth watching.
  • Labs – I’m a creative soul. So I want to share with you some news with my current developments and investigations.
  • Microsoft – I work there, so I presume I’ll sneak in some MS-related information too.
  • Polish Software Industry – I’m paid to know well what’s going on in my local software market. I’m proud Polish by the way, so why not to promote my country and software from it? Regardless if MS or not, Polish brilliant minds are worth international awareness.  
  • Programming – Yeah I know.. I’m addicted. From time to time I presume I’ll paste here some source code too.
  • Various Rants – Isn’t it what are you reading just right now?

Cheers,
Daniel Biesiada

PS. As it’s fresh, greetings to all of you guys, whom I met in Los Angeles, CA at PDC 09 this month. It was great time, and Carl Franklin was my best surprise.