Game Dev Blog

The Spodiest Blog On The Planet

Keep forgetting to update, so this is useless as a dev blog :D

Anyway, after seeing the nasty grams sent out about the Breakout clones on the App store, I’ve spent a few days putting together a Mac OS X build of the game, just in case.

The first day was a serious falling out between me and XCode. I just wanted to add another target to the project file and then build them all from the same project without having different windows open. Obviously there’d be some changes in what files were compiled, but there’s a target ownership flag that Gaz pointed me out which would do the job. Although, to be fair, he also said to just create a new project as it’s easier, but I figured it’d be nice to actually get all the targets working from the same project. More fool me :(

I must have spent 4 or 5 hours trying to get this to work, but despite the settings saying one thing, the actual build process seemed to do something different. Even going through the pbxproj files showed different things :( In the end, the pre-compiled AppKit headers would get built twice (or more) and the nib wouldn’t reference properly either of which would result in a billion errors and no build. Not to mention all the resources getting copied to different places in the application bundle. Lots of stress, no fun and I never did suss it out, so instead I created a new project file with just the Mac Target in, which with the *exact* same settings, worked absolutely fine first time. I’ll take the advice in future :(

The actual port was cool. UIKit/AppKit and the UI*/NS* classes are largely the same when it comes down to it, the changes I found were for stuff that’s understandably iPhone specific. The only really gotcha I tripped up on was the lack of simple way to get a CGImageRef from an NSImage, something my texture code was doing in one line on the iPhone. Meant a couple of hours of nothing visible in my window, which was a let down, but once sussed, the game popped straight up.

Actually, that’s my biggest gripe about coding with Apple libs. There’re loads of built in types, many of which on the face of it look largely similar, so it’s always confusing to know which to use. I’ve found a few times that I’ve used the wrong type initially, so when, say, saving stuff out, I’ve either had to re-write a load of code to put everything to the right type, or do some voodoo conversion at the last minute. And ObjC just doesn’t look nice in the editor. It’s hard to format clearly…

Despite that, a lot of the Mac SDK is starting to make sense now, and tbh that’s been my only real frustration. The flip side has been a super speedy knocking up windows, text boxes, inputs or whatever and the docs have always provided really solid examples that I’ve been able to bend about. There’re some slight changes to the game for the Mac version: Slightly bigger ball (Rik’s advice :D), it’s locked in at 60fps (instead of 50) and you don’t get to touch the screen to enter your name, but other than that I’ve hardly had to do any specific tweaks or code changes which is awesome :D

I’m really really surprised at how quick and pleasant the whole experience has been, tbh. I was expecting a massive faff :D

I’ve just got the Mac XML-RPC stuff to do, then it’s decision time as to what to do with each version…

Quick Demo Movie…

Progress is going well :D

I’ve moved the old code over to the new 2.1 SDK for the iPhone. It’s doing roughly 60fps in the simulator and 46-52 on the device. There’s probably room for improvement as I’m not too hot on optimising, or OpenGL, but even a steady 50 would do me, tbh.

I’ve added in the support for xml-rpc uploading of High Scores, which you can see at the end of the movie. It’s only going to a server on my local machine atm, but it looks like it won’t be too much heart ache to get this going on the net.

Small list of things to do, mainly tiding up transitions and adding a few options on the menu, oh, and a load of levels. But the big stuff is done. :)

Managed to get to grips with the getting my code signed and runnable on production iPhone. It’s a bit of a pallaver to be honest and I don’t really want to go into any detail for fear of breaking any NDAs. However the good news is that it does work, the bad news is GR+++ runs incredibly slowly.

It’s shouldn’t take long to sort out, I’m confident the main code is plenty fast enough; the unofficial SDK version proves that’s the case.

The likely culprit is the OpenGL code that downloads the game screen into a texture. I had a problem similar to this on the mac version a long while ago. I’d created the texture in GL_UNSIGNED_SHORT_5_6_5 format, the same format that the game itself runs in and this went really slow. The reason was that the HW itself doesn’t seem to support this format natively and the driver itself was doing a very inefficient conversion to RGBA. The solution was changing the texture to RGBA8 and doing my own rather nippier conversion from 565. It wouldn’t surprise me if that was the case this time as well. Gareth mentioned he’d seen someone on a messageboard say they’d had problems with something similar. It’ll be that or the sound I’m sure.

Rolando

In other news a chap on the yakyak forum has written a really nice looking iPhone game called Rolando, you can see it here. It’s a nice OpenGL based title that uses tilt a lot and has a bit of a LocoRoco aesthetic going on. The web page has an ace little animation showing the game working and I asked him how he’d recorded this and he pointed me in the direction of Screenium by Synium. This little app allows you to make a video of an area of the macs screen which in turn means you can run your game in the iPhone simulator and grab the output of that. Neato. I did a quick (and in much needed of improvement) test here.

It’s been a pretty good few days for random apps on the mac. I can recommend having a look at these:

Viscosity: a great OpenVPN front end for the mac that replaces TunnelBlick which was okay but a bit flakey at times. Even though it’s only in beta Vicosiy has been rock solid the last few days.

Cornerstone: A very slick looking SVN front end. I quite like using SVN from the command line but this is quite nice. Would be handy for artists innit :D

I’ve downloaded the latest iPhone SDK yesterday and had a quick fiddle to see about converting GR++ from the unofficial hack SDK onto Apple’s proper bit of kit.

After an hour and a bit of fiddling everything compiles nicely and the game is running. Unfortunately it’s in Helen Keller mode, it receives no input and doesn’t display anything but it is running in there, honest :)
The Unofficial SDK version got stuff on the display using an API called CoreSurface which unfortunately doesn’t exist in the official release so I’ve had a look at OpenGL ES. GR++ software blits to a 200×320 surface that’s made up of 16 bit RGB words in a 5-6-5 configuration and I need that copied up to the iPhones 400×640 rez screen.

Rather than software scale the plan is to create a texture that I’ll use glTexImage2D to dump the GR++ screen into each frame. After that I’ll print a quad using that texture scaled to the screen size. This is how the mac version worked so. In fact I’ve got this mechanism working by copying over the mac code, all I have to do now is make sure the GR++ screen gets dumped in. I’ve made the texture the same 5-6-5 format as the GR++ screen, which -should- be the fastest way to get this working which it should be in the next hour or so :D
After that I need to complete my official developer registration so I can check the game on an actual iPhone, I’m currently using the simulator. Unfortunately emulating the iPhone at full speed is a little bit beyond my macbook air right now so I’m devving back on the Mac Pro for a little while.

EDIT

Here we go, some obvious mistakes :D

buy cialisbuy cialisbuy levitrabuy levitrabuy propeciabuy propeciabuy somabuy somabuy levitrabuy cialisbuy propeciabuy levitrabuy somabuy cialisbuy propeciabuy levitrabuy somabuy cialisbuy levitrabuy propeciabuy soma

Latest version is online, now with added audio :D The update should appear in the installer, so check the Xen Ports category.

Thanks to Swith for the awesome jingles :D

Successfully nicked Gaz’s audio code today and got it in game. So that’s pretty much the last big thing left to do. :D Apart from drop shadows. But I did finally put the high score entry stuff in earlier in the week, and that’s nice and tidy…

I can’t believe how much of a difference a bit o audio makes. It’s put a right smile on my face, even if I’ve just discovered my sound design skillz ain’t brilliant atm… :)

I’ve got a firm deadline for the end of the month, so it’s proper heads down content fiddling now to try and get it as polished as possible. I wanted to put fluff effects in for the menus (plasmas and shit) and high score table, but I think that’s gonna have to slide for now. Still, it feels good to have this much out of the way. It’s a proper little game :D

I’ll stick an updated build up later next week so you can have a play…

Okie doke, I’ve put today’s version online so you can have a quick look-see.

If you’re hacked and using Installer.app: Tap the sources button at the bottom right of the app, tap Edit (top right), tap Add (top left) and put the following URL in:

http://kor.gazaxian.com/iPhone/installer.xml

Let it refresh and if all goes to plan, next time you tap the “Install” button, you’ll have a shiny-new category at the very bottom of your list: “Xen Ports”. Tap on that and BallZup should be there for you to download. :D Once it’s installed the Xen Ports category will only reappear when I update the app. That confused me for a while :D

Anyway, customary build waffle:

- Front end is totally place holder. Tap BallZup to start a game
- There be no audio :D
- Only about 15 or 16 levels in there atm.
- This build’s not got the high score stuff working properly. If you get one, move your finger about the screen. There’s a hotspot somewhere that’ll exit you back to the main menu.

Think that’s about it for serious issues :D

And the emulator now supports OpenGL ES.

This is good as I should be able to get Gridrunner++ working on it now.

Very busy right now but I should be able to have a look-see over the weekend :D Woohoo!

And you can get it here:

http://developer.apple.com/iphone/library/releasenotes/Miscellaneous/RN-iPhoneBetaAPIDiffs/index.html

It’s getting there. :D

Lost a bit of steam the last couple of days, but the previous couple of weeks have been really good. I’ve got a game. It’s kinda close to an alpha ‘done’, I’ve got some finished levels, working transitions and the high scores are in, and for the most part, it’s looking nice and stable.

I’ve learnt a lot. Especially about how bad a couple of design decisions were, as far as drawing to screen was concerned. The collision’s been simplified, so I’m no longer brute forcing everything and I’ve had a look at improving the draw updates. My basic sprite class was ok, but there was lots of overdraw and the speed was bad because of that. I spent 2 or 3 days hacking in a dirty-ish rect solution, using some tips Gaz gave me, and although the code isn’t too great anymore, the multi-buffer approach he suggested has made the speed more than good enough. I can chuck loads of multipliers, balls and shit around the screen, so the later levels should be pretty hectic. Lesson learnt about making that sorta change late on in the project though. I’ve probably spent as long sorting out little issues that have fallen out of the change as I did actually coding it.

I’ve got a hefty list of things to polish, but bar audio, it’s getting very close to the point where I’m just tweaking stuff and making the levels. I think the only possible large-ish stuff left is changing the brickhandling to support different sized bricks and possibly looking at online high-scores. Not sure if I’ll do the latter though ;)

I’ll chuck a build up once there’re a few more levels, so you can decide for yourself :D

I’m not being too clever with the power-ups atm: what ever you pick-up changes all the balls in play, immediately - the original thinking was to put some sorta rules in place and have alot of the bonuses be semi-contextual to what was on screen, but the quick first-pass has a happy side effect that I didn’t think about. Take Fuseballs; they’re little bombs which bounce around and after 5 hits explode into 5 balls. In my test level, I’ve got Fuseballs, straight Multiballs (which immediately multiply all the balls) Goldenballs (which batter through 20 or so bricks before becoming normal) and Ninjaballs (which are little comedy shadows no one likes but me, but will give you much higher pts per brick). If you time it right you can pickup up a Fuse, let that explode, then grab a multiball, which will give you 25 balls bouncing around. Keep a few of those in play and get another Fuse and you’re in comedy heaven. Balls falling off the screen all over the place. Convert any of those to Golden and the level’s over before you know it…

You can clean out a level really quickly with these, but it’s virtually impossible to keep the balls in play and grab any large amount of multipliers, so the difference in score can be a several hundred thousand points. Most bricks are worth 10 - 100pts atm, so the best points strategy is one or 2 balls that you keep nursing into Goldenballs. That way you can follow them and scoop up the multipliers. Simple stuff, but probably easy to play around with when it comes to placing power-ups in the level. This way of playing also takes a lot longer, but if I work out a simple-ish strategy for bonus placements, you should be able to switch styles mid-level just to clear the bastard thing.

Anyway, I’m going to forget about the rules I’d scribbled down before and try just 2: 1) If you’ve more than 10 balls on screen, 50% of the placed bonuses will convert to Hitlers. Which remove all balls but one (and give you some point value per ball, x your multi). 2) If you’re down to less than 5 bricks and you’ve had 4 bounces without hitting anything, it’ll drop a magic laser to let you clear out the level. I think the rest, albeit bog simple, will probably take care of itself and the player can decide how they want to get through the level.

The reason for doing breakout in the first place is because it’s throw-away gameplay, and I think alot of iPhone play will be about that, so having it setup to let people hammer through levels if they want is probably a good thing. We’ll see. The power-ups are already a laff for 30 seconds, even if the game is trivial :D