Red Nose Day MonoGame Video Now Online - with Tutu Action

"Because the world definitely needs a man dressed in a tutu explaining how to create video games....."

After a bit of time learning how to use Adobe Premiere again (I learn to use it every time I have to make a video - at six month intervals) I have now got the recording of the Red Nose Day lecture ready for the waiting world.

You can choose to regard it as either a "Poetic masterpiece combining rhyme and technical achievement in a single, flawless whole" or "Twenty minutes of my life I won't get back". Whatever.

But if you do get anything out of it, please throw some money my way by visiting here:

http://my.rednoseday.com/sponsor/robmiles

Three Thing Game Finals

Hardy survivors...

Hardy survivors...

We had our Three Thing Game competition over this weekend. Just in case I wasn't busy enough writing poetry and whatnot. Anyhoo, great fun was had. A team of stalwart judges, including developers from Smashed Crab Studios, went through the final 17 teams and found us 6 finalists. As is the way of the competition, we had each team present their game at the aptly named finalist presentations. And here they are in no particular order.

Team: "I hope my friends don't bail on me"

Team: "I hope my friends don't bail on me"

Team "I hope my Friends don't bail on me", AKA Jason Powney, showed off the mayhem he had created from "chainsaw", "penguin" and "water". "Penguin Chainsaw Massacre" had tons of bloodthirsty action, with underwater mine hazards and even a sunken wreck. A very polished production.

Team: //TODO

Team: //TODO

Team //TODO, aka Daniel Masterson, had started of with "ASCII art", "sanctuary" and "error" and built, to our amazement, a 3D rendered graphical game displayed in a console window using text graphics. Something of an awesome technical achievement we reckoned. And the game looked fun to play too.

TEAM: aNOTHER BAD IDEA

TEAM: aNOTHER BAD IDEA

Team "Another Bad Idea", aka Robert Chisholm and Adam Thornes had crafted a very neat top down fighting game from "Toilet Plunger", "Small Mammals" and, not surprisingly, "fighting". The game had frantic one on one action as the players acted out the eternal struggle between fox and rabbit using toilet plunger weapons.

Team: You Will Lose

Team: You Will Lose

Team "You will Lose", aka Joseph Edwards and Tomasz Kope,c had turned up the particle generators to the max and produced an atmospheric game based on "square", "random" and "shooter". Some nice coloured effects and randomly generated play areas made for good looking gameplay.

Team: One Musketeer

Team: One Musketeer

 Team "Four Musketeers" was down to one musketeer by Saturday lunchtime, but that didn't stop them producing a very neat four player shooter game from "Scrapper", "Wombat" and "Hull". The action was fast and smooth, with multiple weapons and you could even use the gun to jump. Can you spot how the thing "Hull" was used?

Team: Bad Computer Pun

Team: Bad Computer Pun

Another technical tour-de-force from team "Bad Computer Pun, aka Nick Ross. We advise our students to use Three Thing Game as a place to test out hew game engines and Nick had certainly done that. Matlab is a serious mathematical package designed for serious mathematical stuff. Not for writing games. But the power of Three Thing Game compelled Nick to go against this and craft what is probably the first ever computer game written in Matlab. It is definitely the first ever Matlab game that involves "ostrich", "oasis" and "escape". And it looked pretty good too.

I didn't envy the judges their job as they went out to pick the winners. Thanks go to Warren Viant, Derek Wills, Lindsay West, Jon Purdy, David Parker and the Smashed Crab crew for giving up a Saturday afternoon to help out. Anyhoo, after much detailed discussion they come up with a first and second places, plus a technical achievement award.

Pic1 (17 of 25).jpg

First place went to "I hope my friends don't bail on me". The game was commended for the high quality of gameplay, completeness and the way it had stuck very well to the three things.

In second place we had"Another Bad Idea". Their game was singled out for the fun multi-player action and great looking graphics.

Pic1 (25 of 25).jpg

The award for Technical Achievement goes to //TODO. You just don't expect people to use shaders in ASCII art games. Awesome stuff.

I'm going to be chasing the teams for videos of their games and I'll update this post with more details when I get them.

Thanks to all the judges, to Lee Stott from Microsoft and Simon Jackson from MonoGame for dropping by and taking a look. And thanks to David Glover for making the Fenner Lab work so well and allowing us all in.

The next step for the teams is to get their game published. I'm going to be running some sessions about game publishing, keep an eye out for them.

Making a Universal MonoGame Project

At one of the sessions earlier this week we were talking about game development and I found out something really interesting. Thanks to Giles for passing me the link.

If you want to make a MonoGame solution that contains a Universal Application for Windows Phone 8.1 and Windows 8.1 you can find a build of MonoGame that contains templates that just work here.

You can deploy to phone or pc just by setting the start project. The distribution also contains the new content management stuff. I'm going to make an example application and a little screencast about how to use it when I get back to the UK.

This is completely wonderful. It will make it so much easier to make games which will be rady for both the Windows Phone and the Windows stores.

Halloween Three Thing Game Kicks Off

Three Thing Game is going strong, and I'm sad. We've got over 150 students in the department working on games overnight and I'm not going to see what they have made.

Thanks to the vagaries of airline ticket pricing (who knew it would cost so much to fly on Sunday) I have to head out the MVP Summit on Saturday morning, leaving the event in the capable hands of David.

We started the event with a fantastic presentation from Dean and Dominique about MonoGame. A few things of note from the session:

  • A really good way to make a name for yourself (and get jobs etc etc) is to get involved with the Open Source projects.
  • You should publish what you make. The first one probably won't be an overnight success. But the fifth one might be.
  • MonoGame is all grown up, with versions for pretty much every platform including the PS4 (and I reckon the Xbox One won't be far behind)
  • The new Content Management stuff is awesome

Of course we had pizza. Five hundred pounds worth of pizza.

Lee and Simon building a "pizza fort". 

Lee and Simon building a "pizza fort". 

I think we managed to feed everyone OK. The lass on the phone at Domino's listened with increasing incredulity as the order built up, and they had to send out two pizza packed cars to deliver it.   Thanks so much to Lee from Microsoft for sponsoring all the cheesy goodness.

I took a bunch of pictures before I had to zoom off and pack. Above is a sample. You can find them all here.

Monogame at TechDays

This is the audience getting ready for the presentation. 

This is the audience getting ready for the presentation. 

Sage advice

Sage advice

I did my final presentation of TechDays this afternoon. I love working in the Netherlands. Yesterday I celebrated my arrival on stage by kicking one of the lamps and breaking the bulb, in the process fusing all the lights. This made for a rather fraught five minutes for the tech guys, who had to find and replace the fault part. Then, during both of the presentations yesterday I was continually tripping over the lights and moaning about them. (Moaning is one of the things I do best. Today I arrived to do my presentation to find this thoughtful warning on the lamp in question. And the thing is, it worked. I didn't touch the lamp once. The audience was, as usual, great. I reckon that Dutch audiences are around the best in the world (and I've seen a few). They are up for anything, and are very happy to be in on whatever joke is going around.

I was talking about MonoGame on Windows 8.1 Phone and PC. Some of the demos were a bit reluctant to work, mainly because I'm presently running two development environments (VS 2012 and VS 2013 RC2) on my trusty Surface Pro 2. These kept grabbing the wrong files and then discovering that they didn't work. But in the end everything came right. You can find the slides and all the demos here

This is a really nice part of the world. Amsterdam is great, but I reckon The Hague beats it in terms of pace of things (a bit less frantic) and a lot fewer tourists (or at least that is how it seemed to me. They even have trams that go on the grass. 

(Note that this is not a cunning drugs reference.)

XNA Resources Follow-up

DSCF1380_1_2.jpg

Further to the talk on XNA earlier this week, some folks have been in touch for any other XNA references that I might know of. Here are a couple.

You can find a complete course which teaches programming using XNA at Microsoft Faculty Connection here. There are slides, labs and all kinds of good bits and bobs that you an asset strip and use as the basis of your teaching.

My Microsoft Press XNA 3.0 book (not the most recent, but still good for getting started) can be found as a free download from here.

All of the stuff will work on MonoGame too.

Windows Gaming Awareness Event

DSCF1395.jpg 

A great audience. I kind of have to say that because I’ve not left Birmingham yet. Although they actually were a great audience.

Just done a talk at the Windows Gaming Awareness event about XNA and MonoGame.Great fun. Well worth getting up at 5:45 am to catch a train to Birmingham to deliver. You can find all the content here.

It has also been very interesting to see what other gaming tools and techniques there are out there. I’m going to have a play with quite a few of the things that have been discussed.

Game State Management in MonoGame on Windows 8

ApplicationLog

I’ve been trying to make sense of how Windows 8 and MonoGame interact when the application changes state. I think I’ve figured it out.

There seem to be broadly two things that can happen to your game when it is running. It can get deactivated (the user finds something better to do) or it can get “snapped” to the side of the screen. If you are going to sell the program in the marketplace it needs to handle both these situations.

protected override void OnActivated(object sender, EventArgs args)
{
    addMessage("activated");
    base.OnActivated(sender, args);
}
protected override void OnDeactivated(object sender, 
EventArgs args) { addMessage("deactivated"); base.OnDeactivated(sender, args); } protected override void OnExiting(object sender,
EventArgs args) { addMessage("exiting"); base.OnExiting(sender, args); }

To handle the activation issues you override the event methods above. I’ve just put some logging code in so that I can work out what is going on. The events are fired when you would expect them to be. When the game starts you get an “onActivated” message and when anything happens to interrupt your game (for example the user minimises it or switches to another application) you get a “onDeactivated” message. At the very end, when the user quits your game you get the “onExiting” message. The activated and deactivated message come in matched pairs. The only slight trickiness is that a game will get an activated message at when it starts and when someone returns to it, but you can use a variable to keep track of this.

When your game is deactivated it should probably pause the game (because the user will not be able to interact with it). When your game is reactivated you can either resume the game or stay in pause mode and give the player a few seconds to compose themselves before continuing. When the game is exited your game should store any persistent game state and the first time it is activated your game should load the state.

The next thing you need to do is handle changes to the application view. These occur when the user “snaps” you to the side window or when the orientation/size of the screen changes. The first thing you need to do is bind an event handler to the event which fires when the application view changes:

ApplicationViewChanged += 
(sender, args) => ViewChanged(args.ViewState);

Your event handler will have to deal with changes in orientation and also “snapping” to the edge of the screen.

private void ViewChanged(ApplicationViewState viewState)
{
    switch (viewState)
    {
        case ApplicationViewState.Filled:
            addMessage("filled");
            break;

        case ApplicationViewState.FullScreenLandscape:
            addMessage("fullLand");
            break;

        case ApplicationViewState.FullScreenPortrait:
            addMessage("fullPort");
            break;

        case ApplicationViewState.Snapped:
            addMessage("snapped");
            break;
    }
}
This is my test method. It just sends a message out for the different states.

When you get snapped your game could display a “Mini-screen” in the snapped area. Above you can see what a snapped game looks like. The cornflower blue area on the right is the snapped area. When the game is unsnapped it will get a message to indicate the orientation of the screen. My games just pause when they are snapped.

One thing to remember is that when you get snapped the size of the screen changes.You need to change the size of the screen so that things are still drawn correctly in the snap panel area. You can grab the new values of the viewport size to do this.

cheeseRectangle = new Rectangle(0, 0, 
_graphics.GraphicsDevice.Viewport.Width,
_graphics.GraphicsDevice.Viewport.Height);

The above snippet resizes a cheese drawing rectangle to fit the whole screen. I could use this to make sure that my cheese is always displayed full size (although when the program is snapped this will make for a rather long and thin display).

Having got this far you are pretty much sorted. There is just one more thing you need to know, and that is the sequence of the messages. The log sequence at the top of this post will help here. The important thing to note is that you get viewport changed messages after you have been deactivated. If you think about it, this makes sense. The user can start to drag your application screen and then either put it back, or drop it into the snap area. It is important that the application is stopped when the user begins to perform such an action. So if your program is snapped you will get the sequence:

  1. deactivated
  2. snapped
  3. activated

You never get the view changed messages in isolation. This even the case when you use the Windows + . command to snap the game from the keyboard.

Gaming in Academia Event

Doncaster

I got this email from TripIt today. It doesn’t seem to understand that I’m changing trains in Doncaster to go on to Birmingham for the Windows Gaming Awareness event. Not that there is anything wrong with spending time in Doncaster.

I’m doing a session tomorrow in Birmingham about XNA and MonoGame in Windows 8 and Windows Phone 8. If you want to come along too, I think there may be a few places left if you are quick.

Farseer Physics in MonoGame

screenshot_02132013_165926

I really like MonoGame. I also like physics. Particularly the Farseer engine, which works very well with XNA and lets you make things bounce around very nicely. I’ve had some success putting Farseer on Windows Phone, so today I thought I’d see if I could get Farseer to work with MonoGame. So I opened up my venerable old Destruction Golf demo from ages ago and just copied across the Farseer library and the code.

And it worked. Pretty much first time. Took me fifteen minutes in total. Amazing. The only problem was with the sound effect that plays when the ball hits the house. This wouldn’t play for some reason. But everything else seemed to move very realistically. If you want to add a bit of physics to your XNA then it is well worth a look. It is the older version of Farseer, but I kind of prefer that.

You can find the sample code for MonoGame Windows 8 here. You can find my video presentation about how the code works here.

MonoGame at the Global Game Jam Briefing

Pics (1 of 2)-Edit.jpg
Another day, another room full of smiling faces. Or something.

You can excuse the audience for looking a bit shell shocked. They had just sat through a whole bunch of game development stuff. I started proceedings, with a fifteen minute section that I retrospectively titled “Watching Rob fail to get his tablet to work in lots of different ways”. After I got a picture on the screen and a keyboard and mouse that worked (something that turned out to be surprisingly difficult and worthy of a blog post all to itself) I did some stuff about how easy it is to get MonoGamae working Windows 8. You can find my slides and sample code here.

Then it was the turn of Simon to talk about good practice for game development and creating sprite sheets. Before this talk we had engaged in a game of “PowerPoint Chicken”. The game is very simple, the one who is the latest to have their slides ready for a presentation wins. I thought I was in with a good chance of winning, what with having my slides ready less than five minutes before the talk. Of course this left me no time to test my tablet, hence the pain at the start, Simon beat me easily, I think he was writing his deck while I was speaking. Which is probably cheating. Anyhoo, it all passed off well enough, with plenty of failing demos to keep the audience amused.

A word from the wise here, PowerPoint chicken is a dangerous game.

Finally Louis, one of our students, turned up and gave the best presentation of the day all about Unity. I’m really going to spend some quality time with this framework, it looks excellent. I’ll put slides and sample code from the other presentations later on.

Now it is full steam ahead for Global Game Jam Hull. We have over 100 folks registered, a bus full of folks coming over from Grimsby, a load of our students. And some games to make.