CodeStock 2008 XNA
By CSharpner · August 9, 2008
Today (August 9th, 2008) was the 1st annual CodeStock convention. For a rundown of the events, click here. By far, the coolest event was the one on XNA... Microsoft's free game development SDK for Windows, XBox 360, and Zune (yah, Zune... for all 4 of you that have one). It was presented by Chris Williams from Magenic. Chris definitely looks the part of a game developer... young guy, goti (?SP?), bald head, heavily tattooed, and a true hacker (and one of the 4 Zune owners)... well, almost a true hacker. I had to revoke that label when he started promoting VB ;)I've been following (I use the term loosely) the development of the XNA platform since it came out over a year or so ago... don't recall exactly when it came out now. I've been intending to get into it, but it's hard for me to justify my time on writing games when I've got a list of things that need to get done that's a mile long. Now that my 8 year old son is interested in it (being a HUGE XBox gamer himself), this may be a good excuse for me to dive into it. My short and limited exposure to it tells me it looks like it'll be exceptionally easy to write a game with this platform. It's essentially a new class library that sits on top of the .NET framework. You write your game once and with little or no modification, it can work on Windows, XBox 360, and Zune (and potentially other platforms in the future... like Linux with Mono??).
XNA games utilize your hardware GPU (if you have one), otherwise, software rendering is performed.
Anyway, here's my quick and dirty note taking during Chris' presentation (which, turns out to be my largest set of notes I took during all of CodeStock).
- Use XNA to develop games for:
- Windows
- XBox 360
- Zune (3.0 XNA SDK needed)
- 2D and 3D graphics supported.
- Works with any Visual Studio SKU (Update 2008-12-17: for XNA 2.0, but XNA 3.0 requires any Visual Studio 2008 SKU).
- http://creators.xna.com/resources/essentials.aspx
- XNA Game Studio 2.0 - Needed if you're not using Visual Studio 2008.
- Current version is 3.0 CTP (pre-beta). (Update 2008-12-17: 3.0 has been RTM for several months now)
- Supports Visual Studio 2008.
- www.microsoft.com/express/download
- Drivers for wired XBox controller (driver not needed if using Vista)
- Download here.
- Samples & Start kits:
- "Game Loop"
- XNA games have a "game loop" that continuously runs. Each iteration calls your code for updating object positions and drawing.
- LoadGraphicsContent()
- load sound, images, from folder.
- makes objects out of them.
- Update()
- Called by framework, you handle.
- You check state, update, then call Draw()
- Draw()
- You read state and draw your scene for that time slice.
- 2D objects.
- Sprite batch
- Bundles up multiple sprites to send to the GPU for one quick render.
- There's a start, a bundling, and an end.
- Content Manager
- Manages life of objects (sprites, sounds, images, etc...)
- Game Time
- Important concept. Provides timing information for:
- how many milliseconds since last update, etc...
- helps games run the same on different speed hardware.
- Important concept. Provides timing information for:
- Content Pipeline
- Processes art assets at build time.
- Creates names for assets to use in code.
- Uses content subproject in your game.
- Sprites
- There's no "sprite" class, but there is a Texture2D class.
- example: Ball.BallTexture = content.Load
... (didn't have time to write down the whole line) - Update 2008-12-17: Ball.BallTexture = content.Load
("Ball");
- example: Ball.BallTexture = content.Load
- Shaders (.x files) - information to send to GPU.
- HLSL (High Level Shader Language)... not available on Zune (Zune has no GPU).
- GPU effects.
- There's no intellisense for this.
- HLSL (High Level Shader Language)... not available on Zune (Zune has no GPU).
- Purple ($FF00FF) is transparent, unless your sprite files are in a format that supports transparency (alpha channels are supported!!!) (Update 2008-12-17: PNG and JPG images with transparancy work wonderfully! No need for purple.)
- Background image (in 2D games) is considered a sprite.
- Vector2 (point?)
- Origin is 0,0
- When a sprite is rotated, it's rotated around the origin.
- When scaling a sprite, the origin doesn't scale with the image.
- There's no "sprite" class, but there is a Texture2D class.
- Sprite batch
- GamePad object/class is the controller.
- Sounds
- XACT is a tool in XNA 2.0 & 3.0. BTW, no XBox 360 support in XNA 3.0 (will be in final release... they just don't do it until final release because of complex restrictions/paperwork to get it certified). (Update 2008-12-17: 3.0 has been RTM for several months now. You can currently run your game on XBox 360 after a $99 fee.)
- XACT is a GUI app.
- Can create banks of sounds (.XSB files).
- Zune doesn't support XACT, so use the Audio API.
- XACT is a tool in XNA 2.0 & 3.0. BTW, no XBox 360 support in XNA 3.0 (will be in final release... they just don't do it until final release because of complex restrictions/paperwork to get it certified). (Update 2008-12-17: 3.0 has been RTM for several months now. You can currently run your game on XBox 360 after a $99 fee.)
- Development
- You can step through your code, directly into the XBox 360.
- XBox 360 uses a modified version of the compact framework.
- To put your own games on your own XBox, you must subscribe to the $99/year ($50/3 months) service.
- With this service, you can also publish your games for peer review and eventually sell them on XBox Live for REAL money. M$ keeps about 1/2. (Update 2008-12-17: You keep 70%!!!)
- With $99 sub, you get TorqueX framework... normally $150 or so just by itself. Apparently you get lots of cool stuff for game dev with TorqueX.
- Zune
- Screen res = 320x240
- No shaders
- No GPU
- No XACT
- WiFi support
- No emulator available - must deploy to Zune during development
- 16MB max for game.
- no data transfer to PC (to prevent copying MP3s... stupid DRM crapola)
- XNA community games
- Make an installer, then enter "rating" information, then publish.
- Peers review your game, then pass (or fail) for whether it works, not whether they like it.
- You get paid when people buy through XBox Live. You keep 70%.
- Game size determines sell price (yah, I know... really poor formula... I can add 20MB of random data too!) (Update 2008-12-17: You set your price. If your game size is too big, there's a MINIMUM amount you're allowed to charge. You can charge more though.)
- I need to find the creators club web site... sounds like cool stuff on there. (Update 2008-12-17: http://creators.xna.com)
- There's a really nice racing demo game on there.
- (Update 2008-12-17 http://creators.xna.com)
- Starter kit content is all free to use in your own games.
- Takes about 45 minutes to compile and deploy to XBox 360 on the first compile.
- Text in games
- No font system... must make text sprites in content folder.
- Resources
- http://msdn.microsoft.com/en-us/xna/default.aspx
- xnadevelopment.com
- ziggyware.com
- creators.xna.com
- thezbuffer.com
- blogs.msdn.com/shawnhar
- blogs.msdn.com/xna
- ILoveVB.net/web/blogs/vbxma (if you really want to punish yourself). I wouldn't have posted this link, but it's Chris' own blog, so he deserves his link here.
- twincitiesxnausersgroup.com
- igda.org/wiki/index.php/igm (what's up with PHP on this site???)
If you're interested in attending CodeStock 2009, contact http://codestock.org/.