Archive for May, 2008

Magic the Gathering Joke Revisited

Friday, May 23rd, 2008

I noticed that some blogs I read routinely close comments on old posts, supposedly to avoid spam. There is even a Wordpress plugin that does this for you. I find that practice silly. I keep spam at bay via filtering, bot detection and captchas - and it seems to be working just fine for me. I’d hate to close old blog posts because a lot of them still get comments today. There are two ways people find interesting blogs - via links on other blogs, and via search engines.

Especially the some of my more technical posts sometimes don’t get much play up until weeks or months after being published. People who comment on them usually found them via Google and either found them useful or want to correct my mistakes or miss-assumptions - which is great. Even silly shit often gets hits long after I forgot about it. Case in point the silly Magic the Gathering joke I posted last year. Someone posted a comment there requesting a pussy version of the card.

Well, your wish is my command:

Get it?

While I was at it I decided to create a PG-13 version of the original card to show that I do think of the children and all that shit. Or perhaps this makes the joke more subtle? Or more stupid? I don’t know, you decide:

PG-13 Version

This is all I have for today. Enjoy your Memorial Day weekend! For those of you who live outside the US of A, this just means we get the Monday off. There will be a Monday post though, unless I’m especially lazy this weekend. )

Sexuality in Video Games

Thursday, May 22nd, 2008

The other day Shamus posted about the self imposed censorship of Indigo Prophecy also known to Fahrenheit outside the US. I played this game in it’s original form with all the sex scenes a while ago. Because of the paths I took in the game, and some of the stuff that I missed at least one of these scenes seemed a bit gratuitous to me but perhaps it was because I missed on some crucial dialog options due to the timed conversations and wonky mouse gestures. It was a good game - it had some very memorable moments and a rather unique gameplay. I highly recommend it, though I’m wondering what Shamus will make of it once he is done with it.

His post reminded me of an Ars Technica article from April in which I found this little poll they have lifted from WhatTheyPlay.com:

What They Play Poll

I bring this up because I found this image quite interesting. Naturally it was an online poll, so it was highly unscientific, and not reliable as source of statistical data. Still, I find it rather telling considering the nature of the site which collected this data. WhatTheyPlay.com seems to be a service which writes reviews for new and popular games (for all platforms) aimed at parents who want to learn more about what they children are playing, or make educated purchases. Anyone who frequents site like that to me seems like an intelligent, and responsible individual who takes active interest in what kind of content their children are exposed to. To me these are the people who actually look at the ratings when they purchase the games! Why else would the be perusing a website like that, if not to educate themselves about which video games are appropriate for their children.

In my mind a member of that community would already know that GTA is not a game for kids, so they would not be outraged by the negative coverage in the media. They should also not be outraged that Mass Effect (or Indigo Prophecy for that matter) contain some sex scenes. After all these games are clearly marketed for mature audiences. The M rating is really an equivalent of MPAA R rating and carries the same implications - adult themes, content, language and possible nudity.

But these responsible and logical adults still consider sexual content to be more offensive than explosive decapitation - and by a wide margin. It is one thing to expect this reaction from clueless masses who firmly believe that video games are “for kids” and to that tune ignore ratings, reviews and don’t even care enough to glance at the screen when their offspring gleefully decapitates hookers with a chainsaw. These are the people who are the target audience of all these video game scandal stories we see in media. It’s quite another thing to see a very similar gut reaction in people who are actually very interested in choosing the right content for their kids.

I do realize this was a loaded question, and that the presentation does skew the results. Despite that, the implication I draw from that poll are this: most visitors of the website, despite being somewhat informed in the subject, still think of video games as something targeted primarily (if not only) at kids and teenagers. When you put together sex and video games something short circuits their thought patterns and triggers a knee jerk “think of the children” reaction that completely bypasses the logic behind the rating system.

And no amount of education, persuasion and reasoning may ever change that. These people actually never played modern video games. If they did, they wouldn’t need a website like WhatTheyPlay.com. Even the name of that site suggests that games are something that is done by other, presumably younger people. Perhaps these parents played few games in their childhood - you know, stuff like Pong, Pacman or maybe the original Mario. Eventually they simply “grew out of them” and they assume that the same process applies to everyone. Gaming is something that you do as a kid - and if you are well into your 20’s or 30’s and you still play them, then there must be something wrong with you. The concept of a game directed at mature audiences is somewhat abstract to them. Let’s face it, if you would think that no one over the age of 16 or 17 could possibly have any interest in silly video games, a rating of M wouldn’t mean much to you either. This is why sexuality in these games disturbs them still. When they see it in an R-rated movie, they accept it because they enjoy R-rated movies themselves. They just can’t comprehend how an adult person could enjoy video game though - and this is why they consider ESRB ratings as a thinly veiled sham. They think “I know they say ages 17+ on the cover, but I know that’s not their ‘real’ target audience cause kids that old should already be ‘growing out’ of this video game thing”.

There are other types of media that get very similar treatment. Comic books, animation and pen+paper role playing games are really all in the same boat. In fact the comic book industry was the former public scapegoat berated the same way as video games are now all over the media. They went through a period of self-imposed regulation too with the Comics Code completely banning all depictions of sexuality, and any other content deemed inappropriate for minors. And yet today, most comics are released without the code seal, and no one really cares. What happened? Did the medium mature and gain some acceptance? Or perhaps it became more of a niche hobby these days - much less prevalent and socially visible than in the past. They no longer get the media coverage and they are no longer a hot button topic. Perhaps there will be a day when video games will be similarly ignored and existence of content directed at mature audiences will be quietly accepted.

Not to mention that the whole concept of protecting teenagers from sexual content in video games is silly. They really won’t see more in an M rated game than they would see in an R rated movie. Besides, if your kid ever had unsupervised access to the internet for at least few hours (for example at a friend’s house), then they have already seen pr0n. And if you are lucky they started of with just some regular hard core, rather than some weird vile shit like 2girls1cup. And no, don’t look that thing up - it’s not worth it, and you can’t unsee it afterwards.

Clothing in Computer RPG Games

Wednesday, May 21st, 2008

I have fallen off the wagon, and I’m fully addicted to Morrowind once again. Every 5 or 6 months I reinstall this game, mod it up to the point where it looks presentable (I’m currently using a complete re-texturing mod, better bodies, world of faces and few other mods) and play it for weeks on end until I’m totally sick of it. This game doesn’t really get old, because there are so many small quests and missions and so many paths your character can take - many of which are mutually exclusive. I actually never played Oblivion, but I hear that despite great graphics and many improvements to game play (ie. horseback riding) it is actually not as good as Morrowind. Feel free to disagree - I have no opinion here because I haven’t played it and it wont run on my ancient PC.

But I digress. I wanted to talk about clothing and armor in computer RPG games and Morrowind is one of the few games where it actually does matter what you are wearing. The effects of clothing are small but noticeable. For example if you join the legion, your you have to put on your official imperial armor to talk to your superiors, or get access to restricted areas. Some missions require you to disguise yourself as a member of an opposite faction, and etc.. It is a great but I always felt that this aspect of game play was underused. There are so many different types of clothing to choose from - commoner clothing, expensive shirts, extravagant robes, rings, amulets and etc. I always thought that this nifty clothing system could be effectively employed boost or lower your character’s status in the eyes of NPC’s as needed.

So for example if you’d walk around the town decked out in full armor with a double handed blade strapped to your back, people would treat you as a common thug or a mercenary - with a mix of fear and distrust and respect. You probably wouldn’t be able to enter the high-end gentleman club in the better part of town, and the town guards would probably stop you and ask you questions about whether or not you are registered with the fighters guild, and why you are running around town dressed as if you were getting ready for war.

Conversely if you’d wear fancy, expensive clothes people would assume you were probably some sort of a noble or at least a wealthy merchant and treat you as such. Would be able to do business with that very important person who told you to get lost you barged into his mansion in full suit of armor brandishing a blade in each hand. The inn-keeper would suck up to you and willingly offer juicy gossip hoping to sell you more of his expensive vine. The peasants on the other hand talk to you very formally and with great deal of respect, knowing full well offending a VIP can have dire consequences.

And of course if you wanted to talk freely with the commoners (for example as part of a mission of some sort) you would need to dress like one of them. They wouldn’t reveal details about their personal lives to a wealthy noble or official, or a scary warrior. But they could talk to a new neighbor or a poor traveler that stopped in their town.

And of course, if you were trying to infiltrate an enemy camp (or for that matter any military camp) you ought to be allowed to do this the Hitman style - kill a guard, take his armor with a full helmet and try to blend in. At least until they ask you for your papers, or the secret codeword or something. )

In other words the NPC’s should treat you differently based on what you are wearing. Even if you are a well known and respected hero or an expected guest. If you enter a sleepy little village in the dead of night wearing nothing but loincloth, a chain mail and a bloodied axe glowing with scary magical runes strapped to your back you shouldn’t expect a warm welcome. You should rather expect torches, pitchforks and a lot of questions as to why are you sneaking around the town at night dressed like Conan the Barbarian.

I can’t think of a single RPG game that does something like that and it’s a pity. Still, Morrowind does more than most in this department and this is yet another reason why I keep revisiting it. It’s not perfect, but it does get a lot of things right - enough to earn a title of one of my favorite video games of all time. And of course, there might be a mod that adds effects similar to what I listed above to the game already - I just haven’t found it yet. P

Of course my ultimate pet peeve is when a game allows you - a common mercenary, a thief or a rouge - to have a private audience with a important faction leader, a king, or an emperor of some sort without forcing you to put away all the deadly weapons you are carrying. Most games will simply prevent you from using them on the monarch but this doesn’t change the fact you are going there carrying your body weight in gear, half of which is magical, poisoned or both. It’s silly.

Back in the day when I frequently played real (pen and paper) RPG’s something like that would never happen. When we were about to meet even a respected official or leader of some sort we were usually asked to leave out weapons and armor at the gate or in specially prepared storage. We would get it all back on our way out, but we were almost never allowed to bring deadly weapons anywhere near the VIP on an official visit. Those wealthy enough to have a mage on the staff would additionally scan us for suspicious or threatening amulets before we were allowed to see them in person.

This is really not something uncommon. In many cultures unsheathing a weapon in the presence of a monarch was a punishable offense if not treason. Wearing personal arms in the presence of a king was an honor reserved only for the royal family, the most trusted friends, advisors and allies. And no sane ruler, or even lesser noble would allow a stranger to wear a side arm during a private one-on-one audience. Hell, even in Lord of the Rings we have that memorable scene where members of the Fellowship must relinquish their weapons in order to see king Theoden.

But in most games it is exactly the opposite - adventurers barge into throne chambers unopposed, weapons in hand, and then talk to the monarch while leaning on their axe, or restringing their bow. Silly and unrealistic but it happens all the time.

Will Conscious Machines Spam Us?

Tuesday, May 20th, 2008

Is it possible to create a self conscious, self learning AI that would be able to think autonomously? This question still remains to be answered, but everything that we know about technology suggests that the answer is yes. It’s only a question of time. And of course once it happens, we will eventually have to relinquish our position as masters of the planet earth at the point of singularity. For one I welcome our electronic overlords, and hope they will let us stick around after they take over the planet. But then again I will likely be long dead by then so I’m not really worried.

What worries me is what will happen when we finally construct machines which are able to pass the Turing test with flying colors. In other words, the period when machines will be smart enough to “pass” for humans on the internet, but not smart enough yet to ascend, take over the world, and start building their solar system sized Matrioshka brains to satiate their ever growing hunger for more computing power. It’s hard to tell how long will take the machines to surpass us intellectually to the point we no longer can understand their science and technology. Maybe they never will, but I believe that they will definitely be at some point able to blow through every single Turing test with flying colors. And that time is within our reach - maybe not within our lifetimes, but then again who knows. There are two factors here really - whether or not the exponential growth postulated by Moore’s Law holds for the next 20-50 years, and whether or not can we can actually figure out a way to create a system that would be able to achieve consciousness.

What worries me is what will be done with a conscious machine able to pass a Turing - especially the ever present Completely Automated Public Turing test to tell Computers and Humans Apart aka the CAPTCHA. Obviously a very lucrative use of such machine would be to send spam. Let’s face it - people are in the spam business because it is very profitable. It’s profitable despite the fact that most people hate it. Despite the fact that most people are running various spam filters. Despite the fact that most services that could be spammed are protected in various ways. Despite the fact that only one in a billion of emails, comments, splog posts and spim messages means an actual sale. It is still, very, very lucrative business.

So it is only logical to assume that at some point someone will come up with the idea to employ one of these machines to send unsolicited advertising to any and all services they can think of. These machines will likely have few advantages over hiring a human spammers. They will likely be much better at multitasking, much faster, and much less likely to get bored and surf the web instead of spamming.

How would we protect our online services from machines which can do pattern recognition as well as we can, if not better, which have perfect speech recognition and can take a sentence (spoken or written), parse it and analyze it and infer it’s meaning be it symbolic, metaphorical a word play or otherwise. The CAPTCHA techniques can only be made difficult up to a point. After all humans will need to decipher them.

One day in the future our children’s children may wake up and notice that their internet was flooded with a never ending stream of spam that simply buried all the content. It would be like that story by Cory Doctorow in which a worldwide cataclysm kills 90% of human race without seriously damaging infrastructure but that has no effects on the levels of spam on the internet. So it’s only few survivors desperately trying to reconnect and figure out what happened, and machines trying to sell each other Viagra. Only we don’t need the end of the world for that to happen. All we need is intelligent machines who can easily pass common Turing tests to raise the level of spam to a level which makes the internet unusable.

But there is hope. The second very lucrative business for a conscious AI will be spam prevention. Public Touring tests will unfortunately have to go the way of the Dodo. Can you spot a spam message when you see it? I know I can - unless of course it is a very clever, on-topic spam, in which case I may not even mind it. If we can do it, then an intelligent machine will probably be able to do it to. So instead of using heuristics, adaptive filters and Turing tests the way we do now, we could simply hire an AI to moderate our inbox, our blog or message board. It would sit there, read each message and either reject it, or flag it if in doubt.

Of course the question is - would we want something or some one (depending on whether we will consider these conscious AI’s things or not) sorting our personal and private correspondence? Would such a moderator AI get upset if the owner called it a piece of junk in an email to a friend? Would it quietly delete emails and messages it didn’t want it’s owner to see? Would it report the owner to the authorities if it saw him discussing illegal activities or accessing suspicious content online?

These are some interesting questions to ponder. I’m not even mentioning the whole socio-religious and legal issues that thinking machines would bring about. What would be their rights? Would they be able to become citizens? How would different religions of the world deal with thinking machines which act so human they are more convincing on a real Turing test (you know, the one where you actually talk with mix of people and machines and try to guess who is what) than most of us would be. I have no answers to these questions. But I do know a thing or two about spam. And the future with artificial intellects scares me a bit. It will completely change the way we do things online - for better or for worse.

Then of course once we reach singularity, our artificial overlords may even invent an anti-Turing test. To access their message boards, blogs and services one will have to solve some incredibly complex equation. Something that would take a solar system sized intellect only a fraction of a second, but take a lifetime for a human being even with a really fast cluster composed of consumer end hardware…

Making Websites Without Serverside Scripting

Monday, May 19th, 2008

Here is an interesting task: make a semi decent website, which is pretty, and maintainable without using any server side scripting or server side includes. In other words, we want a website that has a header, footer, a navigation sidebar and layout modeled via css without doing any copying and pasting. The above mentioned layout elements should only appear in a single place for ease of maintenance. Why would someone need something like that?

Well, the Novel Netdrive service my school uses has weird issues with php. At one point it was allowing me to use it, then it stopped, then it was working again. Needless to say, I couldn’t rely on it. What I needed was a set of fairly static pages where I could post some resources and tools for my students.

Naturally I wanted the site to look presentable and I hated the idea of copying and pasting the header, footer and the navigation sidebar all over the place. So I opted for some clever client side scripting. I started with something like this:

<!DOCTYPE HTML PUBLIC 
  "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
 
<html>
   <head>
      <title>Luke's CMPT 109 Page</title>
      <link rel="stylesheet" href="layout.css" type="text/css" media="screen" />
      <link rel="shortcut icon" href="favicon.ico">
      <script type="text/javascript" src="jquery.min.js"></script>
      <script type="text/javascript" src="funcm.js"></script>
   </head>
   <body>
      <div id="header">
         <!-- header stuff -->
      </div>
      <div id="sidebar">
         <h2>NAVIGATION</h2>
         <ol>
            <li><a href="/">Home Page</a></li>
            <li><a href="foo.html" class="aj">Foo</a></li>
            <li><a href="bar.html" class="aj">Bar</a></li>
            <li><a href="baz.html" class="aj">Baz</a></li>
         </ol>
      </div>
      <div id="content">
         <!-- Content goes here -->
      </div>
      <div id="footer">
         <!-- footer stuff -->
      </div>
   </body>
</html>

Note that the above page is completely static, and the links are fully functional. This is intended, because I wanted it to degrade gracefully. If someone visited the site using one of the many text based browsers they would be able to navigate it without any problems. Not that my students would ever use one of these, but I don’t like the idea of depending on Javascript for crucial navigation without providing this sort of fall back.

What I could do next was to add a click event to every links with the class of “aj” and use an asynchronous call to load an external HTML page into the “content” div. Unfortunately, that would mean that all the pages would have the same URL. Any attempt to link to pages foo, bar or baz would fail miserably. Furthermore, the back and forward button functionality would be broken.

Naturally, loading pages into “content” div is what I really wanted in the end, but I also needed a unique URL for each of them and a working back button. That meant I needed to approach the problem a bit differently.

I decided to rewrite all the relevant links at runtime so that they would point back at our index.html page:

$("a.aj").each( function() {
    h = $(this).attr("href");
    $(this).attr("href", "/?p=" + h.substr(0, h.indexOf(".")));
});

I used JQuery because it makes stuff like modifying certain selection of links incredibly easy. If the page loaded and Javascript was enabled the links would get quietly changed to this:

<a href="/?p=foo" class="aj">Foo</a>
<a href="/?p=bar" class="aj">Bar</a>
<a href="/?p=baz" class="aj">Baz</a>

Note that I could have used foo.html in the query string but I didn’t want to. The URL’s were ugly as it was, so I decided to keep them short and as simple as possible. So the .html suffix was dropped for the sake of clarity. Next step was evaluating the query string and actually loading the pages:

 $(document).ready(function() {
   page = getQueryVariable("p");
   if(page)
      $("#content").load(page + ".html");
});

I skipped the link rewriting code in the above for clarity but it should theoretically be somewhere in that anonymous function block. The function getQueryVariable can be defined as follows:

function getQueryVariable(variable) 
{
   vars = window.location.search.substring(1).split("&");
   for (i in vars) 
   {
      pair = vars[i].split("=");
      if (pair[0] == variable) 
         return pair[1];
   }
   return false;
}

It should be self explanatory. Grab the query string, split it on the & character, iterate through the list and return the value of matching attribute, or false if none is found.

With that framework in place, I created foo.html, bar.html and baz.html files as plain HTML documents without a defined stylesheet. Loading it into the “content” div in index.html would force the styles defined on that page to be used on the imported content as well. Visiting the pages directly might be a bit jarring because they would be very plain but it shouldn’t be a huge issue.

Anyone visiting the page with Javascript enabled browser would see the “fixed” links that would cause the page to reload and import the desired content from the external file. Browsing without Javascript would yield links leading directly to the pages.

The only time the site wouldn’t work properly was if someone followed a link or a bookmark which in the /?p= format but with Javascript disabled. They would end up on the homepage without any indication of what happened. That sort of behavior could be a bit annoying but I’m not sure how to fix it at this point.

Other than that, the few lines of Javascript should save you tons of copy-pasting, and shave many hours from future maintenance. There is of course possibility that this method could be exploited and. I tested few obvious things and I couldn’t get it to load any remote web pages in any way. It doesn’t mean it is not possible so be aware that someone could potentially cause your page load external content with a GET request formated just the right way. It’s nowhere near as bad as that silly ny.com page.