Archive for July, 2010

… in particular, netbooks.

I was asked by a family member to help choose a netbook. For those who don’t know, netbooks are small, cut-down notebooks (laptops), with just enough processing power to do email and surf the web. They typically have a 10 inch screen, a single core CPU (Central Processing Unit, the brain), and an integrated GPU (Graphics Processing Unit, which draws all the graphics on the screen), 1GB of RAM (Random Access Memory, short-term memory), 160GB Hard Drive (long term memory) and no CD drive. As a result, they’re generally cheaper than their larger notebook cousins but, as is the case in many arenas, you get what you pay for.

So, out of the veritable smorgasbord of netbooks on offer, I had to decide which one to recommend. Having ascertained how the netbook was to be used, I could start min-maxing.

Er, what’s min-maxing, you might wonder.

Well, it comes from game character creation where a player has a certain number of attribute points to divide between various character traits, such as strength, wisdom, dexterity, etc. and they apportion those points in such a way as to create the best character possible for the role in question.

So, if they wanted a brutish figher, for instance, they would put most points on strength and only a few, if any, on wisdom. Or, if they wanted a roguish character, dexterity would receive a lot of points (to improve the character’s chances of success at sleight of hand) and not so many on the other traits. Of course, the player could spread the points out evenly amongst all the traits, in which case the character would tend to be a jack-of-all trades (but master of none).

Now, as far as I’m aware, netbooks don’t tend to have dexterity or wisdom attributes (although, arguably they do have strength), but they do have other attributes which I needed to take into account.

The main ones are: CPU speed, GPU speed, RAM, OS (Operating System), hard drive size and battery life.

Generally, with a computer, there needs to be a balance between certain attributes if the machine is to perform to the best of its ability.

For example, if the CPU is fast, but the GPU is slow, the extra speed of the CPU will be wasted while the GPU is struggling to draw all the graphics.

Conversely, if the CPU is slow and the GPU is fast, the GPU will be twiddling its proverbial thumbs while the CPU is struggling to supply it with the data needed so it can draw to the screen.

If the netbook only has a small amount of RAM, both the CPU and the GPU will be putting their feet up while the hard drive thrashes about paging data in and out of RAM.

Lastly, the efficiency of the OS (Windows XP or Windows 7) can have an impact on performance, so I had to weigh up the benefit of a slightly faster and less resource hungry Windows XP (which won’t be supported by Microsoft beyond 2014) against the slightly slower and less efficient, but potentially better supported Windows 7.

So, having looked at all the netbooks from a variety of websites, I plumped for one within budget which had a reasonable CPU (although not the fastest) as it had a better GPU than that of the faster CPU netbook. I guestimated this combination would provide a smoother user experience overall, especially on graphics-heavy websites. And since this machine was just going to be used for email and surfing, it didn’t need a huge hard drive to store a lot of data. However, it did need a reasonably long battery life, as it was to be used whilst away from home, and it also needed more than four years of Windows Updates if it was to be used for the projected time span.

Well, the netbook in question has now been ordered, so we’ll see in due course whether my min-maxing efforts will have paid off.


Read Full Post »

Title screen

Animal Trackers for iPhone - Half-price SALE! Now only 99c (69p)

This unique timed puzzle game for both adults and kids will have you tracking a variety of animals over 50 levels across diverse terrain, solving simple puzzles along the way. And now only 99c (69p) in the half-price SALE!

AppStore: https://itunes.apple.com/app/animal-trackers/id367460068?mt=8


Title screen

Animal Trackers for iPhone. Now only 99c (69p)

Continuing on from the Family Tech Support saga, I had a fortuitious text from a friend of mine asking how I was (thanks Abdi), so I told him my predicament. He suggested downloading the free UBCD (Ultimate Boot CD) data and burning it onto a CD and using that (rather than a bootable floppy disk) to get read/write access to the user data on the laptop so I could copy it to an external drive.

So, I got the UBCD4Win version, burnt a CD (not a DVD, which didn’t work), changed the boot sequence in the BIOS so the CD drive was at the top of the list, and booted into a cut-down version of Windows XP which allowed me to copy the user data onto the USB hard drive. At least now, if all else was lost, the data wasn’t.

So, back to that error message:

STOP: c000021a {Fatal System Error}
The Windows Logon Process system process terminated unexpectedly with a status of 0xc0000135 (0x00000000 0x00000000).
The system has been shut down.

A Microsoft article had said that error code c000021a indicated that the problem was occuring during the execution of either of the files csrss.exe and/or winlogon.exe. So, I replaced the files, just in case they had somehow got corrupted, but that made no difference.

More searches later, a suggestion was to return to a previous restore point before the problem occurred. Usually, you need to be able to load up Windows before you can do that, but this post showed how to do so using just the Repair Console. However, since I now had a bootable UBCD, I could do the same thing in fewer steps using that. And after a number of attempts at progressively earlier restore points… the problem still persisted!

Yet still more searches later revealed a useful piece of information. Apparently, according to a German thread, status 0xc0000135 means ‘Missing DLL’!

Aha! But which one(s)? The suggestion was to compare all the DLLs on the laptop with all those on a healthy PC and copy across just those that were missing. Since both PCs had in excess of 1300 DLLs in the C:\Windows\System32 folder, doing the comparison by hand would have taken ages. Fortunately, Microsoft has a tool call SyncToy which allows you to compare two folders and synchronise their contents – as long as the PC has Microsoft .NET Framework v2.0 installed… which, needless to say, the laptop didn’t.

Title screen

Animal Trackers for iPhone - Half-price SALE! Now only 99c (69p)

Be prepared for doubled-back trails, trails disappearing down holes, multiple trails, trails that cross water, hedges that need to be hacked, boulders that need to be moved, switches that need to be flipped, snow that will slow you down and sand dunes that need to be negotiated.

AppStore: https://itunes.apple.com/app/animal-trackers/id367460068?mt=8


So, some shuffling about of files amongst PCs ensued. My girlfriend’s PC has Windows XP Home, so I copied all her DLLs in the C:\Windows\System32 folder to a new folder (WorkingPC) on the USB hard drive. I then plugged it into the XP Home laptop and copied all its DLLs into another folder (Laptop) on the USB hard drive. I then downloaded SyncToy onto my PC (which has XP Pro), chose the third sync option (copy from the left folder to the right folder, but don’t delete anything) and previewed the result. It came back with 70+ overwrites of existing files, and 300+ new files to be copied.

Not wanting to mix up different versions of existing DLLs, I unticked all the overwrites leaving just the new files to be added. However, I wanted a folder containing just the new files, not any files that already existed on the laptop. So, I renamed the right hand folder (Laptop) to LaptopOrig, and created a new folder called Laptop. I then confirmed the sync operation, leaving the Laptop folder with the 300+ new DLLs.

Plugging the USB drive into the laptop, I copied the new DLLs into the C:\Windows\System32 folder, rebooted, removed the UBCD and waited. The Windows XP loading screen appeared, the progress bar animated… and then froze… and the screen went black. Nooooo! I turned around and looked out of the window, thinking what remedy to attempt next, but when I turned back, the Windows XP screen saying “Loading user settings…” had appeared! And a few moments later, it was at the desktop. I had a working laptop again!

Ah, deep breath… and relax…

And then get back to work on Animal Trackers, which incidentally is now finished and available on the AppStore for just 99c (69p)!

If you found this walkthrough helpful, please treat yourself to the fruits of my labours, a fun tracking game for adults and kids alike, helping the five members of Team Tracker (Foxy, Pumi, Bearny, Coyli and Sidey) track down the ten members of Team Quarry, across 5 terrains and 50 levels in the ultimate tracking competition!

AppStore: https://itunes.apple.com/app/animal-trackers/id367460068?mt=8


Foxy looking up

Animal Trackers, the iPhone game. Foxy waiting for guidance

Pumi looking up



Coyli looking up


Sidey looking up



Read Full Post »

Family Tech Support

I’ve not had much time for programming this past week or so, as I’ve been playing Tech Support for the family. This has involved cycling a couple of 43 mile round trips, the first time to pick up a family member’s laptop so I could try to fix it at my leisure at home (since there was no quick fix), and the second time to pick up an external hard drive onto which I could copy all the important data (if I could retrieve it, that is).

The symptom was the Windows XP Home laptop was stuck in a perpetual reboot sequence. After about 40 seconds or so, the Windows XP loading progress bar would freeze, the screen would go black and the laptop would reboot. Ad infinitum.

So, I pressed F8 during a reboot to get a list of boot options and went through them one at a time.

Boot into Safe Mode (with / without networking): Same problem – rebooted before it even got into Safe Mode.
Boot with debugging: Same problem.
Every other option: Same problem.

One of the options was not to automatically reboot on a system error, which I chose, and this resulted in a BSOD (Blue Screen of Death) which gave this cryptic piece of trivia:

STOP: c000021a {Fatal System Error}
The Windows Logon Process system process terminated unexpectedly with a status of 0xc0000135 (0x00000000 0x00000000).
The system has been shut down.

So, I searched the Internet from my MacBook to see if anyone else had had the same problem, and it seemed that quite a few people had. Great! Well, you know what I mean. So, expecting the solution to appear at any moment, I scrolled down the forum posts… nope, not this one… nor that one… oh, this other person has the same problem… ah, and this guy also has the problem… yes, yes, but what’s the solution?

It seemed that lots of people had the problem, but no one had a definitive remedy!

More searches ensued, and finally some solutions were proposed:

Boot from the Windows XP Home CD, enter the Repair Console and enter chkdsk /r.

The problem with that is you have to enter the administrator’s password – which no-one knew. I tried admin, Admin, password… three wrong attempts… automatic reboot. Tried a few more… automatic reboot. Did some searches online for a default password… eventually tried just pressing the enter key… and it took me to the console! (Incidentally, I did try that about half an hour before, but I didn’t realise that this console I was seeking was just the DOS prompt! It didn’t help that a message a few lines up read ‘Press enter key to quit’… but it turns out that was left over from a previous choice!)

So, finally at the Repair Console, I tried most of the options, including chkdsk to see if any files were corrupted, but they weren’t. The boot log file ntbtlog.txt was no help. I tried to copy the user data off the hard drive onto a USB thumb drive, only to be greeted with ‘Access denied’ messages.

There was the option of doing a Repair Install, but apparently that just overwrites all your system files with, in my case, Windows XP Home SP1a files which, assuming it fixed the problem, would possibly require Windows to be reactivated and also be updated to SP3 again. The activation code was fortunately stuck on the underside of the laptop, but I figured a repair install would be a second to last resort, with a full install (wiping out all user data) being the last resort…

Read Full Post »

By default, when an app starts, the iPhone’s operating system, iOS, assumes that the device is being held in a portrait orientation, where the screen is taller than it is wide. This is fine for many business apps, but for a lot of games, it’s better to have the device in a landscape orientation, where the screen is wider than it is tall.

When I wrote the first version of Animal Tracker using OpenGL ES, I didn’t actually tell iOS that I wanted my view onto the screen to be in landscape mode, I just got OpenGL ES to rotate its graphics by 90 degrees before it rendered them in the view. But with Cocoa Touch, you can request which orientations are to be supported and if the device is held in one of those, iOS will rotate the view automatically. This saves me having to manually rotate the graphics.

Well, that’s fine in principle. I wanted the game to start in landscape mode, however, irrespective of how the player was holding the device. To do this, in the Info.plist file, the property list that iOS checks when the app starts, I set the only supported orientation to landscapeRight, where the home button is to the right of the screen (as opposed to landcapeLeft, the other way round). So far so good.

Then I loaded my first view and displayed it on the screen… only to find its dimensions were wrong. Instead of the contents of the view appearing as they should, nicely laid out within a 480 x 320 area, they appeared as if they were constrained to a 640 x 160 area, resulting in them being squashed together vertically, but stretched out horizontally beyond the right edge of the screen.

OK, I thought, no big deal. I must have just forgotten to set some flag or other, or had neglected to constrain the buttons properly in the view controller’s XIB file. (A XIB file is just a freeze-dried snapshot of a number of objects, including views, backgrounds and buttons, that the programmer can drag and drop in a program called Interface Builder, IB, and which is used by the XCode IDE, hence XIB.) So, I checked my code, played around with this, checked some more, played around with that. Until, aha! The first view now appeared correctly! Then I tapped the button to move to the next view and… its contents were all squished! Argggh!

I like solving problems on my own as I think it helps in the long run to improve my programming skills. But after a few days of trying to work this thing out, I admitted defeat and looked online to see if I could get any insights. As it turned out, I was not alone. A number of other programmers had also found themselves in a similar situation and the concensus seemed to be that it was a problem with iOS itself! It doesn’t seem to read the initial orientation of the device properly.

Thankfully, Johannes Rudolph had done some research and posted a work around on the StackOverflow website, which involved enclosing the initial, or root view controller in a navigation controller, and pushing and popping subsequent view controllers as required. It wasn’t ideal, as the root view controller remains in memory the whole time, rather than being swapped out as I had it originally, but it worked!

Read Full Post »

Well, with the introduction of the iPad and iPhone 4, I needed to learn how to implement the Model-View-Controller design pattern within iOS. (It used to be called iPhone OS – the iPhone Operating System – but since it’s also used on the iPad, Apple recently dropped the ‘phone’ part.)

When I was learning to program the iPhone, I’d naturally trawled the Web looking for tutorials and came across a few interesting ones. One was a simple iTennis game written in Cocoa Touch by Brandon Treb, but it didn’t follow the MVC design pattern. So, as an exercise, I converted it to use MVC.

The game logic was now wholly contained in a few Model classes and with some tweaks to the code, my iPod Touch was able to play itself at tennis – and continue to do so, even during the time I had returned to the menu. By the time I asked it to display the game again, it had subsequently won a few more points.

At this point, I figured that since I would be separating my game logic from its visual representation, I might as well learn Cocoa Touch properly and see if that would be able to cope with the display demands of my game.

Read Full Post »

Initially, I’d only been expecting to write Animal Tracker for a single form-factor – the iPhone and iPod Touch. Each had a resolution of 320 x 480 pixels and so only a single set of resources would be necessary for both devices. Then Apple introduced the iPad, a much larger device with a resolution of 768 x 1024. Later still, the iPhone 4 appeared. It had the same size screen as previous iPhones, but had twice the resolution – 640 x 960. Both new devices could run games written purely for the iPhone / iPod Touch, but owners of these devices were beginning to expect new releases to support them specifically- preferably as Universal apps – applications in the form of a single program that would run on all three devices and take advantage of their respective features.

It then became apparent that the usual practice of embedding the game logic right in the OpenGL ES view (an object which is displayed on the screen), as exemplifed by Apple’s own template, was inadequate when it came to catering for three different displays. So, a rewrite of my game so far would be needed.

Enter MVC. It stands for Model-View-Controller and is basically a design pattern for separating the game logic from the way it is displayed. All the brains of the game go in the Model, the graphics calls go in the View, and the Controller acts as an intermediary and liaises with them both. This way, the model can just do its thing and run happily without any display at all, if it wanted, while any one of a number of controllers could interrogate the model for its current state, and then relay that to its associated view to be rendered in whatever manner was desired, be it 2D, 3D, or even text!

Read Full Post »

A few months after my accident, my Mojo came back.

It soon became evident, though, that a month’s time frame to write a game was fine for a basic, no-frills game, but if I were to have any success with Animal Tracker, I might as well take as long as was necessary to make sure it was as good as it could be. After all, there were countless games on the App Store already that looked as if they were just thrown together and deservedly got many one star reviews.

This time round, however, I decided to take things more slowly and just progam for an hour in the evening and a couple of hours or so at night. This went on for some time until I came to realise that I had spent three days on trying to find the solution to a single bug. Of course, had I not had to work during the day, I could have solved it the same day it appeared. By this time, summer was almost here, and my bank balance was much healthier, so I handed in my resignation at work and left to become a full-time indie developer!

Read Full Post »

Older Posts »