MonoGame Demo

screenshot_08022012_142049

Last week I discovered how MonoGame is making it possible to write XNA games for the Windows 8 Metro environment. And I managed to draw a blue screen, which was nice enough, but not much of a basis for a game. So today I thought I’d make a sample project that had all the bits that you need to make your own game, including art assets, using the touch panel, using the accelerometer, drawing text and making sounds.

I’ve made a single, one-stop, demo that does all these things. It also includes the source of the MonoGame code as part of the project. I’ve found this to be quite useful when working out how the XNA implementation works. If you download the zip archive you should have everything you need. Here is how to get started.

Pre-Requisites

You will need three things before you can move any further:

  • Windows 8 Release Preview – this is where you run everything
  • Visual Studio 2012 Release Candidate for Windows 8 – this is where you build your program
  • Visual Studio 2010 for Windows Phone – this is where you create the XNA resources that you want to add to your game

Getting the Files

To get started just download the file from here. This is around 22MB. Before you unzip the file it is a good idea to Unblock it. This will stop Visual Studio from giving you warnings when you open any of the projects. To unblock the file you just have to right click on the file where you have download it, select Properties from the context menu and then click Unblock and then OK as shown in the badly highlighted screenshot below.

image

Then unzip the files. There are quite a lot of them. Once you have completed the download you will have the whole MonoGame framework and my little test project. Open the folder and find the Visual Studio Solution “MonoGame.Framework.Windows8” and open it. Make sure you open it with Visual Studio 2012 Release Candidate. If you double click the solution you will probably start up the wrong version of Visual Studio (I do) which doesn’t end well.

Running the Sample Program

The solution contains a project called Test Project which runs a port of a Windows Phone demo I wrote that lets you draw lines of dots on the screen using your finger. The dots that you draw will also fall down the screen in a way that is controlled by the accelerometer. You can clear the dots by double tapping on the screen, the game will make a “Ding” sound when you do this. The game also writes some text on the screen.

Resources and Fun

The MonoGame XNA part of things works very well, apart from content. At the moment there is no way of getting Visual Studio 2012 to pre-process XNA content for use in a game. We get around this by creating a Visual Studio 2010 XNA project and using it to produce the xmb files that are read by the content manager when the game runs. The content in the sample program came from existing XNA projects that I had around the place. If you are migrating an XNA game onto Metro you can do the same. The tricksy bit is where you put the xmb files for the game to use. I had no success adding them to the Visual Studio project, instead I had to put the xmb files in the specific directory read by the game when it runs.

image

Here you can see the path to the AppX\Content folder where I put the XMB files for the sample game. These include the two textures, the font and the ding sound file. If you want to add more content to your game, just drop your files here and then refer to them in the program as you would in any other resource:

protected override void LoadContent()
{
    // Create a new SpriteBatch, which can be used to draw textures.
    spriteBatch = new SpriteBatch(GraphicsDevice);
demoTexture = Content.Load<Texture2D>("DemoArtwork"); demoRectangle = new Rectangle(0,0,GraphicsDevice.Viewport.Width,
GraphicsDevice.Viewport.Height); smudgeTexture = Content.Load<Texture2D>("Smudge"); font = Content.Load<SpriteFont>("MessageFont"); dingSound = Content.Load<SoundEffect>("ding"); }

You should be able to use my TestProject as the basis of anything that you fancy making.

Windows 8 is a Mullet

DSCF8294.jpg 

Windows 8. No, really.

Some time back I was given a copy of Visual Aid: Stuff You've Forgotten, Things You Never Thought You Knew and Lessons You Didn't Quite Get Around to Learning. It is full of diagrams that tell you stuff, and is as much an object lesson in presenting data as it is a collection of quirky and interesting facts.

It had a page on haircuts, with an example of each. Including the Mullet. For those of you who don’t remember the 80’s, a mullet was a kind of crew cut front with an enormous length of hair behind. It was billed as the haircut that was “Business at the front, Party round the back”.

Just like Windows 8. I’ve been using Windows 8 for a few weeks now, and it really is an operating system of two halves. It is as if Microsoft have looked at the tablet experience and gone “There’s no way we can make a single system that does tablet and desktop at the same time”. So they have made a machine with works as well as Windows 7 for the desktop and has a Metro interface for the tablety stuff.

I reckon it works.  There are some irritations. The determination of Microsoft to hide the Start button has annoyed a few people, but I’ve now got used to pressing the Start key on the keyboard and then typing the first few letters of the program name to run it. I can get Visual Studio working in much shorter time than previously.

For me the biggest irritation is the way that some things are hard wired into the Metro full screen mechanic, whether you like it or not. For example, the good news is that Windows 8 has a built in viewer for PDF files. The bad news is that when you open it you get to view the document full screen or nothing. There is no way you can have small window open on your desktop, which is annoying.

I’m using a Samsung Slate as my primary computer now and it works a treat. I can dock it for proper work and then take it out and about with me. It would be nice if it had USB 3, so that I could access external disks a bit more quickly, but I can live with that.

I mentioned my “mullet theory” to a Microsoft Person on the Windows 8 team as the possible basis of a marketing push. She thought it mildly amusing, but I think it is unlikely we’ll get Nik Kershaw to sport his again I’m afraid.

Thunderbirds are Go

image

When I was a kid in the sixties (yes I am very old) a must view TV program was Thunderbirds. We first watched it on our old black and white telly which took ages to warm up. It wasn’t until we saw some magazines pictures that we actually found out the colours of the Thunderbird craft. I’ve never really understood why Thunderbird 2 is green, but I digress. The franchise has been round a few times since, with a major revival in the nineties. (At this point I shall gloss over the awful film from 2004).

Anyhoo, one of my birthday presents was a copy of the Hayes Thunderbirds Manual, which gives a detailed breakdown of the International Rescue organisation and their craft. I like this as much now as I would have done nearly fifty years ago. At first I thought it was a reprint of magazine articles of the time, but there is a lot more to it than that. The authors have made use of the wealth of resources gathered by Thunderbirds aficionados over the years and put them together into a very comprehensive and will written exposition of the Thunderbirds universe. There is even an episode guide right at the end of the book. If you have any interest in this fantastic series, then it is well worth a look.

Olympic Tennis at Wimbledon

IMG_3023.jpg

We were lucky enough to snag some tickets for the tennis at the Olympics. This was held at Wimbledon, somewhere I’ve always fancied going to. So off we went. The trip across London was actually quite boring. After a media filled with dire warnings of travel chaos it was rather nice to just get on a sequence of trains and get there exactly on time.

DSC00130.jpg

The first match we saw was a ladies singles first round match and then we moved on to the highlight of the day for me, a second round match with Roger Federer.

DSC00223.jpg

Then, after a third match we headed for home.

There has been a lot of nattering about how London will have problems staging the Olympics and how the organisation and the infrastructure will not cope. This is rubbish. All the stops on the Tube were well highlighted and the trains were busy but very tolerable. They had folks lining the route from the station to the venue. The security check just took a few minutes and very person we saw, from the first chap at the traffic lights on the walk to Wimbledon to the cashier taking our money in the well organised souvenir shop, was polite and upbeat, asking if we had a good time and wishing us well. It was a thoroughly enjoyable experience. With a bit of luck we’ll make it to some Paralympics events in September too.

Nintendo 3DS XL

image

The Nintendo 3DS is a nice little portable console. The 3D effect doesn’t do a great deal for me (apart from make me slightly queasy after a while) but there are some very good games for it. I rather like Pilot Wings, Street Fighter and Mario Kart 7.

Now Nintendo have released an XL version of the 3DS, like they released a full fat version of the DSi a while back. It works exactly like the 3DS, only with a bigger screen. I really like this. Although the device is a bit bigger to cart around, it is not prohibitively larger and I’ve got much better at games like Ridge Racer as I can now see further into the distance because the dots on the screen are larger.

However, the XL version does have a much less “premium” feel than the original 3DS. That came with a power supply and a docking station. The 3DS XL comes with, well, just a cardboard box. Not even a power supply. This is a bit of a problem if your business model for your upgrade involves selling the old 3DS. Fortunately I have a spare supply lying around from way back.

The original 3DS was made of expensive looking plastic of different colours and levels of shinyness. I don’t think that this added a great deal to the gaming experience, but it did make it feel a bit special. The 3DS XL is not badly made, but the plastics and the finish seem to have been built to meet a price, rather than to make an impression. The large 3D screen is very impressive, but not particularly 3D as far as I’m concerned.  Battery life is no worse than the original device and the transfer from one device to another is painless and fun to watch, as a horde of Pikmin characters carry the information from your old machine to your new one.

If you have a 3DS that you have to squint at, you will appreciate the improvement. I certainly have.

King of Tokyo

image

Number one son doesn’t like board games with lots of dice. He reckons that they remove the skill, and doesn’t like being beaten by blind chance. I, on the other hand, love lots of dice. I like to be able to point to an unlucky throw as the reason for my failure to win, rather than any lack of skill/intelligence on my part. I reckon that chess would be vastly improved by a bunch of dice and a spinner.

Having said all that, number one son rather likes the “King of Tokyo” game, even though it has lots of dice. I like it too. Each player is a monster trying to take over Tokyo, or be the last one standing. A turn is a bit like the Yahtzee game, where you repeatedly throw a bunch of dice to get a good set, and then decide what to do with it. You have to balance attacking, healing and buying power ups as you go along.

The games are fast and furious and fortunes can wax and wane on the throw of the dice. We got through a couple of games in an hour and they were great fun. Even though I didn’t win.

Pesky Dice.

Uggh Boots

IMG_0598.jpg

Qn: When is an Ugg boot not an Ugg boot?
Ans: An Ugg boot is never an Ugg boot.

If this is confusing, welcome to the club. When we went to Australia one of the items on the agenda was the purchase of a pair of Ugg boots. Note that this was not my agenda.

Anyhoo, we found lots of shops selling “Genuine Australian Ugg boots”. So we bought a pair in Sydney. And they broke in Melbourne. So we took them to what we thought was the local Ugg shop. And we discovered that there is no such thing as “Genuine Australian Ugg Boots”.

We thought Ugg was like Nike, i.e. a particular manufacturer of shoes. Turns out that Ugg is a lot more like “sheepskin”. In other words, anyone who makes footwear out of bits of sheep can call them Ugg. The people in the shops aren’t exactly forthcoming with this information, which means that when you think you have bought a branded, supported product, you haven’t.

The only good news is that a search on the phone for Ugg Boot Repairs found someone just down the road who should be able to fix things.

XNA for Windows 8 Metro

image

One of the sad things about the move to the new Windows 8 Metro platform is the way that XNA seems to have been left by the wayside, with no way forward for the platform and no workable alternative from Microsoft. I see this as a bit of an own goal really, just when people like Sony are releasing a suite that makes it easy for C# developers to create and deploy applications, and when Microsoft are looking for a way to get developers on board with the Windows 8 way of doing things, they seem to have pulled the plug on the best way to do this.

However, it is not all bad news. The people at MonoGame are beavering away on a solution that will let you leverage your XNA experience and make games for Windows 8 Metro. Following the instructions in this blog post I managed to get a screen full of Cornflower Blue on my Windows 8 system. The familiar Update and Draw methods are present and correct, along with all the XNA types that you know and love. At the moment getting content (fonts, textures and sounds) into your game is a bit of a faff, in that you have to make a Visual Studio 2010 project and use that to prepare the content for use in your Metro program. Having said that, it does work and, thanks to the dedication of the Mono team it looks like we will have an XNA trajectory on Windows 8 Metro. It is just a shame that it is not coming from Microsoft.

Networks of Evil

IMG_2038-Edit.jpg

One thing that struck me while we were away is how things conspire to make your mobile phone useless when you go abroad. Just when you are in a place where you could make the best use of portable data access you find that it is prohibitively expensive, if it is available at all. Using voice is out of the question. I can’t think of anyone I’d be happy to pay 85p a minute to talk to, or receive a call from at 70p. So I made no calls on the phone while we were away. Then one night the network made my phone call itself. Which was very confusing for me, as well as costing me 1.55 a minute..

Then there is network connectivity. Charging 8 pounds a megabyte for data access from the phone makes it unusable on the internet. Are there people who can afford to do anything with data at this price? I don’t think so, because I didn’t run across anyone wearing a solid gold hat and looking up things on their phone. From a technical point of view it can’t be any more expensive to provide me with network access than it is to connect the local folks sat next to me on the tram. This is just plain and simple profiteering. Ugh.

So we go back to the hotel. They are happy to provide me with “unlimited” access to the interwebs for just 29 dollars a day. That is around twenty times the cost of my home connection. But wait, it gets better. Once I’ve transferred 100MBytes (i.e. read a few emails, uploaded some pictures and visited a few image heavy web sites) I can either pay extra per megabyte or get shunted onto a capped data connection that is actually slower than my dialup modem used to be. Double ugh. It’s almost as if they have concocted a tariff that makes it impossible for someone to, say, watch a movie from Netflix in their room. Or actually achieve anything.

My experience has been that the more posh the hotel, the more appalling the network charges. The Howard Johnston motel I stayed at had free WiFi. Once I found myself in a very pricey hotel in Las Vegas (I wasn’t paying fortunately) where a network connection wasn’t expensive, it just wasn’t there at all.

In the end we became the worst kind of WiFi leaches, looking for places that happened to provide working WiFi for free. It is always sobering to read all these reports of how connected devices are going to be the way, the truth and the future, and then find yourself in a place where the network either doesn’t work, or is so expensive as to be useless.

Number 30 in Plumbing and Household Automation

image

I’ve just received a box containing 10 copies of my new book, Start Here! Learn the Kinect API. This means that the book is actually in the shops and you can all rush out and buy it. I suggest one copy for home, one for work and another for travelling should just about hit the spot. Apparently the ones in the shop are not signed by the author, which makes them a lot more valuable.  And I can categorically state that none of the books contains a “Golden Ticket” which is worth a million pounds and gets you a free tour of the University of Hull campus. Not one. Honestly.

And according to the Amazon Best Sellers Rank (show me an author that says he doesn’t check this and I’ll show you someone telling a whopper) the book is (drum roll):

#30 in Books > Crafts, Hobbies & Home > How-to & Home Improvements > Plumbing & Household Automation

And it is lot of fun.

Water Welcome Home

R Miles Failed hose connector

So, what would you like after 30 hours of travel? Would that be a cup of tea, or perhaps a nice lie down? How about a flooded kitchen? Thought not. Neither did I. All seemed well when we staggered back into the house. Although the kitchen floor did seem a bit shiny……

You can see the culprit above, the plastic fitting behind the washing machine had failed and released quite a lot of water into our brand new kitchen. So rather than any of the above, we were instead engaged in mopping up and making good, along with wondering if the place would ever get back to how we left it.

Oh well. Worse things happen at sea. For one thing, there is a lot more water there….

Flying home via the Skydeck

IMG_2894.jpg

Today we flew home. But because the flight was not until the afternoon we had time to sample the Melbourne Europa Tower Skydeck , which has “the highest viewing platform in the Southern Hemisphere”.  This gave some very good views, as shown above. IMG_2930.jpg

It also had WiFi, so I could download some more Kindle books for the journey back..

Next we got to sit in an aluminium tube for 23 hours…..

Pinball and Batman

DSCF8589.jpg

This is in one of the Melbourne shopping centres, you get this view if you eat at Nandos, which worked for me. After lunch I dragged number one wife all across town and down to an industrial estate for some pinball action. I’d seen an advert for a place called Bumper Action that said they had lots of machines for sale.

DSCF8593.jpg

The advert didn’t lie. They had loads. all on free play.

DSCF8600.jpg

..including the best machine ever, on the left. No idea who the bloke is.

They also sold spares, and I was able to buy a replacement set of electronics for the clock on my TZ machine. If you are ever in Melbourne you should check them out. They have loads of juke boxes and some arcade games too. Lovely place, run by folks who really care about the important business of shooting small metal balls around a wooden playfield….

Once we had made our way back to town we headed off to the Imax to see the latest Batman movie. All I can say is wow. I reckon it was really, really, good. Spiderman last week was OK, but this film shows how it should be done. I was a bit worried that, at well over two hours, the film might drag a bit in the middle. But it didn’t. A fitting end to perhaps the best superhero trilogy that we have seen.

Puffing Billy

IMG_2446.jpg

Thought we’d get out of town for the day. So we went for a ride on Puffing Billy, which is apparently Australia’s favourite steam train. This is not Puffing Billy by the way, this is how we got to it. Essentially we took a train ride to take a train ride, which made perfect sense at the time.IMG_2474.jpg

This is Belgrave, where the train starts from. They seem to have some really cool cars there apparently. IMG_2500.jpg

This is Puffing Billy (or at least one of them)IMG_2531_2_3.jpg

Levers and pipesIMG_2755.jpg

Heading home.

It was great fun.I love the smell of a hot steam engine.

IMG_2377_8_9.jpg

When we got back I had another go at capturing the view from our room.

Video Games and Napoleon Bonaparte

First stop today was the Game Masters Exhibition at the ACMI. Very good except for one thing, I wasn’t allowed to take pictures.  Then it was on to the Napoleon exhibition at the National Gallery of Victoria. I wasn’t planning on getting quite so much culture today, but they had a deal on the tickets.

IMG_2196.jpg

I think these letters are actually larger than the great man himself..IMG_2201.jpg

You know you’ve made it when they reproduce you in bronze….

The exhibition was really good. The thing I learnt most from it was how little I know about French history. But it does look very interesting.IMG_2204.jpg

Trams with profound questions.

Once we had got our fill of culture we went for a wander around town.IMG_2236_7_8.jpg

Melbourne skylineIMG_2310_1_2.jpg

There were some really nice coffee shops on this street, I’d love to have been in town long enough to try all of them. IMG_2353_4_5.jpg

Shopping centre architectureIMG_2356_7_8.jpg

An umbrella display, slightly processed..

More Melbourne Culture. And watches.

IMG_2037.jpg

Today we caught a tram to the Docklands part of Melbourne. They had a Roman Exhibition that looked interesting. IMG_2043.jpg

The whole thing was inside an enormous tent, which we loitered in for a while. Lots of Roman technology that you could play with, which was fun.

IMG_2053.jpg

Then we went on to the harbour area, where you can take quite nice pictures.

IMG_2072.jpg

After lunch we went over to Victoria Market, which has loads of stalls selling mostly tasteful merchandise.

IMG_2089.jpg

IMG_2093.jpg

Then we staggered back for the evening.

IMG_2028.jpg

The view from our window gets even nicer at night.

Melbourne Museum Monday

IMG_1957.jpg

This is the view from the Melbourne Exhibition Centre, a very imposing place that we didn’t get round to visiting.

IMG_2011.jpg

When we go travelling we always like to take in the local museums and try to acquire a bit more culture (which might be a lost cause in my case). Today it was the turn of the Melbourne Museum.

IMG_2002.jpg

This was ace. There was a superb exhibit on how the brain works. It turns out to be quite complicated. Next to the museum is the Melbourne Imax cinema. On the way out we bought tickets for the Batman movie that comes out on Friday. To superheroes in one week, both on Imax. Can’t be bad.

Melbourne Sunday

IMG_1756.jpg

This is Flinders Street Station in Melbourne. It says so on the front.

Today we started our first full day in Melbourne. Lovely place. Has trams and everything. At the moment it looks like it is to Sydney what Boston is to New York.

IMG_1765.jpg

But with more graffiti, which makes it a bit like Seattle too.

IMG_1802.jpg

This is Federation Square. They have the Australian Centre for the Moving Image here, which has a fantastic exhibition all about the origins of modern mass entertainment. It even has an exhibit for Skippy.  There is also an interesting looking Game Masters exhibition. Perhaps we’ll take a look at that later.  No, we’ll definitely take a look at that later…

After lunch we went down to St. Kilda, which is down by the beach side. Every Sunday they have booths selling crafty bits and bobs, which were fun.

IMG_1851.jpg

This is the entrance to Luna Park.

IMG_1893-Edit.jpg

This is the main street in St. Kilda, given a very mild HDR treatment...

IMG_1888.jpg

I just love what they did with this place.

The weather was very kind, but one thing I have noticed is just how fast it can change from bright blue skies to grey.

IMG_1904-Edit.jpg

To this, complete with hardy swimmer.

IMG_1913.jpg

Anyhoo, after a good walk round and another ride on the trams we were ready to turn in. Jetlag to Australia is the worst I’ve ever experienced. The day is completely inverted and there is no way to ease yourself into it gently. After well over a week we are still waking up at odd hours and feeling exhausted at 8:00 at night. But we are not letting it stop us have a great time. More fun tomorrow.