Wednesday, December 16, 2009

Gameplay and Storytelling: Part 3

I recently downloaded a game for the iPhone called Suviving High School, part 3. I was anticipating not liking it, because I am not a fan of current teen culture, and the game seemed likely to glorify it. The reason I felt interested in downloading it was because it seemed to be a game where story was important.

One of my long term goals with game development is to develop a style of gameplay where what you do in the game and what you do in the story are linked. Surviving High School showed me two things: 1) This is a viable gameplay mechanic, and 2) There is a demand for it.

Surviving High School is, in essence, a very rudimentary version of what it is that I hope to eventually accomplish. The game follows the story of you, going through high school, and along the ways you get to choose to do various things, build relationships with people, and in the end, based on how you did, things happen.

It also handles a couple of the things that I have been concerned about quite well, specifically, how to drive the player. Up front, the player is given three main goals: Win at football, Get a car, become popular. It is, of course, essentially impossible to pull all of these things off, and the player must make choices along the lines where they are going to concentrate. Are they going to make their character strong so that he can perform 'special moves' in football? Are they going to spend time studying so that they can do better at school, so that they do well enough that their dad buys them a car? Or are they going to watch TV and skip class to be come popular? (Philosophically, that's the part I hate most - that the player was rewarded for doing such things - but whatever, I won't go into a teen-lifestyle rant today :)

Where this game differs from my view on what I hope to eventually accomplish, down the road, with this style of gameplay is the characters interaction. What we have here is great - I actually enjoyed building up relationships with the various characters, and I really tried hard to have a good relationship with the girl who I was dating, and I really felt bad when other characters didn't get along well with my character. And I point out that this game does it very well, and it has excellent scripts and the characters are interesting and varied. But what I want to accomplish is a game where your interactions with other characters are richer. Surviving High School plays roughly like a "Choose your own adventure" game, where your relationship with characters is dependent on what you say in situations where you only get to choose one of two possible things to say.

I want to someday have a style of gameplay where you can go, strike up a conversation with another character, and say pretty much whatever. This of course leads to many concerns, of which syntax, performance, and possibilities are among them. I have been thinking more and more about the idea of symbolic language, as used in Siboot. (This would also solve the difficulty of porting to other languages; no having to learn how to parse multiple languages!)

Alright, so saying "Pretty much whatever" is unlikely, and it would lead to players saying dumb things to the characters. (You know that as soon as you start talking to one of those 'bots' online or wherever, you try to say the zaniest thing possible in the hopes of tripping it up). But creating a more rich, verbose interaction between characters, I believe, will really immerse the players. Because truthfully, in Surviving High School, there were many times when I didn't feel compelled to say or do either of the things that I was given the choice of doing, and felt as if I were picking the "lesser of two evils".

There is one other area that Surviving High School did well that I still would like to potentially improve upon in my own game down the road, and that is variety of actions. In SHS, the game calls on you to do many things, from sing to act to play football to etc..., and each of these things would of course require different minigames or actions to fully work. What they have instead for most cases is word based games; you spell or choose words that are related to the actions. This nicely solves the problem of having to create many different actions for the player to perform but at the same time devalues the experience of trying to accomplish some of the things your character does. While it would be difficult to create a game where the player has many options of actions on top of the various conversation requirements this game would require, I feel that finding some solution to this would be important.

At this point all of my ideas are experimental and I don't know how to solve all the problems I am encountering in my mental designs. Those that I am finding solutions for are often expensive or require vast amounts of technology and scripting times. It will require vast amounts of experimentation and iterations before this style of gameplay is fully realised. Perhaps I won't even be the one to realise it, but I hope to be involved to some degree.

Friday, December 11, 2009

Castle Conflict: Update is live!

The original plan for the Castle Conflict update was for it to take eight days to develop (similar to our original development cycle of 8 days). Of course, live intervened, and during that 8 day period, I had a concert, a contract to work on, family commitments, and many other interruptions. These conditions existed the first time as well, but we we had planned this time ... well ... it took longer.

Nonetheless, we had a game that had rough versions of all the features by the Monday after we had started, which was good because myself and the Lead Programmer from FPM Software (a new iPhone company in Calgary working on games, the first of which, Shift Maze, was submitted to the app store on Wednesday) were hosting a testing dinner that night, where friends and family got a chance to play our game. We, of course, bribed them with food.

The app was delayed a further two weeks. One week, I was away from the code base, working on and teaching iPhone Dev School with Michael Sikorsky, who also has a game that has been or will soon be submitted to the app store.

Josiah (the artist/audio developer) and I decided to take another week to finish the app, to make sure that it was a really polished experience. And so it was that, 4 and a half hours past our deadline, on the morning of December 8th, we finally clicked the 'submit' button so that Apple could view our game.

Castle Conflict went live around midnight last night. The new update does not have all the features we planned, yet both Josiah and myself keep playing the game. (I have gone through campaign mode probably 10 times by now, and am still not bored of it). We are planning future updates already, now that we have the architecture in for levels and new units to be added easily.

It has been a wild ride. But it has been fruitful!

Screenshots of the new update:












We also have a youtube video:



(and if you go to our channel, there are also 4 videos that show the game being developed).

And finally, the iTunes URL :)

Monday, December 7, 2009

iPhone tip: don't change ${EXECUTABLE_NAME}

This is a series of quick tips for people who are having a few problems, with ad-hoc iPhone builds and xCode in general.

1) When creating an ad-hoc iPhone app, be sure to have a 512*512 png file in your app called iTunesArtwork . Just iTunesArtwork, no png at the end.
2) Be sure to create an Entitlements file (Add->New File->Code Signing->Entitlements). Name it whatever, and place it in the root, not in any subfolders. Then, go into the information for your target, and set the Code Signing Entitlments field to the name of that file.

The next one is important, as I lost > 30 minutes on it: do not change ${EXECUTABLE_NAME}. This is in the information for your Target, under properties/Executable. I decided to change this, because I had one target for regular development and one for ad-hoc distribution, and I thought to myself, boy, it would be neat to be able to tell the output of these targets apart easily. So I changed that value to CC_AdHoc, and suddenly my code was exploding. The worst error I got was "CC.app: object file format invalid or unsuitable". It took me a while to realise that it was the ${EXECUTABLE_NAME} that was causing the problem, and once I did, was highly frustrated. So just leave that variable alone, it will save you a lot of problems.

Thursday, December 3, 2009

Objective C in-code profiling

To check how long something is running in objective C:

1) Declare an NSDate and set it to [NSDate date]
2) Run the code you want to test
3) Get an NSInterval from the NSDate by sending the timeIntervalSinceNow message

So for example:

NSDate* date = [NSDate date];
//RUN some expensive code her
NSTimeInterval interval = [date timeIntervalSinceNow];
NSLog(@"Time running expensive code: %f", interval);

Tuesday, November 17, 2009

iPhone Games / Return of Castle Conflict

The return of Castle Conflict / Week of no sleep round 2

It is something that's been in the back of Josiah's and my mind for months now (ever since Castle Conflict first went live in May), something that we'd intended to do a lot earlier. When we first released the game, the reviews we were getting basically said, "We love this game, but there's not enough of it!". When you have users saying, "We want more of your game!", then usually, it's a good idea to give them more of it.

All well and fair, but we felt fairly limited in what we could do. We had some significant problems, most notably, screen space; we had used up all the screen space we could, and any new units we added would require more buttons. Where would those go?

The second was, if we only have 8 units, how do we make multiple levels?

At the time, we were still of the mindset that iPhone games would not take us long to make. Castle Conflict had taken us 1 day of prototyping + 8 days developing + 1 day finalising. And those weren't full days. Furthermore, we had an idea for another game that we thought would not take long to make: Ant Attack. Surely, if we made Castle Conflict in a week, we could make Ant Attack in one, maybe two? And during that week, we could let our subconcious work on ideas for how to fix Castle Conflict. Surely, our users could wait a week for another update?

That ended up not being the case. The truth is, we don't work together full-time. I had a couple of computer games I was finishing up at the time. Josiah is also working on a computer game and a band project. To make matters further delayed, we each had a summer vacation of greater than one week planned, but neither of us at the same time.

Ant Attack ended up taking us 4 weeks of development, but because of our varied schedules, did not get released until the middle of October, at which point I was in the midst of a move. So it is with a huge sigh of relief that we were able to sit down, solve the aforementioned problems of Castle Conflict, and free a block of time to finish it.

Let this be a lesson to all future iPhone developers: Make your update for your game as soon as possible! What we should have thought in May, and will think next time, is "Surely this audience who might want Ant Attack can wait a week until our existing audience is pleased with the update they have told us they want." Because, you don't know how often those weeks of productivity are going to be available to you. And you want to address the audience that already exists, not one that might not.

What update?

In order for this to be feasible in the time we have available (once again, just one week), we are once again structuring this update in a tiered manner, and those tiers are:

1) Campaign Mode, New unit pack 1
2) Quick Play Cleanup
3) Campaign Mode Cleanup
4) New Unit Pack 2
5) New Unit Pack 3
6) Multiplayer

Sadly, multiplayer is last, and we don't really expect to get it in this update, as much as we would like to. Luckily, updating is easy to do.

Planning is Key!

We have one week for this project, so once again, we are using as many productivity tools as possible to keep things organised and moving smoothly.

1) MSN: We are working from different cities, so the ability to communicate in real time is a huge need. MSN allows us to do that.

2) XP-Dev: We are once again using this online tool to manage our tasks and plan our project. The software has been updated, so before where we had to rank our tasks by integral values to determine their importance, this time we were able to split our tasks across multiple iterations, as outline above.

3) Mockups/Flow charts: Okay, so we are very 'indy', and I use the free Mac 'Paintbrush' software to make these, so they don't look as professional as those done in Visio or another equivalent software. Nonetheless, sometimes the best way to communicate is visually, so we use images as below to communicate ideas before spending hours working on implementation and graphics for them:


Friday, November 13, 2009

Storytelling in Games: Part 2

The Game Industry likes to refer to itself as art. They like to talk about how they allow the players to have deeper experiences in the story than the player has had before. I am not going to comment on whether or not games count as art (I think it's subjective and on a case by case basis), but the storytelling is an interesting aspect.

When a reader reads a book, they often feel strong connections to their characters. They get to hear what their characters think, feel, dream, hope, etc. It can reach a point where, if a reader is truly immersed, they feel like they ARE a character. Games give players one more step into that immersion. They let players actually BE that character. But this is a problem, because games usually have the following constraints:

1) A linear or semi-linear story
2) A path for their protagonist
3) Other characters that the player interacts with.

I'm going to use Tales of Symphonia, an RPG for the GameCube, as an example of this. Let's consider the story. You play as a main character, Lloyd, who is trying to save the world. Lloyd does so by running around, killing random monsters, levelling up, and beating bosses. Over time, he encounters other characters, which join his party. Now let's examine how the above effect the players perception of themselves as Lloyd:

A linear or semi-linear story

Lloyd really has about one goal, and he can only really approach one ending. "Defeat the bad guys, save the world." The plot is a bit more complex, but that is the overriding choice that the player makes. There are certain dungeons to which the player must go, to collect certain things, to reach this ending. The player does not get much of a choice in that; they have to follow a roughly linear, designed path to 'whats next'.

Tales of Symphonia is what I would classify as 'semi-linear'. The player can make choices along the way that effect the ending, either by effecting the relationship between their character and other characters, and they can even change the end a bit. But there are finite choices that they can make, and these are NOT tied to the gameplay. Throughout the game, the player is given several binary decisions, and based on which ones they select, the ending varies. So, the player CAN influence the ending of the game, but to do so is almost a seperate section of the game then how they PLAY the game. It does not matter how many random monsters you kill, or how strong your character is. The core gameplay is not the deciding factor.

A Path for the Protagonist

In Tales of Symphonia, the player is guided by other characters and clues as to where to go next. There are not really a ton of options, for the player must hit all certain spots, and experience certain events, before the story can advance. "Side Quests" are the closest thing to additional story, but they often include supplementary or inconsequential story, and do not actually move the key plot forward.

The metaphor that the game promotes for the path to victory does not leave the player with a lot of time to figure out their own way of creating a path to victory. They must follow the path that the game has set forth for them.

Other Characters that the player interacts with

Oh boy, this is the hardest part to tell in a story. In a book, the characters have a free range to say whatever the author wants them to say, and interactions can be as complex or simple as any scene allows. The same is true for theater, movies, television, radio, and pretty much any other drama with dialogue.

But in games, we run into a problem. The player has to interact with other characters, but we can't really create verbose responses for everything that the player can say. In Tales of Symphonia, Lloyd has his own personality and talks for the player. That is one solution, although it breaks the illusion that we are Lloyd, and it works really strange with the scenes where Lloyd gives you a choice of two different things to say. Suddenly, we are Lloyd, but normally we are not? The amount we get to shape our character is pretty minimal.

Games have handled this in a variety of different ways over the years. In the Legend of Zelda, you never see what it is that Link says, only the responses that the NPC's give. So you can imagine that Link said whatever you want, as long as it makes sense with that response. In the Monkey Island and similar series, the player doesn't say anything until the player makes a choice about what to say, and then the computer has a series of canned responses. So there is more options, but ultimately, it often results in the player trying to say everything to see what they can learn from the NPC's, even if it means taking similar dialogue paths again and again.

In the Computer Science industry, programmers have been trying to get computers to talk for years. A.L.I.C.E. is an example of a bot that was scripted, but after tons of work on ai and intelligent sentence responses and parsing, the bot could still get confused by complex sentences. While the technology has doubtless advanced in the years since, it is still unlikely that the technology exists for a computer agent who could respond intelligently to any statement the player could construct, let alone adapt that entity to have a growing, changing relationship with the player, interact with the player in non-speech methods, and then expand that to have many such characters in the game world.

So, in short, this is the biggest difficulty encountering story-game evangelists. Interestingly, a method of dealing with this was developed by Chris Crawford on a Mac game in the '80s called Siboot. Essnetially, a limited number of symbols was used to represent different things that the player could say, and so the player communicated with other characters in a symbolic manner. He gives an excellent explanation of it in his book "Chris Crawford on Game Design", which I highly recommend reading.


These are only some of the difficulties that story's must overcome in games, but step one of the battle is understanding the problems to overcome.

Sunday, October 18, 2009

iPhone Dev Camp Keynote

iPhone Dev Camp is in the process of wrapping up even now. During the course of the camp, we were all able to share some valuable lessons. Here I will share some links to some of the interesting libraries and tools that were discussed:

MonoTouch - A development environment for creating iPhone apps in C# with .net

App Vis - A place to download a visualizer for your iPhone Apps status.

Five Second Test - Interface feedback

Squeezing every drop of performance out of the iPhone - A slideshow by someone who really tried to get a smoothly operating app.

Anti-Crack - piracy prevention for your iPhone Apps

Pinch Media - I've talked about them before in this blog, but they came up a bit during the camp. A website for a great library to learn about how users are using your application.

iPhoenix Fund - A fund for developing 133 iPhone apps


I myself gave a keynote today, about Cocos2D and developing games quickly. Although I do not think it has as much value without someone speaking to it, it has been requested that I share the keynote presentation. For those interested, a link to it exists at: this link.

As I type this, those participating in the app track are finishing up development on their app. They gave a demo of what they had a couple hours ago, and it really is amazing how quickly they came up with an app idea and began to implement it. If I understand correctly, the app is actually going to be used at the Calgary Science Center.

The camp was a lot of fun and overall a large success. If you are in the Calgary area, interested in iPhone development, and missed out, I urge you to attend the next one. I will post with details in my blog about it when I know them, instead of the day before like I did this time.

Thanks again to Michael Sikorsky for organising and hosting the event!