Skip navigation

Looks like a perfect day to tell you a new story.

Last time, I worked on a game that grew up as a monster in few weeks and I’d to finally kill it with my own hands. Pretty heart-breaking :(

So, this time I did something new. I didn’t yell about my new project. I’ve realized that the one thing that kills my interest in something is yelling about it on internet. It’s something like my brain is a completely different entity than me, it likes to work in isolation and without any sort of pressure, quite contrary to what environment I’m used to.

So, this time I worked on this new game as if I wasn’t too serious about it, and in such a quick time almost all of the gameplay is ready.

The game is about a baby penguin learning the skills of tobogganing from his/her master, The Seal.

Here’s fugly screenshot

And here’s the game in action, as of now:

This movie requires Flash Player 9

As you can see the graphics is under rapid construction.

The sounds are also under construction.

Can’t say when will this thing be done, I’m trying to make it easy and simple game that I can play at bedtime.

I will update this page as time proceeds. Keep watching if you’re interested in the development story.

The name is still undecided, I’m thinking of something like ‘The Penguin School’ or ‘Peengoo Goes To School’ write your suggestions in comments.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

DAY 1: 0917 hours

So, here’s the plan:

I’ll coding a game from the scratch to the AppStore for next 17 days, and I’ll try to update this blog as often as possible, I’m thinking about at least once per day.

Here is the fact, my job profile and the human inside me doesn’t allows me to code for full 24 hours, although I wish I could, but I can’t that’s the fact of life, but I’m trying to target coding at least 4 hours on weekdays and 10 hours on weekends.

The following is the list of resources I’ll be using (hopefully):

  1. Xcode 4.3
  2. Inkscape
  3. Paintbrush
  4. sfxr (the flash version, I know there’s a cfxr port for mac too)
  5. Garage band

And I’ll try to code everything in pure ObjectiveC with OpenGL ES 2.0.

RAQ (Rarely asked questions):

  • Why 17 days?
  • Because according to one holy book I’ve read, the God in that religion created the whole universe in 17 days, I’m kidding if you didn’t noticed. I don’t know why I picked 17, it’s just a random number that sounds cool, putting it another way- because it’s the largest prime number known to me.
  • Why OpenGL ES 2.0?
  • Because I’m just learning OpenGL, and 2.0 is just awesome enough for me, also I’m planning to put some funky looking effects that come with GLSL.
  • Of the above mentioned tools, which ones are your favorite?
  • Franky saying I’ve never used OpenGL at such large scale, and I’ve created few rectangle with Inkscape. I’ve used Paintbrush a lot for annotating red circles and arrows on some screenshots. SFXR, I’ve played for few seconds and was the easiest thing to master. As for GarageBand, I’ve no experience of using it as such, but my half-baked musical knack should get me through it, hopefully.

OK, the question-answer session is over, and as a great Ninja Panda once said: Enough Talk, Let’s Code!

Read More »

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Every sometime you might get into a situation with your design pattern, that you might have this inevitable desire to use a Singleton class, or maybe you are coming from C++ background and are much used to it.

But, you shouldn’t forget that Objective-C is a different language, that here the classes are first class objects, so today I’m going to show a way to avoid using the singleton pattern and fill with the class methods instead. Read More »

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Today is 2nd January, I’m already late by a day making my this years resolutions. Unlike most of the people, I never make resolutions before the new year starts for real. On 31st December, I usually don’t give a shit, I imagine as if the world is going to end today, so I spend the day partying. I always leave the 1st January for hangover from last night, in fact, I believe the best day to think about the new year resolutions is on 1st January 2:00 PM onwards, because at that time you’re too hungover to actually do anything, and you’re not to intoxicated to think about yourself.

One other benefit that I have is that my birthday comes on last week of december, so I also have of sense of aging on a secondary thread to help me make my resolutions. Its not like I’m dying or anything, but I love to compare myself with all my personal heroes and their achievements by this age. Some make me feel happy, others unlucky.

So, coming back to this year’s resolutions, as usual I blurted out on Facebook and twitter:

Resolution 2012: Make things that will leave the entire world flabbergasted for many generations.

Then, I gave it another thought. Every year I make some resolutions, mostly they are just generic ideas, and like all the C++ abstract classes, they don’t actually do anything. All the time they just sit there, waiting for something to extend them and turn them into something more concrete. But, it never happens.

So, this year for a change I’ve decided to dump all the abstract classes theory and do something meaningful. This year I’ve decided to make monthly resolutions instead of yearly. For example, instead of thinking like

I’ll create a pac-man like game.

I’m thinking more like,

OK, now that I’ve created the provisioning profile. In next 2 days I’ll complete the prototype, then, if it looks good, I’ll finish the game by next week, and one week for graphics enhancement and one week for testing and launch the thing on AppStore,..

Hope this help me move forward in time this year, otherwise next year I’ll try doing it weekly ;)

References:

1. This article helped me in getting over the infinite game engine loop.

2. This article helped me to realize to post this article you’re reading.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

I’ve been curious about diving into some real Graphics stuff, as far as I remember from last few years. And because I didn’t get any related education at my college or from anyone I knew, I just had to somehow rely on my destiny and the Internet, or both.

From my experience as a self taught OpenGL programmer, I’ve made a list of things for anyone else backpacking into the wild and adventurous world of graphics.

  1. Read a lot: The whole OpenGL thing is like a big cotton ball that you have to unroll, read as much as you can, there are plenty of experienced people out there ranting about different aspects of graphics programming, try to read them all, even if you don’t understand it now, you will someday.
  2. The Redbook should be your first book: I think thats all is there to say, I actually read 3 books before getting hold of The Redbook. It’s must for all OpenGL noobs, and it’s even suggested on the official OpenGL website. If you think you’re interested in coding for mobile platforms and this book is for desktop only, you’re making the same mistake I made. This book has lots of simple sample code that would make it easier for you to digest the thing one at a time.
  3. Open GL ES is the advanced level: If you’re like me coming from mobile platform, don’t try to rush to ES. Just like you can’t play Mario level 1-4 before dying in 1-1 a couple of times, you can’t play around with ES without the fundamentals. Always remember that the ES is an advanced level and after a while you would love to jump back to simple GLUT based programming on your desktop for drawing polygons and modelview transformations, so get a strong hold of it.
  4. It takes time: Even if you’ve a fair amount of experience with a Saxophone, you can not just pick up the guitar and expect to play like Jimi Hendrix in few days. OpenGL is a huge API, and it takes a lot of time to master the art. You can render few interesting things if you are a fast learner, but building big things take lot of practical experience. And the bigger your code grows the more complicated it will become, and the bigger the code,  more knowledge of the fundaments you’ll need. Be patient and learn.
  5. Practice: Always remember the only shortcut to mastering something is by practicing it as much as you can, every great programmer out there one day started just like you and me. Try writing small programs that achieve little things like drawing an specific shape, or playing around with a specific effect. The bottom line is write small, write too many before you start with your first big one.
  6. Experiment: I could’ve easily merged this point with the one above it, but the greatest thing with OpenGL is there are plenty of effects to be achieved, its like building a dream sequence, often I start coding with drawing a simple circle but after few hours its the entire galaxy. Don’t hold yourself with the code you’ve just read in the book or blog, try to experiments with things, you are probably going to find more than expected. Don’t hesitate to refractor the code upside down.
  7. Refresh your mathematics: One of the big part of OpenGL is mathematics, refresh all that you learned in school or college, algebra, geometry. All your mathematics is going to come to life!
  8. Don’t give up: If you start you coding session with something particular in your head, just don’t give up until you get the result, always remember its an API after all, it’s not like you need to know a particular thing before trying out something else. I often find jumping around and trying out several things to build whatever is in my head as one of the best learning sessions.
  9. Build something interesting as a side project: Whenever you start swimming around the OpenGL pool, keep a project in your head, it could be a small movie or a replica of your fav. game, or the layout of your neighborhood, keep one big thing on your side and try to keep refining it with things as you learn, that way you will have something to show off to your friends every sometime.
  10. Don’t die in isolation: Worse thing that can happen to you is, midway you might get stuck on something you can’t get over and that can kill your enthusiasm of learning, particularly if you’ve nobody experienced around you. The solution is to get involved, there are plenty of experienced people out there, follow them on twitter and read their blogs, read discussions on forums like stackoverflow, and read all the possible answers to the questions, everything is helpful, and don’t hesitate to ask even the dumbest thing. Being curious is a good thing.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

The other day I was working on my game engine…

Wait! another lonely guy working on another game engine

Yes, that’s true I’m working on a game engine, and it’s true because creating a game engine is what I believe the best way to understand how a game engine works from the inside.

Anyhow, that not the point, the point of this rant is every sometime I’m doing something new, I’m stuck to this one big question:

what language do I pick, to talk to my computer?

And here’s how the discussion goes on for hours among my inner components:
Read More »

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

I’m totally sick of all those links that try to say the same thing over and over about Sonia Gandhi is a bitch, Rahul Gandhi is a whatever and shit… its not like we’re living under some Kings and Queens, its total democracy, that means someone out there on the voting day gets out of his bed and walks up to the polling booth and casts down his vote in their favor, he must be having something cooking up in his head, because humans in general are lazy people, they don’t do a thing, while they have BP problem and diabetes and doctors are yelling at them, like “you’ll be dead, walk at least an inch a year, exercise bitch!”, but they don’t do that, they rather prefer to die in the hole they’re living. So, that one day of voting means a LOT of thing. I’ve casted a vote once in my life and I know how important that day in my life is. So, all I’m trying to say is if you don’t like somebody as your next PM, good, don’t vote for him, beat down that wrong voting guy by voting the right one, problem solved!

Now, you can say we are sharing information, so share information on who should we elect next, my lord! Basically, you’re just yelling “Don’t vote for that fucking asshole”, instead what I want from people is news like, “Hey everybody, this guy is so great, he has done this and that, and if we make him our leader, he’s gonna do all the awesome things God carved in the stone and gave to Moses”, and I can consider voting for that person.

Sharing negative information won’t lead to any good, it’s just eliminating one bad person out of many, instead of highlighting the good ones. Sharing is a lethal tool, use it wisely.

Thanks for reading my fugly, grammatically incorrect rant!

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

If you even wanted to know whats the endianness of the device you are running your code on, this article might just help you out.

But, before we hit the code lets see what does the endianness means.
Endianness is basically how the data is mapped between the registers and the memory. Well most of the time it doesn’t matters what our system’s endianness is, but in rare circumstances like when you are porting your perfect code from one platform to another and all of a sudden you start getting some unexplainable bugs, there might be a case that its something related to the endianness.

Well, the good news is there are only two kind of possible endianness; the Big Endian and the Little Endian.
(Of course, some clever engineers have designed bi-endianess as well, but that is just a merge of the two)

Big Endian:
In this format the data is mapped in such a way that the Most Significant Byte is stored at the lowest address.
So, if the memory starts at location A and we have the data as XY, then the memory is mapped as:

A: X
A+1: Y

You see the bigger the end of the data gets the bigger the address gets, thats why I think they named it Big Endian

Little Endian:
This format (as might have guessed), is just the opposite. Here the Least Significant Byte is mapped at the lowest address.
So, the same case will be mapped as:

A: Y
A+1: X

If you need to get more information on endianness, look at this article at wikipedia

Now, for our code we will be using union, yes that should refresh your C lectures at college.

union endian{
	short num;
	struct {
		char one, two;
	}chars;
};

If we assign a number to the short it should be split in two bytes, because the union shares same memory between its members.

So, if the short is a 16 bit (or 2 bytes) long and char is 8 bit (or 1 byte long), whatever data we assign to the short and read as the chars will give us the two halves of the short.

Here’s a main program for our testing:

int main(){
	union endian te;	/*test endianess*/
	te.num = 256;
	printf("%p: %d\\n%p: %d\\n",&te.chars.one,te.chars.one,&te.chars.two,te.chars.two);
	return 0;
}

As, you can see the data I’m setting to the num variable is 256, that is in binary:

00000001 00000000

or
X: 00000001
Y: 00000000

So, if a device is using Big endian style it should map the the first half to the smaller address and the later half to the bigger address, while, the Little endian machine should assign the first half to the bigger address and the later half to the smaller address.

Here’s the output on my machine:

0x7fff5fbff450: 0
0x7fff5fbff451: 1

Which means internally my machine is mapping data as:

0x7fff5fbff450: 00000000     (A: Y)
0x7fff5fbff451: 00000001     (A+1: X)

And its a clear case of Little endian mapping. Now, check out yours!

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

1. Keep sipping water every now and then. Thats the rule number 1: Keep Hydrated!

2. Keep a note book to ease some mental thought work. Like there is some game geometry or a complicated recursion, draw it on a piece of paper and see how much better picture it makes in your head.

3. Set milestones – a final milestone when you’re going to shut down the computer, and in between milestones.

4. Take short breaks every time a milestone is achieved. Even if the break is just getting up to refill your bottles from the rule# 1.

5. Don’t over caffeinated yourself. Restrict coffee breaks to a mug maximum in 5 hours. And remember not only Coffee is caffeine, there’s some soda drinks too.

6. Plug in the earphones, but keep the sound low. Firstly, the music will not interfere with the code, secondly you don’t care whats going in the neighborhood and lastly as you get more deeper into the code the sound is anyhow going to fade out.

8. Get enough sleep before going for a heavy duty coding spree. This is very important, because it decides how long you are going to indulge and how much productive the session is going to be.

9. Do your work, stay focused, keep away from distractions. Yes I mean Twitter, Facebook, YouTube, and things like these you are reading.

10. Lastly remember there are things more important than your code. I mean your family, friends, pets,… because thats where you’re going to show off the cool thing you are making before anybody else in the world. Don’t ignore your social life.

Happy coding!

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS