Friday, June 27, 2008

THAT much security in an MMO?

Blizzard has announced a new product for World of Warcraft: the Blizzard Authenticator. It’s a one-time password dongle (much like you’d see from security companies such as RSA) that they’re selling for $6.50. The extra security layer is optional; players aren’t forced to buy the authenticator. So, is Blizzard responding to a general perception that there’s a lack of security from their customers? Or are incidents of password theft really that high in WoW?

Monday, November 26, 2007

Why I will never buy another Alienware

When I first started at Flying Lab almost two years ago, I of course had to give back the Aluminum PowerBook I had been using for my previous job. My personal laptop, an old Titanium PowerBook, was too old to be much use by that point. I decided I wanted to get a new machine. After looking around at gaming laptops (I wanted to be able to do work on the machine), I first ordered one from a small custom shop called CyberPower, which was DOA. After several failed attempts to contact their supposedly "24/7" support line, I finally got a hold of someone there and was able to return the machine for a refund. Burned by that experience, I decided to go with a more well-known manufacturer. That's when I turned to Alienware.

I bought an SLI-enabled Alienware Aurora m9700 laptop, which ran fine for a normal machine, but certainly didn't perform the way a "gaming" machine should perform. It's been plagued by troubles ever since.

Actual problems I've had with the machine itself:

  • Low framerates and unplayable choppiness in World of Warcraft (certainly not the most graphically intensive game on the market) and Half-Life 2 (released 2 years before this machine was new and supposedly top of the line). These games should run silky-smooth on this machine. I suspect the wifi card has something to do with the choppy framerate in WoW, as it happens more often when playing over a wireless connection.
  • The machine has had two sticks of RAM die since I bought it. To be fair, Alienware support was pretty good about diagnosing the problem and sending replacements, at least.
  • Often instead of going into sleep mode, the machine will freeze with the fans and drives still spinning but the screen off.
  • The machine currently locks up after about 30-50 minutes of playing WoW on very low graphics settings. I'm currently down a stick of RAM (see above), so I'm going to withhold judgement until I replace it. WoW should still run just fine on this machine with only 1GB of RAM, though.
  • [UPDATED:] While idle, the machine runs at about 30-60% cpu utilization, with spikes to 100% that occasionally lock up the machine. Process Explorer lists this as coming from DPCs, or Deferred Procedure Calls from drivers. This seems to point to a piece of hardware that's not interacting well with its driver.

Problems I've had with Alienware, and the design of the machine in general:

  • The drivers for the AMD Turion mobile CPU just aren't cut out for a gaming machine. The CPU goes into "power save" mode during gameplay, reducing it to about 800MHz.
  • Alienware charged me $25 when I bought the machine for a set of "Respawn" recovery DVDs that would restore the machine to its factory state. These DVDs turned out to actually just be coasters. Alienware did refund me the $25, but not until a year later is when I needed the DVDs and discovered they were bad. Even just a little testing would have caught this earlier and allowed them to re-create the DVDs. Instead I spent a day re-installing the OS and finding, downloading and installing the right drivers and utilities.
  • Alienware also charged me to install a tech-support utility called "Alien Autopsy" that would record information about my current system state to aid in troubleshooting or support calls. This utility was installed in a broken state until I got a replacement copy from Alienware tech support. Not a huge deal, but again, something just a little testing could have prevented.
  • When I ordered the machine, I also selected two games to add to my order. The games never arrived, with no explanation as to why. When I called Alienware about it, they explained that the reason was that the games were out of stock, and wouldn't be restocked. They offered me a $50 gift certificate to Amazon as a replacement, so that I could buy those games from Amazon instead. Since I paid less than $50 for the games, I agreed. However, the gift certificate never arrived, and when I called again about it, Alienware claimed it would be sent soon, as they batched up such emails to be sent together. I've since lost the incident number, and never got the Amazon credit.

I can't justify getting another computer so soon after spending as much as I did on this machine, but I really hate not being happy with my computer. So I've resolved that once I get my replacement RAM (so that I can rule it out as a problem), I'm going to keep calling Alienware support to make sure that all my issues are resolved. Hopefully it doesn't take me hours and hours of tech support phone calls.

Saturday, April 28, 2007

"Scripting Languages" vs "High Level Languages"

Recently, Joe wrote in his blog:

As I see it there are three kinds of languages in this world:

  1. Hard to write, but blazingly fast: C and C++, or even assembly if you’re really hard-core
  2. Easy to write, but so slow that you have to use them sparingly: PHP, Lua, Python, Perl
  3. Flash

Java fits into an awkward niche between 1 and 2. It’s easier to develop in than C++, but not enough to keep up with the scripting languages, and yet it’s far too slow to write the whole game in. Add to that the incredible pain of forcing your users to install the Java VM, and you get a non-starter of a language.

This seems to be the common perception of high level languages lately – languages like Python* are considered “scripting” languages: they’re not compiled like Java or C#, and they have a “simpler” syntax. I’ll use Python for terms of discussion because of my familiarity with it, but I’m sure the same is true for languages like Perl and Ruby.

Implementation

All too often, on the GameDev forums, I read people’s posts claiming that an interpreted language could never be as fast as a language that compiled to a native binary format like C#. So that we’re all on the same page, let’s get this out of the way at the beginning: “managed code”, “language runtime”, and “virtual machine” are all concepts on par with “interpreted language.” Sure, the first three imply a level of “smartness” by the interpreter – compilation of the language into some interpretable bytecode, and perhaps a JIT compiler – but any modern interpreted language should be doing these things. We’ve come a long way from the days of parsing text and executing it.

The fact that Java and C# need a compilation phase is merely an interpretation difference. I like being able to change code on the fly and have the interpreter recompile it into bytecode for me. Other people like having the extra type-safety and syntax checking pass of a compile step. Personally, though, I think these class of bugs get much less frequent with a language like Python.

Runtime Speeds

The Computer Language Shootout does consistently list Java and C# (albeit, on Mono) as faster than Python. In Python’s defense, the benchmarks never have Psyco – the Python JIT compiler – enabled. Running a few of these tests myself using Psyco, I saw a speedup of at least 4x running with the most basic braindead use of Psyco. This still puts Python slightly behind Java and C# for speed, but not by much. Of course, many of these tasks are heavily numeric – something I would hope you’d implement in C and wrap for use in Python if speed were a concern.

Development Speeds

I find myself able to develop applications much faster in Python than in C++, due to the nature of the syntax. (As I over-excitedly told Joe over lunch one day, “orders of magnitude faster!!”) I’ve heard many other developers tell me that it’s impossible to manage anything more than a large project in a high-level language, or that once it comes down to writing production quality code the speed gain is lost.

I’ll step away from the “Python as an example of high-level languages” here for a moment, and talk about Python specifically. A lot of claims against Python’s ability to deal with large projects comes from its dynamic typing. I think a lot of misconceptions come from this – it’s important not to confuse dynamic typing with weak typing. Python is a dynamically- and strongly-typed: references (variables are all references) can point to any type, but data keeps its type and will not be automatically cast to fit the current expression.**

As far as development speeds on production-quality code and suitability for large projects, I’ve found both of these statements to be completely untrue in practice. At a previous job, I worked on large python applications. In several cases, we decided to re-write some of the server-side code in C++ to gain some speed. (Audio processing and mixing on a server processing audio for many clients in any number of audio conferences, for example.) These pieces would take several times longer to write than the original Python modules.

I think a lot of the misconception about production-quality code being slower comes from people who have experiences with Java or C#. In these C-like languages, developers still need to jump through a lot of the syntactic hoops that C++ developers do, but still have the cost of needing a language runtime. The difference from C++ ends up being that you can use a few neat language tricks to hack together code quickly, that’s not “production quality.”

Development Environments

One place Python and other high-level languages fall down compared to Java and C# are in the development tools. Developers who are used to Visual Studio like that you can seamlessly step from C++ to C# code in the debugger. Java users have Eclipse. (Yes, Python users have Eclipse too, through the PyDev plugin, which is quite nice.) There is no well-integrated tool for Python debugging across language boundaries. On Linux, you could set up GDB to recognize Python code, but that’s a huge hassle – and Linux specific.

I don’t think the types of errors you need a strong debugger for come up quite as much in a high-level language. Pointers don’t suddenly go NULL. You can’t mysteriously clobber your vtable. But that’s not to say that a debugger isn’t an invaluable tool. WinPDB is a great tool, but especially in game development, there are going to be times when you need to step into the C++ source for a module you wrote.

Conclusion

As Joe mentions in his article, I think most developers are stuck in their own little bubbles. I certainly have been surprised lately to find out that Java has become much faster and can now be used for non-ugly GUI applications with SWT. Hopefully, I’ve encouraged you to at least look in the direction of high-level languages if you never have. Every tool has its uses, and I think you’ll find that high-level languages are better for a lot more than text processing these days. And C or C++ probably isn’t the best choice for everything that it used to be. But if you’re still writing that text-processing tool in C, you might need to expand your bubble.

* Yes, I’m biased towards Python, I know. I love Python. Whenever anyone in the office mentions anything about languages other than C++, all heads turn to me, expecting my Pytho-vangelism. But there is a reason I love Python; there are several, in fact. I’ll go into them in a later post to keep this footnote short.

** I say ‘usually’ because Python is about as strongly-typed as C when it comes to primitive types. Different numeric formats will usually be automatically casted to the appropriate type for an expression. The expression “x = 5.5 + 10” is valid, “x = 5 + ‘32’” is not.

Friday, June 30, 2006

Procedural Universes

This is mostly for my own good; links to resources on procedurally creating game universes of different types...

Saturday, May 13, 2006

Random Map Creation

Since people seem to still be interested, I've decided to post weekly updates about my progress with Emperor. It'll keep y'all informed, and keep me feeling accountable for my progress. That helps for motivation.

This weekend's project was a better random map generator. Last time, I just generated random points, and then for each system, went through a list of it's "neighboring" star systems, giving it a random chance to be connected to each system. That random chance declined, the more systems the first system became connected to.

random map

In the new version, I'm using an algorithm much closer to one used to generate random mazes. I generate three-dimensional points weighted towards the center (in a "Gaussian" or "Normal distribution") so that the core of the galaxy is much more dense. Then, I walk from a random star near the core outward like a tree to systems with no* star lane connections. Here's an image of a map generated by this new method. Notice the star lanes are much less tangled than the old emperor map..

The big thing left to consider is home world placement. I was previously going to add new clusters of stars to the map for each empire so I wouldn't have to risk choosing them a crappy home world, but that makes for a crappy map. This way I can lay out a nice huge galaxy, but I need to figure out my rules for home world placement...

* And by "no connections" I mean "a low number of connections" that's weighted so that a system with 0 connections has "no connections" 100% of the time, and the chance for other systems to have "no connections" falls off sharply the more connections they actually do have. Tweaking this weight allows for the average number of connections per system to go up without having systems connected to almost every other nearby system.