2009/09/27

Evolution! (+video)

Hello kids,
it's been really busy two weeks and Gelex made huge step forward. With all these polishes and optimizations I've implemented, the game plays and feels much much better. At least for me :)

As I've promised before I've prepared new video where you can see all these new things in motion. On top of that you can see some elements which I didn't mention yet:
- numbers for score now have an animation when they change
- there is an animation when you make combination of same colored bricks
- new animation for faces when they are destroyed
- there is implemented level system - after you destroy some amount of bricks the game becomes harder - you can see your progress in the upper left corner - the green "level window" slowly turns red, if it's all red you will go to the next level



If you watch the older video and then this new one, on a first look you will feel that it is still the same game. But on a second look you will realize (I hope you will :) ) how much the game has changed and I like to say "evolved" :)

For me the ingame part of Gelex is complete. I know, I know there are still no sounds, but I will deal with music and sounds in the end. Right know I'm focusing all my skills on one thing -> The Menu!

If you've read interview with me on PocketGamer.biz (I really wanna thank Jon for this opportunity and the article!) you would probably know, that I want my main menu to be more interactive, more animated or simply just more fun. Wait for the next article and you will know more how I wanna achieve that.

Love,
Granny Marie

2009/09/23

How to polish your game - part 3

Hello kids,
All these polishes I did last week are great, but i was still feeling that it needs something more. So i decided to add one more animation. It's related with score system and I didn't explain that system yet, so I write about it today.

The score system is quite simple, but it's kind of tricky, because it is the key to master the game and earn lots of points. So here are the rules:

1) if you make combination of 3 bricks, you will receive 3 points - first 3 bricks are worth 1 point each
2) when you make any combination, timer for bonus will start counting - it is represented by yellow tube
3) each destroyed brick will give you one second to the bonus timer
4) if you destroy more bricks than 3 in bonus time, each brick is worth one more extra point - fourth one is worth 2 point, fifth one 3 points, sixth one 4 point and so on
5) When bonus time is over, bonus score ended and starts from the beginning. Game will save how many bricks you've destroyed during that bonus time as "combo"

So your goal is to keep destroying the bricks shortly after each other. I hope you get why :) If not, wait for the game and after few games of it, you will understand the rules.

I've mentioned combos - how many bricks you have destroyed during one bonus time. Each time you make any combo (at least 5 bricks destroyed needed) you will be awarded with some evaluation/rating. These are just text messages, but I wanted them to be more attractive. And here comes the last polish I've made.

The idea of this effect was simple. The text is made from Gelex matter that will splash on your screen and then flow off it. Here you can see the result:



What you think? Isn't it cute? :) Maybe it looks simple, but it was quite hard for me and took me lots of time. But I'm happy each time I make a combo and see this little animation. :) Sometimes I really wish to see it more often. But you know, then it wouldn't be so special :)

Bye
Granny Marie

2009/09/19

Optimizations - part two

Hello kids,

As I promised you in one of my last posts I’m going to tell you some more information about optimizations in the code. Last time I ended at the situation, that physics processes took same time as the graphics ones. I’ve realized that I can’t do much more with the physics. So the only choice was to find some ways to optimize drawing functions.

I wouldn’t say that it is some kind of real optimization, but it’s more like write the code better way :) My intention was to minimize number of calling glDrawArray function, because it takes quite a bit of time and I was calling it so many times – ineffectively. So I tried to put as much images as possible into one triangle trip and drew it in one single call of glDrawArray.

Next thing I found out was that it is much more efficient to calculate coordinates of vertex by myself compared to using OpenGl transformation functions and to join some objects into one triangle strip through degenerated triangles, instead of drawing them separately.

I can guess that my experiences won’t help much other people, but what could really help is this guide book or this one. Both of them were very useful for me and other programmers can find there information that can improve their code.

Ok dears, thanks for reading my today’s post.

Bye

Granny Marie

2009/09/15

How to polish your game - part 2

Hello kids,
I wanna continue in my last article about polishes that will improve the visual look of my game. Last time I managed to add some changing colors into the square field. This time I tried to add some animations to make the background more alive.

As you will see, all those new things are just small improvements, but as a whole (I think) it boosts the quality of the game a lot. So here is the list of new things:

1) Door over the “next brick view” window – each time you receive a new brick to control, there is an animations of closing and opening door.

2) Lights above this (1) window – when there is door animation, the lights above it start flashing.

3) Bubbles in these tubes – in the blue and yellow liquid in tubes flow some bubbles

4) Surface of the liquid – now it looks more 3 dimensional :)

5) Popping bubbles – in tubes there are little popping bubbles above the luiqid.

6) Flashing lights – actually they act more like broken lights, but it looks fine :)

7) Valve and steam – I added 2 valves into the upper left corner. They move every time there is a change in amount of liquid in tubes and sometimes there is steam coming out. The steam is done by particle effect. It was not so hard, but it needed few tries to look the way I wanted to.

And that’s all. In next few days I’m planning to create new video and you will see all those things in motion, but for now you must accept only these images.

Bye bye,
Granny Marie

2009/09/12

How to polish your game

Hello kids,
I have realized, that I’m spending so much time just playing witch Gelex and doing nothing else, that I’m not sure if I can finish it according to my plan. You know, my productivity declines, I write few lines of code, build it to see the result and after half an hour I’m still running the emulator and playing Gelex even if the new lines of code didn’t work the way I wanted :) I really love the game!

But for today I wanna write what I did with the background. As I mentioned last time, it feels little bit empty. So I had an idea about the main field (the one with squares). I wanted to be animated and it should be changing colors during the play. In OpenGL is quite simple to give image some color tint. So I’ve prepared the field in grayscale (as you could see in the last video) and write a function which gives it a color tint and gradually changes it. The change is quite slow, so it doesn’t disturb you from playing.

But there was a problem with that. I was increasing and decreasing one of RGB component randomly and that quite often leads to the situation, that the image was grayscale without any color or colored with very strange color (not really nice). The algorithm was just not right. I found out, that I could use HSV representation of color point. I got saturation and value set to 1 and I’m changing (increasing or decreasing) only the hue component. Then it's transformed into RGB for OpenGL use. As you can see on image, there won’t be any strange color at all. And it works great.

Everything looked alright, but I wanted more :) So I tried to set different color tint to each vertex of the field and the result amazed me. I think it improved the visuals like hundred percent :) This time I don’t have video of it, but you can see three images of the progress and I can guarantee you, that in motion it looks really fantastic :)



More about other polishes that I’m planning to add into my game will be in the next article.

Love
Granny Marie

2009/09/10

You can play it! (+video)

Hello Kids,
Last two days I was so busy - working hard and implementing all the new images into the program and I've also improved the code itself - that I had no time for anything else - my garden, my chickens, my cat, even my goat. Everything had to wait.

But right now I’m really happy that I put so much effort into it. The application could be finally called a GAME :), it’s fully playable and I got brand new video for you to see it in action. So, here it is:



Isn’t it cute? :) I’m so proud of myself. The face animations are so funny. In Chipmunk (the physics engine) I’ve lowered the friction property, which means that all these bricks are slicker, so they are sliding over each other. And it feels great to play with it :)

Ok ok, that’s enough of self-praise and back to the reality :) It’s playable and looks quite finished. That’s fine, but it’s just a beginning. I need to add music and sound effects, menu, maybe some loading screens and so on. And I see another million things that I wanna add into this in-game. You know not something huge, new gameplay element or something. No no. Just small things, that will make the game more polished.

First of all I wanna do something about the background field - the grey field with squares. It’s so boring to watch and the game feels empty. I wanna put there some animations or something. That’s the problem of the entire background image. It’s so static. Some animations would make it alive. I have some ideas, but I don’t wanna write about them now. I want to see them first and if it’s gonna work I will write something about it.

I’m gonna take some rest now and you can write me a comment what’s your impressions :)

Bye
Granny Marie

2009/09/08

Background image is here!

Hello kids,
Last few evenings I’ve been drawing the main in-game background image and now I am really proud to present you the result. It should represent the machine, where you can let the jelly bricks disappear. You can read more why there is machine in my previous post.

Let me describe what you can find there. I put some “nice” (I know they are as ugly as my goat Liza in the morning :) ) pink numbers there.

1. You can find level number there. Each new level the game becomes harder and harder
2. Next brick – shape and colors of next brick
3. Information about score points
4. You highest score you’ve ever scored
5. Game Over line – if there is any brick above this line after the time limit (6) is over, the game ends
6. Time limit – how much time left for controlling your actual brick
7. Another time limit, but this time for score bonuses – I will describe that sometime later
8. Main field for playing with bricks


I have also prepared one fake screenshot (it’s prepared in Photoshop, so it’s a fake not real screenshot :) I didn’t put new images into a program yet) how the game should look in the final form.



I am still not convinced about the main square ground, because it feels a bit empty, even if there are bricks, there is lots of empty space. I will try to do something about that. And these faces are little bit too big.

So let me know if you like it or not. I am waiting for your responses :)

Bye bye
Granny Marie

2009/09/07

First optimization (+video)

Hello kids,
I’m going to tell you more about some programming things I’ve done in my game and how it affected the results. And I got fresh new video for you. Again with nice music by “Eva a Vašek”. I can guess that younger people don’t like it, but I love it. I wanted to add some Hungarian polka, which I also like, but I got it only on LP records (you know these black big discs :) ) and was unable to digitalize it.



What you can see is very first look at gameplay itself. One finger for moving, two fingers for rotations. When 3 colors match together, little square inside the brick appears – whole brick should disappear after that, but It doesn’t. Yet! :)

What you can’t see are many hours of experiments and failures with optimizing the code to run as fast and smooth as possible. First of all I found out, that when I switch off “Compile for Thumb” in XCode settings, the application runs much faster. But that was just beginning. Next thing I’ve learned was, that Chipmunk should be compiled in GCC compiler with parameter “--fast-math“. But that helped just a little.

Then I was kind of stuck at one point. My physics operations took so much time and I was unable to improve it. I tried to change size of spacial hash, that’s what documentation says and should help -> doesn’t. Then I changed squares for circles as the basic physical object -> again no improvement. After that I’ve developed idea that I’m going to do the physics operations not on all objects in the scene, but only on upper ones, because the bottom lines don’t need that. They are fixed at one place. Of course that was wrong idea and leads to even worse results.

But in the end I’ve discovered it! I’ve lowered the number of iterations of physical solver. That means that all calculations are less precise. So you should say that is a bad thing. But it’s not! Firstly it lowers the time for physical processes significantly and that’s what I really wanted. And secondly, because of less precise calculation results, objects in the scene acts more elastically. And that’s wonderful.

At this point my physics engine takes same time as graphics processes and I’ve got some pretty good ideas how to improve them too. But you need to wait for some future post about that.

Bye kids,
Granny Marie

2009/09/06

A game like mine

Hello kids,
Today morning I have received e-mail from one of my blog readers. He told me, that there is already a game like mine, but on a PC platform. The game is called Triptych and the basic principles of that game are really very close to my ideas about Gelex.

At first I was quite sad about that, but after few games of Triptych I’ve realized, that the game is so funny and enjoyable that I forgot all the worries that my game won’t be as unique as I’ve planned to be. I must tell you, that today I’ve spent nearly whole day playing it. I love the game! :) The authors did a great job on it and I admire them.

Right know I’m worrying just about one thing. That knowing Triptych will influence my development so much, that I create just complete copy of Triptych :) Well, I hope that it’s not gonna happen. At least my game is on iPhone not a PC and on an iPhone is nothing like that…. hope so :)

Apart from playing Tryptich all day long, I was doing some drawing. But this time not just a sketches but some animations of the face of brick. You can see the results here. I’m planning to add much more animations in future. These are just first three – laughing, “I am innocent look” :) and scowl face.

That’s all for now kids,

Love,
Granny Marie

2009/09/05

Gelex!

Hello kids,
I just wanted to let you know, that my game got finally a name. Last week or more I was thinking about it really hard, but it was worth it. I think I found a nice name that fits my game perfectly. The name is Gelex :) (As you probably already know from the headline :) ).

I had few basic requirements for that name. I wanted to be short, easy to remember, easy to say and of course -> completely new word! It also should cover these facts:
- The game is about jelly, gummy bricks
- There will be some stunning effects (hope so :) )
- The whole problem with bricks happened because of accident during one experiment.
- Physics plays huge part

And the name covers most of them. Only the physics fact is not in the name. First part “Gel” is obvious. “Ex” is for experiment and is also quite close to FX, which means effects. Also the sound of the name Gelex sounds to me quite close to effects – yeah, because of the X at the end :)



This is just a sketch of the game name. In the future I want it to be animated with lots of polish stuff. Wish me luck with that :)

2009/09/04

Physicist and the story in my game

Hello kids,
Such a terrible weather today. It was raining all day long. It makes me feel sad. So I decided to draw some nice sketches of main character of my game to cheer me up. Oh gosh! I forget to tell you about the main character and the story behind the game! Ok, let’s do something about it...

As you already know the game will be about moving bricks and stuff like that. So where should be anything like main character? Actually there are two main “heroes”. First one is some kind foolish, crazy, funny physicist (I still don’t have a name for him. Any ideas?) And the second one is a new substance/matter which he accidently invented. This new matter takes form of a little brick – you know, jelly brick :) – and got eyes and mouth and it can even talk. But the most problematic thing about it is (apart from all those noises and talks it makes) that it clones itself all the time. So the physicist invented a machine (which will be actually main in-game screen) where he can let these bricks disappear. The only thing needed is match 3 same color bricks together.

The physicist will be something like a guide in the game. And the bricks will be just annoying little creatures all over the place and of course the main thing to play with :) I must admit that the idea of physicist and jelly creatures was inspired with the Flubber movie. I know, it’s a silly movie, but I love it. And Robin Williams is always so great. So please forgive me :)

I think it’s enough about the story, which probably won’t be said anywhere in the game. You know, it’s gonna be just a little arcade game and the story thing is just for myself and you-my readers of course :) But enough talking here is the picture of the physicist:


It’s just a sketch. I’m still not decided which one will be used. Maybe I will draw something completely different or I will improve one of these. But right now I think he should be younger than these ones. I am so bad at decisions….

Ok kids, I’m going to take some rest. And by the way, for those who tweet me that I‘m a fake. You know if somebody would told me, that there is a farmer guy who was catching chickens for all his life and now on people just realized that he can sing like no one other can, I wouldn’t believe that either. Yeah, I’m huge fan of Kevin Skinner from Americas Got Talent. I’m watching him on YouTube and hope he’s gonna win whole competition. You never know, maybe my game will hit the top on the AppStore :)

2009/09/03

Physics in my iPhone game (+video)

Hello kids,

As I promised in one of my previous posts I wanna write something about the physics system in the game. I am not really into physics and I don’t want to go much into a details, so don’t expect anything technical...

The physics is the key for my game and because I didn’t feel good about programming all this physics stuff by myself, I have decided to use some existing physical engine. You can find many existing engines all over the internet, but what I really needed was not something like huge massive physical engine, but just few simple functions. I didn’t need those soft body physics or physics for liquids or something like that. I just wanted simple, but fast enough collision system, with gravity involved and the collisions should make some impact on the bricks – you know, to feel like rubber bricks.

So I started searching the web. Again! I completely passed all those well known physics engine like PhysX or Havok. Not only there is a problem with licensing and stuff like that, but they are really huge and don’t fit my needs. Then I find ODE (Open Dynamics Engine), but again it was not the right thing for me. Quite promising was Box2D, it’s a C++ based engine and the implementation to my project didn’t seem that hard. But before I started working on that I found Chipmunk engine and this video. I was impressed with the speed and all the comments how simple it is to implement it.

I found some examples how to include Chipmunk into XCode project - http://johnehartzog.com/2009/04/integrating-chipmunk-into-objective-c/ but for me was very useful the Moon Buggy tutorial which is not for iPhone application, but each line is very good commented. Overall it took me about a day of work and Chipmunk physics was in my game and worked! I was so excited about it, that I said to my grandsons to take a camera to my place and shoot short video from the game. So here it is.



I know, it’s nothing special right now, but you can see the basic functionality is working. With one finger you move with the last imported block, with two fingers you move with all bricks on the screen, double tap import another block. There is gyroscopic feature which influence direction of gravity – to be always down to the ground. And there is some bouncing. Still not like gel or gum, but I am working on it.

On the video you can see also one big problem. It’s not optimized yet. When there are more bricks the framerate falls down rapidly and the game becomes snatchy. You can see two numbers in the left corner of the screen. The first one is an amount of blocks on the screen and the second one is time in milliseconds of one frame. As you can see, most of the time the second number shows (around) 30 milliseconds, but at the end it jumps up to 60 or even more milliseconds which means 16 FPS or less.

That video was shot by my grandsons over the last weekend, so it’s not actual version. Right now I have implemented some optimization and corrected some of my mistakes (Yes, everyone can make a mistake.) and the program can handle much more bricks with stable FPS now. But about that I will write sometime later. Kids, I have to tell you it is great when the summer is over - I don't have to spend so much time in my garden and I can fully concentrate my time on my iPhone game!

2009/09/02

Little bit about my iphone game + first picture

Hi kids,

I think I need to describe the game design of my game little bit more than I did before, when I was writing about the basic concept. I could put here whole design document, which I wrote for myself already. But it’s about 5 pages long, so it would be probably boring read for you and the main problem - the game design document is in Czech. You know when I’m writing something just for me I don’t bother with English – I’m sorry for that.

My game from game designer’s point of view


The basic idea of the game is simple. Blocks of 3 (different color) squares/bricks fall down and you can move them in any direction and rotate them. Your goal is to put 3 or more squares of the same color together, that will let them disappear and you will receive some points for that. You have limited time to control the actual block of bricks. After that limit is over, next block will appear and you have another few seconds to position it as good as you can. If there is not enough space for another block the game is over.

There’s gonna be some level system with progressive difficulty. Each time you destroy some amount of bricks, you will progress to next level. Each new level means less time to control your block and sometimes even new color brick appear. That will make game harder and harder with each new level. There’s also gonna be some score bonuses to make scoring system more variable, but I don’t wanna tell you all details. I need to keep some thing as a secret until the game is finished. And - as you know - every woman has to have some secret!

Physics? Yes, physics!


But the main thing is physics, which plays huge role here. All the bricks are affected by gravity, they collide with each other, move fluently – not like in Tetris, where they jump from one position to another – and they act like made of rubber or gel. You know not like huge heavy stone bricks, but more like jelly bricks.

During designing my game in my head I had some troubles about controls and how to deal with it. I didn’t want to use gyroscopic system much, not for the main gameplay. I have one idea how to use gyroscopes in my game, but it’s gonna be like side effect or “cool feature” (Am I cool grandma when I use word cool?:). It won’t affect main gameplay, but I will probably describe that in some future post...

A struggle with on-screen controls


So I was thinking really hard how to use all these touches and multitouches the best way possible. One idea was to put little icons of keys on the screen – 4 as arrow keys for moving, 2 for rotation (clockwise and counterclockwise), then I figure out that something like stick instead of arrow keys would be better and then I completely left this idea of keys on the screen. I found out, that it would be much more comfortable to use whole screen to control the game. But how? Ok, sliding finger over the screen moves the block – that’s clear. But the rotation? Oh yeah, we have multitouch! It hits me like a storm! Simple use 2 fingers and move over the screen and the block will rotate. I have made some tests already and it works great - I’m so excited about that!

Ok kids, I think that’s all for today. Wait, no! Oh boy, I almost forgot - I have one picture for you. It is my iPhone with very early version of my game without graphics.



Next time I’m planning to write more about the physics and all the problems I’m solving each day with that and maybe, just maybe, I will show you some parts of the game...

Love,

Granny Marie

2009/09/01

iPhone game programming basics - recommended books

Hi kids,

This time I would like to write some basic info about programming. It's really important part of making a game and I have not pay much attention about it on my blog yet. So here is first try to change it. I'm not planning to put here lines of code or anything like that, because you can find many examples and tutorials on the internet. This will be just my impressions and what I've found interesting.

First of all I must correct few things. In one of my first post I wrote, that I don't feel like a big programmer and that's true – I don't. But to be honest I have some programming experience from the past. I was working in IT, wrote some small programs in C and C++ during 90s when I was employed at Masaryk University in Brno. But it's quite long time ago and Mac, XCode, ObjectC is completely new to me. Because of that I needed some help for the start, so I searched the web for some advices and found great book called Beginning iPhone Development by Dave Mark and Jeff LaMarche, which helped me a lot. Another interesting book by Dave Mark is iPhone Games Projects. You can find there many advices from successful game developers. I really recommend both of them to other beginning developers, but even if you are experienced you could find many useful information there.

Shortly after studying these books and all other great articles over the web, I found out that you don't need to write all your game in ObjectC (I must admit, I don't really like it - forgive me Apple). Actually it is possible to write most of your code in C++ and only basic routines like handling inputs and the main timer loop of the game in ObjectC. That was quite a relief for me! After that discovery it was quite clear for me to go that way and it pushed me forward a lot.

Last part of this article I would like to write little bit about game engines. From the beginning I was sure, that I'm not going to use any engines at all and write all by myself. So I started learning OpenGL ES which is subset of OpenGL. I knew little bit about OGL before. I really want to recommend excellent NeHe tutorials, that can help beginners with OGL really really lot. So because of my experience with classic OpenGL, it was not really hard for me to be friend with OpenGL ES (it's nearly the same).

But the hard part came with the physics. It really overwhelmed me and I must admit that I changed my mind about writing all by myself and decided to use some of the existing physics engine. So I searched, searched and finally found one, but you must wait for another article to learn more about the physics engine I decided for, because that’s enough for today.