August 30, 2006

[XNA] VB Template For XNA Application

Here's a simple template you can use after installing XNA Game Studio Express Edition so you can start coding your XNA apps in VB 2005.

1) Create an empty VB 2005 project.
2) Add references to Microsoft.Xna.Framework and Microsoft.Xna.Framework.Game. Both should be in the GAC.
3) Add a module named Program.vb.

Code:
Module Program

Sub Main()
Using game As New Game
game.Run()
End Using
End Sub

End Module
4) Add a class named Game.vb.

Code:
Imports Microsoft.Xna.Framework
Imports Microsoft.Xna.Framework.Audio
Imports Microsoft.Xna.Framework.Components
Imports Microsoft.Xna.Framework.Graphics
Imports Microsoft.Xna.Framework.Input
Imports Microsoft.Xna.Framework.Storage

Public Class Game
Inherits Microsoft.Xna.Framework.Game

Dim graphics As Components.GraphicsComponent

Private Sub InitializeComponent()
graphics = New Components.GraphicsComponent
GameComponents.Add(graphics)
End Sub

Public Sub New()
InitializeComponent()
End Sub

Protected Overrides Sub Update()
' The time since Update was called last
Dim elapsed As Double = ElapsedTime.TotalSeconds
' TODO: Add your game logic here
' Let the GameComponents update
UpdateComponents()
End Sub

Protected Overrides Sub Draw()
If Not graphics.EnsureDevice Then Return

graphics.GraphicsDevice.Clear(Color.CornflowerBlue)
graphics.GraphicsDevice.BeginScene()

' TODO: Add your drawing code here

' Let the GameComponents draw
DrawComponents()

graphics.GraphicsDevice.EndScene()
graphics.GraphicsDevice.Present()
End Sub
End Class


There. You now have a functioning XNA game skeleton.

[XNA] XNA GSEE Released, or 640 posts...

XNA Game Studio Express Edition (beta) released. You know you want to download it. You know you want to touch...

Also, this is post #640. As a reference to Bill Gates' infamous (false) quote, "640 posts ought to be enough for anybody." Well, I'm still going to be posting, so I guess it isn't.

[Personal] Vista Pre-RC1

With the imminent release of XNA Studio Express Edition, I decided that I'd rather mess with it at work and installed Windows Vista Pre-RC1 on my home machine last night.

Aside from it not detecting my Audigy 2 ZS out of the .ISO and a goofy video driver crash when playing a 720x480 WMV9 video over the network, it's been rock stable and fairly performant. Most GDI and GDI+ apps are performing better than they do on XP. Game testing starts tonight.

Task switching is pretty nifty as well...

I'm running 32-bit right now, but plan on installing 64-bit when Vista hits RC1.

August 28, 2006

[Query] Virtual PC on x64

Out of curiosity, is anyone running Microsoft Virtual PC 2004 on Windows XP Professional 64-bit Edition?

I'm considering nuking my current Windows XP Media Center Edition install on my home rig and installing XP-x64.

August 25, 2006

[XNA] Rico Speaks

Rico Mariani is one of the performance gods over at Microsoft. He posted his notes from his speech at GameFest on the GC used for the Xbox 360 version of the XNA Framework. The notes worry me a bit, but depending on how the framework is set up, it may not be that big of a deal. Still going to get ideal performance from the desktop GC, but the GC on the Xbox 360 side is going to require a lot of tuning...

August 24, 2006

[Console] Small Print Follow-Up

Wow, it isn't often that you get to do a real follow-up in the same day, but the opportunity presented itself over at blog of Ozymandias, who was nice enough to post screenshots of the boardgames that are coming to Xbox Live Arcade.

Let's see how well these games follow the readability rules from the last post.

"Alhambra" looks pretty good. The numbers on the cards and tiles are nice and large, as are the numbers by the avatars at the top. The only cause for concern would be the smaller numbers on the tiles on the left. The 9, 7 and 4 are nearly blurred out of existence.

"Carcassonne" has a significant amount of small text. While legends like "Next Tile" aren't that big of a deal, look at the stats by the avatars. The green player's stats are nearly invisible, and most of those numbers will be hard to read on an SDTV. Plus, it's hard to make out where the pieces have been placed due to color blending. (The only way you can see the yellow piece on the far right tile is because of the shadow, and even that won't help on an SDTV.)

"Settlers of Catan" is a mixture of good and bad. The massive tiles and pieces are going to be great regardless of your TV, but the command icons blend together and the names under the avatars are so small they may as well not even be there. For the second shot, I can't tell which player is selected: red because of the halo, or blue because of the blue X underneath him. I'm going to assume red because of the subtle "give" arrow shift. The command legend is fairly small, but given the amount of empty space on the screen, having it that small doesn't make a lot of sense. Also, the numbers on top of the cards (the 4 on the sheep for example) blend badly. (Update 4:39p: I'll say that the numbers blend. That 4 on the sheep that I saw was really a 1, and I couldn't tell until I blew the picture up to 1280x720.)

So, if you were making these games, which changes would you make to enhance the 10' experience?

(Update 4:39p: Added comment, corrected spelling error.)

[Console] HDTV Madness

Well, I spent some time playing "Texas Hold'em" last night on my TV at home...my standard definition TV. I still haven't picked up "Dead Rising" yet, but I'm fairly certain that based on what I saw, I now understand the issues that those players were facing in that most of the actual in-game text is almost illegible on a standard definition TV.

Menus are appropriately sized and even most of the pop-ups are legible, but the actual text in-game for items like commands, status, etc., are near impossible to read. What's even worse is that there are times where it is difficult to tell the difference between a club and a spade, and in poker, that can be lethal.

I hear the common defense of "We're optimizing to HDTV's" and I don't buy it. HDTV penetration is increasing, but most of the screens that are being sold are in the 20-25" range...meaning that the TV isn't going to be that much larger than a current TV screen. Sure, the text may look nice and crisp, but if it can't be read from 10 feet away, what good is it? The 10' experience must drive your artistic decisions with console games. That's generally going to mean that any text you are relying on the end user reading should be no smaller than 24 pixels tall if you are rendering to a 1280x720 framebuffer, and fonts should not be "narrow" fonts where possible because of how narrow fonts blur out on a regular TV.

The fonts in "Texas Hold'em" are 16 pixels tall, and appear to use Arial Narrow. The mission prompt glyphs (under the selected weapon icon) in Dead Rising range between 8 and 13 pixels tall. While they're outlined so make them slightly more visible, that's still too damn small.

To give you an idea, the "Number of Zombies Killed" text in the bottom-right corner of the screen is 22 pixels tall, but the font is a nice bold font with vertical strokes about 6 pixels across. And you know what? You can read it. What a novel concept.

If you want a "rough idea" of how your game is going to look on an SDTV, but don't have an SDTV handy, here's how to do it.

Load up your game and take a screenshot. Open up your favorite image editing software, and proportionally resize the screenshot to a width of 512 pixels. Save the screenshot as a JPEG. Here is an example from "Dead Rising" (screenshot from TeamXbox):

Dead Rising Screenshot

Finally, show it to someone else. If they can't easily read the text, it's too damn small or blends too easily. It's very difficult to read the "Backup for Brad" string in the upper right of the screenshot.

August 23, 2006

[Japanese] Umin Chu (Unimportant)

Does "umin chu" (men of the sea) have the same or similar double-entendre meaning in Japanese that "seaman" has in English?

(There's a potentially off-color joke that I'm trying to understand.)

[XNA] Jad Engine

If you want to start messing around with a managed game engine before the beta release of XNA Game Studio Express Edition next week, check out Jad Engine.

I spent the better part of yesterday messing around with it, and I was impressed with the performance of this engine, as well as the featureset. Now, the engine is LGPL, so keep that in mind if you're planning on making a release, but it's a great starting point to see how powerful managed code can be.

August 22, 2006

[XNA] Hosting

I've been contemplating providing AdSense-supported hosting for XNA projects starting in September.

The only restrictions I can see right now would be under 50Mb total (in keeping with the Arcade MU ideal), nothing pornographic, no "borrowed" content from commercial titles, and your project pages would have to have a Google AdSense banner (like I have at the top of my page) at the top of the page.

Would there be any interest in this? If so, please leave a comment on this post so I can gauge interest.

August 20, 2006

[Humor] Extreme Geek

It's sad when your friends send you geek tests and wager money that you'll score higher than any of them.

It's even more sad when they're right...

The Test: http://www.innergeek.us/geek-test.html

My Score (without cheating): 56.01578% - Extreme Geek

Thanks to Kevin #1 (for the E-mail) and Kevin #2 (for pointing it out to Kevin #1).

August 18, 2006

[Review] "Snakes on a Plane" (2006)

Ladies and gentlemen, I give to you the successor to the "Rocky Horror" throne. The cult movie for the next thirty years..."Snakes on a Plane."

The theater I saw it in tonight was about a third full. Most people at this particular theater wanted to watch "World Trade Center" or "Talladega Nights" instead of this wonderful B-movie.

Now don't get me wrong...this is a B-movie in the truest sense, but it embraces what it is rather than fights it, and with that, it rises above mere B-moviehood.

The director knows when to break the rules. He broke the "never interrupt the motivational speech" rule back in "Deep Blue Sea." In this one, he broke the "never really put the kids at risk" rule and the "never mess with the whacked out clean freak" rule, both to great effect. He also knows when to use humor. Every single snake death or plane death cliche that he could possibly use ends up on screen in all of its gory glory.

And there is gore...lots of it. This is not a movie for children by any stretch of the imagination. My wife, a woman who was weaned on horror flicks since birth, actually left the theater ill for five minutes because the combination of her fear of flying, her fear of snakes, and a scene involving an infant and a rattlesnake got the better of her. You will see snakes everywhere in this movie. Snakes on a breast. Snakes up a dress. Snakes in a toilet. Snakes in a tank. Snakes in a light. There's one point about thirty minutes in where every single man in the audience will...well...I better leave you to figure that one out for yourself.

This is a crowd movie. It's a good movie in its own right, but the crowd can really make or break this film. The audience applauded the opening credits, applauded SLJ's first appearance, applauded the snakes, applauded "the line," and even sang along to Cobra Starship's "Bring It."

This was a movie for the crowd. If you're going to see it, see it this weekend in the evening...because you'll never get the chance to experience it like this again until they start swapping out "Rocky Horror" nights for "Snakes" nights.

Note: After the "Bring It" video ends, there's nothing left at the end of the credits, so go ahead and leave so the cleanup crew can get to work.

[Humor] 99% Fixed

IGN almost has it completely fixed...

3D Realms everywhere but the headline...

(You can see the previous version of the story here.)

[XNA] Positives About Custom .NET Version

Now I want to go over some potential positives of having a custom version of the .NET Framework available on the Xbox 360.

1. TCR compliance at the execution level.

I don't know how many of you have ever worked on a console title, but it can be a real pain in the ass. You have to make sure that you don't write to forbidden areas of memory, you have to use the proper library versions, you have to use the correct compiler, you have to make sure you don't ship with anything looking for certain forbidden paths that are actually okay to use during development and debugging...lots of major pains in the ass.

Using the .NET Framework, as long as you try to avoid allowing unsafe calls, you can actually enforce most code-side TCR requirements at the framework level. Code trying to open forbidden path Q? Throw an exception. Code trying to jump to forbidden address X? Throw an exception. The ability to stop code at the execution level is critical if they want to maintain security of the console.

2. Get people into the proper frame of mind for developing in a Least-User Access model.

Now initially, it sounds like XNA apps are going to require the hard disk. If so, one can make the assumption that there are going to be four folders exposed to an XNA app: their installation folder, the title folder, the user folder and the scratch folder.

The installation folder will most likely be read-only, and will consist of the files necessary to run the game. Writes to this folder by the XNA app will most likely be verboten. The title folder is meant for shared access between all users on the console. Things like shared high score lists and shared content updates would go here. The user folder is meant for user settings and saved games. The scratch folder is meant for temp files.

This mirrors the way that games should be written for Windows Vista and even XP. Files installed to Program Files are supposed to be read-only for security reasons. Shared content between users should be dropped into a subfolder of the CSIDL_COMMON_APPDATA or CSIDL_COMMON_DOCUMENTS folder. Files unique to a user should go into a subfolder of either CSIDL_LOCAL_APPDATA or CSIDL_PERSONAL. And scratch data should ideally be in a folder created using the GetTempPath() Win32 API call, or using the System.IO.Path.GetTempFileName() .NET function, along with setting the file attribute to include FileAttributes.Temporary to improve performance. (It's actually kind of nifty...look it up.)

3. Customized performance for the hardware.

This is the big one. Right now, garbage collection responsibility is only split between cores on a multicore box if the server GC is installed. With a custom framework version, not only can they eliminate the need to redist the workstation GC, but they can also hardcode in the number of cores, assigned memory regions, etc. to speed performance.

Instead of having to worry about the proper processor optimizations for the JIT, they can focus on a single platform with a static memory configuration.

For the XNA Creator's Club subscribers, a GAC makes lots of sense (try to save HD space), but it can lead to potential security holes in XNA apps they want to ship to the world, so they can nuke the concept of a GAC and just require that all signed XNA apps either ship with the proper framework and library versions or just merge them all together using ILMerge.

Now again, there's a lot of supposition going here, but I'm trying to give Microsoft the benefit of the doubt. No doubt they've thought of a lot of this already.

(Update: 8/21, 8:53a: Fixed a couple of typos.)

[Humor] Animator vs. Animation

I've been staring at the same block of code for nearly three hours, and I swear that the problem I'm hunting for is actively hiding.

However, at least it isn't fighting back.

[Humor] Internet Gaming Forum Drinking Game

The following is based on my experiences in various and sundry Internet forums, and should not be attempted by anyone. Chances are that if you actually tried this drinking game, you'd suffer liver damage before you finished your first page of comments. I'll be updating this through the weekend with additional items, as well as adding in any good suggestions from the comments area.


Aliases

Sip each time you see an alias based on a videogame character.
Sip each time you see an alias that uses "l33tspeek."
Sip each time you see an alias based on anatomy.
Sip each time you see someone's alias mistyped.
Chug each time you see someone get upset that their alias was mistyped.
Down it each time you see someone use their real name as an alias.

Games

Sip each time you read a comment proclaiming that game X is going to revolutionize the industry.
Sip each time you read that game X wasn't anywhere near as good as they thought it was going to be.
Sip each time that someone says that the excitement over a game is making them hate that game prematurely.
Sip each time that someone uses an incorrect or out-of-date piece of information to make their case about a game.
Sip each time that someone complains about a game's price.
Sip each time that someone complains about a game's length (too short or too long).
Sip each time that someone complains about a game's ending.
Sip each time that someone asks for cheat codes.
Sip each time that someone forgets to use a "spoiler" tag or warning on a game that was released in the last 12 months.
Sip every time you see a post from someone complaining about a game that they admit they haven't played.
Sip each time that it is announced that a game is slipping.
Chug each time that someone complains that someone forgot to use a "spoiler" tag on a game that's been out for over a year.
Chug each time that someone complains that free content released after a game ships should have been included at launch.
Chug each time a game is released on time.
Down it each time a game is released earlier than expected.

Games Industry

Sip each time that someone shows a complete and utter lack of knowledge about the inner workings of the game industry.
Sip each time someone who works in the industry makes a well thought-out reply, only to have a dozen unemployed net jockeys say that they're wrong because of some misconceptions about economic theory.
Sip each time someone complains about any form of copy protection.

Multiplayer

Sip each time someone complains that there aren't enough people playing game X online.
Sip each time that someone complains about all of the idiots who play game X online.
Sip each time that someone says they were banned from a server for cheating, but they don't cheat, they just have "l33t skillz."
Sip each time that someone complains about anti-cheat software.
Sip each time that someone puts up a server for an old game.
Sip each time that someone complains about said server for not having mod X installed.
Sip each time that someone asks for a CD-key.
Chug each time that someone is given a CD-key that they asked for.
Chug each time that someone says they were banned from a server for cheating, and admit to cheating.
Down it everytime someone makes a post commending their fellow players for a game well played.

Miscellaneous

Sip every time someone makes a forum in-joke. ("Is this the patch that makes the game fun?" for Blue's News; "* I N S E R T S O M E T H I N G H E R E ' D *" at ShackNews; etc.)
Sip every time an argument breaks out over something dumb, like the cup-size reduction for Lara Croft in "Tomb Raider: Legend."
Chug every time the argument is resparked.
Down it every time the argument is resolved to everyone's satisfaction.
Sip every time someone is called an idiot.
Chug every time someone's ancestry is insulted.
Down it every time someone has something respectful said of them.
Sip every time you see a sentence with at least two typos.
Chug every time you see a post with no typos.
Down it every time you see a post that would make an English teacher smile.
Sip every time a dedicated post is made for off-topic chat.
Sip every time that off-topic chat creeps into on-topic threads.
Sip every time you see "FTW" or "FTL" in a post. ("FTW"="For the win," a reference to Hollywood Squares. "FTL"="For the lose," the opposite.)
Sip every time you see someone type "loose" when they mean "lose."
Chug every time you see a post that has no vowels in it.
Chug every time you see a post that contains only a hyperlink to the previous discussion on this same topic.
Sip every time you see a post that isn't safe for work.
Chug every time you see a post that not only isn't safe for work, but is misleadingly named. (i.e. JessicaSlumberParty at ShackNews.)
Down it every time someone links to something that you really want to blot out of your memory. (See previous bulletpoint.)
Sip every time you see a post from someone who seems to be wearing a tinfoil hat.
Sip every time you see a post from someone who makes a doomsday prediction based on a single datapoint.

August 17, 2006

[XNA] Microsoft.VisualBasic Namespace

Right now, it's looking like C# is going to be the supported language for XNA.

Now, I can't say that I'm happy about that. One of the major reasons for the .NET Framework was to make all languages first-class citizens. C#'s ability to use unsafe code shouldn't give it preferential treatment for gaming.

That said, there's a high likelihood that we'll be able to hack a way to use VB 2005, provided we don't link in the Microsoft.VisualBasic namespace, and I'm actually okay with that. Why? Two reasons. First, most of what is in the namespace is old helper functions that are duplicated in the .NET Framework already. Second, I'm fine with working within the System namespace structure.

I don't need to use Len(str) when I can use str.Length() instead. I don't need Trim(str) when I can use str.Trim(). The only thing that most of the VB helper functions in the Microsoft.VisualBasic namespace buys us is an extra level of error checking by checking for strings and other objects being equal to Nothing. No offense, but if something is set to Nothing inside the game and we didn't set it to Nothing, something is definitely wrong to begin with and we need to be trying to find the root cause, not letting the function hide the error from us.

While we'll potentially be losing some helpers from Microsoft.VisualBasic.Devices, again, most have fairly close compatriots inside the System namespace.

I love VB, and will do whatever I can to make sure that XNA and VB find a way to work well together, but if getting my code onto the Xbox 360 means ditching a mostly-redundant namespace, I'm fine with saying "bye bye."

[Piracy] Search Queries

Just for the hell of it, lets take a look at the piracy-related search queries that have hit my site for the last 24 hours, shell we?
  • beach head 1983 rom

Okay, starting out with a title that's been out of print for 23 years...

  • copy titan quest
  • copying titan quest
  • titan quest copy protection
  • titan quest pirated copy
  • titan quest secure rom

...and moving to a title I had nothing to do with.

  • costs of piracy
  • game piracy blog
  • piracy on blogger
  • rom piracy
  • the cost of piracy to microsoft
  • the hidden cost piracy

...People looking for my article, or for pirated software blogs. Not sure which.

  • diablo 2 easyplay 3.1

...No idea how in the Hell this one got to me, but as far as I can tell, it's a hacking tool that people are using in relation to Battle.net.

  • download paintbrawl extreme 4 the game for pc free

...I'd laugh at the idiocy of this person if I had the strength. The first game was atrocious. Looks like this one was just as bad.

  • download windows mce 2005.iso
  • windows media center 2005.iso
  • windows xp professional cd 2
  • xp professional cd 2

...Or you could just buy it from NewEgg.com.

  • filesystem_steam.dll exploit
  • how do you steal people s steam id
  • steam piracy

...No, won't help you hack our distribution network, sorry.

  • film free download

...Glad to know that pirates aren't just limited to games.

  • how to find out who stole you steam

...Sorry, man, you'll have to contact Valve for that one.

  • game boy roms free no bulshit
  • katamari damacy rom
  • katamari rom
  • tenchi muyo rom download

...And now we're into console piracy. Joy.

  • larry leisure magnum cum laude free iso
  • larry leisure suit rom
  • leisure suit larry magna cum laude rom

...It's been two years since I played this game, but you'd be amazed how many people come here looking for the pirated copy. I get about 300 queries related to this per month. It's sickening. Of course, if they're that desperate to get it online...

  • playing dungeon siege from an iso image

...People seem to love looking for workarounds and cracks.

  • provision sin
  • provision warez

...Well, since they've stopped contacting me directly asking for tech support, I guess they've had to go underground looking for support. Hey, assholes...the game is only $15. Just buy the fucking thing.

  • radek submarine sin
  • sin bug radek
  • sin emergence bug radek cutscene
  • sin episode 1 emergence fix
  • sin episode 1 fix glitch
  • sin episode 1 patch
  • sin episode submarine bug
  • sin episodes bug fix
  • sin episodes bug radek provision
  • sin episodes cracked stuck radek
  • sin episodes crash bug
  • sin episodes emergence patch provision
  • sin episodes filesystem_steam.dll problem
  • sin episodes fix
  • sin episodes fix radek
  • sin episodes patch pirated
  • sin episodes provision
  • sin episodes radek submarine
  • sin episodes stop submarine
  • sin episodes stuck in submarine
  • sin episodes stuck u4 lab
  • sin episodes submarine bug
  • sin episodes submarine stuck
  • sin episodes u4 base
  • sin episodes u4 lab bug fix
  • sin episodes u4 lab stop after radek
  • sin episodes u4 laboratory fix
  • sin episodes u4 laboratory solutions
  • sin episodes warez
  • sin pach
  • sin patch
  • sin stuck submarine radek
  • stuck in laboratory in sin episode

...Funny, I wonder what bugs were fixed in the first patch that are getting people are so anxious to get fixed?

  • visual sourcesafe 2005 warez

...And as you can see, we can't even trust most developers to actually purchase the tools that they use. Whee. If you're desperate enough to use SourceSafe, man, look at Subversion.

Yeah, it's discouraging to look at what people search for sometimes. At least nobody has come here looking for a way to kill his wife yet.

[Games] When Memes Go Too Far

I'm a frequent forum-goer over at ShackNews as Ritual-MikeR. Not only do they have a decent amount of original content, they also do a good job of aggregating content from other sites, and they seem to have a fairly hardcore userbase.

Recently, a bit of a meme has been going on at the Shack regarding Dallas-based game developers...seems we're all alike. It started with someone asking 3D Realms to patch "SiN Episodes." It then regressed into every Dallas game developer working on every other Dallas game developer's game. The fact that we were working with id Software on the Quake IV 1.3 patch further solidified the meme.

Well, at least at IGN, the meme has finally gone too far. (Screencap below for posterity.)
Ritual working on Prey 1.1 patch
At least at the moment, we have nothing to do with Prey, although given the level of coincidences in this industry, give it a week and we might.

August 16, 2006

[Blog] Moving On Up...

Ranked #98,695 at TechnoratiWell, I guess this is as good a birthday present as any...I broke into the top 100,000 blogs at Technorati.

Given that they're tracking 51.4 million blogs at the moment, I'm not going to complain.

[Gaming] Why Managed Code Works For Games

Over the last few weeks, I've been trying to bring my development skills back up to where they should be. They've atrophied a bit over the last year and a half because I've been so focused on testing that I've had little time to devote to code.

During this time, I've been working my way back up with C++, Visual Basic .NET and a bit of C#, and the more coding I do, the more I remember why managed languages rock for game development. For this discussion, I'm going to focus on the .NET Framework, as it is what I am most familiar with.

Performance is the biggest thing on the minds of most game developers. A consistent, smooth framerate is important for immersion and the overall player experience.

In C++, most performance optimizations can be classified as either algorithmic optimizations, disk access optimizations or allocation optimizations. Nowadays, it's only when you're really pushing for that last 1% that you start worrying about the low-level assembly-level stuff.

For algorithmic optimizations, it's things like using A* instead of Djikstra for pathfinding, properly constructing your vertex and index buffers instead of sending everything off one polygon at a time, and utilizing the vertex and pixel shaders on the video card instead of handling everything on the CPU.

For disk access optimizations, you're looking at packing your files into "packed" files to reduce file system and security check overhead, precooking your content so that it's closer to what it would be in memory, and making sure that files that are related are close to each other and preferably in order on the media.

For allocation optimizations, you're looking at handling your large allocations early and keeping them around, potentially writing your own custom allocator, minimizing allocations per frame, etc. Allocations and deallocations are not only the biggest enemy of performance, but also the biggest cause of horrible memory leaks.

The nice thing is that for the most part, those are the same optimization tools that you'd use for writing anything using managed code.

You're still going to be performance-bound by your algorithms and file access is still going to be a major overhead. You'll be swapping memory leaks for another fear, though...Gen-2 collections. Of course, the allocation tracking tools available for the .NET Framework rock for finding and eliminating the stray allocations that can lead to a Gen-2.

Small, common allocations aren't feared as much in the managed world. The act of allocating memory in managed code is relatively cheap. (Consider it strongly-typed malloc()-lite.) Gen-0 collections happen often, and are rarely more expensive than a page fault. The biggest headache will be your first couple of Gen-1 collections while your long-term allocations (textures, vertex buffers, etc.) get promoted up to Gen-2. (Of course, anything over 85,000 bytes gets auto-allocated from the large object heap, so they're pretty much Gen-2 to begin with.)

A lot of people fret about the small amount of extra overhead involved in making the call to native code. Of course, most of the things you'd call native code for are already in place in the framework (just a matter of making the framework work for you). However, if you're calling native code that often, ask yourself this: Do I really have to be that chatty with the API? Am I batching my drawing, or just sending it poly-by-poly? Am I polling the XInput controllers multiple times per frame, or am I getting the info once and caching it for the frame? It's the same things you'd be looking for when optimizing native code.

So far, it sounds like things are pretty close to equivalent, but there are other benefits as well, most of which are focused on helping the developer. It's great to be able to get reliable stack traces because you don't have to worry about stack corruption, bad pointers, etc. You don't need to worry about buffer overflows, incorrect typecasts, goofy C++ function signature mismatches in libraries, and the list goes on.

Of course, the benefits have some drawbacks. If your object uses unmanaged resources (like file system handles, or graphics resources), you have to remember to implement and use the IDisposable interface, because unlike C++, you can't rely on the destructor for any object to be called the moment it goes out of scope. (It actually won't be called until the object is collected by the GC, but if you properly dispose of it and suppress the finalizer at the end of the dispose call, there's no performance drop in comparison to C++.) Strings require some forethought if they are going to be integral to your codebase because they can't be changed after they are created. Calling native API's is discouraged, but can be done. In addition, there are times where it is necessary (QueryPerformanceCounter and QueryPerformanceFrequency for example). (P/Invoke is your friend...)

Expect a brief ramp-up if you decide to move to managed code. However, the ramp-up will be worth it. After all, if the team at GarageGames can port their best-selling Xbox Live Arcade title to managed code in three weeks and have similar performance running unoptimized ported code on unoptimized beta libraries, chances are other teams will have similar experiences.

[Personal] Mid-life

Well, I've officially hit mid-life. The dreaded sixth bit. &H20 (or for the rest of the languages, 0x20).

Lessons learned:
  • Even if you learn from the past, there may be times when you are forced to repeat it.
  • Trying to hold on to a sliver of a hope that people have at least a little bit of ethics is nothing more than lying to yourself.
  • Evidently, aggression combined with intolerance can conceal incompetence inside Microsoft once you've reached middle management.
  • Criminals will be brazenly open as long as you don't talk about their crimes.
  • Someone has to take responsibility...may as well be me.
There are others, but I have to get to work.

August 15, 2006

[Misc] Guard Lizard

Small lizard above my front doorIt's rather odd what the severe heat down here in Texas will do.

For example, the heat has driven a local lizard to hang out above my front door.

I figure if I don't bother it, it won't bother me. If I'm really lucky, it'll act as a guard lizard and attack any intruders.

Of course, I'm not expecting to be really lucky. For all I know, this is one of JT's spies. After all, they're both cold-blooded...

Of course, neither one has subpoenaed me...yet. Time to count my blessings...or just count down the time. Either way, I get to work with more numbers. Woohoo!

[Blogger] Full-Text WTF

For some reason, Blogger is truncating my posts at 255 characters again instead of doing the full-text feed like I've got it set to.

If you get a truncated post in your reader, please visit the page for the full post.

[Statistics] How To Lie With A Chart

The New York Times printed an article today showing the ridiculously low amount of Americans that believe in evolution compared to the rest of the world.

They pointed to the article summary in Science, but since they knew that most of their readers didn't subscribe to Science, they ran a chart as well. (This links to a local copy in case they change the chart.)

Notice anything odd about the chart? There's a hash mark at the top at the 50% mark, and an unfortunately believable curve of "Yes" answers going down. At the bottom, there's another hash mark. The position of the hash mark at the bottom would lead you to believe that just over 50% of the population of the U.S. believes in evolution. You would be wrong.

So you can compare apples to apples, here is the same chart with a straight line down from the 50% mark...notice anything different?

Now, the obvious defense here is "the bottom hash isn't a hash, it's indicating the label underneath. You know, the one that says 'White areas represent an answer of not sure.'" So why not put that label at the top with the rest of the legend? If "white" is too hard to indicate, why not use a different color?

It's a poorly designed chart, and given that most people are only going to glance at the chart rather than dissect it, it's a potentially misleading chart as well.

August 14, 2006

[GameDev] XNA Framework

By now, I'm sure you've all heard about XNA Game Studio Express. While I'm happy that some information is coming out, I'm concerned about a few items.

For example:

  • The XNA Framework SDK is only going to come with XNA Game Studio Express and XNA Game Studio Professional according to the FAQ. Seems like a waste and a half for those of us who already own a higher version of Visual Studio 2005 than the Express Editions. It also scares me to have the SDK tied to the development tool.
  • Last year, when I was speaking with some of the guys up at GameFest, some of the design decisions behind XACT seemed to be in place to specifically discourage modding, but I don't know what changes to XACT have occurred since then.
  • While I understand the decision to not allow Live connectivity on the 360 side of things for the Express Edition, I'm worried that not even System Link connectivity seems to be included.

That said, I'm going to reserve my judgment until I see the tools. It's quite possible that my concerns are not justified. While I wish I could be up at GameFest this year so that my questions can be answered in person, I'll just have to wait for the tool and see for myself.

August 12, 2006

[Anime] "Totoro" vs. "Totoro"

Tonight, I finally watched the Disney dub of one of my favorite movies of all time, "My Neighbor Totoro."

Up until now, I'd only seen the full-screen Fox dub of the movie, so it was interesting comparing the two.

The Disney version has a more accurate dub, a crisper recording, an amazing audio mix, and is technically superior in every way to the Fox dub...so why do I feel like something was missing?

I can only put it on the performances of Dakota and Elle Fanning...they were almost too polished. While all of the adults came across as very convincing in their respective roles, Dakota and Elle came across as child actresses playing children instead of the children that they really were. It may sound like a silly distinction, but it's true.

So I'm going to keep both versions of the movie. I'll keep the Disney version for those times when I want to watch it subtitled, but for when I want to hear English, I'm going to have to stick with the Fox dub.

[Quake] Quake III: XInput

If you use the Xbox 360 Controller for Windows and want to use it to play "Quake III: Arena," I made it very easy to do so.

Download "Quake III" XInput and follow the instructions in the enclosed readme.

Right now, it's hardcoded to only use the first controller. Code is included if that isn't good enough.

[Past] No wonder...

So, I found out that Daryl Welsh is working on the Xbox 360's backwards compatibility feature.

No wonder most of my collection doesn't work yet on the 360. The people in that area must be scared stiff to experiment and try anything that won't work 100% of the time for fear of getting bitch-slapped down to the minors...

August 11, 2006

[Security] Visual Studio bundled with Windows?

I'm still trying to finish up my post regarding region locks, but I saw an interesting article over at Ars Technica today...

Will Visual Studio ever ship with Windows?

...and even just reading the headline, my initial response was, "I hope not." Let me explain.

Over the last several years, Microsoft has been bundling more and more features with Windows. Unfortunately, a lot of what was added increased what was called the "attack surface," or the parts of Windows that were exposed so that hackers could work their way into your system.

Right now, Microsoft is making a conscious effort to reduce the attack surface for Windows. Microsoft is removing some commonly used controls because of the security holes that they present. While this is going to lead to some short term pain for developers, it is a win in the long run for security.

Visual Studio is perhaps the most attractive point of attack that a hacker could use, specifically because of the rights associated with debugging.

Let's say that I'm a hacker, and that I'm going after a user that doesn't have admin rights on his box. I'm going to be very limited in what I can do on that box by default, but let's say that this user is automatically added to the "Debugger Users" group. Suddenly, while I may not be able to do much to this box, the amount of information I can get from this box dramatically increases. Essentially, any process that I'm allowed to attach to for debugging purposes is now open to give me information.

I can see the wonderful attacks using MSBUILD and the ITask interface now...

No, leave Visual Studio as an optional install. The .1% of people who care about Visual Studio are generally the people who are better able to determine whether they want to accept the inherent risks.

August 9, 2006

[SiN] Personality Challenge System

For the hell of it, I threw together a personality test for "SiN Episodes."

This isn't one of those "what character are you" tests. This one just tries to humorously figure out where your challenge sliders should be set to when you play the game.

If you've got a minute to spare and want a small chuckle or two, give it a shot.

August 8, 2006

[Personal] Guard Bunnies

Xbox guarded by Bun-Bun, Ryo-Ohki wearing the Fez of Gaming Power, the Monty Python bunny, and Lain...I have nothing to fear.
(click for larger version)

I keep my original launch team Xbox at the office. Obviously, something like that requires crack security.

So, I've got Ryo-Ohki, the most dangerous space pirate ever to grace the small screen, powered-up by the Fez of Gaming Power; Bun-Bun, psycho bunny with a switchblade; the small white rabbit from "Monty Python and the Holy Grail;" and Lain from "Serial Experiments: Lain" all on guard.

I have nothing to fear.

[Piracy] Titan Quest Publisher On Piracy

Michael Fitch is one of the Creative Managers over at THQ, and he wrote a fascinating post over at the forums on QuarterToThree.com about the support headaches generated by the pirated copy of "Titan Quest."

My favorite quote in the thread isn't from him, however, but from Qmanol:
I don't like copy protection and all, but really, complaining about games that are buggy due to a bad hack by the pirates? That's like complaining that the electronic keypad lock you smashed with a crowbar let you through the door, but electrocuted you, so people shouldn't put locks on their doors.

August 6, 2006

[Personal] PMC The Next

Well, I've pretty much decided on the iRiver PMC-120. It'll be a couple of weeks before I can get it (have to save up the $200 for it), but I really like the Windows Portable Media Center software, and the iRiver is the closest thing I can find to my Zen PMC that isn't a Zen PMC.

August 5, 2006

[Blog] Moderation Disabled

As promised, I've disabled comment moderation now that the majority of the furor here has died down.

August 4, 2006

[Testing] Reason #∞ To Dislike PC Testing

Okay, I can't share any source code for this one, but you've got to love this one...

Standard do-nothing DirectX application, consisting of basic render loop and DirectInput polling. The only other items hooked up to the computer are a USB keyboard and a USB mouse.

While the application does not have focus, the render loop runs at full speed (~120fps).

Once the application gains focus, the application framerate drops to .2 frames per second.

Because the problem "goes away" when the application has focus, you can't hook it up to the debugger to track it down, so you insert trace statements.

The trace statements indicate that the DirectInput mouse polling call is "timing out," and is the cause of the problem. Changing the mouse to a different mouse or to a PS/2 mouse has no effect.

Unplugging the keyboard and plugging it back in causes the symptoms to go away until the computer is restarted, at which time the symptoms come back. Changing the keyboard out completely for a different USB keyboard causes the symptoms to go away permanently. However, if you swap the keyboard for another from the same brand, the symptoms come back.

In other words, somehow the keyboard is causing a 99.8% framerate decrease by interfering with the mouse.

Let's just say that on a scale from 1 to 10, this hit a 950 on my WTF-o-meter.

[Personal] Woe PMC

My Zen Portable Media Center died in December. I finally got it back from warranty service in March. On my way home, it died in the exact same fashion as last time.

At this point, I really don't want to buy another Creative Labs product again. I really liked my Zen PMC because of how well it worked for what I needed it to do. Unfortunately, it's also really good at breaking on a regular basis for no apparent reason whatsoever.

I don't want an iPod Video. As "nifty" as they may look, I don't like having to double-dip for my content. I've already spent more than enough money "single-dipping" for my content, thank you very much.

So anyway, I'm in the market for a decent portable video player that won't break, works with standard video formats including Windows Media 9 (transcoding okay as long as it's automatable), has a decent video life (loved the 8-10 hour battery on this baby), and a nice size screen.

[Working] CLM

CLM Acronym, stands for "Career Limiting Move." Originated at Microsoft. Signifies a mistake or decision that eliminates any hope of promotion or advancement within your field.
Everyone makes mistakes. It doesn't matter what you do.

Some mistakes only affect yourself. Some mistakes can cost millions of dollars. Some mistakes can lead to lives being lost.

Personally, I believe that almost all mistakes are opportunities in disguise. A person can grow by learning from a mistake, processes can be strengthened as a result of the mistake, and if a mistake is properly handled, a mistake can actually lead to positive PR.

Of course, there are some mistakes that are just too large to be looked past. Sometimes, mistakes like that can lead to termination. Other times, mistakes end up being something that seems worse when you are going through it: the dreaded CLM. A good example would be Gumpei Yokoi from Nintendo. Even though he had guided several successful products to market (including the GameBoy, the Metroid series and others), the Virtual Boy was a large enough disaster that it essentially ended his career at Nintendo.

Nintendo saw the value of having him there, but also did not want to give him an opportunity to fail on that large of a scope again, so he was pulled out of a position of authority and relegated to being a "respected elder." In other words, he was essentially left in the middle of Nintendo with no responsibilities and was essentially useless.

CLM's are a difficult thing to overcome inside a company. Generally, if you are able to overcome the CLM, the people that you worked with in the past will have passed you internally, so any support structure that you may have had is essentially gone. It can be even worse if you decide to jump ship and go to a different company, because you'll be starting from scratch with no support structure.

So what do you do if you believe that you have committed a CLM? The first thing to do is to own up to it. People who take responsibility for their actions are generally able to overcome career obstacles like this easier than people who try to place the blame outside of themselves.

The second thing to do is to sit down with your manager to try to come up with a plan for how to rebuild yourself and move past this problem. "Made a mistake, but learned from it and moved past it" beats "made a mistake and wallowed in it for eons" any day.

The final thing to do is forgive yourself for the mistake. Most people who commit CLM's tend to dwell on them every day, and are constantly blaming themselves for the result. While one should never forget their mistakes, one should we willing and able to let go of any negative emotions surrounding the mistake.

August 3, 2006

August 2, 2006

[Movies] Snakes on a Viral Marketing Plane

On a lighter note...

The "Snakes on a Plane" viral marketing machine has just kicked into overdrive.

[Misc] Sigh...

I was trying to come up with a decent post for number 600. It isn't often that anything hits 600 installments. Most webcomics tend to falter before they hit 100, and most blogs have faltered within a single day.

So I wanted to do something special. I wanted to look back at the ups and downs of posting over these last few years. I wanted to show the positives of knowledge sharing, show the value of public debate, and show that through the open flow of information, the world coule become a better place...and then I saw this post over at Ars Technica in relation to my recent complaints that pirates were asking for support.

You don't understand! It's the developers who are evil and trying to defraud consumers, and the pirates are just fighting for their rights.
Wow. I'm stunned.

I'm stunned by the ethical leap that someone would have to make to even utter that statement. Of course, I've been stunned a lot lately by ethical leaps and lapses.

I wouldn't be surprised if this was one of the same people talking about molesting the pre-teen female star of "Lazytown." (If you haven't seen the posts from one of these wonderful examples of humanity, just read the comments on one of the videos and weep for the future of humanity.) Following his logic, it seems that children are evil and he'd just be fighting for his rights as a pedophile.

I spent a good part of the morning discussing region locks with Ozymandias over at Microsoft because I felt that region locking caused more harm than good. (I'm working on a post for that topic, but the fact that I was bringing it up at all is the point for now.) I pointed to areas where region locking led to either financial issues for the platform holder, additional support issues for the publisher, and potential lost sales for the developer. I also brought up my experiences as a consumer where I've tried to import items as well. It was a very lively discussion, but at each point, we were attempting to balance the wants and needs of every member of this community: platform holders, publishers, developers and consumers.

While we agreed to disagree, we all agreed that in the end, all of the parties involved were gaining something while losing something else. It wasn't a zero-sum game for everyone (some parties were gaining more while others were losing more), we were discussing it trying to find some sort of equilibrium in the gaming ecosystem.

The attitude from the poster above is not the attitude of a contributor, but that of a parasite. He wants to contribute nothing, but instead reap all the benefits that he can. Due in part to the growth of broadband and the social acceptance of peer-to-peer networks, this community of parasites has grown significantly faster than the rest of the gaming community.

I'm not rich. I make enough to keep my wife and I in our one-bedroom apartment in Dallas and buy a game about once a month. I'm not naïve. I expected there to be some level of piracy because of the history in this industry, but I did not expect the level of piracy that we experienced, nor did I expect the severe amount of chutzpah that the parasites had.

Parasites in nature have a purpose. They feed off of larger entities, only to eventually become food themselves. However, nobody can feed off of the pirates in the gaming ecosystem. The many "benefits" that most pirates claim to produce in the ecosystem are only benefits for the pirate.

I don't know how to end this. I really don't. So I'm just going to stop, say thanks for sticking around for 600 posts, and get back to wondering exactly where this ecosystem fell apart.

August 1, 2006

[Games] I'm Pro-"Games For Windows"

Now, for the last week or so, I've been fairly "doom and gloom," but I want to call out some positives coming down the path...namely, Microsoft's "Games For Windows" push.

"Games for Windows" has been around for awhile, and it essentially is a means for developers to get a logo on their machine that says, "Yes, I will work on Windows." That's it. With the upcoming arrival of Vista, however, "Games for Windows" is going to take on a whole new level.

"Games for Windows" consists of two parts: the logo and the push.

The logo program has been around since Windows 95, but started getting more of a games focus around mid-2004, and enforcement for use of that logo has been getting more strict as time goes on. Essentially, there are a set of rules that developers need to follow to get the "Games for Windows" logo.

Most of the requirements are fairly straightforward. Some can get waived depending on your distribution platform, although those waivers are going to be going away as well.

The main goal is to try to get games to have a standard way that they work with Windows. They want faster installs. They want save games to go into your "My Documents" folder. They want file access to occur according to a proper security policy. In other words, they're trying to get a little bit of console TCR's into the PC business, and that has to be a good thing from a support standpoint.

A secondary goal is to make it so that Microsoft has to create fewer shims to keep games working in newer versions of Windows, but that's beyond the scope of this discussion.

The other part of "Games for Windows" is the push. Remember when I was saying that we have to pay graft, er, market development funds to stores so they won't bury us with the rest of the products that never sell? Well, Microsoft is essentially saying, "Hey, you make things easier for us, and we'll help out by paying the graft for you."

Microsoft is going to be dumping loads of money out there, trying to show that Vista is a better OS for gaming, trying to get people to upgrade their systems to handle Vista, get Vista sold to more people, etc. And games help sell upgrades. If Microsoft can point to a few shelves as well and say, "And these games will work great with Vista," hey, all the better, right?

Starting with Vista, the "Games for Windows" logo is going to be a cherished item. "Look, these guys made sure their game worked with Vista and I'm not going to need to worry about 94 'user access protection' dialog boxes popping up every time I try to save." If you care about the experience of your users, pay attention to this closely...if your user has to enter a system password just to save their game, chances are that they aren't going to be happy with you.

In short, this is going to be a good thing. It will reduce support costs, help reduce the amount of money that it takes for PC titles to break even (slightly), and provide a more consistent experience for the end user.

Could we ask for more? Sure...but this is a great start.

[Games] Why $40 million?

Okay, now it's time to look at third-party deals, and why it takes $40 million in retail sales before the developer sees a penny above their advance.

Let's say that Publisher A signs Developer B to make a game for a $2 million advance against earnings. Developer B is going to get 10% of net on wholesale.

Publisher A gives the $2 million to Developer B over the course of the game being developed to cover expenses, etc. This puts Developer B's current earnings on the game at -$2 million. (They've received $2 million against their earnings, so they're in the negative.) At this point, the publisher is also at -$2 million on their balance sheet. (This part is important...)

So, the game is done, and Publisher A starts their marketing push, manufacturing, etc. As you may remember from before, this puts the publisher at -$15 million total.

At first, all money that comes in from the title goes to the publisher so they can recoup the $15 million loss they have incurred. Why doesn't any go to the developer? Because the money is against net earnings, and the $15 million is expenses directly related to the title that the publisher has incurred.

Once the publisher has earned back their $15 million, 10% of each copy sold at wholesale starts going towards the advance against net profits. So if this is one of those games that was selling like gangbusters, and the wholesale price is still $40, that means that for this example $4 out of each unit would be going towards the -$2 million hole that the developer is currently in. Most games have already undergone a price drop at this point, so you're looking at between $1.50 and $3 per unit going towards the hole.

In practice, it takes about $40 million in retail sales to refill the $15 million hole the publisher is in and the $2 million hole the developer is in.

This is the primary way that day-0 warez hurts developers. Initial sales are crucial on any title. The more sales before that first price drop, the more likely that the publisher will break even early and the more likely that higher dollar amounts will be applied to the developer advance. The longer it takes for the publisher to break even, the harder it is for the developer to earn out against their advance. Every sale taken away early on makes it harder for the person behind the title to actually make any money off of it.