Native games on UIQ (PART1)
Audience
There are various ways to enter a new arena, as a scholar my interest in electronics saw me building electronic toys, gadgets and games. When the digital age beckoned I often sat in the back of the lecture theatre doodling graphics for a game to write once we had a laboratory session with computer access. Once I got a job things changed, but I still doodle. The mobile platform presents a new opportunity for many, so you might be here because you want to learn how to write applications natively (C++) for Symbian O/S and have fun while doing it, or you are new to Symbian and want to write a game that takes advantage of the platform to the MAX!
Those are my 2 audiences for this series, one last thing about me I promise. I love Windows development; so a lot of what I share I will draw parallels with Microsoft APIs, whenever the context makes sense. After 15 years on windows it is hard to shake the Microsoft-way. I am also a recent starter to Symbian O/S with just less than a years' experience. I do not know how many parts thus tutorial series I will fill, but I have enough for 2 already, so here goes.
The most successful apps and games I ever wrote started with a great idea, I am not going to bore you with ideas like 'replay-ability', 'cool graphics' etc, but rather: 'easy-of-use', 'great UI' and 'fast!'. Unfortunately you probably do not have your great game concept already at hand today, so in this article I am starting with the how of design, and then graphics, then since you are itching to write code we get the concepts tested, and only then start code. If you rush right in and start coding, you may have an inflexible architecture to deal with, so we leave the coding untill the last minute, and test out lots of ideas along the way, debug them and finally plug them into our design in the end. My aim is not to show you how to write games in general, but as I explained, to teach you how to leverage the O/S and provide a user experience. Code does not do that, design does. While we put our design together we will be looking for features and algorithms to make it all work. Once we are ready to put it all together and have learned all we can about what the platform can and can't do ; we can start to code our application.
I am patterning my tutorial on the P990i, but most UIQ phones will do the miles I intend covering. I have gathered some resources that will give you some idea of the options, and links to some source that you should try dig up and study while we are still in the design phase. One big killer could be portability if you decide you want to port to S60 latter, a solid understanding of the porting effort involved might help our design come along.
Links
Some source samples and inspiration to write games; each part of this tutorial will feature some links.
UIQ.com Full example applications
Nokia games_resources
An S60 port of nethack
The SDN Wiki (open source projects)
NGage Home
Lastly you want a good intro to Symbian O/S, and that will be 'Symbian OS Explained' by Jo Stichbury *blog* available from Symbian press.
OK now you have some fun reading material, lets continue.
Game Concept
I am going to move into the game concept now so that the design will make some sense, the game is damn silly and turn-based, but the series is a gentle intro to the platform, because I am also learning. Lately I rarely bite off more than I can chew.
The intended help text here is a clue to our design, but also our first problem...
Shoot the Wumpus is a memory game which is played in a
randomly generated maze. The setting is quite simple, the
Wumpus is hungry, and you are a food source.
You have fallen down a shaft into a dark tomb.
From the light coming from the collapsed ceiling you see no
way back up, the floor of the tomb appears quite clear of
debris, something lives here! You look for a weapon, and
pick up a bow and some arrows before heading into the darkness.
You point the tip of the bow ahead so as not to bump into
anything. From here you can just see a passage ahead, sniffing
the dank air reveals nothing more than what your eyes can tell
in the inky black.
Aim
Stay alive and find the exit. The denizens of the tomb are
quite harmless all but one, there are a few bottomless wells
to watch out for and only one way to get out. It will take
some time to find the exit, and the Wumpus is still hungry,
scarring him away could buy you some time though.
How
The game uses four compass directions, you navigate in each
direction as you go, beginners will try draw a map as they go.
Often the way forward is blocked and you need to choose North,
South, East or West, whichever is open to you. You will know
when you reach the exit stairwell, your ultimate goal. If you
detect or suspect that the Wumpus is near, you might fire one
of your precious arrows in his direction. If it does not simply
strike a wall, but hits the Wumpus, you scare him off for a while.
Strategy
The starting skill level determines how big the maze is, and
the appetite of the Wumpus, as well as how many arrows you
find to start out with. Experienced players will encounter
more of the tombs other inhabitants none of whom are helpful
but the toughest may find artifacts to help lead them to safety.
Game design
The problem is how we display the help text to the user, there are a few options, but the best might just be to load the text from file thus saving runtime memory, something you will be doing quite often looking ahead.
Next up is some design ideas covering how we intend providing the experience we have just described in the help text above.
Intro:
As a thinking game you can move as quickly or slowly as you like.
There are two kinds of objects in the game:
- static objects
- moving objects
description. | passable | terminal 1. walls n y 2. empty passage y n 3. bottomless pit y y 4. exit stairwell y n 5. fallen ceiling y n 6. deep water n y
Each of these has a description of its own.
If something is 'terminal' it means it will 'terminate' the player.
Moving Objects
These are objects that can be picked up (removed from the world) dropped or otherwise modify the game experience. Items may be stacked on the ground.
description. | terminal | inventory | effect 1. player n n n 2. Wumpus y*1 n n 3. bats n n y*2 4. bow n y n 5. arrows n y n*3 6. slippy slime n n y*4 7. burning torch n y y*5 8. tinder and oil n y y*6 9. bucket of water n n y*7 10.gold ring n y y*8 11.silver ring n y y*9 12.debris n n y*10
Objects that have effect have some function, for instance :
- [*1] You get eaten, nothing personal about it, just like the Wumpus own hygiene routine, it is not personable at all. The Wumpus is consequently detectable for a 1 square radius.
- [*2] encountering bats will disorient the player as they flutter about your head and you try to fend them off.
- [*3] arrows : You also need a bow to be able to use these, and they come in quivers of 3 arrows only.
- [*4] slime : when encountered you stand a chance of loosing your balance and your orientation.
- [*5] torch : You can't put this into your pocket when you find it, but it will light just enough of the gloom to let you see what is in the next room, without it artifacts in there are invisible. Goes out after a while!
- [*6] tinder : You can relight a torch (if you have one).
- [*7] bucket of water. If you can see it and drink it, your mind will clear for a while. If you encounter it in the dark, it tips over, emptying with a clatter. You cannot carry the bucket with you, once drunk it is discarded in a corner lest it trip you up.
- [*8] and [*9] ring: depending on which it is, the ring will either give you helpful or un-helpful hints.
- [*10] debris : makes a crunch noise as you step on it, whether this helps you or not is up to you.
Coming soon PART2, the rest of the design, Carbide IDE, and some graphics experimentation!






Audience
The market of UIQ3 software is really small. Much smaller than S60 or Windows Mobile market. So don't expect great revenue from games development on UIQ3.
Welcome (author)
This little tutorial is already generating interest, great. I do not want to subtract from what I've posted, but instead encourage developers. I realize that previous tutorials have been written for S60 by the dozen, (and I am providing links to them in this series) hence a UIQ approach today. It's also in my nature to not back the clear winner in a race, there is no challenge in that; notwithstanding I hope that most of this series sheds fresh light on the mobile platform in general and not just the UIQ touch-screen interface. I am happy to integrate non-UIQ concepts back into the series, so all the Nokia fans can also ask, and hopefully I can answer.