Installer for Cocos2D v1.0 Released

On July 14, 2011, in cocos2d, support, by Steffen Itterheim

Cocos2D is finally and officially carrying the version number v1.0. Without any beta, unstable, rc suffixes.

I’ve updated my Cocos2D Installer Package (.pkg) to use the latest v1.0 and removed the v0.99.5 version, which cut the download size in half (35 MB). Cocos3D is still included of course. And as always, the main reason why you would want to use the installer is to avoid any issues installing the Cocos2D Xcode Project Template and File Templates.

You can download the Cocos2D Installer through Cocos2D Central or directly from here via this hotlink.

Tagged with:  

Game Kit Data Send/Receive Demo Project

On January 22, 2011, in cocos2d, Programming, by Steffen Itterheim

An ongoing discussion about how to correctly send/receive data with Game Kit on Cocos2D Central prompted me to write a demo project to complement the Learn Cocos2D book’s Game Center chapter. The resulting working code is in this post, and also reprinted below.

The Game Kit Data Send/Receive Demo Project (download here) is based on the Learn Cocos2D book code made for the Game Center Chapter. It’s called Tilemap16 just to stay in line with the naming scheme.

You control the little Ninja as usual, but this time anytime you move it, it will also move on all other connected devices because the tile coordinate is sent via Game Kit to all connected players but only when it actually changes. The demo even allows you to move the Ninja on any device, and all others will follow, so it truly works in every direction. In addition, a score variable (int) is transmitted every frame just to show how to send different types of data at different times.

I wish I could have made a movie to show how cool this is but alas, my iPod was busy running the demo, so all I can show as proof is my iPod and iPad running the game with both Ninjas at the same position (mushy image made with my already-ancient iPhone 3G under perfect programming but terrible lighting conditions):

Source Code Example

In summary this is the code that’s used to send/receive data with the help of the GameKitHelper class I wrote for the book (also included in the download and free to use for anyone and any purpose):

[cc lang=”ObjC”]// add this to the header
typedef enum
{
kPacketTypePoint,
} EPacketTypes;

typedef struct
{
EPacketTypes type;
} SPacketInfo;

typedef struct
{
EPacketTypes type;

CGPoint point;
} SPointPacket;
[/cc]

Sending a packet:

[cc lang=”ObjC”]
-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
CGPoint location = [touch locationInView: [touch view]];

SPointPacket packet;
packet.type = kPacketTypePoint;
packet.point = location;

gkHelper = [GameKitHelper sharedGameKitHelper];
[gkHelper sendDataToAllPlayers:&packet length:sizeof(packet)];
}
[/cc]

Receiving the packet:
[cc lang=”ObjC”]
-(void) onReceivedData:(NSData*)data fromPlayer:(NSString*)playerID
{
// first, assume it’s the general SPacketInfo, that way we can access type
SPacketInfo* packet = (SPacketInfo*)[data bytes];

switch (packet->type)
{
case kPacketTypePoint:
{
SPointPacket* pointPacket = (SPointPacket*)packet;
CCLOG(@”received point: %.1f, %.1f”, pointPacket->point.x, pointPacket->point.y);
break;
}

default:
CCLOG(@”received unknown packet type %i”, packet->type);
break;
}
}
[/cc]

Requirements & Setup

You need:
– 2 devices which are Game Center capable, eg they must have the Game Center App installed. If it isn’t, that device is not ready for Game Center. 1st & 2nd Generation devices up to iPhone 3G do not support Game Center. In addition Simulator will not work due to Matchmaking/Invites not being supported on the Simulator.
– 2 Game Center accounts (you can create dummy accounts via the Game Center App)

What you have to do:
– Create a new App on iTunes Connect, enable Game Center for that App, and replace the Bundle ID of your App with the one in the project’s info.plist. Please refer to the Game Center section in the iTunes Connect documentation.
– Make sure Push Notifications are enabled on all devices via Settings App.
– Run the Game Center App on both devices, login and make sure each device is logged in with a unique account. Then invite the other device’s account as friend and accept the friend request, this makes it easier to join each other’s matches.
– Build the Tilemap16 App and deploy it to both devices. Whenever you make a change to the code, you must deploy the App to both devices again, to make sure they run the same code.
– Run the App on one device, wait for the matchmaking screen to appear. Invite your other device’s friend account to join the match.
– Wait on the other device for the match invite to pop up. Tap Accept. The Tilemap16 game will launch.
– Tap Play Now on the first device once the other player has successfully connected and is ready.
– Move the Ninja on either device and watch it move on the other.

Enjoy!

Why I chose IP.Board for Cocos2D Central

On January 10, 2011, in support, tools, by Steffen Itterheim

One of my book readers, Jim, asked me an interesting question. Not about the book but about the Cocos2D Central community website that I’ve installed a few weeks ago. I thought the answers to his questions are of interest to others even though it doesn’t exactly fit the Cocos2D theme of this website. Jim was asking:

(1) Why did you choose IP.Board over something like phpbb or vBulletin and (2) after having it for a while, would you recommend it to others?

(1) Why I chose IP.Board

The initial starting point of my search was the fact that bbPress sucks. That’s my professional assessment, believe it or not. Well, no, don’t believe that, it’s actually a quite nice forum if you are already hosting a WordPress website and you want a forum that integrates well and won’t be receiving much traffic. But as I’m sure many can relate, the bbPress forum software doesn’t scale very well.

But more importantly I wanted a forum that is able to factor in popularity and relevance of posts in searches, and searches over all the content (eg. the wiki area) not just posts. One that allows users to subscribe to threads and forums and receive email notifications. One that makes embedding code and media easy using the most common forum syntax bbCode. One that allows to extract the helpful and relevant articles from threads so they don’t become buried in the thread. One that allows attachments and signatures, which users could use to promote their Website, App, Product, themselves and what not. One that integrates well with social networks, one that let’s you like things, tweet posts and allow users to sign up with their existing Twitter, Facebook or OpenID accounts.

The usual candidates

Primary candidates were of course vBulletin and phpBB which I’ve both used in the past. Especially vBulletin was the first one I looked at but then I learned two things: for one it’s a rather expensive one-time payment of $285 for the full publishing suite, and $195 still for only the forum. And then at least two or three users mentioned that their support or the stability of the software recently went south with version 4. That was enough to let me look around for possible alternatives. I can’t say if version 4 is really that bad and the rumors are true, but I haven’t looked back since.

Beginning my search I quickly came across the Forum Software Reviews website. This was initially very helpful to find out about all the various options that exist – and wow, the forum software market is crowded indeed. It was also clear that there was almost no “free” option I could seriously consider. The free forums fell off the grid in two or three categories: they either lacked critical features or they had an impressive feature set but oh boy was it ugly to look at and confusing to use. The third category was when “free” wasn’t really free and there was a strong upsell to the commercial version, respectively on the downside having to rely on voluntary support.

The phpBB software was my second choice in line. Oh yes, it’s free and rather complete but, like I said, I worried about support. I also wasn’t impressed by its look and feel at all. It’s hard to tell but … I don’t know, it simply looks cheap and noisy to me. I would certainly prefer the admittedly clean and noiseless look of bbPress. I then came across FreeForums.org which are offering a polished version of phpBB and they also host it for you for a small fee. But ultimately I was turned off by the fact that it was still phpBB and still ugly, and they are charging for features I don’t feel comfortable paying for. $10 per year for the removal of the Copyright notice in the footer? $5 per month to remove the ads? $30 per year to allow me to use the recovery console? Some features I pay monthly, some every 6 months and the rest yearly? Come on. Give it to me straight. And I want to pay for features I’m getting, not to disable “features” I don’t want and quite honestly, are nothing but a checkbox in their customer database. If that’s the attitude of the company when it comes to selling, how is their attitude towards supporting me going to be? I decided I didn’t want to find out.

IP.Board to the rescue

A few people mentioned IP.Board and even though I skipped it at first, and when I checked it out the first time it didn’t seem like a good fit and more likely to be overkill. Still, after coming back to the website several times, I went ahead and tried it. That’s when all the powerful options dawned on me: what if, instead of adding just a forum and integrating it with the Learn Cocos2D website, what if I made something bigger?

That’s also when the idea for the name “Cocos2D Central” and – being prepared for the future – “GameDev Central” came to be. An external community website that eventually would be the backend for the Learn Cocos2D blog. It made me think about moving everything over to IPS, except for the intro and the blog. I would be able to move my store over to IPS. I liked the IP.Downloads product because managing downloads is “blegh” in WordPress. And generally I could do much, much more to build and grow a community with all the neat social features that are built in.

I quickly decided to start with the Standard 25 plan for $20 per month. It was minimal risk because there’s no minimum duration you sign up for. And I quickly added IP.Content and then upgraded to Plus 40 because I wanted to be able to use IP.Nexus, the eCommerce addon. I’m now paying $35 per month to Invision Power and gladly so. I couldn’t be happier with their Hosted Community offer. I could have bought the products, installing and administering them myself, but that task seemed daunting and if I learned anything: services that are good are worth paying for. My time is better spent coding than managing the server, website and forum.

(2) Would I recommend it?

Definitely a resounding yes!

What really blew me away was the level of support given by Invision Power Services Inc. They are the Zappos of community software! Both on their forum and via tickets, they respond fast and I haven’t seen a post that didn’t receive a reply. They do make you feel welcome and supported.

There were a few minor hickups. Shortly after signing up Cocos2D Central experienced frequent downtimes from 10 to 45 minutes each, sometimes several times a day. I asked them about that and they were quite forthcoming to answer this question: communities are hosted on virtual servers, so several communities share the same hardware. If a community gets hacked or attacked or simply flooded with requests (Slashdot effect or a DOS) they are moving the affected community to a new server. As I understood it they were in the general process of splitting communities based on the nature of their content, so that those communities more likely to be receiving attacks will be hosted on different servers, so that communities with “regular content” won’t be affected. The downtimes still happen but are now much less frequent and shorter.

How do I know? I monitor the website via Pingdom, which alerts me via email when Cocos2D Central goes down and when it comes back online, in 5 minute intervals.

So overall, I can certainly recommend the Invision Power Services. And just so you know, I wrote this post without any affiliation, I don’t receive any money or other benefits from them for writing this. I’m simply a fan and hopefully for a long time I will be a very happy customer too.

Tagged with:  

A couple hours ago I’ve opened Cocos2D Central (http://cocos2d-central.com), a forum / website / soon-to-be-community. Initially intended for readers of my Cocos2D book but generally open to everyone.

To be able to handle all the feedback and questions I receive by email while allowing everyone else to benefit from it, the logical next step was to create a forum. And that’s what Cocos2D Central is right now, a forum. But it will be much more (articles, downloads, blogs, store) because I can, but not without seeing actual demand, so I’m starting with the essentials and take things from there. I dubbed it “Cocos2D Central” because I think that with Cocos2D X and Cocos2D Javascript (Web) there are two relatively new Cocos2D engines which have great potential to become quite popular as well, so why not enable the new website to cover the whole Cocos bunch at once?

Next step: slowly growing a community on Cocos2D Central. For that [[UIFingerPointGestureRecognizer alloc] init] I need you!

Please hop on over and join (it’s really convenient with OpenID, Twitter and Facebook login options), then say hello and post your thoughts. I look forward to meeting you on Cocos2D Central! :)

Tagged with:  

Learn Game Development with Cocos2D

On April 17, 2010, in , by Steffen Itterheim

Hex Map rendered by TilemapKit

The Cocos2D-SpriteBuilder game engine is a strong alternative to SpriteKit for iOS and OS X game developers. Sometimes, it can be a tough nut to crack. I’m Steffen, book author, blogger, game developer and nutcracker.

I’m most active on Stackoverflow.com where I moderate, and sometimes answer, questions on Cocos2D, SpriteBuilder, Sprite Kit, and 2D game development in general.

Since 2015 I’m working on TilemapKit, a complete solution for all tilemap game developers!

Follow me on Twitter!

My Latest Book: Learn SpriteBuilder

Learn SpriteBuilder for iOS and Android Game Development

SpriteBuilder is a visual and versatile design tool for Cocos2D. In Learn SpriteBuilder you learn how to get the most out of SpriteBuilder to create a full-featured 2D action game that you can use as a basis for your own games.

You’ll learn SpriteBuilder best practices, how to incorporate SpriteBuilder into your game development workflow, and how to use the various features of SpriteBuilder, including game physics, scrolling, menus, and playing audio assets. You’ll learn everything from the basics to advanced topics like visual effects, soft-body physics, rendering textured polygons and porting to Android.

You’ll be using both SpriteBuilder and the latest version of Cocos2D, version 3. If you have a bit of iOS development experience and you want to learn to create imaginative 2D games, Learn SpriteBuilder for iOS Game Development is exactly the book you need.

About

On April 17, 2010, in , by Steffen Itterheim

Learn Cocos2D Game Development

Steffen in bullet points:

The long story, shortened a bit …

At the beginning, I was merely a Cocos2D developer just starting out with this fine game engine. I started working with Cocos2D in May 2009. Despite many years of game development experience, I struggled many times over – there was so much to learn and specifically for Cocos2D there wasn’t much documentation to go on.

Learn & Master Cocos2D Blog

A year later, I was well aware that besides growing in popularity, the basic issues of getting started with Cocos2D essentially stayed the same. Consequently, beginner’s tutorials got rampant visits from aspiring Cocos2D game developers. So I decided to start this Learn & Master Cocos2D website and blog to help you get started and answer pressing questions while trying to earn a living selling source code products like the Line-Drawing Game Starterkit.

Learn iPhone and iPad Cocos2D Game Development Book

Within hours of going live with this website in early May 2010, I was contacted by Jack Nutting, author of Learn Cocoa on the Mac. He got me in contact with Apress and a short but intense proposal period for a Cocos2D book followed. Then I blogged about the book’s progress every week. What followed were five months of writing and learning more about Cocos2D and writing books than I ever imagined. The book was finally completed and released in December 2010: Learn iPhone and iPad Cocos2D Game Development: The Leading Framework for Building 2D Graphical and Interactive Applications.

Cocos2D Central

During the time I wrote the book, this website had to take a backseat, so I did not grow the tutorials and other content as I had initially planned. With the book finished, I knew I was going to do lots of Q&A and it should be done publicly, so that everyone can benefit from it. The result is the Cocos2D Central forum and community website.

Kobold2D: Cocos2D on Steroids

Another result from my extensive work with Cocos2D is Kobold2D. It is designed to make Cocos2D developers more productive and making it easier to get started. I use it for all of my own work.

Kobold2D originated from the idea to build a consistent framework for all of my Cocos2D projects, instead of inadvertently dispersing the reusable code over multiple projects. If you’re serious with Cocos2D development or just getting started you should really check out Kobold2D.

My Leitmotif

I have always been a nutcracker and firefighter in my previous game industry jobs. I have always been sitting between chairs, as I did not fit a proper, established job description. I’m a jack of many trades, master of some. I program, I design, I write, I market, I sell, I help, I teach, I moderate, I network and I do what I think needs to be done. But most of all, I’ve always been helping other developers – that was always present in every job I did, and when I worked with the right people, those were the best times I ever had. Give me a problem and (most of the time) I’ll want to solve it. I’m happy when I can help others grow and excel. That’s my leitmotif, that’s what I’m doing now for Cocos2D developers.