Archive for May 24th, 2008

Game Mechanics

Saturday, May 24th, 2008

Have I ever told you how I enjoy interpreting game mechanics? RPGs, specifically... Roll the dice and compare and add and manipulate the numbers based on what you have equipped and trained. Dungeons and Dragons just plain confuses me, though. I think it's too bloated to be any real fun... I've looked that the core books before and my eyes kind of glazed over and I put it back down. On the flip side, World of Warcraft's system is left to pure observation. You more or less have to reverse engineer the numbers you see on the screen. It's a pain, but someone's gotta do it, and lots of people have produced some really amazing formulas. And then there's CircleMUD... Pride of the multiplayer text adventure genre. (At least to me.) To understand how CircleMUD works, you have to look at the code.

When you build for CircleMUD, you have to know terms like damage roll and hit roll and THACO and AC in order to determine how hard something hits and how often something hits. I've spent the last couple of days deep in the code of CircleMUD to determine exactly how it figures up if a creature lands a hit against a player! Here's what I've come up with:

THAC0. THAC0 stands for "To Hit Armor Class Zero". It's derived from old D&D rules, and I'm not sure how it worked in D&D, but here's the code from CircleMUD 3.1 stock:

int compute_thaco(struct char_data *ch, struct char_data *victim)
{
int calc_thaco;

if (!IS_NPC(ch))
calc_thaco = thaco(GET_CLASS(ch), GET_LEVEL(ch));
else /* THAC0 for monsters is set in the HitRoll */
calc_thaco = 20;
calc_thaco -= str_app[STRENGTH_APPLY_INDEX(ch)].tohit;
calc_thaco -= GET_HITROLL(ch);
calc_thaco -= (int) ((GET_INT(ch) - 13) / 1.5); /* Intelligence helps! */
calc_thaco -= (int) ((GET_WIS(ch) - 13) / 1.5); /* So does wisdom */

return calc_thaco;
}

Gotta love C programming code. I haven't really investigated the first part, where it's trying to figure THAC0 for the player. Right now, I'm only interested in how hard NPCs hit players, and that's on the lower half. In a nut shell, THAC0 starts at 20, and then it examines the strength points of the NPC and references a manually generated array that returns a little value and subtracts that from 20. Then it gets the value of the hit roll and subtracts it, and then it uses a formula to subtract a special non-floating-point value. For NPCs without any hit roll, the default THAC0 is always +22. They begin with 11 points in both Intelligence and Wisdom, which translates to about -1, which is then subtracted from 20. ((20)-(-1)) is 21. The lower the THAC0, the better, so having 11 points in Intelligence and Wisdom is bad. The maximum is 18, normally, so the more the merrier!

Then you have to figure up the Armor Class for the player:

int compute_armor_class(struct char_data *ch)
{
int armorclass = GET_AC(ch);

if (AWAKE(ch))
armorclass += dex_app[GET_DEX(ch)].defensive * 10;

return (MAX(-100, armorclass)); /* -100 is lowest */
}

First it gets the AC, which is, by default, anywhere between -100 (best) to +100 (worst). Then, if the player is awake, it checks the points in Dexterity and compares it to a manually created array of numbers, very similar to how THAC0 checks Strength. It then multiplies this number by 10 and adds it to the Armor Class. Then it makes sure the armor isn't out of range. But wait! There's more! When it comes to actually checking if there's a hit or miss, it first calculates THAC0, then Armor Class, and then it rolls a d20. (A 20-sided dice.) If the d20 is 1, then you automatically miss and the THAC0 and Armor Class checks were for nothing. If the d20 is 20, then you automatically hit. If it's anywhere from 2 to 18, then the program advances to THAC0 vs AC calculations:

if (diceroll == 20 || !AWAKE(victim))
dam = TRUE;
else if (diceroll == 1)
dam = FALSE;
else
dam = (calc_thaco - diceroll <= victim_ac);

It takes the calculated THAC0 and subtracts the d20, and with THAC0, lower is better, so you want a high d20 roll to subtract... Then, if THAC0 is equal to or lower than the Armor Class, it's a hit. I'm not working with a stock CircleMUD, so things are slightly different, but as you can see, it's a complicated procedure. To hit someone with -100 AC, your THAC0 needs to be -100 or lower. That means you'd need a hit roll of at least 120 to be assured a hit. (After calculations, a default mob with a hit roll of 120 gets you a THAC0 of -98, but remember, the lowest you can roll that d20 is a 2 (because a 1 is a miss), which is subtracted from the THAC0 to always give you at least -100.)

Pretty insane... But, somehow, I enjoy it. I'm telling you, if I had programming experience, I'd be writing my own MUD engine. Something that's easy to document and explain so other people can easily figure out what numbers are best to have. None of this "check Dexterity and compare it to this chart so you can pull a random number so you can multiply it by 10 to subtract from Armor Class." I would settle for a simple statistics system. Strength, Dexterity, Intelligence, etc... They would all start at 10, like most D&D related games. At 10, you get no bonuses and under 10, you get penalized. 25 would be the maximum you could have in any statistic, and it would be a flat out: "Okay, Strength is 20, so add 20 to damage." It would be simple, and if the entire engine was built with that in mind, it would be perfectly balanced.

Honestly, if anyone says games aren't educational, point them here! That'll teach them to generalize. And... I really don't know why I bored you all with this. I'm just bored.

Microsoft Certified Professional

Saturday, May 24th, 2008

Of course, when it comes to Microsoft, you know I'm biased for them. I like them as a company and I'm willing to overlook their blunders because I enjoy their products. They have an absolutely colossal amount of money and they're willing to spend it on awesome research like the Surface, on awesome gaming technologies like Halo 3 and the Xbox, and on continuing the most popular operating system on the planet: Windows. Still, I like to think I can acknowledge problems with their stuff. Like, for example, Vista's performance issues. While I acknowledge the less than XP performance of Vista, I still took the stance that it was a necessary step in stabilizing and securing the operating system.

Anyway, all that aside, I have just passed my first Microsoft certification, and I am now an official Microsoft Certified Technology Specialist, with a certification in Microsoft Windows Vista: Configuration. That's right. I'm now recognized by Microsoft as being someone who can set up and maintain their client operating system. I know... Makes it seems like it's not a real accomplishment for my talents, if I may pat myself on the back, but it was a little more complicated than one might think. You might know how to fix something when you're sitting at the screen, but I guarantee you it's harder to relay those steps when you're staring at a multiple choice question. Anyway... As an MCP, I have access to Microsoft Certified Professional Home Page, which nobody ELSE has access to but us professionals, bwahaha!

But yes... I just wanted to gloat a bit. Like I said, I like Microsoft, and I think it's great that I'm in the system as a certified professional. I have access to a lot of neato stuff now... Not sure if there are any real perks, like getting software for free if you're a registered developer, but I still think it's pretty awesome. Next week, I plan on getting my certification for Windows Server 2003. It's going to be a lot harder, but if I'm able to pass that, then I'll be well on my way to securing a job exactly where I want to be: Network Administration.

Vista Performance

Saturday, May 24th, 2008

When Vista came out, people complained. Just like when XP came out... Just like when 2000 came out... Just like when 98 came out... Just like when 95 came out... (You get the picture.) One of the major things they complained about was the performance of videocards in games. With the radical redesign of the way drivers interface with the operating system, DirectX was also radically redesigned to accommodate the changes. See, DirectX was designed to offer a high-speed interface to the graphics system of Windows and was intendeed for developers to harness to full potential of the hardware without writing their own interfaces. It was a video acceleration breakthrough and anyone with an unbiased opinion of Microsoft knows this. It's what made PC popular for games.

Now, during the history of DirectX, Microsoft was experimenting with how to make it work. They tried to make DirectX not work directly in tangent with the kernel of the system, running in user-mode to promote stability, but that proved to be far too slow and they abandoned that approach. As a result, DirectX up to version 9 has been a kernel patch, more or less, but with Vista, drivers are no longer operated at the kernel level, so DirectX 10 couldn't either. This is what all the smart people bring up. I mean, you have the casual Vista haters who just hate for no reason, and then you have the true concerned performance mongers who dig up information and go: "Look, this is what Vista does and I don't think it's so great." Not for performance, maybe, but separating drivers from the kernel practically eliminates Stop errors. (Otherwise known as Blue Screens of Death.)

But fear no more! ExtremeTech has run benchmarks on Vista (SP1 and base) vs XP (SP3 and SP2) and I think the results will surprise you. Certainly there was a performance decrease with Vista base, but with the advent of SP1, you can see that the frame rates are on par with XP if not exceeding XP entirely. I tolerated the slower performance of Vista for the stability of the new driver model, but I think it's clear that Microsoft is figuring out how to make DirectX 10 (which runs safely in user-mode) work as fast as DirectX 9 (which runs dangerously in kernel-mode). Everyone needs to revise their opinions about Vista's performance and wake up and smell the roses... Vista is not the mammoth tangle of processor intensive garbage that everyone makes it out to be. Every operating system is released with issues, even immaculate Apple has bugs (that are just simply overlooked by fanboys). Vista just needed a bit of time to mature, and, slowly but surely, Microsoft is addressing the concerns of everyone who doesn't want to use Vista. Soon enough, the only reason they haven't upgraded would be because they don't want to. Which is fine, but don't go justifying your decision by making Vista out to be something it clearly isn't.

Fact is: Service Pack 1 DOES increase performance to every bit the speed you had with Windows XP, AND you're getting a far safer and stable approach to drivers than you did with Windows XP. You have the best of both worlds now... I think it's time for some people see how nice Vista is for themselves. If history is anything to go by (and it usually is), all you performance mongers will eventually see the light and upgrade. After all, you upgraded to Windows XP, did you not?

The Happening

Saturday, May 24th, 2008

From a post by NewsBusters.

Turns out that this isn't a story about zombies or aliens or anything cool like that... It's a story about global warming. What in the heck?! Shyamalan's a smart guy. I wouldn't have taken him for the type of person to buy into all this crap about man-made global warming. (Especially after 31,000 scientists that include 9,000 PhDs have decided to put their names AGAINST the theory. So much for "consensus", eh? You know, science is the idea of testing limits and proving and disproving theories. For anyone to say that a debate is over on a subject, be it a debate on quantum mechanics, dark matter, global warming or intelligent design, is not a true scientist.)

I have enjoyed Shyamalan's movies up until now. By principle, I will not support or condone anything or anyone who believes in the fallacy of man-made global warming. As such, I will not be watching this movie at the theaters, and I will not be purchasing this movie when it's released. I'm sorry, but as far as I'm concerned, this is just another version of "An Inconvenient Truth" and I will not support it.

Participation

Saturday, May 24th, 2008

So I'm going to make a whole new category for these types of posts... I seem to make them a lot. Just little posts that mention something in passing that really doesn't need a lot of explanation, but is meant to provoke some sort of... Thought. I thought of calling it "Food for Thought", but that's so boring and typical and I really don't think like that. I've noticed myself leaning more toward a professional presentation of things, and I think I'm getting too straightforward! Humor and personality makes things unique! So, after careful consideration, the new category is going to be dubbed "Showertime Speculation", and is based off how I personally use the shower to go through random trains of thought. They're never lengthy trains of thought, but they're sometimes pretty profound, if I do say so myself. That being said, here's the inaugural Showertime Speculation:

American Politics. Over the past several months, I've obviously developed a major interest in American politics, laws, and government in general, and I've had countless people tell me things like "politics? how can you stand to read that stuff?" and "hah! I keep away from that stuff like the plague", and I'm left sitting there wondering why in the heck they act like this? I'm going to tell you what I think of when I hear the word "politics". It's not "cockroaches in Washington" or "maniacal liberals bent on the destruction of all that's good in America", though those things certainly fall under the term. When I hear the word "politics", I think of the incredible privilege we have, as Americans, to be able to have politics in the first place! I think of how we, as Americans, believe in the right to determine our own leaders by fair representation. As such, we have a responsibility to keep ourselves informed of current events, what laws are trying to be passed and for what reasons, and to keep ourselves informed about the character and opinions of people who are offering to run for office to represent us.

Americans ARE lazy. We're the greatest country on the planet and so many citizens take it for granted. They don't seem to want to bother themselves with keeping tabs on the government and just kind of go with the flow of their peers and political parties. When I hear someone say they don't like politics or even can't be bothered to deal with it, I'm left wondering how in the heck someone could say that. I wouldn't call it a duty, because it's not required for someone to vote, but I would most certainly say it's a great responsibility as an American to BE involved in politics at some degree! You can choose not to take care of your responsibility, sure, but then that makes you... Irresponsible. (Yeah, I got creative there.)

Now, I realize that politics is considered a hobby or sometimes even a career that people just don't enjoy. I understand that... But for someone to flat out say that they keep their distance from politics as a whole? That just gives me the impression that you're too... Something... Selfish or ignorant or whatever... To be bothered with at least checking out the basic political events for yourself in order to make informed judgments about who to vote for. I can tell you right now that I think very poorly of people who can vote but decide not to, and I think far more poorly of people who vote just for the sake of voting and without any true understanding of who they're voting for. I understand that some people don't want to keep track of every little bill and law getting passed around, but I still think that it's your responsibility as an American to at least pay SOME attention to politics, especially when it comes to these presidential primaries. To have the freedoms that we do doesn't come without a price... Part of that price is that you HAVE to be involved in politics at some degree, and to be involved in politics at all, you need to be aware of what's happening around you, and that means you're going to have to get a little dirty with political news and blogs so you can at least make a small effort to understand and comprehend what's happening.

And... This really wasn't a small thought, but it's still something I came up with in the shower.