A quick tip regarding -hd resources in Cocos2d
0When enabled, Cocos2d supports automatic loading of standard and Retina based images and textures based on whether the filename has a -hd suffix before the extension (ie, MySpriteSheet-hd.png). If the filename doesn’t contain a -hd, it will be treated as a “standard” resolution file. In code, when loading a texture or image, you use a filename that does not include the -hd suffix. Here’s an example of code to load a background image. I have two versions of Background.png. One named Background.png, and the other named Background-hd.png. Cocos2d will automatically load the correct version based on whether or not the device has a Retina display or not.
// Add main background to scene CGSize winSize = [CCDirector sharedDirector].winSize; self.mainBackground = [CCSprite spriteWithFile:@"Background.png"]; m_mainBackground.position = ccp(winSize.width/2, winSize.height/2); [self addChild:m_mainBackground z:-1];
I recently completed some rough draft art for part of a game I’m working on, and I had only exported the Retina based versions of the textures and images, and named them with the appropriate -hd suffix. I did not export the standard resolution files at this time. After coding up the feature that would use these new textures, I found that when debugging, I would get warnings indicating that my “texture-hd.png” was not found, even though it existed in the resources folder, and eventually an assert once an attempt to load the texture was made.
For now, I can get around this issue by specifying the -hd suffix in each filename when loading images or textures. This issue also goes away when you add the “standard” def versions of your files.
Hopefully this will help others who come across the same issue during development, and save them a bit of time.
My Next Project
0After going through my various iPhone app ideas, I’ve finally decided on my next app. It will be an “edu-tainment” app, designed for children in early elementary school.
I recently watched a Ted talk about “Re-engaging” boys in learning. Having three boys of my own (3,4 and 6 years old), I feel it’s very important that they learn to love learning, and do so using any method available, including learning through gaming.
I’ve started the process of planning and designing a game that helps young kids learn math. Now, there are a TON of run of the mill math apps out there (traditional flash card based apps), so I’m aiming to take it to the next level… Stay tuned for updates as I progress in the design and development of this app.
Time ‘Til Ticket has been Approved!
0After only two days sitting in the Apple approval queue, the update to Time ‘Til Ticket has been approved. Download away!
Coming soon… An Update to Time ‘Til Ticket!
0Just a quick note to let my 20 or so users of Time ‘Til Ticket that an update is coming. I know, not a huge user base…
I’ve updated the look of the app, fixed some bugs and switched to a better algorithm for determining the time between tickets. The newer algorithm helps deal with large, irregular time differences between called numbers.
I’m just about done with these changes and should be submitting the update soon.
It’s been a while…
0Well, soon after I started the new version of my site, I got insanely busy at my day job making it difficult to keep up with this site.
My industry has a trade show every fall called the Global Gaming Expo, or G2E. Since my team was slammed with our currently scheduled games, I volunteered to do a game based on some new technology our company is developing. The game was to be based on a very popular series of movies.
Since the trade show was only 8 weeks away, I ended up work 100+ hour weeks in order to get the game to a presentable state by the time the show started. Well, I’m happy to say that I was able to get the game ready in time. It, and some of the technology developed by my friend and coworker were a smash hit at the show. Well, now that the trade show is done and I’ve had some time off to recover, I’m starting to get back to my current and planned apps, as well as updating this site.
Let’s do an iPhone game
0Recently I partnered up with another developer and artist from work, and we set out to create an iPhone game. We came up with a few ideas, mostly derived from other games we had previously played and loved. No idea was solid, but some had promise. We settled on one idea to start, and decided to run with it. We each went separate ways to work on our portions of the game. The artist was to develop concept art for the game and work on character development. The other dev and myself were to determine which game engine was right for us and start prototyping some of the basic concepts in the game.
Determining the engine to use wasn’t too difficult. Our game wasn’t going to be 3D, and after some research we quickly settled on Cocos2D as our engine of choice.
In my spare time away from the day job and family, I set out to do my part and start prototyping our game. I quickly fell in love with Cocos2D, and all it has to offer. I was able to get examples up and running quickly, and do show off some very simple demos of some of the features we wanted in our game. However, this is where it stopped being easy.
I quickly discovered that when you talk to other people about developing a game, you will find potential team members who are in love with the idea of developing a game, but quickly bail on you when it comes time to execute. Both the artist and second developer I selected for the team never really got off the ground when it came time to start executing on our ideas. I soon found myself developing prototypes on my own, with my own “developer” art.
The excuses from the other team members boiled down to either not having time, being too tired at the end of the day, or just a simple, “I didn’t feel like working on it”.
I also found that it’s pretty much impossible to develop a game without a solid game spec, which we didn’t have. We barely had a story line, let alone a full fledged game spec.
After a month or two, I felt like the team had given up, even before we started. I had worked through several test apps the prototypes a small fraction of what we wanted to do in our game, non of which was impressive or fully reusable. I myself was discouraged with my overall lack of game design and development expertise, and not knowing how to motivate the team to help out.
After expressing my feelings to the other developer on the team, he suggested that we change course and possibly set our sites on something smaller. I agreed with him, especially having read a couple of articles that agreed with his suggestion.
Prototyping: You’re doing it wrong
So, we decided to do a big reset, and focus on some simple clone games first before restarting our efforts on our big original game. This has turned out to be a magnificent idea. In my next few posts, I’ll be detailing my experience developing a simple iPhone game based on an existing game. My plan is to develop a full game and release it for free once its complete.
Hello world!
Yes, this is the first post. I plan on using this site to discuss software development, photography and anything else I find interesting. I’ll also showcase some of the iPhone apps I’m working on, including concept and testing apps.
