Tag Archives: Technology

Virtual Reality

In 1992, a couple of years before the Web started to gain traction, Virtual Reality was the new hotness.

I was a second year Engineering student, and encouraged the head of one of the research groups on campus to allow me and two fellow students to work on a VR project over the summer break for credit.

We improvised a poor-man’s VR helmet (a stack-hat) with a poor man’s stereoscopic HUD (two video camera viewfinders) and poor-man’s motion tracking (two POTs on the helmet for 2 DOF head tracking, and a Nintendo Power Glove). All of this was driven by two Amiga 500 computers, one for each eye, using custom software written in AMOS and AMOS 3D. One of the most challenging parts of the project was synchronising the displays via a null-modem link, and reading the POTs, which had to be timed off the vertical scan (something arcane like waiting until the electron beam of the display reached the 7th line, and then reading some register or other before it reached the 12th line).

We were excited, but, in truth, the project sucked balls.

While working on that project, we became involved with the Perth Virtual Reality Interest Group, which held meetings in Tech Park (Enterprise Building 3, funnily enough, where I returned 15 years later – ack – to work at Interzone). The SIG organised a special, private viewing of the Virtuality Arcade Machine (which also used the Amiga computer) when it made a brief appearance in the Perth Myer store.

I remember being very excited by the potential of VR at the time, in part due to a documentary that aired on TV that featured Marvin Minsky, Jaron Lanier, William Gibson and Tomothy Leary. It’s funny and embarrassing in hindsight, but it was a strange time, with people absolutely convinced that VR would be the future of entertainment, medical imaging and stock market manipulation.

I wonder what the modern equivalent of VR is? Social gaming, perhaps?

Go

Yesterday I posted the following on Twitter:

Why is the #golang community so much more holier-than-thou than the #ruby community? Harumph to all sanctimonious hackers.

This got a concerned response from someone who works at Google as a “Go Gopher”, whatever that means. It also made me feel like a dirty troll, which wasn’t my intention at all: I was just venting after a frustrating day.

When Google’s Go Programming Language was announced late last year I was fascinated. I loved the decisions they’d made regarding code formatting (the language enforces a particular standard, making debates about the right way of formatting code a moot point), dependency management (it’s a compile-time error to include something that you don’t use; streamlining your dependencies to speed up builds in C++ is a nightmare by comparison), and language features (defer, iota, interfaces and goroutines are all very cool). I read through the documentation, watched the videos and toyed around with the language a bit, but I didn’t dive in and get my hands (really) dirty straight away.

Recently, I’ve started working in earnest on the back-end for MegaHAL.10, an online chatterbot that can learn to talk in any language by example. That project has a few requirements that make Go an ideal language for the server-side code, including:

  1. The need to be fast, and to manipulate a lot of data in memory. This makes C or C++ an obvious choice, and discounts languages such as Ruby or Python. Go is a lot closer to C++ in terms of efficiency, so it’s a candidate for the implementation language.
  2. The need to work with all human languages, meaning it’s important that the chatterbot engine supports UTF-8 end-to-end. All strings in Go are UTF-8 by design, whereas it’s fiddly to properly support UTF-8 in C++.
  3. The server will need to handle many simultaneous requests, and the concept of goroutines is ideally suited to satisfying this requirement.

So I started coding things up, and eventually ran into some problems that I couldn’t answer by reading through the provided documentation.

For example, consider the provided documentation for the sort package. The description is a brief “the sort package provides primitives for sorting arrays and user-defined collections”. Just what I need! Unfortunately, the documentation for the Sort method is no more than its specification, “func Sort(data Interface)“. That is all.

You can click through to see the implementation of Sort, revealing that it just calls through to quickSort. Great! I’ll look at the documentation for that. Unfortunately, there is none; quickSort is private (because it starts with a lowercase character), meaning that it doesn’t appear in the documentation at all, although its implementation is right there in the source.

So they’re hiding stuff from you in the docs, while at the same time recommending that you treat the source as documentation.

Now, this is a contrived example. I didn’t really need to look up documentation for Sort, but I did have several problems of this category with other packages and functions that I wanted to use. What I’m trying to illustrate here is how difficult they’ve made it for a newcomer to the language to get acquainted with things. Contrast this, for example, with the documentation for sort in Ruby:

Returns a new array created by sorting self. Comparisons for the sort will be done using the <=> operator or using an optional code block. The block implements a comparison between a and b, returning -1, 0, or +1. See also Enumerable#sort_by.

It’s succinct and easy to understand, with clear examples and cross references to related functions. Exactly what you need to dive in and get started on something.

I’ve just finished working on FAQoverflow, a fun little project that was implemented in two weeks using Ruby, and I rarely needed to look outside of the provided documentation when writing a fairly complicated API spider. When I did, I found the community polite, welcoming and useful. Consider, for example, this question to ruby-talk, made soon after the first version of Ruby was released in the west:

Ok, I’m having trouble with an extremely simple class. Here’s my example:

This got an immediate reply from Matz, the creator of the language:

Example:

Now, that’s really helpful! Here’ by contrast, is the first question I ever saw on golang-nuts (when searching to find out how the ternary operator worked):

How can you call your self a C-like language and NOT have the ternary operator? But seriously, why isn’t it in Go? This could be a deal-breaker for me, as it’s often more succinct and clear to use a ternary operator than an if/else, *especially* if you require curly braces even for single-line blocks.

And here’s the first answer:

Then “go” write your own language or use a language that makes use of your precious ternary operator.

Ouch! That answered my question, but it certainly rubbed me the wrong way.

When you’re deeply focused on writing code, and jump to a browser to do a quick search, and the first thing you hit is a mean-spirited reply to a reasonable question, then it breaks your stride and leaves you with a foul taste in your mouth.

Of course, if this just happened a few times it wouldn’t be a problem. What concerned me is that throughout the day, whenever I searched for an answer to a question I had about Go, I always got a mean-spirited answer to a fair question. Sure, I admit I might have had an unlucky streak, and I admit that I usually read the first reply to each question due to my familiarity with Stack Overflow, whereby the first reply tends to be the best. But I just don’t encounter that with the Ruby community. And it was enough to make me stop looking to the forums for answers, which is a shame.

Some more examples of less-than-useful answers (paraphrased) that I encountered on the day I was working with Go:

“Having optional arguments to functions would be useful.”

“In the rare instances you need them, make wrapper functions and give them unique names.”

Coming from Python and Ruby, I’d have to say that optional arguments, or arguments with sensible defaults, are far from a rarity, and are often extremely useful. And, no, I don’t believe that it’s good practice to create eight differently-named wrappers for a function that you’d like to have three optional arguments.

“Why does strconv have functions to parse int and int64 but not int32?”

“Because making a function for every possible integer type is tedious and clutters the interface.”

Clutters the interface? Really? Do you mean that the generated documentation gets a bit longer, meaning you have to scroll through it? Do you mean that you really shouldn’t need to specifically convert int8 and int32 from their string representation, ever? Or that if you do you should write that functionality yourself?

“I was following the tutorial on the website, and it said… (a simple misunderstanding)?”

” I don’t get the point.”

Thanks for sharing, but why not correct the obvious misunderstanding or be more specific about what it is that you don’t get?

“The library code is … hard to learn from. I’d rather see short example programs.”

“Rule one of problem solving: break it down into smaller problems, see rule zero.”

Right, so rather than provide short, concise usage examples in the documentation, you want me to dive into the source and spend time understanding the implementation of the functions I want to use?

“I’m sure this is totally obvious, but I can’t seem to find it anywhere in the docs…”

“One way to get answers to questions is to search the golang-nuts mailing list.”

Hmmm… dare I ask any questions at all?

Now, yes, perhaps I’m being harsh. But when you’re struggling with something unfamiliar and new, it’s a godsend to find a superb resources such as Programming Ruby or The Ruby User’s Guide or why’s (poignant) guide to Ruby or the Standard Library Documentation, and these resources exist because the community cared enough to want to help newbies to understand why they fell in love with the language. Guess what? It works.

I just don’t get that feeling with the Go community at all. At the moment, it feels defensive and argumentative. Now, it may well be that Go is suited to a different class of problems than Ruby, and that the language is therefore going to be niche, appealing to systems programmers  only, and that it’s still immature and not really suited to production code. Fine. My problem is that it sure wasn’t marketed that way. The Go team claim that their language is an expressive, concise, clean, and efficient language designed to make programmers more productive. Sounds good to me! Now if only I could learn to use it as such without banging my head against defensive, unhelpful, critical answers on golang-nuts.

So, Go Community, where should I be looking?

Procedural Adventures

Apart from text adventures, I love point-and-click adventure games (of the Monkey Island ilk), and the more modern Japanese interpretations of this genre (such as Hotel Dusk and Another Code). These latter games tend to be more focused on telling a story, and the interface offered to the player is subsequently stripped down (with less emphasis on navigating the environment and using objects on everything to see what might happen).

L.A. Noire

Sandbox + narrative? Image by GameInformer.

On the other hand, I’d love to see a sandbox adventure game, which places the player in a vast world that they are free to explore. Such a game would render the usual approach of playing an adventure game (go everywhere, examine everything, pick up everything, talk to everyone) impractical. It would be interesting to see what would happen if you were free to explore an enormous environment in which a story could be told based upon what you do, not in spite of it.

Strangely enough, I once worked on such a game. When I worked on L.A. Noire I was particularly interested in the problem of bringing story to the player in large sandbox environments, and of procedurally generating a massive population of NPCs who went about their daily business in realistic ways. I would love to write a text adventure game that used some of these techniques to produce an experience truly different to anything else out there.

Yes, I’m the kind of guy that just hung out and watched a shopkeeper go about his business in Shenmue for the entire day-night cycle, and who tails pedestrians in GTAIV to see where they go. I love that kind of stuff.

FAQoverflow

StackOverflow is a Q&A website for professional programmers. Joel Spolsky and Jeff Atwood developed the concept as a direct competitor to Expert Sex Cha… errr, Experts Exchange, and I now find that answers on StackOverflow are often in the top few results when I search Google for geeky, programmer-type stuff. They’re doing some good things; I liked the podcasts they recorded while the site was being developed, and I’m excited that all user-contributed content is cc-wiki licensed, allowing it to be shared and remixed.

Stack Overflow

Stack Overflow. Image by Jeff Atwood.

Joel and Jeff reused the Q&A Engine they developed for StackOverflow to power a couple of related websites, ServerFault and SuperUser, and then attempted to monetise the whole shebang by offering StackExchange, providing hosted Q&A websites on any topic to whomever was prepared to pay a steep monthly hosting fee. That didn’t work out so well.

Not ones to give up, Joel and Jeff tried Plan B, visiting a whole bunch of VCs in a whirlwind tour, raising US$6m in two weeks. They then returned to the drawing-board, coming up with StackExchance2.0, which is totally free, and whereby new Q&A sites are born via a community proposal process, which is how the USENET newsgroups of yore were created. It seems to be going swimmingly, and there are now about a dozen new Q&A websites in open beta on topics that include Cooking, Bicycles, Home Improvement and Personal Finance.

Many of the questions and answers across all of the websites in the StackExchange family are interesting to browse. As a StackOverflow user, I’ve been creating accounts on all of the new sites as they go into open beta, but, unless you’re really motivated to ask questions or write answers (and they do their darndest to motivate you, with XBLA-style achievements, points and leaderboards), you’ll find it difficult just to browse the sites for enjoyment.

Late last week I discovered two things that I hope will change that.

  1. They’ve released a public API that’s super clean and powerful. It’s easy to browse if you have the JSONview Firefox extension, and really easy to access from script.
  2. Amazon have, finally, implemented default root object capability for CloudFront, making it possible to serve a static website entirely from S3.

I’m currently writing a Ruby script that will spider all of the StackExchange Q&A websites, with the intention of finding the 100 best question-answer pairs for each site (as determined by a metric that takes into account many things, such as the brevity of the question and answer, the number of upvotes the question received, and the difference between the upvotes received by the first and second answers). These question-answer pairs will be grouped into ten buckets, based on the tags associated with the questions. All of this will then drive a new website, FAQoverflow, which purports to contain “great answers to questions about everything”. The site will be easy to browse (even on your iPhone), using styling inspired by Readability. And there’ll be PDF and eBook editions of the FAQ available for download. It’ll all be built automagically via a script that publishes a new edition every week or so, and will be user-supported (I’ll ask for donations from the community to pay the minimal hosting bill).

Cleaning

People like cleaning up. Well, not always literally, and not quite everyone. But, for whatever reason, there seems to be something that’s intrinsically enjoyable about reducing entropy. I enjoy actual, real-life cleaning up once I get into the swing of things, and then I can’t stop until it’s “done”. But getting motivated enough to start in the first place is difficult, which is why I wait until I can’t stand the mess anymore. Or perhaps I just want to give myself a challenge?

As far as games are concerned, cleaning is a common metaphor. Tetris is perhaps the best example, as are match-3 games such as Bejeweled. In Tetris you interlock falling tetrominoes in very pleasant, satisfying ways in order to remove rows of blocks, while in Bejeweled et al you remove gems of the same colour by shifting them around. In both cases, the essence of the game is arrangement and removal. There’s something addictive about sorting like stuff into groups, identifying patterns, planning for what may happen next and progressing by removing groups of stuff to leave behind smaller collections of stuff.

Postal Worker, the game that I was intending to work on at the beginning of this year (and which suffered ludus interruptus due to the Global Game Jam and the Interzone Fiasco, and is yet to fully recover) was based around this concept of sorting things into groups. I do plan to return to it eventually, once I finish the Kranzky Engine for iPhone. But, I digress.

I started writing this blog post because I was thinking of two important issues that both involve cleaning in some form, and which are both inspired by recent events. I don’t want to make a federal election out of it, but I have been thinking about both the government’s proposed mandatory ISP-level filtering of RC content, and of the shelved emissions trading scheme.

I first learned about carbon trading about seven years ago when I read, I think, “The Armchair Economist“, by Steven Landsburg, which is a study of how incentives change behaviour (with famous examples including the fact that mandatory seatbelt laws result in an increased number of car accidents – you’d minimise accidents by requiring everyone to mount a metal spike on their steering wheel which is aimed directly at their heart). In essence, the intent of carbon trading is to incentivize individuals and corporations to look for alternatives to their energy supply by creating a marketplace that will inflate the cost of carbon-producing energy to the end user. That is, the operators of coal-fuelled power plants will need to pay more to continue polluting the environment, and will pass this cost on to their customers, who will then have an incentive to consider other means of fulfilling their energy needs. This will create a market for greener (in the sense of lower CO2-emitting) energy production. Along similar lines, wouldn’t it be interesting to introduce a cholesterol trading scheme, to improve the overall health of the population and thereby to reduce the strain on the health care system? I kid.

The proposed Internet filter has proven unpopular, as so many of us are opposed to censorship of any form. It is difficult, however, to have a proper discussion around a subject that threatens to raise the spectre of child pornography (which is a core reason for wanting to implement a filter in the first place). Child pornography is quickly replacing Godwin’s Law as a means of nipping any debate in the bud. It’s similar to accusations of racism making any measured debate of policy regarding asylum seekers difficult. The truth is that censorship simply limits exposure to offensive material that needs to be deliberately sought out anyway, and won’t prevent those who deal in such material from continuing to do so. In fact, it may make it onerous to identify and bring to justice those who produce such material, as it will only serve to encourage them to go deeper underground, obscuring any handy evidence that would have been left behind had they traded the stuff online. The fact that the production of images of child abuse is a multi-billion dollar criminal industry is under-reported, and the success rates of finding the perpetrators and bringing them to justice are unknown. I want to know; we should all be in the business of protecting children everywhere. Just not  via censorship.

Enough with the depressing thoughts. Just cleaning out my brain. Please don’t get all Nazi on me in the comments :)

Classification and Censorship

I’ve been lurking on a thread over at the Pigmi Discussion List that’s been debating the pros and cons of Game Classification, in the wake of the news (reported on Kotaku) that the Australian Government is working to close a loophole that allows unclassified games and applications to be downloaded and used on mobile devices. Coincidentally, I was contacted yesterday by Ben Grubb, a journalist with the The Sydney Morning Herald, for comment on the very same issue. I wrote this blog post partly to express my thoughts to Ben (his article has now been published online), and partly to respond to Nick Lowe, who expressed some opinions in the Pigmi thread which irked me. Nick has since written an opinion piece that suggests he had a change of heart before I’d had a chance to change it for him :)

Classification exists to allow consumers to make informed choices. The Classification Website states that games are classified to “provide consumers, especially parents, with classification information to help them choose a … game to play”. This implies that game classification exists to help us protect our kids, which makes it especially annoying when games clearly only intended to be played by adults are banned from sale in this country. Besides which, I believe that these kinds of recommendations are of limited benefit, and are often ignored by consumers. When deciding whether or not to allow my child to play a particular game, I’d much prefer to base my decision on my previous experience with the game, or on the recommendations of my friends and family.

The Classification Website states that “every film and computer game, whether produced locally or overseas, has to be classified before it can be made legally available to the public”, which means that most of the games I’ve ever created, including my GameJam entries, and the iPhone and iPad games released on the App Store by RocketHands, are illegally available in Australia.

Apart from causing some titles to be banned, this mandatory classification system, which requires game developers and publishers to pay to have their games classified, has resulted in some content just not being available at all in this country (presumably because publishers/developers choose to forego the expense of getting a game classified if it is not forecast to generate a large return in this market). This robs us from experiencing small, independent offerings which, for mine, are where the fun’s at. These classification requirements mean that many smaller WiiWare and Virtual Console titles don’t get a release down here, and have prevented Microsoft from making the Indie Marketplace on XBLA available to Australians. This is a regrettable state of affairs.

On the other hand, countless downloadable games and online Flash games are readily available, and, due to their entirely unregulated nature, sometimes contain highly objectionable content. The behaviour of the Australian Government makes it easy to accuse them of revenue-raising (by fining Apple, and requiring them to pay for classification) rather that performing their stated duty of protecting the kiddies (although I’m presuming that they assume their proposed Internet Filter will take care of everything else).

I think Apple should be applauded for flaunting the letter of the law, allowing countless applications and games to be available to Australians via the App Store, while satisfying the spirit of the law, by policing the App Store themselves, ensuring that violent, pornographic content is not available, and rating all games and applications to allow consumers to make an informed choice. Rather than complying with the Australian Government, Apple needs to fight for a shake-up of our classification laws. At the very least, games should be treated the same as TV, where the commercial stations self-regulate based on an industry code of practice (which is essentially what Apple has been doing until now).

What I’d like to see happen is for the classification process itself to be deregulated and crowd-sourced, with each game initially released as unclassified (and, therefore, unavailable to minors), and for adult users to submit the age threshold that they deem appropriate after experiencing the game for themselves. I’d predict a wide standard deviation of responses (which begs the question of why we allow one or two public servants to make these decisions for us), but it’d be great to be able to see the average recommended age for a game as taken from members of my social circle.

P.S. Note that “Plants vs Zombies” has been classified as 9+ by Apple, but that I’m still happy for my 4+ daughter to play it :)

Infinite Loop

My machine at work was nagging me to activate XP, and all the licenses had been maxed out, so we bought a single copy of XP Pro, and I entered the license key. Everything seemed to work, and I left on Friday a happy man. This morning, however, it was a different story. Upon logging in, I got the “you need to activate windows” prompt. So I clicked “OK”, thinking I might have to enter the key again. Unfortunately, the activation screen just displayed a simple “This copy of Windows is already activated.” message. Clicking the lone “OK” button logged me off, at which stage I proceeded to try every single combination of button clicking, windows closing, rebooting and so forth, to no avail. I was stuck in an infinite loop. Eventually, after much Googling and several dead-ends, we figured out that updating my existing XP installation to SP3 allowed us to activate against the new license, which was for a SP3 installation. I really, really hate it when doing things the right way is slower and less convenient than doing things illegally. It’s why DRM sucks, and it’s why my new games company won’t be going in for any of that bullshit – it just doesn’t respect the user.

USB

I was using the computer in the boardroom at work, and someone had left their USB memory stick plugged in. “No worries”, he said. “Let me eject that”. He moved the mouse to the USB icon in the Taskbar, waiting for the balloon help text to pop up (it says “Safely Remove Hardware”), and then said “there you go, you can pull it out now”. He expressed total surprise when I explained that you need to right-click, and go through the rigmarole of manually stopping the device in question. “That explains why these things always break for me.”

Cheap As…

My parent’s bought themselves a PC. Not terribly successfully. Their brand new HP Pavilion a6130a desktop, with Visa Home pre-installed, came with the default amount of RAM: 512MB. To an old-timer like me, that’s a massive amount of memory, as I got by quite well with 512KB on the old Amiga, thankyou very much, so three orders of magnitude should suffice. But, as the tech-savvy among you know, Windows Vista will hardly boot with 512MB of memory, and will start swapping the moment you attempt to open a web browser. My Commodore 64 was more responsive than the brand new PC my folks bought themselves. So, I thought I’d upgrade their machine to 2GB. And, you know what? That cost less money than what we spent on a dinner of fish and bloody chips. Considerably less. To think upgrading my old Amiga to 1MB with a 512KB memory expansion cost me five hundred bloody bucks. Sheesh!