Working Within Constraints

Putting together the gameplay demo for Project One has been a challenge for many reasons.

For one, I’ve been learning a new language, C++. It’s not radically different from the languages I already know but it’s got its own quirks and sometimes just setting up basic things takes a little longer than it would if I were working with Java or Obj-C. Two, I’m working with a new library, Cocos2d-X, that’s super powerful. But with power comes complexity.

But the main challenge has been working with the devices that our new game will run on, mobile devices.

The iPhone is, very literally, a computer in your pocket. But, like the old desktop market, some are more powerful than others. Dan has an iPhone 5, with the latest hardware and things on his device just blaze. But I have an iPhone 4, two steps behind. And I’ve found that things that work just fine on his have to be scaled back to work on mine.

The banner image on top of this post is a prime example. There are eleven particle generators being used. On my development machine, it runs at a perfect sixty frames per second. The same is true on Dan’s phone. Mine can only pull about 52-54 FPS. Not bad, right? Well… yes, it is bad.

True, this is just a technology demo so it’s not the end of the world. But we’re planning on each level having at least two minutes of gameplay and a serious amount of art associated with it. Eleven particle generators could very easily be part of a single level on top of everything else that is part of a level, plus the physics simulation, game logic, and more. And that’s part of the challenge.

None of this is overwhelming though. Like everything, it’s just about resource management. Will a level have a hundred particle generators? Having them doesn’t use scarce resources, running them does. So we’ll just have to be aware of where the camera is and turn on particles the player is approaching while turning off particles the player has passed.

Our goal is to be able to accomodate iOS devices as old as the iPhone 4, so these challenges are proving to be interesting. But it just means we’ll have to test regularly and not let ourselves get carried away with unnecessary whiz-bang that doesn’t add anything if it impedes performance. It will also be interesting to see how things perform on Android devices. Obviously we want it to play on the widest range of devices to maximize our market but we may have to limit them a bit to not hogtie our options and compromise the game itself.

The gameplay demo is proceeding really well and I’m sure there will be some great posts from both Dan and Mike soon on the challenges they’ve encountered. I know Dan’s been using LevelHelper to begin putting together the game world and Mike has been turning out some amazing artwork.