Nico's digital footprint

I grew up in the nineties, that makes me awesome by default

The cat is out of the bag (WP8 released)

by Nico

So it finally happened, Microsoft announced Windows Phone 8 and detailed all of its features. The keynote itself was pretty cool with Joe Belfiore, Steve Ballmer and even Jessica Alba on stage. And as special bonus guests Joe brought his children on stage to show off the new Kids corner feature.

Kids corner is like a second user being logged on on your phone with you being the administrator, determining what applications can be seen and started by the second user, usually being your kid. A darn cool feature that is! Once configured it’s as easy as swiping to the left when on your lockscreen to switch to the second session. It’s so easy and intuitive that I really believe that a 2-year old can figure it out. (I've seen 2-year olds navigating Windows like a pro…). Other features include rooms, virtual houses where you can keep track of, for example, your family. See all their tweets, calendars, locations, chat with them, etc. and that includes people using iphones and Android devices! Also a cool, albeit a bit of a gimmick, is that apps can now change your lockscreen. For example, the Bing app can set the daily Bing image as lockscreen image, or the facebook app switches between your facebook pictures as lockscreen image.

For people with a limited dataplan comes DataSense, this is a build in feature that will keep an eye on your data usage, that also should be quite a bit lower then on another device because of the compression techniques used in the mobile operating system, DataSense will adjust the way WP8 behaves when you’re nearing your datalimit, should save some pennies to quite a lot of people.

Off course they talked about apps as well, the Windows Phone ecosystem now has over 120.000 apps (unofficial sources talk about 125.000) with hundreds of new ones being added each day. I believe this number will rise once developers get hacking with the WP8 SDK but all in all a great number! Also 46 of the world’s 50 most popular apps are now available on WP8. The fact that Windows Phone now support the Unity game engine makes it really easy for a bunch of popular games to be released on Microsoft’s platform. Devs win because an extra platform is an extra form of earnings, Microsoft wins because more apps for their system and consumers win because they can waste more time with games. But the biggest eye-catcher in the apps area was Skype. An all new version of the app that allows messages and calls to come in even when the app is not running. And most importantly, it does not run code in the background so the app won’t drain your battery like a certain other messaging app (yes I’m looking at you What’s app…).

Other new features, that amazingly enough haven’t been discussed in the keynote, include dual and quad core support, NFC, SD card support, brand new kernel (now shared with the Windows 8 OS), multi-tasking has been expanded for up to eight apps instead of five, SkyDrive can be used to back up texts, apps, settings, pictures, … For the business market there’s the intune, SCCM and other management tools support. There’s also the possibility to completely encrypt the device, remote wipe it when stolen. The devices have UEFI with secure boot, so no tempering with the bootloader is allowed.

And for us developers: the Windows Phone 8 SDK will be available today during the Build keynote! A few more hours to go and we can get cracking at Windows Phone hacking in Visual Studio 2012! Just remember, to use the emulator you’ll need a machine that runs (and supports) Hyper-V. Also, Windows Phone now supports native code!

As for release dates for the devices, the HTC 8X, 8S and the Samsung Ativ S will be in stores this weekend, the Nokia devices will be available end of the month.

For all the juicy details, here’s an 18-minute video of Joe walking through the operating system:

Meet Windows Phone 8

Tags:

.Net | WP8

MonoGame–XNA on Windows 8

by Nico

UPDATE: The good people of MonoGame brought it to my attention that MonoGame currently does not support Windows Phone 7 (XNA is supported on Windows Phone though) but they will probably support Windows Phone 8. Thanks for the heads up guys!

There’s currently no official support for XNA on Windows 8. That’s actually a real shame because XNA is my favorite way to develop games and Windows 8 is a fun platform to develop on. Luckily there’s always the community to come to our rescue. Enter MonoGame, an open source implementation of XNA for virtually any platform out there. Think iOS, Android,  Windows 8, even Playstation Vita.

A while ago Wesley and me started working on a BreakOut clone for Windows 8 using MonoGame. We currently have a raw basic gameplay and a first level. We even released a first official screenshot Smile

I now the screenshot doesn’t look really fancy yet (wel except for the giant pacman which is always awesome right?) but it’s an early build of a work very much in progress.

Follow us on Twitter for more updates (@NicoVermeir & @WesleyCabus), also see Wesley’s blog where he links to more information on MonoGame and how to set it up on your device.


Tags:

.Net | Game development | MonoGame | XNA

Techdays Belgium 2013

by Nico

Word just got out this morning that Techdays Belgium will happen on 5, 6 and 7 March.

Just as the previous years I'll be there! Although this year will be kind off special as it is my first Techdays as a MEET member. MEET will get some attention at Techdays as usual, the how and what will be discussed in the coming months.

Furthermore, this edition of Techdays will probably be all about the new and reimagined Microsoft. I excpect loads of sessions on Windows 8, Windows Phone 8, Azure and everything combined. I'm already looking forward to it and if you plan on attending, be sure to find me somewhere and come say hi.

See you there!


Tags:

WinRT: GroupedGridView first item other template

by Nico

I’m currently building a comic application for Windows 8, yesterday I was building the page where users can see the details about a certain comic issue. The idea I had for this page was that on the left was the cover of the issue, followed by a list of characters appearing in the issue. A grouped GridView would be perfect for this scenario but it only accepts one template, so all groups usually look the same. Here’s the way that I’ve fixed it, I’m not 100% happy with it but it works. If you have a better way, please tell me, I’ll update this post accordingly and give credit where credit is due off course.

Let’s start off with the class. I have a class called Issue that obviously contains all the information about an issue.

public class Issue
{
    public int Id { get; set; }
    public bool IsImage { get; set; }
    public string Name { get; set; }
    public string Image { get; set; }
    public List<Character> Characters { get; set; }
}

Notice the IsImage boolean? That one’s the key to the whole thing. The image itself is just a string to an image on the web. Next up is the Character class.

public class Character : INotifyPropertyChanged
{
    public string Name { get; set; }
    public bool IsImage { get; set; }

    private string _image;

    public string Image
    {
        get { return _image; }
        set
        {
            if (_image == value)
                return;

            _image = value;

            RaisePropertyChanged("Image");
        }
    }

    public Character()
    {
        IsImage = false;
    }

    public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void RaisePropertyChanged(string propertyName)
    {
        PropertyChangedEventHandler handler = PropertyChanged;
        if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
    }

}

Again in this class a boolean called IsImage. This time however the boolean has an initial value of False set in the constructor.

A third class is a generic class that will contain all collections to be shown in every group in the GridView

public class GroupInfoList<T> : List<object>
{
    public object Key { get; set; }

    public new IEnumerator<object> GetEnumerator()
    {
        return base.GetEnumerator();
    }
}

This is a pretty basic implementation that you will find on many blogs and samples about grouped GridView.

The next step is in the viewmodel, where I’ll load in the data and prepare everything to be shown in the Grouped GridView.

private async void LoadData()
{
    IssueGroups = new ObservableCollection<GroupInfoList<object>>();
    var issueDetails = await _service.GetIssueDetail(SelectedIssue.Url);

    var cover = new GroupInfoList<object> { Key = "Cover" };
    SelectedIssue.IsImage = true;
    cover.Add(SelectedIssue);
    IssueGroups.Add(cover);

    var info = new GroupInfoList<object> { Key = "Characters" };
    info.AddRange(issueDetails.Characters);
    IssueGroups.Add(info);
}

First I create an ObservableCollection of type GroupInfoList, the class I’ve created in the previous step. Then I’ll ask my service to get me all the details of the issue. Once I have all the info I start dividing it into the groups that I want it shown on the page. I wanted to start off with the cover in the first group but I can’t just put the image url in the group because that way I can’t pass anything to my converter later on. So instead I just put the entire issue object in the first group and I set the IsImage property to True.

The second group will contain all the characters, remember that Character sets IsImage to false in the constructor, so no need to do that here explicitly. I now have everything set to show two groups in my GridView. Onto the XAML we go.

So now we reached the actual problem. We can set one ItemTemplate but I need two. Here’s what my template looks like.

<GridView.ItemTemplate>
        <DataTemplate>
            <StackPanel>
            <Border BorderBrush="Black" BorderThickness="2" Width="300" HorizontalAlignment="Left"
Height="120" Visibility="{Binding IsImage,
Converter={StaticResource KeyToVisibilityConverterReverse}}"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10,0,0,0"> <Image Source="{Binding Image}" Height="100" /> <StackPanel> <TextBlock Text="{Binding Name}" Width="180" Foreground="Black"
Margin="12,0,0,0" TextWrapping="Wrap" /> <TextBlock Text="{Binding Role}" Width="180" Foreground="Black"
Margin="12,0,0,0" TextWrapping="Wrap" /> </StackPanel> </StackPanel> </Border> <Image Source="{Binding Image}" Height="500" Visibility="{Binding IsImage,
Converter={StaticResource KeyToVisibilityConverter}}" /> </StackPanel> </DataTemplate> </GridView.ItemTemplate>

I've build a stackpanel that contains both my templates, one is just a simple image bound to the cover image. The second is a border containing a smaller image and a few textboxes. And as you can see, the Visibility of both templates are bound to IsImage. Now I have two converters to bind too, one has to return “Visible” when IsImage is True while the other one has to return “Collapsed”. Here’s what the converters look like.

public class KeyToVisibilityConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, string language)
    {
        return (bool)value ? "Visible" : "Collapsed";
    }

    public object ConvertBack(object value, Type targetType, object parameter, string language)
    {
        throw new NotImplementedException();
    }
}

public class KeyToVisibilityConverterReverse : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, string language)
    {
        return (bool)value ? "Collapsed" : "Visible";

    }

    public object ConvertBack(object value, Type targetType, object parameter, string language)
    {
        throw new NotImplementedException();
    }
}

And that did the trick for me, this is what my result looks like.

 

I hope I helped some people out with this. Like I’ve said at the beginning of this post, this feels more like some sort of dirty hack than a decent solution but it works. Please let me know if you have another way of doing this.


Tags:

.Net | MVVM Light | Metro | Windows 8 | XAML

Weekly update on my XNA project

by Nico

My first week back on the job is finished, that means I’ve had about 5 hours of time to work on my lunch game. Progress started of pretty small because of some enemy placement issues that showed up after I changed the complete control scheme. After loosing about an hour of time trying to fix it, I’ve decided to revert back to the virtual thumbsticks. About half an hour and some Mercurial commands later I was back to the original controls, the enemy movement behavior also reverted back to normal.

Day 2 I decided it was about time to make the enemy move, the character itself was moving up and down but without any animation, he was just sliding up and down. My animations are done using a spritesheet, the eight walking directions each have a line in the spritesheet. In the code itself I have a rectangle that has the width and height of one texture on the sheet, using the Update method I move the rectangle after x amount of time. This is the piece of code that creates the animation

protected Rectangle SourceRectRunning;
protected readonly TimeSpan RunRate = TimeSpan.FromSeconds(0.1);
protected TimeSpan RunTimer;

public override void Update(GameTime gameTime)
{
    RunTimer -= gameTime.ElapsedGameTime;

    if (RunTimer <= TimeSpan.Zero)
    {
        if (CharState == State.Running)
        {
            if (SourceRectRunning.X >= TextureWidth * 7)
            {
                SourceRectRunning.X = 0;
                return;
            }

            SourceRectRunning.X = SourceRectRunning.X + (int)TextureWidth;
        }

        RunTimer = RunRate;
    }
}

 

The CharState is just en enum that I’ve build. The enum looks like this

public enum State
{
    Running,
    Standing,
    Spotted,
    Walking
}

This makes it very easy for me to call the right code when the player starts moving or when he’s spotted by the enemy.

I was very happy of how the animation looked like, so I figured it was about time to do something about the collision detection. This is something I’ve implemented quite some time ago but it never really worked how it should. The way collision detection is working in my app is a pretty nifty one. I found it in the demo code of the tile engine that I’m using.

A map build with Tiled consist of several layers, I have a layer that contains only the floor textures and a second layer that contains stuff like trees, walls and other non-interactable objects. The demo project contained with the WP7 Tiled engine has a method that can get the color of a certain tile on a certain layer. I take the player’s position, add a few pixels to it and determine the color on that location of the Objects layer, if the color is NULL then there’s no object in the way. Let me show you the code

Color? collColor = _level.Map.GetColorAt("Objects", _player.WorldPosition + 
    (VirtualThumbsticks.LeftThumbstick * 5));

if (collColor == null)
{
    //player can move
}

The GetColorAt method looks like this

public Color? GetColorAt(string layerName, Vector2 position)
{
    var l = GetLayer(layerName);

    TileLayer tileLayer = l as TileLayer;

    position.X = (int)position.X;
    position.Y = (int)position.Y;

    Vector2 tilePosition = new Vector2((int)(position.X / TileWidth), (int)(position.Y/TileHeight));

    Tile collisionTile = tileLayer.Tiles[(int)tilePosition.X, (int)tilePosition.Y];

    if (collisionTile == null)
        return null;

    if (collisionTile.CollisionData != null)
    {
        int positionOnTileX = ((int)position.X - (((int)position.X / TileWidth) * TileWidth));
        int positionOnTileY = ((int)position.Y - (((int)position.Y / TileHeight) * TileHeight));
        positionOnTileX = (int)MathHelper.Clamp(positionOnTileX, 0, TileWidth);
        positionOnTileY = (int)MathHelper.Clamp(positionOnTileY, 0, TileHeight);

        int pixelCheckX = (collisionTile.Source.X) + positionOnTileX;
        int pixelCheckY = (collisionTile.Source.Y) + positionOnTileY;

        return collisionTile.CollisionData[(pixelCheckY * collisionTile.Texture.Width) + pixelCheckX];
    }
    else
    {
        return null;
    }
}

As I’ve said, this piece of code comes from the Tiled engine I’ve found on this site.

The problem I was having before was that I was passing the player’s coordinate on the screen to the method instead of the player’s position on the map. It does work much better now but currently I’m passing the coordinate of the upper left corner of the texture (XNA default) so it does need some fine-tuning.

I’m thinking next week to do some more work on the level editor or maybe start working on interactable objects. I’ll write another post next week, so stay tuned or follow me on Twitter to get daily updates.


Tags:

.Net | Game development | WP7 | XNA

XNA Lunch game update

by Nico

So I’ve already missed my first blog appointment about the Windows Phone game that I’m developing during my lunch brakes. Not a good start, but I’m taking two weeks off work so I do have a valid excuse Glimlach

Last week I worked 3 hours on the game in total, my vacation started on Thursday with the app-a-thon. In those three hours I reworked the control scheme. Previously the character was moved using a virtual, on-screen thumbstick. That worked great but on a device with such small screen estate and my huge thumbs there wasn’t much left to see. So I reworked that into a point and click system, tap on the screen and the character will move to the position of the tap. A side effect of this new system is that some enemy movement bug got fixed automagically, that was a rather nice surprise.

Next to the control scheme I made some progress on the collision detection system, since my level engine is a tile based layered engine it was quite easy to do. I’ll probably dedicate a separate post on the collision detection system.

All in all good progress with little time. The project will now be shelved until the end of June, the day my vacation ends is the day I’ll pick the game back up. So that’ll be two weeks without updates.

Keep an eye on Twitter for upcoming updates and see you in two weeks!

     


Tags:

.Net | WP7 | XNA | Metro | Devices

Windows 8 Summer app-a-thon

by Nico

Last week, on June 12, Microsoft Belgium organised a Windows 8 App-a-thon. Place to be this time was the casino in Blankenberge, a city at the Belgian coast. The concept: two app-a-thons, one during the day and one during the night. Gather a team, build an app in a few hours and show it off to the rest.

As usual I arrived a few hours early, always prefer arriving early then arriving late and have an entire room stare at you as you enter. The room was quite big, there were about 50 registrations for the event, a small and entertaining group. Once everyone of the day group arrived and got setup the introduction of the day began. Katrien De Graeve, a Microsoft Belgium Evangelist, gave the intro with me giving a small demo of Trello, the online board system that the app-a-thon community is using to divide the groups and brainstorm about different ideas.

   


After all the introductions were done, it was time to grab the first Red Bull of the day and started coding. My team would arrive for the night so during the day I mostly worked on my ComicDB app. This was also my first public appearance as a MEET member. This meant I would be a helper on people getting stuck. I did help some people with small issues and it felt good, being part of a community means helping people out and getting help from others. And you get fancy t-shirts Glimlach.

   


There were no demos after the day event because most teams stayed to continue working on their app during the night. Between both events it was time to get out and get some ice cream and seeing the beach. Yes that’s right, a bunch of developers went out to the beach instead of staying in a room behind a computer.

 

Then it was time for the night event, while eagerly awaiting the pizza me and my newly arrived team started working. We were working on a XBMC remote for Windows 8. We’ve spent some time before the event getting to know the API (which is a JSON-RPC API) and started working an a .NET wrapper for it. Our team proved to be pretty efficient and new functionality got spit out constantly. Never the less we couldn’t get all functionality working, playing a movie from within the app proved to be a big challenge, something we’re currently still working on.

After some pretty darn good slices of pizza and some hours of coding it was demo time. Some impressive apps got shown off, an app to check the type of beer based on its color, an app that provides you with color schemes that you can use, a MovieDB app and a random funny sentence generator (that one was pretty hilarious).

After that we got one more cocktail at the beach and then it was time to get to the parking lot in the rain and start heading home. It was a very fun day, met some nice people, met some people in real life that I know from Twitter and had a great time working with friends on an app.

I can’t wait for the next app-a-thon in August! And the one in September that the community is currently begging for Glimlach

 

PS: About our XBMC remote app, we are currently still working on it and we do plan to get it in the store. At that time it will also get open-sourced. The name is currently MetroRemote but that can still change.

All my pictures can be found here, should you be on one and wish for me to remove it please send me an email or contact me through Twitter


Tags:

.Net | MVVM Light | Metro | Windows 8 | XAML | Community

Lunch development

by Nico

For the last couple of weeks I’ve been developing a game during my lunch break at work. Why? Mainly because I had this project in my mind for a while and I wanted something fun to do while eating lunch. Since I’ve started working on it I made a habit of tweeting my progress after the break, around 1PM GMT+1. Since I’ve started doing so a lot of people have shown interest in the project, providing tips and some even wanted to see the source code or wanted to help on the project.

I never expected to get this much feedback from something like this so I’ve decided to try and write weekly blog posts about the project, I will still tweet daily about the progress and then make a weekly summary post with findings, problems and fixes.

Now, about the game. The game is a stealth, sneak around the level, isometric 2D XNA game build for Windows Phone 7.5. If I finish it and I’m happy enough with the result to submit it to the marketplace then I’ll port it to Monogame and release it on some other platforms (no, not you iOS).

What I have so far: I have a map, created with a free, open source program called Tiled. I use Tiled because it’s pretty easy to use and it provides libraries for Windows Phone to read the maps in an XNA project. Next to the map I have a player that can run around on the map, the player always stays in the center of the screen so I basically move the map around. I have an enemy, with a triangular field of view, who moves up and down between two points. The player gets spotted when he enters the field of view of the enemy.

What I’m working on now: I’m currently building a level editor with winforms. This will make it easier for me to create lots of levels with enemies and objects in them. I currently have the form, I can open a map and read out the size date from the .tmx file (.tmx get’s created with Tiled). I want to finish the editor now so I can complete a first level. Once I have a complete level I can finetune the gameplay.

Will I open source this? Currently not, there are a few people that I know personally who have access to the source code but the repository will remain private for now. Why? because I’m thinking about making this my first paid app (with a free, ad containing version) on the WP7 marketplace. If I get completely stuck I might get some other developers involved, but for the time being I will remain the only developer.

Can I give more information about the story or setting? I probably could Glimlach but I won’t for now, I’m going to build up the hype meter for this project so that everyone will want to get it and I will get rich. Once I’m rich I can start up my own game developer studio, create Version 2 of this, get even richer, buy EA and finally get them to make decent games again. Then I’ll probably wake up and realize this was all a dream.

Should you be interested in following my project, please follow me on Twitter (@NicoVermeir) for daily updates or stay tuned for weekly updates on my blog.

PS: I’m going on holiday from June 12th until August 1st so there will probably be little to no updates in that timeframe.


Tags:

.Net | WP7 | WP8 | Windows programming | XNA | Game development

slides and demo for my WiPhug talk

by Nico

Yesterday I did a talk in the Belgian Windows Phone User Group about beginning XNA development. It was the first time I did a talk in my own user group and I had a great time.

I also learned a very valuable lesson: don't name your Autohotkey snippets the same as your classes. It was quite the hilarious moment when I entered the class name in the "Add File" dialog and hit the Enter key.

Besides that small setback everything went great. The slidedeck and demo (shooting iphones down with a pink magenta Lumia) are zipped up and can be found here.


Tags:

.Net | Devices | WP7 | XNA

My community day session slides and demos are online

by Nico

Yesterday was Community Day, the biggest community driven event in Belgium.

I did a talk there about porting over a Windows Phone 7 app to Windows 8. It was very exciting, I never spoke to such a crowd before, let alone hooked up my portable to a cinema beamer.

The talk itself went pretty well but I did suffer from demo failure, what was really odd since the demo worked perfectly an hour earlier. I researched the error after the talk and it seems that in a Windows 8 Metro app the path to the manifest file is an absolute path for some reason. I suddenly remembered that I moved the solution to another folder right before the talk, so it was my own fault. Reminder to self: never move a folder before doing a talk.

Anyway, it was a great day, I've met some nice people, had fun discussions and attended an App clinic on UI (thanks Lesley for the useful information!). See you next year community day!

Download my slides and demos here.


Tags:

.Net | Metro | MVVM Light | Presenting | Windows 8 | WinRT | WP7 | XAML

  Log in

About the author

Hi,

My name is Nico, I’m an MVP Windows Platform Development living in Belgium.
I’m currently employed as a .NET consultant at RealDolmen, one of Belgium’s leading IT single source providers.

I'm also founding member and board member of the Belgian Metro App Developer Network, a user group focussed on Windows 8 and Windows Phone development. If you're in Belgium feel free to drop by if we're doing an event. http://www.madn.be

Since June 2012 I'm a proud member of Microsoft's Extended Experts Team Belgium. And in February 2013 I became a member of DZone's Most Valuable Bloggers family.

In 2013 I became a book author and wrote "Windows 8 app projects, XAML & C# edition".

In 2014 I received the MVP award for the very first time.

I hope to get feedback from my readers either through comments, mail (nico_vermeir@hotmail.com), twitter, facebook, …

 

mvp

 

mvp

 

 

MeetLogo

 

MVBLogo

mybook

 

Month List