Mobile phone is now my video game platform of choice

I remember being glued to the television screen while barely surviving in most of the role playing video games I played when I was young. It didn’t matter that most of them were in Japanese, because I would still slog through the dialogue and snatch whatever I could understand. Ahh, those were the days…

As I grew up, I still played video games, but less often. I’ve always preferred to play on console machines rather than the computer. For some reason, game playing felt right on consoles. But game playing on consoles required switching on the television, switching on the console machine… yeah, I’m getting lazy, and selective about my games (you know, not enough time)… It just feels like a bit of an effort.

Then I started to use the computer more often, as a result of my university work and programming. Since the computer was already on, the notion of playing games on the computer started to be more appealing. But I only really play The Sims. Using the keyboard and mouse to play action games felt awkward for me, but the point-and-click-with-no-rush system of The Sims was ok.

But even that sort of died… the loading time was terrible, I had to save… starting up and ending the game still felt like effort…

Then I bought my iPhone.

Now, I own a handheld console (a DS since you asked), though I don’t play very often. The games aren’t “motivating” me enough. Plus the screen is small, and I still have to start it up to play games.

My iPhone, on the other hand, is different. I keep it switched on when I’m awake. That means, if I want to play a game, I just need to load up the game, which is fairly fast. I’m not isolating the iPhone here. Any mobile phone with gaming capabilities fit into the criteria (but I’m kinda invested with the Apple product… not a fanatic, but just reluctant to change phones in general. You know, I’m just obeying Newton’s first law).

When I want to play a game on my phone, I just start the game up. I don’t have to switch on the phone because it’s already switched on. The start up and closing times are (usually) fast. The games don’t need saving, or saves fast, or saves in a way you don’t notice (like on closing). My only concerns are the small screen, and whether I like the game.

I’m saying all this because applications are about the user. I’ve been looking at the top games from the Apple App Store. They seem to be the type of game where it’s easy to learn, easy to start up, easy to let go. Perfect for the attention-deficit and finicky modern mobile phone user. Compare this to the in-depth role playing games I’ve played in the past, burning through hours of playtime just to gain enough levels so I could at least survive the beginning attacks of the boss fight.

Times have changed…

The Psychotic Line – 3rd dimension of the Real Line

We have the Real Line, from negative infinity on one end to positive infinity on the other. Then we have the Imaginary Line, where we rotate numbers on the Real Line around to obtain imaginary numbers (or complex numbers). So what’s the natural logical progression?

Meet the Psychotic Line, with delusional numbers. As expected, special cases of delusional numbers collapse to either a complex number or real number, by simply setting the delusional component to zero.

The delusional part, j, shall be defined as
j^2 = -i
where i is the unit pure imaginary number.

Thus, j^4 = (-i)^2 = (-1)^2 * i^2 = -1

A typical delusional number is written as
d = a + bi + cj
(d stands for delusional, how coincidentally fortunate!)

Where complex numbers require rotation of 360 degrees to span the full complex plane, delusional numbers only require 180 degrees. Simply study spherical coordinates to understand why (part of the effort is already done by rotation from complex numbers). Once one can leap from the real world to the imaginary world, it takes half the energy to jump to the psychotic world.

One should study the psychotic line, delusional numbers and their properties, for they (possibly) hold the secret to untapped human cerebral abilities, interstellar travel, and maybe even a longer answer to the Ultimate Question of Life, the Universe, and Everything. I wish you luck.

PS: This was written in jest. You’re supposed to laugh.

Comparisons using the eyeball check

Back when I first started working, one of my duties every month was to check reports. Yes, I know it says “Systems Analyst” on my job title then. Thank you for pointing that out. Don’t new staff often take on all sorts of miscellaneous duties like that?

As I was saying, I was to check reports (some financial data was involved). The users would check them of course. We’re just checking them (the report generator program was written by us) before handing the reports to them. Basically, it’s to make sure the numbers tally for the sections that they’re meant to be the same.

Now the reports were PDFs. In order to save paper (and more importantly, not keep so much paper physically), I check them on the computer screen. My colleague taught me a simple trick. Use Alt-Tab.

Open the first report and maximise it on the screen. Open the second report and maximise it on the screen too. Then I Alt-Tab between the 2 reports, flipping rapidly to make sure the numbers were identical, then paging to the next on both report, and so on and so forth.

I’m not understanding the content of the page, I’m using visual recognition. As in that’s not really a zero that’s registering in my brain. More like a slightly vertically elongated circle. I’m not comparing words and numbers. I’m comparing pixels.

PDFs aren’t diff-able (at least not that I know of). And it turns out that comparing PDFs using the eyeball check is exceedingly simple (albeit manual and tedious) with the Alt-Tab trick. It’s like facial recognition. Humans are good at recognising faces. We haven’t gotten computers to do on par though…

P.S. In case you don’t know about Alt-Tab, on Windows (hi Mac user!), when you hold the Alt button and tap the Tab button, the window just before your current window pops up. So I open the first report, then open the second report. The first report is on the window just before the second report’s window. Alt-Tab once to bring the first report into focus, pushing the second report back. Repeated Alt-Tabbing simply cycles between the 2 most “current” of the windows, in our case, the 2 reports.

Unpredictable next moves

I’ve been playing Dungeons & Dragons for a while now, and starting to get the hang of it. This group of friends are, shall we say, very tactics-focused. If you’re a D&D player, you should know what I mean. D&D is a tabletop role playing game, and we just happen to focus on the “tabletop” and “game” part. Nothing wrong with that, and it’s still fun.

Now, these friends are very tactics-focused (I think I said that…), and being the new kid on the block, I want to decide on my moves fast, so that gameplay moves on smoothly for the whole group. The moment my turn ends, I think of what I want to do when my turn comes again.

At first, it was easy. There were few enemies. We were a small group at first (4 players including me and the DM). We were playing low level characters, so we had few powers to select from.

Then we decided to play the higher levels (paragon tier, if you happen to know D&D). And a couple of other players wanted to join. The game was starting to get complex, with a lot of paperwork going on. More players, more powers to choose from, more deadly monsters (the DM had to delegate initiative tracking to another player because he was too busy tracking monster hit points and powers).

There were these power cards that I had, together with the character sheet. Basically, they contained the essential information that power has, such as how to determine hits, damage, and any special effects. At the higher levels, I was holding maybe 30 cards.

This became a problem, because of analysis paralysis. “What do I do now?” was a difficult question to answer. One of my friends gave an amusing solution. He said he’d shuffle the cards in his hands, and then a “I will use this one!”, and randomly picked a card out of the stack.

As we played together, I got used to the tactics used by them. We had teamwork. Yay. Which still didn’t completely solve the problem “What do I do now?” when it’s my turn. I would pick, based on the positions of the enemies and my allies, a power to use that was most advantageous. Which changed, the moment an enemy moved out of my reach, or an ally moved into my planned spot of devastation, or an enemy came after me and practically killed me.

Whatever plans I had was only static when it’s my turn. Which might make all that pre-planning useless. There was this game session where I saw a bunch of monsters grouped together (3, which was a lot, considering the sparsity of monsters in most encounters), and I planned a deadly spell to unleash on the lot of them.

I waited for my turn, keeping track of what my allies were doing, and what the monsters were doing (particularly those 3). And when it was just before my turn, a friend before me teleported right smack into the area I was going to blast. I had to make a quick decision, and ran through my stack of cards to see what else I could do.

He made his attack and was done with his turn. Fortunately, I found something that hurt 2 monsters, thus leaving him unhurt (as well as the lucky third monster). It wasn’t the best choice, but I’d rather not set him ablaze.

With all the available choices and moves of the enemies and allies, it’s hard to foresee how the battle was going, and how I was going to respond. Everything was fairly unpredictable.

The worst thing was, I played the only character with special effects, such as blinding, dazing or moving the enemies. The others had marginal similar effects, but they were mainly the damage dealers. I could best contribute by making the battles harder for the enemies, and easier for my friends. So I was searching for a combination of ok damage, and debilitating effects on my cards. It’s hard.

All this is a long winded way of saying, if you’re designing a user interface, make it as unambiguous as possible. The user do not want choice. You, do not want unpredictable next moves from the user. Unless you planned it, of course.

How long does your program live? Part 2

Ok, it’s been a long time since part 1. I apologise. Frankly speaking, I can’t remember what I wanted to talk about… After much thinking and recalling and tea drinking, it came back to me.

So, problems. I was talking about a family of programs living way longer than its creators at my company in part 1. And that program dealt with financial years. Here’s the thing. Financial years were represented in “pairs” of years and in 2 digit form. Thus we have, say, financial year 09/10, representing April 2009 till March 2010. The previous financial year would be 08/09, representing April 2008 till March 2009.

My problem then was that, this family of programs lived everywhere. There were “09/10″ notations in the database tables and views, in the stored procedures, in the Unix shell scripts, and in the C programs. I had a lot of work cut out for me.

My first goal was to get similar C programs to be replaced by just 1 program. Oh you didn’t know? There were programs like foo0809.c, foo0708.c, foo0607.c, and there’s bar0809.c, bar0708.c, bar0607.c … you get the picture. So I wrote a fooXXXX.c to replace all the foo programs, and corresponding C programs for the rest. It was basically a careful search-and-replace operation, together with an additional parameter for the financial year in the main() arguments.

Sometimes, a program generalised to take in parameters is better than several programs doing the same thing but on different database tables. I guess the original programmers didn’t plan enough about the whole structure of the system working together.

Then I did the search-and-replace operation for the shell scripts too. Some of the shell scripts also creates views and database tables for the new financial year, so I had to take care of that. Then came the really nightmarish task of tackling the user interface run entirely by a shell script…

The UI consisted of carefully aligned printed text, and choice options. Much like the choose your own adventure computer games of yore, where you were given a description of the place you’re at, and some choices you could do. This one looked something like:

===================================
     Welcome to Program Foo!

Please choose an option:
1) Jump up and shout
2) Do a funny dance
3) Eat a sandwich
4) Point your finger at your most
   hated enemy, and cry
   "Behold the wrath of my fury!"
   fully expecting some sort of
   lightning or fire to erupt on
   the body of said hated enemy.
5) Exit program

Enter your choice :
===================================

The fun part of it was that there were different variations of presenting the financial year. Some parts used “fy 09/10″, some used “fy0910″, some used “fy 2009/2010″. Know also that I worked with it where pre-2000 years existed, and some interesting programming calculations were called for… most notable was 1999/2000.

I had to keep, say 2009 in a variable. For the “current” financial year, I would add 1 to it to get 2010, then do substrings on them to get the last two digits and print them to get 0910. (or 09/10 depending). The requirement were such that the latest 5 financial years were to be displayed, so I decided to just precalculate the 5 years on immediately loading the script.

Then there was the special condition. Because the programs dealt with data from the previous month, when executing the main UI script in April 2009, it’s not considered the financial year 2009/2010. It’s still 2008/2009. I only knew this because that senior developer (previously mentioned in part 1) said the UI was one month “early”.

So finally, I was done. The main UI script has options which run either another script or C program. Those child scripts or C programs then ran against the database tables. And all of them used the correct financial years.

That’s it. I’m fairly sure I had a third part in mind for this series… Let me go search my memories…