Topics: Development


Reinventing Propaganda

April 19th by Tommy Leung

We are about 11 days from the 1 year anniversary of Propaganda Lander! We know that several thousand people have played the game and hopefully most of them have enjoyed it! We’ve read every review on the App Store and scoured the web for commentary on the game so if you’re talking about us, we’ve tried to learn from it.

While we don’t have anything planned for this 1 year anniversary, we do have some pretty significant updates on the horizon. We won’t be able to have it in time for April 30th–if only we were keeping an eye on this anniversary thing at the beginning of the year!–but, we’re working as fast as we can do get it done. We refer to it as Propaganda Lander 1.5. The story hasn’t changed but, it’ll be an entirely new experience for those who have already beat the game and hopefully more enjoyable for those who’ve gotten stuck on one of the levels.

Propaganda Landers takes some patience and dedication to get through. It’s a great experience if  you’re willing to make that investment and we love all of you who have but, we’d like to share the experience with more folks. This upcoming update will significantly change the game as you see it on the App Store. You’ll still fly a space ship, land it, pick up guys, and deliver them so we aren’t changing the core mechanic. We still feel that Propaganda Lander has one of–if not the–best flying mechanics on the App Store.

We’re adding more polish, refining the levels, and generally doing the things that we would have done if we had more time a year ago. There’s more new things brewing here at SMASHWORX that we can’t share yet so stay tuned!

Expressive Gameplay

November 16th by Nikita Mikros

OK, so I guess it’s my turn to talk about Metroid.  Unlike Jess and Tommy, I don’t get a whole lot of time to myself with the TV which means I spend a lot of time on my DS and PSP.  The Metroid series has always been one of my favorite Nintendo properties. I consider the sidescrollers like Super Metroid and Fusion to be incredibly expressive and fluid.  I was not a fan of the Prime series, feeling that turning Metroid into a first person shooter was an error.  That said, when I saw the preview of Other M I knew I had to play it. I was excited that Yoshio Sakamoto was returning as creative director and my hope was that it was a return to classic Metroid with a twist. I bought the game soon after release but about 2 hours into gameplay my Wii started making some pretty horrible whirring noises.  It was as if the condition of my little white box declined along with my hopeful optimism.  Despite constant complaining from my wife and my own ears, I’ve gotten about 3/4 through the game but tomorrow I’m sending the old Wii back to nintendo for repairs :(  I’ll probably finish it when it comes back but I feel I’ve played enough to talk about the game.  The unbearable whirring had left me wanting more Metroid than what I had gotten.  It was time to break out Metroid Fusion on the old trusty GBA.

I’m not going to talk about Samus’s chattiness since Jess has thoroughly discussed this aspect of the game.  Suffice it to say I pretty much agree with her.  Avatars should be silent enough to allow players to fill them with their own essence.

What I am going to talk about is expressiveness in gameplay.  While playing both games at the same time, it struck me how much more expressive Fusion was than Other M.  So in thinking about this blog post I thought it might be interesting to explore what it means to be expressive in gameplay.  At its core, expressiveness in action games is about “proprioception”, the ability  to “feel” the edges of our body and also the ability to extend this “feeling” beyond our body.  Without this skill humans wouldn’t be able to learn how to drive cars or even walk without looking at our feet.  What’s the difference between a great sports car – let’s say a Lamborghini Gallardo and my dad’s 1976 Chevy Nova? it’s a collection of design details, superior engineering and craftsmanship that allow the driver to “feel” the boundaries of the car. Because of this, the driver knows how the car will react to every action as if the driver were controlling his or her own body.  The more of this “feel” that a driver has, the more expressive  he or she can be, and the same is true of a game.  So how does Metroid Fusion achieve this while Other M fails?

Controls

Game design is all about understanding the relationships that create systems within a game.  Those relationships exist not only within the ruleset that governs events on the screen but also between the player’s real world environment and the inner world of the game.  The same piece of hardware can either deliver incredibly expressive control or flatfooted clumsiness depending on the relationship between hardware and gameplay.

Both Other M and Fusion use the D-Pad to control Samus’ horizontal movement. Unfortunately, in Other M the D-Pad is also used to control Samus not only in the X direction but also in the Z direction.  This has the unfortunate consequence of confining Samus to a strange trajectory when hitting any of the diagonal directions (NE,SE,SW,NW) which usually results in an awkward stairstepping movement that is both annoying and ambiguous.  Ambiguity is the enemy of proprioception, because it blocks the player from predicting the movement of their avatar by feel alone.  If the player needs to do a little jig to get to where they want to go in the z dimension maybe it’s just not that important.  The other adverse and equally damaging side effect of  using the D-Pad to control Samus in the Z-direction is that you now lose the ability to squat or even aim your gun.  So since you can’t aim, the designers made the only compromise they could make which is auto-aiming.  This is important because it determines not only how levels will be laid out, but how boss battles will be structured and the quality of those interactions.

I’m not always adverse to auto-aiming.  I’m neither a masochist or a catholic so if I have to aim with an analog stick in 3D, I’d much rather the game put me out of my misery and use auto-aim.  An analog stick (like the one on the gamecube controller shown below) is a terrible way to aim.  Is it because analog sticks are a bad piece of hardware? Of course not, it’s simply the wrong relationship or mapping from hardware to gameplay.

The mouse or wiimote wand is much better suited to the task. Unlike the stick, there is a better relationship between the gesture of the player and the action in the gameplay because the resolution of the input device (mouse or wiimote) maps almost directly to the output device (the screen).  It’s the reason why Resident Evil 4 is far superior on Wii than it is on GameCube.

Which leads me to the next problem with Other M, which is the aiming view for shooting missiles.  The transition is jarring, though the developers do alleviate the transition by slowing time when going into this view, allowing the player to adjust to the new view.  Sadly, despite this technique I found my view spinning out of control half the time during the transition leading me to getting shot consistently in the first 10 seconds of every boss battle.  It confuses me because I’ve seen games go effortlessly from a 3rd person view to a first person view without it feeling so weird and jarring.  Whatever “feel” is accomplished in the 2D mode is completely lost when this disorienting transition happens.  Aside from the jarring transition, the actual act of aiming is incredibly disappointing.   As described above, consoles finally have a great way to aim on the screen in the way of wand devices like the wiimote, but why bother if the developers  take control away from the player by using auto-aim? There were actual instances in the game where I was trying to shoot something behind the auto-aim object in the foreground but couldn’t.  This lack of control in aiming both in 2D and 3D mode creates a disconnect between the player and the game, I literally could not “express” my intention of shooting an object that was clearly in my line of sight.  This is something that literally could not happen in Metroid Fusion.

Level Design

Level design can be used to create expressive gameplay or it can work to make the player feel frustrated.  Although the levels in Metroid Other M are quite beautiful, it seems like there are many areas in the game where there is a clear disconnect between what the graphics are communicating to the player and the underlying geometry that controls gameplay.  Note the image below.

Samus is in metaball state and just gone through a tunnel which leads here.  My eyes are telling me that Samus should be able to transform and stand up, but the hidden geometry of the level is a closed tunnel.  There are many situations of graphical ambiguity like this in the game, where the lack of consistency between visuals and gameplay serve to confuse the player.  Compare this to Metroid Fusion,where meaning is derived from the tiles that make up the graphics and there’s not a pixel out of place.

In conclusion, I did enjoy Other M, it’s a fun little title.  Unfortunately, it’s not a great game, but it could have been with two simple modifications .  First, by taking more care in mapping the controls more accurately to the gameplay  the player can be more expressive through the controls.  Second, by including more consistent if more minimalist graphics in the level design, the world would feel more “solid”.  The player would feel more free to express themselves in a less haphazard model of the world.  BTW, my Wii came back from Nintendo today.

If you are interested in learning more about game controls check out Steve Swink’s excellent book.

SDK 4.0 Bloated Executable

June 30th by Tommy Leung

In more SDK 4.0 learnings, we came across a file size problem with Propaganda Lander in moving to SDK 4. The Unix Executable File became twice as big as it used to be under the 3.0 SDKs. There was no rhyme or reason for this that we could see.

If you are someone who cares about keeping your app’s file size under the 3G download limit, it is important to optimize as best as you can do get it under 20MB. A lot of games really don’t care which will be an annoyance to someone who wants to buy the game but has no WiFi service nearby. Other games just can’t be that small and then there’s nothing you can do about it.

We are pretty adamant about keeping Propaganda Lander under 20MB. Even with all our wondrous musical tunes, movies with voice overs, and pretty graphics we demand to have a game that can be downloaded from anywhere there is a 3G signal. After all, we are making a game for a mobile phone first and a portable music device second.

The reason why the executable file was twice as big under SDK 4 was because it defaults to compiling for iPad as well as iPhone. I see no reason to have both binaries when most games have specific versions for iPhone and iPad. You can fix this by checking Build Active Architecture Only in the project settings.

You should enable Dead Code Stripping as well–it usually is by default. There’s also Optimization Level which defaults to [-Os] for fastest, smallest and tends to be best.

MoviePlayer in iOS 4

June 24th by Tommy Leung

In the quest to make Propaganda Lander run under iPhone SDK 4.0 and eventually utilize Game Center, I’ve run across some problems/solutions with multitasking. The most recent problem was with MPMoviePlayer. Propaganda Lander plays a movie on each planet plus a nice little video after you’ve beaten the game so movie playing had to work.

SDK 4.0 changes how the MPMoviePlayer works. I think it is now much better than it was before. You have more control over it. It will also, by default, mix with other audio as well. Right now, Propaganda Lander will kill your iPod if a movie plays. We didn’t particularly like that but, there was no choice in the matter. There is now! The iOS 4 version of Propaganda Lander will have this feature.

So, Apple has created an MPMoviePlayerViewController that you can use as a view to control the movie. MPMoviePlayerController still exists but is slightly different. In the past, creating an MPMoviePlayerController would just take over the device and play the movie. You now need to add your MPMoviePlayerController’s view to a UIView or UIWindow.

The MPMoviePlayerViewController will auto rotate if the device’s orientation changes. This was not ideal for Propaganda Lander as it only plays in one orientation: OrientationLandscapeRight. In order to get around that, we had to use the UIView from the MPMoviePlayerController and transform it accordingly.

Here is some code straight out of Propaganda Lander for movie player in iOS 4 :)

You’ll need this for the degrees to radians conversion

#define degreesToRadian(x) (M_PI * (x) / 180.0)

This is the actual code:

MPMoviePlayerController * theMovie;
theMovie = [[MPMoviePlayerController alloc] initWithContentURL: movieURL];
UIView * movieView = [theMovie view];

[movieView setFrame: CGRectMake(0, 0, 480, 320)];

CGAffineTransform landscapeTransform;
landscapeTransform = CGAffineTransformMakeRotation(degreesToRadian(90));
landscapeTransform = CGAffineTransformTranslate(landscapeTransform, 80, 80);

[movieView setTransform: landscapeTransform];
theMovie.scalingMode = MPMovieScalingModeAspectFit;
theMovie.fullscreen = TRUE;
theMovie.controlStyle = MPMovieControlStyleNone;
theMovie.shouldAutoplay = TRUE;

[[[UIApplication sharedApplication] keyWindow] addSubview: movieView];

If you would like to use the MPMoviePlayerViewController that has all the auto rotation features, it would look like this:

MPMoviePlayerViewController * movieView;
movieView = [[MPMoviePlayerViewController alloc] initWithContentURL: movieURL];

MPMoviePlayerController * theMovie = [movieView moviePlayer];
theMovie.scalingMode = MPMovieScalingModeAspectFit;
theMovie.fullscreen = TRUE;
theMovie.controlStyle = MPMovieControlStyleNone;
theMovie.shouldAutoplay = TRUE;

[[[UIApplication sharedApplication] keyWindow] addSubview: movieView.view]

When you the movie is done playing, you will want to remove it. You can do so by using the NSNotificationCenter to get a callback when the movie is done.

[[NSNotificationCenter defaultCenter] addObserver: self
	selector: @selector(movieFinishedCallback:)
	name: MPMoviePlayerPlaybackDidFinishNotification
	object: theMovie];

When the movie is finished, it will call the movieFinishedCallback method which would look something like this:

- (void)movieFinishedCallback: (NSNotification*) notification;
{
	[[NSNotificationCenter defaultCenter] removeObserver: self
		name:MPMoviePlayerPlaybackDidFinishNotification
		object: [notification object]];

	MPMoviePlayerController * theMovie = [notification object];

	[theMovie.view removeFromSuperview];
	[theMovie release];
}

This ONLY works in iOS 4 devices. If you also need to target iPhone OS 3.0 or 2.0, you will need to check for the OS and then have the former MPMoviePlayer code as well. Since Propaganda Lander still targets iPhone OS 3.0, we made this function to check for the OS.

std::string getOS()
{
	UIDevice * device = [UIDevice currentDevice];
	NSString * os = [device systemVersion];

	if([os isEqualToString:@"4.0"])
		return "4.0";
	if([os isEqualToString:@"3.0"])
		return "3.0";
	if([os isEqualToString:@"3.1"])
	        return "3.1";
	if([os isEqualToString:@"3.2"])
		return "3.2";
	if([os isEqualToString:@"3.1.2"])
		return "3.1.2";
	if([os isEqualToString:@"3.1.3"])
		return "3.1.3";

	return "";
}

And for a much more robust way of determining iOS version that can be compared as numbers:

float getOSf()
{
	UIDevice * device = [UIDevice currentDevice];
	NSString * os = [device systemVersion];

	float osAsFloat = [os floatValue];
	return osAsFloat;
}

There’s some C++ and Objective-C in there as you can see. I actually wanted to return numbers but, strings will do for now. You can just as well return NSString’s exclusively if you’d like. As you can also see, we don’t care about OS’s below 3.0. OS 3.2 is the iPad OS and should have no effect for iPhone development but, I left it in there anyway. I believe 3.2 uses the same MPMoviePlayer code as iOS 4.0.

So if your movie player suddenly stops working in iOS 4.0, this is why and this is how to fix it. :)

Propaganda Lander and iOS 4

June 23rd by Tommy Leung

I installed iOS 4 on my iPhone 3GS the day it was available. It runs great and the new features are extremely useful. I’ve turned my 10 pages of apps into 3 pages using folders! I’ve been–as well as many others–waiting for multitasking for apps like Pandora and it’s finally here! I am now waiting for Rhapsody to provide an update with multitasking.

As is with every iPhone OS update, I need to install the new SDK to actually do any work. The update to iPhone SDK 4.0 wasn’t without a few hiccups! We are almost done with the rather hefty Propaganda Lander update and it will run just fine on iOS 4.

iPhone SDK 4.0 assumes every app that you develop will utilize multitasking. As of now, we don’t find much use for multitasking in our games. Propaganda Lander won’t have multitasking. When you close it, it will clear itself out of memory and won’t sit there hogging system resources.

While playing around with the new SDK, I have seen Propaganda Lander operate in the background. I’ve switched from Propaganda Lander to Safari and back. It’s kinda cool. Although, using any other resource intensive application will cause iOS to shut down Propaganda Lander anyway so it’s not particularly useful in that sense.

Implementing Multitasking

I had some difficulty trying to figure out how to opt out of multitasking! I followed the instructions Apple provides in their manual but, it just didn’t work–it had mostly to do with my shallow understanding of Xcode. Developers switching to iPhone SDK 4.0 will realize that their games will have an error upon exiting because it assumes the app is going to run in the background and you haven’t handled for it.

You can either handle for it using these two functions:

- (void)applicationDidEnterBackground:(UIApplication *)application
{
      [glView stopAnimation];
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
      [glView startAnimation];
}

They should reside in your AppDelegate and in this case we are stopping our animations when the app enters the background and restarts our drawing when the app enters the foreground. You are not allowed to make any GL calls while in the background.

That’s a quick way to implement background support although there are lot of other things that you need to account for depending on what your app is doing. Apple has a guide for that.

Opting Out

The other alternative is to simply opt out of running in the background. Apple has a guide for that as well but, it’s not exactly as they describe! Maybe I’m just not as Mac-savy–and I’m not–but, I followed their instructions and added the key/value pair to Propaganda Lander’s Info.plist and nothing happened.

With a little help from Nik–a Mac veteran if you will–we figured out that you can’t simply write YES as a string in the key/value pair. You need to right click in the value box and change the Value Type to a Boolean. This is seemingly obvious except I didn’t know you could do that. I’m from PC-land and we don’t use plists.

So if you are like me and can’t seem to figure out why Apple’s instructions aren’t working, this is what you need to do. It is also possible that I’m the only person developing for iPhone that didn’t know that in which case, hope you had a good laugh!