Launching devgame101.com

devgame101In addition to the consulting and custom software development I provide through GlobalCove Technologies, I’m also creating information products to help people create their own games.  Back in 2007 and 2009 I authored two books on how to create games using Microsoft’s XNA Framework. I’m getting back to my first technology love – video games – and am launching a site to teach video game development. You should check it out at devgame101.com

For the launch of the site, I’m doing a webinar to teach how to create a 3D game using Unity. If you have any interest in game development, I suggest you check it out.

What game are you thankful for?

So I found Brian Fisher of Lion Root today. As I looked around I ended up on his Facebook page where he posted the question – What game are you thankful for?

I started to type in a comment. But then I went to add a picture and then I realized I needed to dust off my blog and create a post.  I have several partially written blog posts that I’ve created over the last couple of years.  They never seemed to make it to the interwebs though.

So in an effort to actually get a blog post created, I decided to take my comment and turn it into this post.

The game I’m most thankful for is…

police-academy

…Police Quest from Sierra

The screenshot is of Police Quest from Serria – That is when I realized I could type in commands to the computer and have it do something. It’s what sparked me to get into programming and I’ve had a wonderful career in software development for almost two decades.

 

I picked the above image because it actually shows typing in look in the prompt at the bottom of the game. I also played Deadline, Witness and other Infocom games on an IBM compatible machine with an Intel 8088 chip after playing this game. My dad picked up the PC a few years after it was out from a co-worker.  I had an Atari 2600 game console, but my friend down the street had the Atari 600XL computer.  It was at his house, while we played Police Quest, that I realized that you could tell the computer what to do as long as you told it in a way it could understand.  Of course, I was just telling the interpreter of the actual game and not the computer itself, but the concept was still valid.  Later, I was able to buy that computer from my friend as he got the Atari 800 XL.  I upgraded the Atari 600 XL from 16K of RAM to 64K to have the same amount of memory as the 800 and the Commodore 64.

Atari600xl atari1050-drive

It was on this machine that I had my first programming experience using Atari BASIC. I could even save my programs to disk!

I don’t recall the exact years I played the games or even in which order, but I do know that I had the Atari 2600 first to play, then I got the 600XL and wrote my first BASIC code on that and finally got the IBM Compatible PC.  I believe this would have been between 1985 and 1987 right when I was becoming a teenager.

It was during this time that I fell in love with video games. I always wanted to create video games and it was the reason why I got into computers.

Within a couple of years, I spent many hours trying to get games to run on the IBM and fighting with IRQ numbers on my Sound Blaster Pro and trying to get games like Doom to run.  The following quote from Remembering Doom 20 Years Later sums it up nicely:

In the early 90’s memory was a precious thing. Games were meant to be squeezed into the 640k of conventional memory. DOS4GW allowed you to use some extended memory to boost this but you still needed to maximize your free memory. That meant assigning some XMS to smartdrv to boost performance. That meant moving the mouse driver into the right partition. It turned us all into programmers.

I spent as much time trying to get my games to run as I did playing them sometimes. Still, this ‘hardship’ is what really helped me understand the different aspects of a computer and how it all worked together.  I like to think that my love of playing games is ultimately what led me to take 5 computer courses in my last 3 years of high school.

I had the opportunity to take BASIC, Pascal, COBOL, Fortran and C++.  (COBOL and Fortran were each 1/2 of a year and I had the privilege to be the first student to learn C++ in our school.)  Well before high school, I would create BASIC programs on my Atari 600XL.  Later, on my IBM, I used GW-BASIC.  I remember upgrading my monitor from monochrome to CGA to EGA and finally VGA.  Then came the graphic card upgrades.  My first HDD was a whopping 10MB.  Life was awesome.

I’m very thankful I grew up during that time. And if I had to choose just one game to be thankful for, it would have to be Police Quest.  While many games were played through the years and I enjoyed the Space Quest games even more, it was Police Quest that flipped the light on in my head that I could actually “program” a computer.

Windows 8 Book written in 8 weeks

It’s been a while since I’ve updated the blog.  Several things have happened.  On July 1st, I received notification that I was renewed as a Microsoft MVP for 2012.

This made me very happy since I also had just signed a contract with Sams publishing (Pearson) to write a third book for them, and I figure this would mean early access to the Windows 8 bits through a MSDN subscription.  To me, that subscription is the second best perk of being a Microsoft MVP.  The best perk is being able to talk to the product teams and to see conversations by folks that are much smarter than I.

My first two books were on game development using XNA.  This third book is about creating Windows 8 apps.  I signed the contract the last week of June with the plans of writing the first chapter on July 1.  

Around the same time I was invited to participate in an App Excellence lab.  For some reason I thought it was more of a Dev Camp setting.  The lab is really for for folks who have an app that is at least 80% done and are wanting to put the app in the Windows Store.  The dev camps are a full day (or 2) of learning about what makes a Windows Modern UI style app and what is needed to put the app in the Windows Store.  I found out the day before that what I was attending was the “80% app done lab” and not the “training / work day with experts lab”.  So I apologized to the field engineer and we discussed the app and I got some good pointers about the app in particular.

image

My original idea was to create a version of the app for the book and then finish it up to submit it to the store.  I realized the concept of the app was too complex for the book.  There would be too much time spent on explaining the app instead of the technology behind the app.  So going through that exercise allowed me to have my first failure within the first week.

I created my Table of Contents (TOC) and spent that first week (before July 1) mocking up 3 apps.  Two of the apps mocked up I would use in the book.  The third was a good exercise, but proved to not be the right game for the book.  The idea was to create two apps and one games as a “Putting what was learned it into practice” section of the book.  In fact, here is the table of contents in its current state.  Perhaps some of the words will change a little, but this is what we have:

Part I: Building the Foundation
1    Getting a Refresher on JavaScript, HTML5, and CSS3
2    Trying out File | New | Project
3    Exploring the Windows Runtime (WinRT) and Windows Library for JavaScript (WinJS)
4    Creating WinJS Namespaces, Classes and Custom Controls
5    Understanding Microsoft Design Style Principles
6    Customizing the Style of our Apps
7    Debugging, Securing, and Measuring our Apps Performance
Part II: Handling the Hardware
8    Working with Multi-touch and Other Input
9    Working with Location and Hardware Sensors
Part III: Working with Data
10    Binding Data to Our Apps
11    Storing Data Locally
12    Using Remote Data
Part IV: Making it a Windows Store App
13    Working with Fullscreen, Filled, Snapped, and Portrait Views
14    Using the App Bar and Pickers
15    Handling Our App Life Cycle Events
16    Using Contracts and Extensions 
17    Using Live Tiles, Secondary Tiles, Notifications, and Toasts
18    Creating a Trial and Handling In App Purchases
Part V: Putting it into Practice
19    Making an App: RSS Aggregator
20    Making an App: Finger Painting
21    Making a Game: Simon
Part VI: Sending it out to the world
22    Understanding the Windows Store
23    Getting an App Certified
24    Making Money with Windows Store Apps
Part VII: Appendix
         This Book’s Website

Yeah, this book is about JavaScript development and not C# which has been my bread and butter for the last 12 years.  I started working with JavaScript excessively around April this year and  have really come to enjoy the language.  Something I would have never thought back in 1996 when I first used it.  Visual Studio tooling could be better, but it is much better than was in the past.

The table of contents went through a few iterations but not many changes overall.  It is currently being reviewed by the technical editor.  Once I get notes I’ll make modifications and then it will go on to editing (for thing like, gramar, and, speeling, altho I’m a very goood speeler, and, gramarist person).

Writing a book in 8 weeks is challenging.  I did the same thing for my first book on XNA.  Writing a book in 8 weeks and working full-time provides very little time for anything else.  On the flip side, with my second book, I gave myself 6 months of time, plus it was an update to the existing XNA book.  I figured that would be a breeze, but that was a long 6 months.

The 2 month approach wreaks havoc on my family though.  I thought I’d have a better handle on writing  it this time around but I got behind on my schedule after about the 3rd week and was in catch up mode ever since.  That means the last 5 weeks, out of the 8, I was in my “worst case scenario” phase of not going to bed some nights and neglecting time I had set aside for my family.

End result?  The book content is done and the deadline was hit.  My daughters haven’t suffered too much but my poor wife has had to really pick up the slack.  We homeschool our girls, so my doing the book from June 26th to August 27th caused my wife to not really get much of a summer break.

image I kept track of my time for this book and I spent 695.2 hours researching and creating content. Ouch.  Fortunately, the main content of the book is done and now I’m just waiting the for the technical editor to come back.  I’m also going through and updating the first chapters to work with RTM as all the code (and screenshots) were originally done on Windows 8 RP.  I downloaded RTM on the 15th and installed it on Thursday night (16th) while attending my local .NET User Group where Brian Hitney and Glen Gordon talked about Windows 8.  Their boss, Brett Wolfe was also there and I was able to schedule another App Excellence lab.  This time I was prepared and had 2 apps to choose from.  We got it scheduled for Tuesday morning, the 21st.  It passed and, just like Jennifer Marsman, I got a Windows Store token.  This was extremely beneficial as it allowed me to grab screenshots of the Windows Store and submitting apps which was crucial since I had an entire chapter devoted to it.  So I’m very grateful that Brett hooked me up with another timeslot.

One obstacle I ran into was not having Windows 8 hardware.  I didn’t attend Build 2011 so I didn’t get one of the nice Samsung Series 7 tablets.  I had purchased an ASUS EP121 in June of that year and have enjoyed using it.  I installed Windows 8 Consumer Preview on it in March and really enjoyed using it.  I then also installed Windows 8 CP on my desktop and only used Windows 8 on those machines.  I was booting to Windows 8 CP on a VHD on my Windows 7 desktop, but I never went back to load Windows 7.  That will change this week as I’ll boot into Windows 7 so I can do an upgrade to the final version of Windows 8. 

Anyway, back to my tablet … I used the ASUS EP121 in order to test my code around touch.  Unfortunately, the device only supports two touch points.  During the App Excellence lab, the Microsoft Field Engineer confirmed that the app was working as expected when 8 fingers were being used.  Writing code for the GPS is no problem even for devices that don’t have a GPS so that was no problem.  But the new accelerometer, magnetometer and gyrometer hardware that will be in all Windows 8 tablet and convertible PCs is something I needed to provide examples on.  The Sensor Fusion software that takes those three hardware pieces and provides results is pretty cool.

image

Unfortunately, my ASUS EP121 hardware didn’t support it.  I went purchased a STMicroelectronics Micro-Electro-Mechanical-System (MEMS) which is the piece of hardware that is in the Samsung devices and will be shipping in many of the upcoming devices.  Paying $140 for that was a lot better than shelling out a grand or so on a device that I would loath after October and November gets here and all the new devices start coming out.  Plus, I was able to snag a seat at the Build 2012 conference coming at the end of October.  I’m hoping there will be some hardware goodness there.

Getting information on the Windows Store and the hardware were the only two problems I had with creating the book (other than running into bugs as I was creating the examples and learning the technology, of course).  This book is an introduction to Windows Store app development in the Sams Teach Yourself series.  It was hard for me to not spend time drilling down into topics as much as I did with my XNA books.  When dealing with a framework like the XNA Framework, there is only so much surface area that needs to be discussed so there is some wiggle room to dig down deep on a topic and even spend a chapter or two discussing non XNA related, but game related content like physics and artificial intelligence.  However, when talking about Windows 8 – that is a HUGE amount of API that can be covered with multiple ways of doing the exact same thing.  How does one determine what is included in a book with limited pages and what is not?  Making those decisions was challenging, but I tried to just stick the items that would be most common to folks starting out and needing to get an app or a game created quickly.

The other challenge was that I wanted to have one of the three main example apps be a game.  Game development can be difficult.  How does one teach game development in a single chapter?  It can’t be done, but what can be done is to introduce the topics such as the game loop and game states as well as introduce other game type of items all throughout the book like working with the HTML5 canvas and using the requestAnimationFrame API.  One of the apps created was a finger painting app.  Even though it is an app and not a game, it has certain properties of a game where the screen needs to be drawn at the refresh rate of the display and separating out the update logic (receiving input from fingers, stylus/pen and mouse) and the drawing logic (of actually drawing lines on the screen based on the touch points).

In another post, I’ll list all of the examples discussed in the book, like the Ink example which uses hand writing recognition, and the three (mostly) complete apps, one of which is a game.  I’ll be submitting those three apps to the store in the next few weeks.  All of the source code for this book will be put on GitHub once the editing process is complete and the book is sent off to the printers.

So while writing the book was a strain on my family I am still happy I did it.  My wife would most likely disagree but she was and is supportive of my efforts.  I think if I did another one, I’d like to have 3 months to do it.  6 months is too long, but 2 months is too short.  I have the ability to focus on something and push through until it is done, but the down side is that I tend shut out almost everything else as I focus on the task at hand.  It is the only way I know of how to get something done when it is very unlikely to get done.

I’m unsure of what the release date of the book will be at this point, but it should be out before general availability of Windows 8.  So writing a Windows 8 book in 8 weeks was challenging, I learned a lot and realized I could write another 2 or 3 books on the subject.  Could, but won’t … at least not for a while … and not in a 2 month period.

Up next, I’ll be putting the finishing touches on the three apps created in the book and submit them to the store.  Then I’ll start work on the next 7 apps.  All of these will be released through my company GlobalCove Technologies.  After the first batch of apps are submitted and before I start work on the next 7, I’ll be redesigning the website to better align with the company’s new focus of Windows 8 app and game development.  While the company will still do training and provide consulting services our main focus will be creating apps for the Windows Store.

If you are contemplating writing an app for the Windows Store, don’t delay.  Don’t put it off.  Get it done.  Some of the first apps will have great success as in millions of dollars success.  Don’t miss out.

Happy Coding,

-Chad

Windows 8 Consumer Preview on my Development Machine

Over the weekend I created a bootable VHD with the Windows 8 Consumer Preview operation system on my development machine.

My initial reaction on my dev machine on Monday morning was that it was less than compelling. However, after using it for just a half a day I think it is very compelling. I’m just scratching the surface but I definitely love this OS already. I still think there needs to be some instructions for folks that get to desktop mode that may not know how to easily get back to the start screen, but that can easily be done with a short cut on the desktop to go back or even a ‘Start Button’ on the task bar. Once you know you just have to hover on the side of the screen to hit the Windows charm or hit the Windows Key on the keyboard (which is how I got back) it is no big deal, but for folks who don’t know it could be frustrating.

I also installed Windows 8 Consumer Preview directly on the metal on my ASUS EP121. Touch is very impressive on the tablet. I fell in love with it immediately. The key to anyone trying to use Windows 8 Consumer Preview on the ASUS EP121 is to download the drivers from the ASUS website first. I have Bluetooth working on it and it is great.

On my development machine, which is what this post is about, I have 2 GPUs. They are both NVIDIA’s GeForce GTX 560 Ti models. I ran into a few issues with the system rebooting on me after displaying RGB dots all over the screen. Updating the drivers helped but it would still do it. Then I changed the “Power Management Mode” in “Manage 3D Settings” in the NVIDIA Control Panel to “Prefer Maximum Performance” and I changed the “Multi-display/mixed-GPU acceleration” to “Single display performance mode.”  After making that change the machine still locked up and rebooted once this week but hadn’t for almost 4 days. So these changes made it more stable but it didn’t solve the problem entirely.

image

Before I get into the actual experience, I figured I would talk a moment about the setup I went through to get the VHD setup. I started with Scott Hanselman’s blog posts on the subject. My machine doesn’t like booting from a USB device and I didn’t want to make a DVD so I used the tip from the commenter on the blog post and setup the VHD that way.

I backed up my Boot Manager Database by running the following:

BCDEDIT /export c:bcdbackup.bak

I gave my VHD 200GB of space but at this point only have used 59GB so far.

When I done installing it came up with Windows 8 with no issues. I was very happy. I was running Windows 8 from the metal via the VHD.

Now, something that made my move easier is the fact that when I installed Windows 7 on this machine back in June when I bought it I split out my Users folders (and Program Files) to my 3TB HDD instead of my 128GB SSD where the OS was installed.

Since I had all the documents on my non OS drive I was able to easily connect to it from my Windows 8 OS.

1

I have two monitors (would like a third but don’t have room on my desk). Originally the Windows 8 start screen was on the left monitor. I right clicked the taskbar on the right-hand side and selected “Make this my main taskbar”. This moved the start screen to the right like you see above. (You can click the images to get larger images.)

What I noticed is when I started using the metro apps while also doing something on the desktop is I had no idea what time it was. Currently, the time on the taskbar is put on the same screen as the Windows 8 start screen (so if the start screen is visible, the clock on the taskbar isn’t visible.)  The only way to see the clock on the start screen (or in a Metro app) is by hovering the mouse on the right side of the screen. This brings up the charms (search, setting, start, etc) as well as the clock in the bottom left quadrant of the screen. That isn’t acceptable to me. I want to be able to glance at a clock.

So I made the Windows Gadget clock visible. (I hadn’t ever used the gadgets in the past.)  As you can see I put it on the bottom of my desktop screen. It has a “Always on top” checkbox, but it doesn’t always work. So in the following screens you will see that I just made sure the window didn’t obscure it.

4

In the above screenshot you will see that I’m using VS 11 as well as SQL Server Management Studio and a PowerShell window where I’ve utilized posh-git so I didn’t have to use Git-Bash. I really like PowerShell.

2

When I’m not using a Metro app and want both screens to be my desktop I can obviously do that as well. Here I have two more PowerShell windows opened as well as Windows Live Writer (so I can write this blog post.) One of the PowerShell windows is using posh-hg  since I do a lot of personal development using Mercurial and Kiln from Fog Creek. The other PowerShell window is just for random stuff I need to do on the machine. I created some functions so I can just put “dohg” or “dogit” and it will load up posh-hg or posh-git and set different color schemes. This way I can easily know which window I need to do my work in.

3

The above screenshot shows how I opened up my Metro mail client and then put it in a snap view so I could have that going while I still utilized the majority of my two screens with desktop apps.

I like the Metro mail client. Being able to see all 5 of my active email addresses is very beneficial. I found myself using my Windows Phone 7 to quickly check for incoming messages before. Now, I can easily see it through this mail app.

5

Although the above isn’t very practical if you are trying to do something on the desktop, I found it to be very productive to switch over to filled mode (opposite of snapped mode) to respond to an email.

6

If I made it full screen I would have to snap it back and then move a window on my other screen to get the system to go back to desktop mode with the Metro snapped app displayed. This way I am able to easily move it from filled mode to snapped mode.

Unfortunately, I had to revert to using Outlook again as I just couldn’t easily add attachments and my exchange contacts (i.e. coworkers) wouldn’t automatically populate in new messages. All my contacts from my hotmail and gmail accounts were fine, but not from my company’s address book in Exchange.

So when I brought up Outlook it started to sync. I didn’t want it to do that since I knew my Gigs of emails were on my D drive. So I exited Outlook and ran the following command to have Outlook point to my existing file (after deleting the .ost file it was making):

cd "C:UsersChadAppDataLocalMicrosoftOutlook”

mklink "Outlook Data File – ccarter@robertsonmarketing.com.ost" "D:UsersChadAppDataLocalMicrosoftOutlookOutlook Data File – ccarter@robertsonmarketing.com.ost"

Then when I booted up Outlook it grabbed my existing file and only had a day of emails to retrieve. (I tried the Metro mail client for a full day before reverting back to Outlook.) I still use the Metro mail app for my other 4 active email addresses though. I do like it.

7

The above screen was when I ran the basic Direct3D template and then put it in fill mode. So I was using VS 11 to run/debug the Metro app that was in fill mode. Still having my email up.

8

9

Those final two images show the Metro Reader application. The writing is too small to be useful when it is in a snapped mode but I did enjoy using it in the fill mode.

Once I had the machine the way I wanted it. (I LOVE IT!) I wanted to create a restore refresh point. I followed this article and had it created in about 35 minutes.

image

It takes a long time to get past that 0% though so don’t give up.

image

My next steps will be blowing away the VHD and reformatting my SSD that has Windows 7 on it to use Windows 8 Consumer Preview. I’ll be using this restore point once I get it installed. I like using Windows 8 that much. I’ve not lost any productivity in using it and using VS11 in Windows 8 is excellent.

image

Just some quick tips from my using Windows 8 Consumer Preview this past week:

image Corners are important!  Hovering your mouse on the  Top Left of the main Metro screen (in Desktop mode or Metro mode) brings up previously used Metro applications. Handy!

Moving your mouse to the Top Right (or really anywhere on the Right edge) and you will get the charms.

image

Windows +  . (period) Will alternate your Metro app from Full screen to Filled to Snapped. Very handy.

Semantic Zoom: On the tablet you can do the typical pinch zoom gesture but with a mouse and keyboard you select a little magnifying glass on the bottom right of the Metro screen.

I enjoy using IE10 as well (in Metro and on the Desktop).

I’m glad we can still pin things to the taskbar on the desktop as that is very handy.

I love the lock screen. I like how integrated everything is from my Windows Live ID, .NET Passport, Windows Account to my Facebook and Twitter accounts. It is all very nice. It is like my Windows Phone 7 has grown up and become a full blown PC. Go Figure.

 

So if you are debating on jumping in on the Windows 8 Consumer Preview hopefully this will help you make that decision. I love developing on Windows 8 Consumer. I think you will too – especially if you have two (or more) monitors.

-Chad