Latest Tweet:
  • Loading...

I just completed my first XNA project, the very "Hello World" of game programming, a PONG clone! But as Tino Didriksen points out in his post "But Can You Make Pong?", PONG is an excellent project for any incipient game programmer. A simple game like pong touches all the major aspects of any computer game, such as:

  • Game Logic: Managing different game states, such as menu, playing, pause, end screen etc.
  • Graphics: Drawing simple 2D graphics, scores, menus etc.
  • Sound: What is PONG without the *doink* when you hit walls and paddles?
  • Controller Input: Your game should work with different input mechanisms like game pad, keyboard, mouse etc.
  • Physics: Velocity in 2 dimensions, collision detection, calculating reflection angles based on what part of the paddle that hit the ball.
  • User Interface: Any game needs menus, scores, a title screen and a end screen.
  • Computer AI: Well, PONG isn't AI in the traditional meaning of the word, but making the computer fun to play isn't as easy as you might think. It shouldn't be to hard or to easy to beat the computer.
  • Two player gaming: Gaming is always more fun when you play with friends.

Tino dives a little deeper into all the aspects of PONG in his blog, and discusses why PONG an excellent game for beginner, so I won't spend more time on it in this post. I strongly suggest checking out his post.

So as I mentioned in the beginning I just completed my implementation of PONG written using the XNA framework. I wanted my PONG game to be more "complete" than some of the XNA PONG samples available online. There are some nice tutorials you might check out. One of them is a video tutorial over at LearnXNA that walks you through an implementation of Pong. Two other implementations worth checking out are Rob Loachs' XNA Pong and Tiny Tennis up on Coding4Fun.

Some of the things you might learn from my implementation of PONG is:

  • How to do simple 2D graphics in XNA
  • How to handle different game states
  • How to implement a menu system
  • How to manage different controller mechanisms, such as game pad, keyboard and Wiiremote
  • How to do both one and two player gaming

I'm not going to include too much code in this blog post, but the code is well documented and should be a usable sample for XNA beginners. One of the "cooler" things in the sample is how I handle different input mechanisms. I've abstracted away the different controllers by creating an interface that the different classes handling the different controllers implement. So when the game starts I create an instance of the InputPC class, which tries to create an instance of all available controllers, and adds them to a prioritized list. I then iterates over the list and assign the best available controller to player1 and player2.

To handle cross platform support I've simply created a Xbox 360 project and linked in most of the files. There are only three classes that differ between the 360 and the Windows version of the game.

Another funny feature of the game is the "Pong Clock". When in the main menu the computer will play in the background, and the score will show the time. The left side loose once a minute, the right side will loose once an hour.

  

WiiMote
Robs post about his flock of butterflies flying around in XNA controlled with the WiiMote inspired me to pick up a WiiMote and play with it my self. As Rob mentions in the blog the hard part is not programming against the device, but getting it connected to the PC. The remote is quite picky about Bluetooth devices and stacks, and I spent quite a few hours to get this working. I tried using both my internal Bluetooth chip (IBM ThinkPad T43p) and an external Billionton Dongle. I also tried all kinds of Bluetooth stacks, including the Vista default one, the IBM drivers, the latest version of the Widcomm stack. I finally got it working using the Billionton external dongle and the Toshiba Bluetooth stack. Rob also had to use the Toshiba stack, so looks like they have a decent Vista implementation, so if you have problems connecting the WiiMote on Vista they might be worth checking out… For more information about the WiiMote and how to get it connected check out the WiiBrew Wiki.

The actual integration of the WiiMote in the game was fairly simple. To communicate with the WiiMote I used a managed API implemented posted up on Coding4Fun on MSDN. I created a new class that implemented the IPongInput interface, and use the buttons to navigate the game UI. To handle the actual game play I read the value for the Y axis from the accelerometer. The WiiMote spits out values from -1 to 1, and I simply check if the value is more than 0.05 or less than -0.05 to detect if the player is moving the paddle up or down. I also create a "effect" parameter to calculate the Y-speed of the paddle.

So if you hold the WiiMote at a steep angle you'll get more speed on the paddle. After some tweaking it turned out really nice!

Downloading and playing the game
I've included the compiled Windows version of the game, a XNA Creators Club compiled package of the 360 version, and the full source code of both versions. To play the game on your Windows computer you need the XNA runtime. The game is written using the recently released XNA refresh, so if you haven't downloaded it you need to do that first. To play the 360 version of the game you need a "XNA Creators Club Subscription" and XNA installed on your computer. To deploy the game to the 360 simply double click the "package" to start the deployment process.

The game is licensed under the BSD license, so you're free to do what ever you want with the code. Have fun go mad!

As I mentioned earlier today the Xbox 360 Wireless Gaming Receiver for Windows XP and Windows Vista is available in Norway as of today. This 199,- NOK (29.99$) device lets you connect up to four Xbox 360 wireless controllers and a racing wheel to your PC wirelessly. It's basically a small USB dongle, like the once you're used to from your wireless mouse/keyboard.

The device ships with XP drivers on the CD, but my fellow RD Scott Hanselman has Vista installation all covered in his blog.

Installation and connecting the devices was a walk in the park. To test the controllers out I installed PJ64 Nintendo 64 emulator on the Media Center computer. The emulator runs at approx 45 frames per second, which is good. I didn't get it to run in full screen, so any tip on this is appreciated. I think this is a general problem with "old" DirectX/OpenGL apps on Vista. Configuring the controllers was no problem, since they show up as "standard" game controllers in Windows. I've uploaded my controller configuration scheme, so if you have a 360 controller and PJ64 you can grab my config.

For any PC gamer this device is a great value add, specially since the "Games for Windows" branding requires gamepad support in their games (as well as some other stuff like a Vista Performance Index requirement, and launch from Media Center).

>

The Xbox 360 HD-DVD drive is finally available in Norway! When I was in London in January I dropped by all the gaming stores trying to get my hands on the Xbox 360 HD-DVD drive. With no luck, they where all constantly out of stock.

The drive is officially releasing in Norway tomorrow, however some online stores have had them in stock a few days already. I pre-ordered mine a few weeks ago, and it arrived today! I've all ready hooked it up to the 360, and it works PERFECTLY! The pricing in Norway is between 1799,- and 1999,- NOK. I got mine at 1699,- since I pre-ordered.

A pleasant surprise was the fact that it was up scaling my regular DVDs over component! By default the 360 is capable of up scaling your DVDs, but if you don't have the HD-DRIVE you need the VGA cable. The reason is some DVD "rules" saying that you can't upscale via analog cable. How ever, a PC is allowed to upscale over VGA, so if you have the 360 VGA cable you get 720P up scaling of your DVDs. With the HD-DVD drive you don't the VGA cable! (In general the component cable gives a better picture and better colors than the VGA cable).

I only got one HD-DVD move at the moment: The Fast and the Furious Tokyo Drift. I ordered the movie because of a review in Gizmodo, saying this was an excellent HD-DVD showcasing some of the new interactive features of the format. I've also ordered a few more movies on PlayX.no, which has a decent library available for 199,- NOK. Hopefully they will be arriving before the weekend.

In other news the Xbox 360 wireless USB connector is also available in Norway. This little, cheap, dongle allows you to connect all wireless 360 accessories to your computer. I'll write a post later on my impression of this device.

wiiiiiiiiiiiiiiiiiiiiii love wiiiiiiiiiiiiiiiiiiiJust a quick birthday post… Today I turned 23, and it's been a great birthday! I started the day with the final exam in the "algorithms and data structures" course, which Håvard blogged about earlier this week. Out of 114 students who took the course last year only 14 passed… But, thankfully this years final examn wasn't that bad, and I expect to get a decent grade.

To night I've had some of my buddies over for chocolate cake, candy, snacks and some Wii gaming. Petter pre-ordered the Wii, so he got his copy today (on the Norwegian launch day). We've been playing all the Wii sports games, which is a ton of fun. Pictures and video says more than word, so check out these Flickr! pictures and Youtube videos!

 

Anyone interested in next generation gaming should check out the excellent blog post titled "Could Microsoft Become the Marked Leader This Generation?". The post is written by Sam Kennedy, editor of 1UP. The article discuss why Sony is going to have some big trouble gaining the same marked share for their PS3 as the did for their PS2. The comment thread of the post is long, but contains several interesting points of view, and all most no trash talk. It's a good read.

This pretty much sums up the impression most people had after this years E3:

..I've been saying this since last year's E3, but after all the flack Sony got for showing a CG rendered video of Killzone all they would need to do was show us that same demo running in realtime a year later and we would have all been convinced of the power of the PS3. Heck, that's probably all they would have needed to show us…

 Another interesting read is 1UP editor John Davidsons post about “eating his kid’s puma’s” after stating that the PSP was going to be the biggest thing ever. The article discuesses what Sony did wrong, and why the DS is superiour in both sales and games. I’m a PSP owner my self, and i really agree that they have huge issues with few good games and too many PS2 ports. The only truly great games i currently own is Dexter and Lumines. I do have GTA, but I mostly use it to load up homebreew and SNES/NES emulator godness. I’m picking up Loco Roco, which looks really promissing, on my way to the airport later today. Going to Denmark this weekend for the Roskilde festival!

Xbox360netThe Game Developers Conference 2006 finished a couple of days ago, so some of you might have heard about this already. Microsoft announced a couple of interesting news at the GDC, among then XNA Studio, XNA Framework and XNA Build.

XNA Studio is a customized version of Visual Studio 2005 Team System aimed at game studios. It helps game studios manage the development process and “content pipeline” (getting all the sound, graphics, models, textures etc into the game).

XNA Build is a tool helping the studios to streamline the software build process, kinda Msbuild on steroids.

How ever, the most interesting announcement was the XNA Framework. This is a custom implementation of the .NET Framework that runs both on the PC and the Xbox 360. The framework contains a set of class libraries to help developers build games faster (and cheaper). By leveraging the XNA Framework cross platform development also become much easier. Basically what this mean is that you can write Xbox 360 games in C#. How cool is that?!  By making Xbox 360 game development accessible for smaller game publisher we’ll hopefully see more innovation and cool games coming out. This combined with the Xbox Live Marketplace distribution model opens up lots of new business opportunities for smaller game developers. Now we just have to hope that the rumors about 100$ Xbox 360 debug units are true… The XNA is available for download as a CTP.

Here are some of the information from the press conference where XNA was announced:

"We've been writing games for the last 15 years as monolithic, single-code bases that are growing unwieldy and complex," says Chris Butcher, lead developer at Bungie Studios. "C# on Xbox 360 lets us think about new modes of programming. It lets us get back to creating a game rather than wresting with code, while maintaining the real-time performance that we need."

Read the whole story over at Xbox.com.

SBGDevShowcaseEver since the Xbox 360 launch in December various third party community web sites accessing and tweaking the publicly available Gamer Card data have been available. Most of these sites have used screen scrapping to access the Gamer Card information available on the HTML site intended to integrate on your blog. I’ve previously blogged about MyGamerCard.net, which is an excellent community site that lets you create custom gamer card pictures you can use on your blog, as well as provide achievement leader boards.

The Xbox team has obviously taken this community interest in game statistics seriously, and has started something called the “Xbox Community Developer Program”. You can apply to become a member of this program to get access to a private forum on xbox.com, as well as a private XML feed with all the Gamer Card information, as well as a list of previously played games. This is way easier and faster than using screen scrapping to retrieve this information.

I applied by sending some reference projects and information about my self, and got approved to become a member of the program. You can get more information about the program, what you get and how to apply by clicking here. They also have a Xbox Community Developer Program showcase site, where you can check out what other people are using the feed for.

A few weeks ago I wrote a blog post about the Xbox 360 Gamertag Creator. This is a third party site that generates themed pictures out of your gamer card information. This week I came across another similar service called MyGamerCard.net. Now, the cool thing about this one is that it logs all the data it grabs off xbox.com. So, based on this data they create leader boards based on your gamer score. The guy in lead, ST TheKing, currently have 19415 gamer points, which is a lot (considering each game gives you 1000 points at most, and there weren’t that many launch titles available).  My current gamer score is 3100, almost 400 behind my good friend Petter (GameMe). Hopefully I’ll catch up with him during the weekend.

One of the cool things about the new Xbox Live system is the gamer cards. Basically the gamer card is a small badge with your gamer tag, your online reputation, a picture, your latest played games, and last but not least; your gamer score. Your gamer score increases as you unlock achievements in different games. Each full blown title has 1000 gamer points to give out, while the Xbox Live Arcade games have 200 points. Currently I’ve only completed one game – Need for Speed Underground. I and my girl friend also completed the single player story in Kameo, but we still have 400 gamer points to fight for.

When you play against people on Xbox Live they can view your gamer card and give you feedback (preferred/non preferred player), and that will affect your reputation. You can also show off your gamer card by embedding it to your homepage. This is done by embedding an iframe on your page displaying the following URL: http://gamercard.xbox.com/SnowJoy.card

One disadvantage using iframes is that it’s not compatible on all browsers and most online forums won’t allow such html in your posts. How ever, most forums allow you to use images in your posts, so today I came across a simple service called “Gamertag Generator”. Basically this service is a bunch of custom image generators reading information from gamercard.xbox.com and rendering it out as an image, using different themes. I’ve included all the available looks for your gamer tag in the bottom of this post. This is a great idea, and I was actually thinking about writing this my self for my custom blog theme. Now I can see how the different look available on “Gamertag Creator” fits on my new design (soon to be published) before I write my own. I might actually write if anyhow as an example on how to do screen scrapping and publish the article up on msstudent.no.

Default Slim Xbox Forum Hawaii Minimal Black Team Xbox Bungie

Abeo game night

Posted in:  | 

Friday night we had the first (and definitely not last) Abeo game night. About 20 people showed up and we had a great time. 4 Xbox 360 connected in a LAN, pizza, beer and snacks… What more can a geek ask for? Oh, almost forgot, flipper! Some of my co-workers at Abeo have bought an awesome Simpson pinball machine and placed in the office. This was actually the first time I had a change to really play it. I scored 21 million, only 90 millions less than the high score…

We had some semi official tournaments playing PGR and Fifa 2006 on the Xbox 360 and Enemy Territory on the PC. The idea is to have a sport contest, a racing contest and a shooting contest with a traveling trophy in each category. If you win the goblet three times it’s yours to keep.

I didn’t get a tap in on any of the goblets. Gøran won the Fifa championship, Ståle won the racing contest and Roland won the shooting game. I’ve uploaded some pictures from the event to my Flickr page.

 Gøran, Fifa champion  Ståle, PGR3 Champion  Roland, Enemy Territory champion

Looking forward to next time!

Christmas sure came early this year. Yesterday i got my 60gb black iPod video, and today the long await Xbox 360 finally arrived! The two first games i bought where Perfect Dark and Kameo. Perfect Dark was okey, haven't tried multi player yet. Kameo was really impressive!

I barely had time to play with my iPod, but I’ve subscribed to a couple of video podcasts, and the quality of the screen is excellent!

IMG_4141

 

Call Of Dutie 2

<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910