BrianPeek.com
A Compendium of Random Uselessness

Brian's Blog

  • Facebook .NET Programmers Group XNA Session Posted


    NET PROGRAMMERS2bcropSmall2 The recordings for the session I gave on XNA Game Studio 3.0 and the XNA Framework to the Facebook .NET Programmers Group have now been posted.  In this session, I give an overview of XNA Game Studio 3.0 and the XNA Framework while building a simple Space Invaders clone named Alien Attack.  This game is gone into even greater detail with more features in chapter 1 of our Coding4Fun book.

    You can find a quick, low-res, streaming version below, or you can download and play the recording at a higher resolution in Microsoft Office Live Meeting.  I had a great time presenting the topic and hope to speak to the group again in the future!


    Meeting #13 - Coding4Fun: Designing a Video Game using XNA Game Studio 3.0 from Muneeb on Vimeo.

    Filed under: , , ,

  • Status of Wii MotionPlus Support for WiimoteLib


    wii-motionplus Ok, I get about 10 emails a day on this, so I figure a status update is in order.

    The Wii MotionPlus extension for the Wiimote was released last week.  Since then, I and others have been working to figure out how the device works.  Unfortunately, it does NOT work as every other extension controller has worked up until this point, mostly due to the fact that the Wii MotionPlus accessory has an expansion port of its own so all of the other extension controllers can plug into it.

    In the past few days, some progress has been made thanks to the folks over at wiibrew.org, although functionality is nowhere near complete.  For example, it’s currently impossible to have the Wiimote notify you when the Wii MotionPlus is inserted into the bottom of the Wiimote, like all of the other extension controllers do.

    I have been working with the information at wiibrew.org and am trying to get things working reliably with my library so that developers can actually get some degree of functionality out of it.

    So, all that said, expect to see a new (likely beta) version of WiimoteLib “soon” that has some bare-bones Wii MotionPlus functionality included.  It won’t be perfect, complete, or bug free, but it will allow you to tinker with the device a bit.  I will update my blog when the new version is available.  Thanks!


  • The Coding4Fun Show – Ep 1 with Andy Beaulieu


    logo The very first episode of my new Coding4Fun Show is now up on Channel 9.  This is a show I plan on doing monthly, interviewing developers creating fun and interesting projects, and showcasing what they’re doing.

    In this first episode, I interview Andy Beaulieu and we discuss his Physics Helper for Silverlight, Blend, and Farseer.  You’ll learn a bit about how he made the library, and how you can use it in your own applications for some pretty cool effects.  You should see the video below if you have Silverlight installed, otherwise head over to the episode on Channel 9 to watch and download in a variety of formats for offline viewing.

    Get Microsoft Silverlight
    The Coding4Fun Show: Physics Helper for Silverlight by Andy Beaulieu

    Have a look and let me know what you think.  It’s my first time trying this out, so I’d love to hear your feedback.  Thanks!


  • Facebook .NET Programmers Group Session on XNA 3.0


    image I will be giving a session on Tuesday, June 2nd at 6pm EST to the Facebook .NET Programmers group on XNA 3.0.  This is an online session and everyone is welcome to attend.

    Topic: Building a Video Game with XNA Game Studio 3.0
    Abstract: This session will demonstrate how to build a very simple 2D game (a Space Invaders clone) using XNA Game Studio 3.0. Attendees will learn how to effectively use the content pipeline, import 2D sprites into XNA, manage input from the keyboard, mouse, Xbox 360 controller and Zune, manage game state, and debug the resulting game. The sample code will be built on a PC and run on the PC, Xbox 360, and Zune platforms when complete.
    Date: June 2nd, 2009
    Time: 6PM Eastern | 10PM GMT/UTC - Get local event time in your city: http://tinyurl.com/l9hq65
    Add to Outlook: http://tinyurl.com/mpp5of
    RSVP and Event Details: http://www.facebook.com/event.php?eid=49178981206
    Live Meeting Link to join meeting: http://tinyurl.com/ago484

    I’ll also be giving away a copy or two of our Coding4Fun book.  Hope to “see” you all there!

    Filed under: , , ,

  • Install the Surface SDK SP1 Workstation Edition on x64


    image_thumbThe Surface SDK SP1 Workstation Edition was released this week and while it will install (but is still unsupported) on Windows 7, it will not install on a 64-bit machine.  The installer has changed a bit, so my previous instructions will not work with this installer, but I have managed to get the new package to install and run.  And here’s how…

    As before, this is a totally unsupported setup, so if official support from Microsoft is required, this is not for you.

    Please note that you will still need to meet the other hardware and software requirements of the SDK.

    To perform the actions in this guide you will need to install Orca, a tool for editing MSI files, included with the Windows SDK.  Unfortunately, this utility isn’t available separately and will require you to download the full SDK to get it.  You can download the Windows Vista or Windows 7 SDK here.

    1) Extract the MSI to its individual files

    This can be done with the following command performed in an elevated cmd window:

    msiexec /a SurfaceSDKWE.msi /qb TARGETDIR=c:\surface (or some other TARGETDIR of your choosing)

    When complete, you will have a new directory at TARGETDIR filled with a smaller MSI and all the files contained within the original MSI.

    2) Remove the platform check from the MSI

    Open the newly extracted SurfaceSDKWE.msi file in Orca.  Select LaunchCondition from the left pane.  In the right pane, select the row labeled Installed OR NOT VersionNT64, right-click, and select Drop Row.  This will remove the check for a 64-bit OS.

    5-14-2009 5-52-27 AM

    After the rows are dropped, save the MSI using the standard File –> Save menu option.

    3) Patch the setupcustomaction.exe file

    This executable is called during the SDK installation process.  Because the installer will launch as a 64-bit application, so will this executable, which will force it to write some registry values into the wrong location.  Therefore we have to patch this file using the corflags.exe utility included in Visual Studio and the .NET SDK. 

    If you have the full Visual Studio installed, simply open an elevated Visual Studio Command Prompt from the Start Menu and the path to corflags.exe will automatically be loaded.  Otherwise, you should find this in the C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin directory and you can set your PATH environment variable appropriately.

    With the path to corflags.exe in your PATH environment variable, change to the following directory:

    <TARGETDIR from above>\Microsoft Surface\v1.0

    Inside this directory, run the following command:

    corflags setupcustomaction.exe /32bit+ /force

    You will get a warning that the file is strong named signed.  You can safely ignore this.

    Administrator Visual Studio 2008 Command Prompt (2)

    4) Install the SDK

    Now that the MSI and setupcustomaction.exe have been patched, run the extracted and patched SurfaceSDKWE.msi file from the TARGETDIR location, not the original MSI file.  As long as you have the other prerequisites installed, the SDK will install without issue.

    5) Patch the executables / Build and fix the samples

    These steps are identical to last time, so I will just link to the original blog post here.

    And there we have it.  A patched and working Surface SDK SP1 running under Vista/Windows 7 x64.  As always, run this at your own risk, but let me know how it works out for you if you give it a try.

    Filed under: , ,

  • Windows Virtual PC and the Microsoft Device Emulator


    Windows 7 (as of RC1) now supports a pretty spiffy new feature known as Virtual Windows XP or Windows XP Mode based on what article you read.  At its core, it is a new version of the Virtual PC product, now named Windows Virtual PC, installed closer to the OS, combined with a Windows XP hard disk image which allow you to run legacy applications under Windows XP on your Windows 7 machine in a pretty seamless way.

    If you install the Windows Virtual PC add-on to Windows 7, you must first uninstall Virtual PC 2007.  By doing that, you remove the special network driver that is also required to use the Microsoft Device Emulator on the network.  The device emulator is typically used for Smart Device development.

    So the puzzle:  The Device Emulator doesn’t work with the new Windows Virtual PC driver, and you can’t install the old version of Virtual PC 2007 and expect the new Windows Virtual PC to keep working.  What to do?

    The answer is to extract the Virtual PC 2007 network service drivers out of the MSI package and manually install them in Windows 7.  So far this has provided the expected result for me:  Windows Virtual PC runs happily, and the Device Emulator now connects to the network.  So how do we do this?  Thanks for asking.  Here is a step-by-step guide to make this go.  Note that this is very much a “works on my machine” experience.  If it burns your house down, don’t hold me responsible.  Note that you should have a valid and complete backup before attempting this on your machine just in case…

    • Download the Virtual PC 2007 SP1 installer executable
    • Rename the installer from setup.exe to something else, such as vpc.exe
    • Open a cmd prompt, navigate to the setup executable, and run (assuming you renamed the file to vpc.exe):
      • vpc.exe /c
    • This will extract the executable to an MSI file at located in the %temp% directory
    • Change to the temp directory by running:
      • cd %temp%
    • In this directory, extract the MSI by running:
      • msiexec /a Virtual_PC_2007_Install.msi /qb TARGETDIR=c:\vpc
      • Of course, feel free to replace that directory with one of your choosing
    • This will extract the MSI file to c:\vpc (or the one you entered)
    • Open the Network and Sharing Center and select Change adapter settings
      adapter
    • Right-click the network adapter you have connected to the internet and select Properties
    • Click the Install… button
      install
    • Make sure Service is selected and click Add…
      type
    • Click Have Disk…
      disk
    • For x86 machines, navigate to:
      • C:\vpc\Program Files\Microsoft Virtual PC\Utility\VMNetSrv\
    • For x64 machines, navigate to:
      • C:\vpc\Program Files\Microsoft Virtual PC\Utility\VMNetSrv\x64
    • Select Virtual Machine Network Services and click OK
      vmns

    At this point the driver will be installed and attached to that network adapter.  If you have the need to attach this to multiple adapters, simply repeat the steps above to install the service on each adapter required.

    Once the driver is installed, you can then link the Device Emulator to the chosen adapter and connect to the network as always, as well as connect to the network in the new version of Virtual PC.

    Let me know how it works for you!


  • TwitterDrive


    tDriveWelcome to the revolution in cloud storage…TwitterDrive!

    Learn more at Coding4Fun:

    :)

    Filed under: , ,

  • Site Upgrade and New Theme!


    After finally finding a Community Server 2008.5 SP1 compatible theme I liked, I was able to upgrade my site to the latest Community Server version.  This theme is provided by Andrew Belon, who has several fantastic CS themes available on his site.  I’ve tweaked his basic Bliss theme (which he uses as his main theme) to my liking.

    I’m a big fan of the new colors and layout, and I hope those reading this are as well.  I’ll continue to tweak over the coming days to make things a bit cleaner.

    If you have any comments on the new site or you see anything out of place, please contact me and let me know…thanks!

    Filed under:

  • Install the Surface SDK on Windows 7 and/or x64


    image

    Update: Running Surface SDK SP1?  See my other post on how to install it on a 64-bit machine...

    The Microsoft Surface SDK was given out to some folks at PDC 2008.  I know the SDK is not out to the masses yet, however one of the questions/requests posted most frequently in the Surface forums is the ability to install the SDK on a 64-bit machine, and/or on Windows 7.  I’ve put together a quick guide that will show how to accomplish this.  But be warned…by doing this you are throwing away support from Microsoft.  This is an entirely unsupported setup and the Microsoft Surface folks won’t be able to help you.  So, if official support is important to you, this guide isn’t for you.  With that said, let’s continue…

    Please note that you will still need to have Visual Studio 2008 Express or greater installed, and you will need to have the XNA 2.0 Framework runtime installed.

    To perform the actions in this guide you will need to install Orca, a tool for editing MSI files, included with the Windows SDK.  Unfortunately, this utility isn’t available separately and will require you to download the full SDK to get it.  You can download the Windows Vista or Windows 7 SDK here.

    1) Remove the platform checks from the MSI

    Open the SurfaceSDKWE.msi file in Orca.  Select LaunchCondition from the left pane.  In the right pane, individually select the rows highlighted in the screenshot below, right-click, and select Drop Row.  This will remove the checks for 64-bit, Windows Vista, and Windows Vista SP1.  The rows are:

    • Installed OR (VersionNT=600 AND ServicePackLevel>=1)
    • Installed OR NOT VersionNT64
    • Installed OR VISTASKU="Business" OR VISTASKU="Ultimate" OR VISTASKU="Enterprise"

    3-10-2009 4-40-54 AM

    After the rows are dropped, save the MSI using the standard File –> Save menu option.

    2) Install the SDK

    Now that the MSI has been edited to remove the checks, install the SDK normally.

    If you are using Windows 7 x86, you are done!  If you are running on an 64-bit OS, please continue…

    3) Patch the executables

    Now that the SDK is installed, several executables need to be patched to be forced to run inside the 32-bit CLR instead of the 64-bit CLR.  This will be done using the corflags.exe utility.  If you have the full Visual Studio installed, simply open an elevated Visual Studio Command Prompt from the Start Menu and the path to corflags.exe will automatically be loaded.  Otherwise, you should find this in the C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin directory and you can set your PATH environment variable appropriately.

    With the path to corflags.exe in your PATH environment variable, change to the following directory:

    C:\Program Files (x86)\Microsoft SDKs\Surface\v1.0\Tools\Simulator

    Inside this directory, run the following command:

    corflags SurfaceSimulator.exe /32bit+ /force

    You will get a warning that the file is strong named signed.  You can safely ignore this.

    3-10-2009 4-57-13 AM

    Next, change to the following directory:

    C:\Program Files (x86)\Microsoft Surface\v1.0

    There are several executable to be patched in this directory.  You can easily do this from a single command as follows:

    for %i in (*.exe) do corflags %i /32bit+ /force

    This will enumerate all .exe files and patch them as done above.  You will again see the warning, and again, it can be safely ignored.

    3-10-2009 5-05-50 AM

    If you don’t care about running the sample applications, you are finished.  If you want to install and run the samples in the simulator, continue.

    4) Build and fix the samples

    The samples, by default, are setup to build as “Any CPU” executables.  This means they will always run under the 64-bit CLR, which is a problem.  They need to be built to run in the 32-bit CLR.  There are two ways to handle this: 1) you can edit each .csproj file to create an x86 build type and build the project, or 2) you can build the projects as-is, and patch them later.  I find option 2 to be easiest, so that’s what will be described here.  Note that you won’t be able to run and debug these samples via Visual Studio by doing this…if this is required, please go with option 1.

    Unzip the Surface Code Samples.zip file from the C:\Program Files (x86)\Microsoft SDKs\Surface\v1.0\Samples directory.  This should output a SDKSamples directory.  In this directory, open the InstallSamples.bat file in Notepad.  You will see several lines that check the registry for various things.  Each one of these will path the registry in a way similar to the following:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Surface\v1.0 /v IsLogicalSurfaceUnit

    Modify each of these to add the Wow6432Node key, which is part of the 64-bit registry that 32-bit applications access:

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Surface\v1.0 /v IsLogicalSurfaceUnit

    It’s probably easiest to do a find and replace, finding SOFTWARE\Microsoft and replacing with SOFTWARE\Wow6432Node\Microsoft.

    Next, run the InstallSamples.bat file.  This will build each sample and deploy them to the Microsoft Surface Simulator.

    Now we need to patch the built executables.  Back in the elevated Visual Studio Command Prompt, change to the directory where you unzipped the sample SDKs.  For me, this path is:

    C:\Program Files (x86)\Microsoft SDKs\Surface\v1.0\Samples\SDKSamples

    Run the following command to enumerate all directories and patch the executables:

    for /r %i in (*.exe) do corflags “%i” /32bit+ /force

    3-10-2009 5-17-51 AM

    Each file will be patched to run in the 32-bit CLR only.

    That’s it!  You should now be able to build, run and debug applications using Visual Studio and the Microsoft Surface SDK on Windows 7 and Windows Vista, either x86 or x64.

    Just remember…this is a totally unsupported scenario, so run at your own risk!

    Filed under: , ,

  • Coding4Fun Book Contest Winner!


    imageIt’s time to announce the winner of my contest to win a copy of our Coding4Fun book!  15 people entered the contest via my forum.  I assigned each of them a 0-based index in the order in which they submitted their entry.  The final list was:

    • leif902 = 0
    • jcauble = 1
    • krakerjak = 2
    • RoryBecker = 3
    • amrkamel = 4
    • anonymous = 5
    • Arrowofdarkness = 6
    • qiuliocc = 7
    • hanan = 8
    • Amira = 9
    • helpware = 10
    • michaelb = 11
    • FunnyX = 12
    • John Bisschop = 13
    • juanformoso = 14
    • bringo = 15

    Now, I did say you had to sign up using a valid user account, but the anonymous person linked to their blog which had contact info, so I decided to allow their entry in the mix….

    To pick the winner, I wrote up a single line snippet in the ever-popular Snippet Compiler, pressed F5, and the result was…

    captured_Image.png

    That’s number 11, which indexes to michaelb and his winning post!  Thanks to everyone that entered for their support and kind words!


1 2 3 4 5 Next > ... Last »