Windows Phone 7 Gaming – Part 3

So i have gone out and brought a new laptop (MacBook Pro 13.3 2.4 etc.) so i can now develop applications in the emulator.

The emulator is still buggy, if i rotate the emulator i just get a garbled screen rather than what i want in the correct orientation (happens with the start screen on the emulator, and IE). Also the game doesnt seem to be taking up the whole screen, which im not sure if thats a emulator bug or a problem with my code.

Anyway i have spent the last hour or so making some modifications and improvements, and here are the latest screenshots it think it looks quite good in the WP7 Emulator. Next major job is the graphics, then everything should start to fall into place. I have the map now automatically generating, and movement around the map working. I have also renamed it, and i think i have one i like now.

StartScreen3LoadGameScreen3GamePlay3

Windows Phone 7 Gaming – Part 2

This is part two in my progress report on the game I’m writing for Windows Phone 7. This week i have made a lot of background changes. I have now added Buttons, Taps (from touch panels on Windows Phone 7, and Clicks on Windows). I have added a Load Game screen. You can now also traverse all of the menus.

Next week i intend to work on the graphics (because it is very ugly at the moment) and the code which draws the landscape to make it efficient as possible. I also have some plans to add support for none rectangular buttons.

Anyway these are the screenshots so far…

StartScreen1LoadGameScreen1GamePlay2

Windows Phone 7 and Gaming

I am currently lodging out in the countryside for my summer job, and I found my ideas list and decided to work on the WP7 games I have had ideas for. So armed with my “craptastic” laptop, Visual Studio + Windows Phone 7 Dev Tools Beta i started to write my first game, which i hope will be done by the end of August/mid September in time for the Windows Phone 7 release so i can sell it on the marketplace (Students can sign-up here for the marketplace FREE).

I am just going to go through some of my experiences as a developer taking my first serious look at this platform and the problems I encountered in the last 6 hours. I would just like to say as well this is my first time using XNA.

Hello World

So i sat down and decided to setup a simple program which prints Hello World to the screen. The first problem i encountered was how to force the screen into landscape orientation. I had a look around and apparently this was not possible in the CTP and CTP-Refresh, so i decided to just use the TouchPanel.DisplayOrientation and set it to LandscapeLeft and to test if that worked in the beta.

My only other experience of writing graphics applications was term where we had to use OpenGL/C to code a little program, and it was quite horrendous work to draw text to the screen, but i was pleasantly surprised by how easy and flexible it is to draw text to the screen in XNA, although i would prefer to only load one font, and change the size, rather than loading a new font for each required text size.

Pressing F5

This is the bit where everything went a bit wrong. While the Emulator would start, i was not allowed to run any XNA applications because my graphics card was not good enough(I’m currently using a 3 year old HP 530 laptop for my main PC). After a bit of searching i found a way to disable checking of this in the emulator.

Under HKEY_Local_Machine\SOFTWARE\Microsoft\XDE create the key XNAEnableGPU (DWORD) and set it to 1.

Unfortunately my hardware really is incapable of running XNA games in the emulator and all i got was a black screen (the program was set to make the background Cornflower Blue by default). This also meant i was unable to test if the screen orientation was correct.

Option 2

Luckily is takes mere seconds to port an application to Windows or the Xbox so for now i will be developing it on Windows, and then when i either get home, or i get hold of a Windows Phone 7 device, i can just port it back across and add support for the Windows Phone 7 controls.

I learn that when you use the “Create a copy for Windows” in Visual Studio that it keeps all the code in sync across the projects for each platform, so if you have some device dependant code (think input control, mouse vs. gamepad vs. touch screen) you just have to wrap it in

#if <platform name>

code for this particular platform

#endif

Another really useful feature that i found is that you can switch graphics profiles on Windows XNA Games, between Hi Def and Reach. So as i want my application to work on WP7 straight away and my current graphics hardware is crap, i am using the Reach profile which works across all devices, while the Hi Def profile has features which only work on Windows or the Xbox.

My Game

I have then spent 3 hours getting used to programming in XNA and while these are some very rough beginnings of my game here are some screenshots of what i have started. I still have a long way to go so watch this space.

By next week i hope to have a lot more of the game play and input controls working and some nicer screenshots and as i go along i will improve the graphics and artwork as these are based on some i just found on the internet

Like all Microsoft products, WP7 has a brilliant set of development tools and i suspect they are only going to get better with time, and with all the device leaks at the moment I’m starting to get quite excited about the launch

PS. If anyone from Microsoft would like to give me / lend me a WP7 device please contact me at @lloydsparkes on Twitter

Menu Screenshot

Game Screenshot

Digital Economy Bill #debill

There has been an over reaction to the bill. I understand how some people were annoyed at:

  1. How fast it was rushed through.
  2. The number of MPs who turned up to debate it.

For the first point, i fully agree, it was rushed through when it shouldn’t have been, a number of amendments could even be debated for this reason, and there are some slight issues that were raised in the debates about the bill, and i think this is going to lead to a number of amendments to it afterwards.

The second point is not valid, that’s the average number of people who turn up to debate a bill, sometimes its even less (yes i know I’m sad, but i watch a fair bit of BBC Parliament, its interesting honest 🙂 ) and 650 people debating the bill would have been overkill, it would have been overkill if 100 people had been debating it.

Now before i go any further lets just make this clear: Piracy is wrong, it is stealing, and that most users of sites like the pirate bay, are breaking the law.

Now i have pirated stuff before, sometimes in a legitimate reason, like when I’m repairing a laptop or pc for someone, they have valid license codes, but they no longer have the disks, i have to download them, and i think that while it is technically illegal, its a fair use in my opinion.

The other things i pirate are music and TV shows, and the odd movie, now my reasoning about this:

  1. There is not an affordable, convenient, preferably DRM free service that i can access. Yes there is Spotify and iTunes, but these have their issues. iTunes and its store are not affordable. Spotify is closer, you can pay for premium features, and to have adverts but it is streaming and doesn’t work so well with portable, and multiple devices. I have seen the Zune subscription and it is closer to what i want, but its not in UK
  2. Convenience and getting what i want. As a student in the UK i cannot get access to many American channels to watch American TV shows (not to mention the time zone issues), i also cannot download them, and why should i have to wait a year or so for the DVDs or even longer for them to be aired somewhere in the UK, what i want is a service that will let me download each episode as close to when it is aired as possible, for a reasonable price (maybe £1 for a 20-30 minute episode like the Simpsons, and more for longer episodes like CSI), if i could do this, i would.
  3. Non physical mediums, i do not want to have to buy a DVD, i don’t want the trailers, adverts, the special DVD extras, or copyright warnings, i just want the film, in a format that i can transfer across my many devices which can be used without a internet connection.
    If those services described existed, i wouldn’t pirate, i wouldn’t need to pirate, now while i suspect this is true for a number of pirates i would suspects that a fair number of pirates do it because they don’t want to pay for the content.
    Now lets get onto the serious issues in the bill that its opponents pick on. There is the “Clause 18” which allows with a Court Injunction to block a website, where it is begin used to infringe on copyright. People worry that this will be abused, but it requires consideration by a court (as far as i can understand from the rewritten clause, I’m not a lawyer), and the impact on legitimate users is to be taken into account. I think this part of the bill is reasonable, if you remove the sources of the illegal material, it makes it harder for people to pirate, if you remove the opportunity less people will do it.
    The other issue is the blocking people from the internet, in a 3 strikes type of law. People say this is unfair to people who don’t know what their kids do on the internet or don’t have properly protected wifi. There are ways of blocking P2P traffic, and as long as the first notifications of an infringement, include sources of information on how to do this, and i believe by the third letter, they will face more serious penalties, like having their connection restricted or even disconnected

I think this is fair, but only if they are treated as innocent, and a court finds them guilty before the measure takes place.

So yes i have a few minor objections but overall the bill generally makes good sense in my opinion.

On a side note, i saw a number of tweets this morning saying that that democracy had not been served, but in all honest there was not enough public action about the bill in its early stages, only in its final few days, also only 19,000 emails and letters sent to MP’s is not good enough, the top petitions on the goverments website get upto 200k+ supporters.

Hopefully the above post is fairly interesting and incite full, (i apologise for any grammar / spelling mistakes that i missed)

OpenGL / Mesa3D programming in Visual Studio

Update: You will need to move the various .dll files into your project folder so they are in the path of the application, otherwise you will get missing DLL errors.

I am currently taking the Computer Graphics and Visualisation module at university and it require writing some programs in C using OpenGL / Mesa3D. Unfortunately the guides and tutorials they give on how to do it on Windows are from 1997, so i have decided to update them for 2010.

In this tutorial i am using Mesa3D 7.6.1, Visual Studio 2008. It also works with Visual Studio 2010 Beta 2.

The first step is to either download the Mesa3D Binaries from here or to compile them from source (compiling from source is pretty simple). Then extract the file somewhere sensible.

The second step is to setup a Visual Studio project so we can actually code something.

First create a new ‘Win32 Console Application’:

image

Then choose your options. I’m picking a Empty project for this, but modify the options to what ever your needs are.

image

Click finish then we, and we have our newly created project. Now we need to make a few changes, to include the additional libraries, and header files we require.

image

Open up project properties. Then under ‘Configuration Properties’->‘C/C’++->’General’ you have the ‘Additional Include Directories’ setting, open this up, and add a folder, and navigate to your Mesa3D folder and select the ‘include’ directory.

It has been noted that you need to have at least ONE .c / .cpp / .h file in your project for the C/C++ options to become available.

image

Then go back to project properties, now under ‘Configuration Properties’->‘Linker’->’General’ you have the ‘Additional Library Directories’ setting, open this up, and add a folder, and navigate to your Mesa3D folder and select the ‘lib’ directory.

image

Now you can do your coding as you like. Import code straight from your Linux projects (Use ‘Add Existing Items’) and it should compile fine if you have done everything correctly.

Anyway i hope this helps someone, if you have any comments for potential improvements or problems you are having, then please leave a comment and i will try to help out.