Monday, September 27, 2010

Upcoming improvements

Portaball has been out for a couple of days now. It's not extremely popular, it's hard to say it's even popular ;) Tomorrow it will most likely reach 300 copies sold. Not too much, considering I spent last three days pushing my marketing skills to the limit. I don't give up though. I received a lot of positive feedback, I'm grateful!

One of the biggest requested feature was sound effects. I've spent many hours digging trough free sfx libraries with little success. Nothing seems to fit my needs, but I keep going. I added few test samples to project and it made some difference.

What's more? Least portals challenge! This one is gonna take some thinking especially on later levels. I haven't tried to do my best yet, this will be fun! During development I wasn't creating levels with 'golden paths' in mind, I was just randomly checking if level is completable.

With this challenge comes another big hit: Game Center integration! Those having Game Center account will be able to compete globally on Least Portals leaderboard. You will finally be able to show all your friends who's genuine mastermind. Additionally Portaball will receive achievements enabling yet another way to distinguish yourself.

I'm really looking forward to releasing this update!

Thursday, September 23, 2010

Portaball. Now in the AppStore!

After quick review process (little over 9 days) Portaball is now on the AppStore! It's great news that my first project got approved so relatively fast and without any rejections. Needless to say, I'm really looking forward to getting opinions, suggestions or even bug reports, though I hope there won't be much in latter category!

iTunes link: http://itunes.apple.com/app/portaball/
iTunesPreview link (you can watch in browser): http://itunes.apple.com/app/portaball/id392543691?mt=8

Wednesday, September 22, 2010

Portaball is in review!

Nine days waiting for review, but finally the process has begun. Fingers crossed for quick acceptance!

Friday, September 17, 2010

On Portaball name

There is no denial that Portaball is inspired by Valve's Portal. As a matter of fact the development codename for Portaball was... Portals. Just a placeholder, nonetheless I would have been more than pleased to release final product under this name.

The problem is, Portal is trademarked. It's not much of rocket science to understand that branding product in similar branch would definitely be copyright infringement. Sure, should I ever create an actual teleportation device, Portal name would be more than appropriate. However, since original application contains phrases like 'Electronic game software' or 'Video game software' it doesn't require a law degree to acknowledge that Portals name is bad idea.

Having faced the problem I made a list of hypothetical titles. I'm not going to publish the whole set, just be aware that there were some names I wasn't exactly proud of (Portalino). Some were going too far away from the heritage of Valve's game or were just lame (Teleporters). Then Portaball popped into my mind.

At first I wasn't exactly pleased. I spent some time analyzing it and I became aware of how comprehensive it is. Here's the list of my conclusions:

  • it resembles the idea of teleportation and portals in acceptable manner
  • it contains word ball, which obviously is one of game's main elements
  • it can be separated into 'port a ball' which implies that one can teleport a ball 
  • it's similar to word portable, thus magnifying the intention of ball's mobility

All in all, I realized Portaball is not that bad after all. My only concern is if it's catchy enough. Still, its uniqueness and diversity make it worth.

Monday, September 13, 2010

Binary uploaded.

Title says it all, hopefully this week Portaball will get approved!

Fixing bugs, brutal way

It's a good thing to wait few hours before releasing.

Portaball is based on Chimpunk, open source, free, fast and amazing physics engine. In the game it's mostly used for collisions detection and as a source for physics objects (walls, ball etc.).
Today however, I noticed that, under certain conditions, it's impossible to complete levels that contain, as I refer to it, "cut-walls". These come in 5 flavors:



They weren't originally intended to be included in game. Having ran out of ideas for new levels I decided to give it a try. Calculating the correct position for wall on a grid is trivial, school math basically. Here's the line of the code:

cutShape = cpSegmentShapeNew(body, cpv(-kGridSize/2,-kGridSize/2+kBallRadius*M_SQRT2),
cpv(+kGridSize/2-kBallRadius*M_SQRT2,+kGridSize/2), 0.0f);

(kGridSize is constant containing dimension of grid and is equal to 40, kBallRadius is self-explanatory)

As a result we obtain a wall of width 0 and position in game's space in this way:



So far everything seemed perfect. Having it tested many times in game it appeared it's not that simple. After bouncing off ball was slightly misaligned, not a big deal after one bounce, sad truth is this minor offset was cumulative. Therefore after springing back enough times the misalignment was not only visible, but also it prevented ball from triggering mini-buttons.

There were two  main reasons for this. First one is limited precision. Real life sqrt(2) is far more precise than M_SQRT2, however, this difference should be insignificant. The other and hopefully main reason was they way in which collisions are being calculated. In Portaball, physics engine is stimulated every 1/60th of a second. As a result: if on a given step ball is just before "cut-wall" on next step it might overlap with wall. The collision is calculated and Chipmunk is, if I've understood documentation correctly, trying to push ball of way to prevent this overlapping. I figured this was my trouble. 

Sure, for a typical physics based game it's not a problem. Objects are flying around and their position has fractional part, but in Portaball everything is designed to follow strict guidelines. Ball always moves in straight lines and crosses center of a given grid. I had a few ideas how to force ball to move by MY rules. The first and obviously naive way was to round ball's position every step. This method not only would interfere too much with Chipmunk, but also it would cause even more troubles.

The solution I went along with was rounding ball's position and velocity just on collision with "cut-wall". Simple rounding wasn't enough. The problematic offset would often be larger than 1. Here's the final implementation:

float x,y,vx,vy;
x=ball->body->v.x;
vvy=ball->body->v.y;
ball->body->p.y;
x=ball->body->p.x; y =vx=round(vx); vy=round(vy);
idSize); y=kGridSize*0.5*round(y*2/kG
x=kGridSize*0.5*round(x*2/kG rridSize); ball->body->v.x=vx; ball->body->v.y=vy;
ball->body->p.x=x;
ball->body->p.y=y;

Ball must be positioned in the middle of a grid. To achieve this several steps must be made. Current misaligned position of ball (for instance 222.34) is divided by kGridSize=40. The result (5.5585) is doubled (11.117). If it wasn't for doubling, ball couldn't be properly positioned in the middle of a grid. Rounded result (11) is again multiplied by kGridSize. As a result we obtain proper (220) positioning of ball (middle of 6th grid in given row/column). Velocities are also rounded, otherwise after bounce they often would have very slightly changed values: 80.00007 instead of 80.0. Better safe than sorry.

This code provides satisfactory results and moreover, it simply works.

Sunday, September 12, 2010

Portaball is finished.

Every goal on TODO list is completed. Game is done.

Development begun on July 25, ended September 12. It sums up to 49 days of work. Including time spent on learning Objective-C and Cocoa my iPhone development adventure took 72 days. Still, it's pretty fast.
It can't be denied, iPhone is an amazing platform to work on.

Tomorrow brings in another milestone, AppStore submission. I've already passed iTunes validation on Xcode and I hope review team won't struggle to approve Portaball. It's really cool game after all!

Thursday, September 9, 2010

Portaball development is nearing it's conclusion!

Work is still in progress, here is TODO list as of today:
  • 6 more levels
  • settings panel
  • levels' descriptions
  • rearrangement of levels by difficulty
I think I am mostly done with icon. Here it is respectively in 512 px, 114 px and 57 px: